diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index bb10cd78e21d..08cac1b146a6 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -133,6 +133,13 @@ pom import + + com.google.cloud + google-cloud-appoptimize-bom + 0.0.1-SNAPSHOT + pom + import + 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
MethodDescriptionMethod 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.

+ *
    + *
  • createReportAsync(CreateReportRequest request) + *

+ *

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.

+ *
    + *
  • createReportOperationCallable() + *

  • createReportCallable() + *

+ *

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.

+ *
    + *
  • getReport(GetReportRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getReport(ReportName name) + *

  • getReport(String name) + *

+ *

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.

+ *
    + *
  • listReports(ListReportsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listReports(LocationName parent) + *

  • listReports(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listReportsPagedCallable() + *

  • listReportsCallable() + *

+ *

DeleteReport

Deletes the specified report.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteReport(DeleteReportRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteReport(ReportName name) + *

  • deleteReport(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteReportCallable() + *

+ *

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.

+ *
    + *
  • readReport(ReadReportRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • readReport(ReportName name) + *

  • readReport(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • readReportPagedCallable() + *

  • readReportCallable() + *

+ *

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.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *
+ * + *

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

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonAppOptimizeStub extends AppOptimizeStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(OperationMetadata.getDescriptor()) + .add(Report.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + createReportMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.appoptimize.v1beta.AppOptimize/CreateReport") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/reports", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "reportId", request.getReportId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("report", request.getReport(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateReportRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor getReportMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.appoptimize.v1beta.AppOptimize/GetReport") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/reports/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Report.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listReportsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.appoptimize.v1beta.AppOptimize/ListReports") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/reports", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListReportsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteReportMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.appoptimize.v1beta.AppOptimize/DeleteReport") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/reports/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + readReportMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.appoptimize.v1beta.AppOptimize/ReadReport") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/reports/*}:read", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ReadReportResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .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 HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonAppOptimizeStub create(AppOptimizeStubSettings settings) + throws IOException { + return new HttpJsonAppOptimizeStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAppOptimizeStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonAppOptimizeStub( + AppOptimizeStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonAppOptimizeStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAppOptimizeStub( + AppOptimizeStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonAppOptimizeStub, 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 HttpJsonAppOptimizeStub(AppOptimizeStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonAppOptimizeCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAppOptimizeStub, 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 HttpJsonAppOptimizeStub( + AppOptimizeStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder() + .setPost("/v1beta/{name=projects/*/locations/*/operations/*}:cancel") + .build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder() + .setDelete("/v1beta/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v1beta/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v1beta/{name=projects/*/locations/*}/operations") + .build()) + .build()); + + HttpJsonCallSettings createReportTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createReportMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings getReportTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getReportMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings listReportsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listReportsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings deleteReportTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteReportMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings readReportTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(readReportMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .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, + httpJsonOperationsStub); + 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()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createReportMethodDescriptor); + methodDescriptors.add(getReportMethodDescriptor); + methodDescriptors.add(listReportsMethodDescriptor); + methodDescriptors.add(deleteReportMethodDescriptor); + methodDescriptors.add(readReportMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @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/Version.java b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/Version.java new file mode 100644 index 000000000000..85c028ad7f13 --- /dev/null +++ b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/Version.java @@ -0,0 +1,27 @@ +/* + * 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.InternalApi; + +@InternalApi("For internal use only") +final class Version { + // {x-version-update-start:google-cloud-appoptimize:current} + static final String VERSION = "0.0.0-SNAPSHOT"; + // {x-version-update-end} + +} diff --git a/java-appoptimize/google-cloud-appoptimize/src/main/resources/META-INF/native-image/com.google.cloud.appoptimize.v1beta/reflect-config.json b/java-appoptimize/google-cloud-appoptimize/src/main/resources/META-INF/native-image/com.google.cloud.appoptimize.v1beta/reflect-config.json new file mode 100644 index 000000000000..0a9e8bf7f264 --- /dev/null +++ b/java-appoptimize/google-cloud-appoptimize/src/main/resources/META-INF/native-image/com.google.cloud.appoptimize.v1beta/reflect-config.json @@ -0,0 +1,1838 @@ +[ + { + "name": "com.google.api.BatchingConfigProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingConfigProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingSettingsProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.BatchingSettingsProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FlowControlLimitExceededBehaviorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.Column", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.Column$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.CreateReportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.CreateReportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.DeleteReportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.DeleteReportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.GetReportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.GetReportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.ListReportsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.ListReportsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.ListReportsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.ListReportsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.OperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.OperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.ReadReportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.ReadReportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.ReadReportResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.ReadReportResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.Report", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.Report$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.Scope", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.appoptimize.v1beta.Scope$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnforceNamingStyle", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$DefaultSymbolVisibility", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$FeatureSupport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$FeatureSupport$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SymbolVisibility", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.ListValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.ListValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.NullValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Struct", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Struct$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/AppOptimizeClientHttpJsonTest.java b/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/AppOptimizeClientHttpJsonTest.java new file mode 100644 index 000000000000..a103de4e63fe --- /dev/null +++ b/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/AppOptimizeClientHttpJsonTest.java @@ -0,0 +1,696 @@ +/* + * 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.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.appoptimize.v1beta.stub.HttpJsonAppOptimizeStub; +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.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.ListValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AppOptimizeClientHttpJsonTest { + private static MockHttpService mockService; + private static AppOptimizeClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonAppOptimizeStub.getMethodDescriptors(), + AppOptimizeSettings.getDefaultEndpoint()); + AppOptimizeSettings settings = + AppOptimizeSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + AppOptimizeSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AppOptimizeClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createReportTest() throws Exception { + Report expectedResponse = + Report.newBuilder() + .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString()) + .addAllDimensions(new ArrayList()) + .addAllMetrics(new ArrayList()) + .addAllScopes(new ArrayList()) + .setFilter("filter-1274492040") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createReportTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Report report = Report.newBuilder().build(); + String reportId = "reportId-427040401"; + + Report actualResponse = client.createReportAsync(parent, report, reportId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createReportExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Report report = Report.newBuilder().build(); + String reportId = "reportId-427040401"; + client.createReportAsync(parent, report, reportId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createReportTest2() throws Exception { + Report expectedResponse = + Report.newBuilder() + .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString()) + .addAllDimensions(new ArrayList()) + .addAllMetrics(new ArrayList()) + .addAllScopes(new ArrayList()) + .setFilter("filter-1274492040") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createReportTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Report report = Report.newBuilder().build(); + String reportId = "reportId-427040401"; + + Report actualResponse = client.createReportAsync(parent, report, reportId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createReportExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Report report = Report.newBuilder().build(); + String reportId = "reportId-427040401"; + client.createReportAsync(parent, report, reportId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void getReportTest() throws Exception { + Report expectedResponse = + Report.newBuilder() + .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString()) + .addAllDimensions(new ArrayList()) + .addAllMetrics(new ArrayList()) + .addAllScopes(new ArrayList()) + .setFilter("filter-1274492040") + .build(); + mockService.addResponse(expectedResponse); + + ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]"); + + Report actualResponse = client.getReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getReportExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]"); + client.getReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getReportTest2() throws Exception { + Report expectedResponse = + Report.newBuilder() + .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString()) + .addAllDimensions(new ArrayList()) + .addAllMetrics(new ArrayList()) + .addAllScopes(new ArrayList()) + .setFilter("filter-1274492040") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-9189/locations/location-9189/reports/report-9189"; + + Report actualResponse = client.getReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getReportExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9189/locations/location-9189/reports/report-9189"; + client.getReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listReportsTest() throws Exception { + Report responsesElement = Report.newBuilder().build(); + ListReportsResponse expectedResponse = + ListReportsResponse.newBuilder() + .setNextPageToken("") + .addAllReports(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListReportsPagedResponse pagedListResponse = client.listReports(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReportsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listReportsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listReports(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listReportsTest2() throws Exception { + Report responsesElement = Report.newBuilder().build(); + ListReportsResponse expectedResponse = + ListReportsResponse.newBuilder() + .setNextPageToken("") + .addAllReports(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListReportsPagedResponse pagedListResponse = client.listReports(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReportsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listReportsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listReports(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteReportTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]"); + + client.deleteReport(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteReportExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]"); + client.deleteReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteReportTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-9189/locations/location-9189/reports/report-9189"; + + client.deleteReport(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteReportExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9189/locations/location-9189/reports/report-9189"; + client.deleteReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void readReportTest() throws Exception { + ListValue responsesElement = ListValue.newBuilder().build(); + ReadReportResponse expectedResponse = + ReadReportResponse.newBuilder() + .setNextPageToken("") + .addAllRows(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]"); + + ReadReportPagedResponse pagedListResponse = client.readReport(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRowsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void readReportExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]"); + client.readReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void readReportTest2() throws Exception { + ListValue responsesElement = ListValue.newBuilder().build(); + ReadReportResponse expectedResponse = + ReadReportResponse.newBuilder() + .setNextPageToken("") + .addAllRows(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-9189/locations/location-9189/reports/report-9189"; + + ReadReportPagedResponse pagedListResponse = client.readReport(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRowsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void readReportExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9189/locations/location-9189/reports/report-9189"; + client.readReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/AppOptimizeClientTest.java b/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/AppOptimizeClientTest.java new file mode 100644 index 000000000000..1cf314f6e45d --- /dev/null +++ b/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/AppOptimizeClientTest.java @@ -0,0 +1,638 @@ +/* + * 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.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.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.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.ListValue; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AppOptimizeClientTest { + private static MockAppOptimize mockAppOptimize; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private AppOptimizeClient client; + + @BeforeClass + public static void startStaticServer() { + mockAppOptimize = new MockAppOptimize(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockAppOptimize, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + AppOptimizeSettings settings = + AppOptimizeSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AppOptimizeClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createReportTest() throws Exception { + Report expectedResponse = + Report.newBuilder() + .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString()) + .addAllDimensions(new ArrayList()) + .addAllMetrics(new ArrayList()) + .addAllScopes(new ArrayList()) + .setFilter("filter-1274492040") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createReportTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAppOptimize.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Report report = Report.newBuilder().build(); + String reportId = "reportId-427040401"; + + Report actualResponse = client.createReportAsync(parent, report, reportId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAppOptimize.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateReportRequest actualRequest = ((CreateReportRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(report, actualRequest.getReport()); + Assert.assertEquals(reportId, actualRequest.getReportId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createReportExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppOptimize.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Report report = Report.newBuilder().build(); + String reportId = "reportId-427040401"; + client.createReportAsync(parent, report, reportId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createReportTest2() throws Exception { + Report expectedResponse = + Report.newBuilder() + .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString()) + .addAllDimensions(new ArrayList()) + .addAllMetrics(new ArrayList()) + .addAllScopes(new ArrayList()) + .setFilter("filter-1274492040") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createReportTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAppOptimize.addResponse(resultOperation); + + String parent = "parent-995424086"; + Report report = Report.newBuilder().build(); + String reportId = "reportId-427040401"; + + Report actualResponse = client.createReportAsync(parent, report, reportId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAppOptimize.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateReportRequest actualRequest = ((CreateReportRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(report, actualRequest.getReport()); + Assert.assertEquals(reportId, actualRequest.getReportId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createReportExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppOptimize.addException(exception); + + try { + String parent = "parent-995424086"; + Report report = Report.newBuilder().build(); + String reportId = "reportId-427040401"; + client.createReportAsync(parent, report, reportId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getReportTest() throws Exception { + Report expectedResponse = + Report.newBuilder() + .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString()) + .addAllDimensions(new ArrayList()) + .addAllMetrics(new ArrayList()) + .addAllScopes(new ArrayList()) + .setFilter("filter-1274492040") + .build(); + mockAppOptimize.addResponse(expectedResponse); + + ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]"); + + Report actualResponse = client.getReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAppOptimize.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetReportRequest actualRequest = ((GetReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getReportExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppOptimize.addException(exception); + + try { + ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]"); + client.getReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getReportTest2() throws Exception { + Report expectedResponse = + Report.newBuilder() + .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString()) + .addAllDimensions(new ArrayList()) + .addAllMetrics(new ArrayList()) + .addAllScopes(new ArrayList()) + .setFilter("filter-1274492040") + .build(); + mockAppOptimize.addResponse(expectedResponse); + + String name = "name3373707"; + + Report actualResponse = client.getReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAppOptimize.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetReportRequest actualRequest = ((GetReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getReportExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppOptimize.addException(exception); + + try { + String name = "name3373707"; + client.getReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listReportsTest() throws Exception { + Report responsesElement = Report.newBuilder().build(); + ListReportsResponse expectedResponse = + ListReportsResponse.newBuilder() + .setNextPageToken("") + .addAllReports(Arrays.asList(responsesElement)) + .build(); + mockAppOptimize.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListReportsPagedResponse pagedListResponse = client.listReports(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReportsList().get(0), resources.get(0)); + + List actualRequests = mockAppOptimize.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListReportsRequest actualRequest = ((ListReportsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listReportsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppOptimize.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listReports(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listReportsTest2() throws Exception { + Report responsesElement = Report.newBuilder().build(); + ListReportsResponse expectedResponse = + ListReportsResponse.newBuilder() + .setNextPageToken("") + .addAllReports(Arrays.asList(responsesElement)) + .build(); + mockAppOptimize.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListReportsPagedResponse pagedListResponse = client.listReports(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReportsList().get(0), resources.get(0)); + + List actualRequests = mockAppOptimize.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListReportsRequest actualRequest = ((ListReportsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listReportsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppOptimize.addException(exception); + + try { + String parent = "parent-995424086"; + client.listReports(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteReportTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAppOptimize.addResponse(expectedResponse); + + ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]"); + + client.deleteReport(name); + + List actualRequests = mockAppOptimize.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteReportRequest actualRequest = ((DeleteReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteReportExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppOptimize.addException(exception); + + try { + ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]"); + client.deleteReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteReportTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAppOptimize.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteReport(name); + + List actualRequests = mockAppOptimize.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteReportRequest actualRequest = ((DeleteReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteReportExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppOptimize.addException(exception); + + try { + String name = "name3373707"; + client.deleteReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void readReportTest() throws Exception { + ListValue responsesElement = ListValue.newBuilder().build(); + ReadReportResponse expectedResponse = + ReadReportResponse.newBuilder() + .setNextPageToken("") + .addAllRows(Arrays.asList(responsesElement)) + .build(); + mockAppOptimize.addResponse(expectedResponse); + + ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]"); + + ReadReportPagedResponse pagedListResponse = client.readReport(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRowsList().get(0), resources.get(0)); + + List actualRequests = mockAppOptimize.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ReadReportRequest actualRequest = ((ReadReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void readReportExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppOptimize.addException(exception); + + try { + ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]"); + client.readReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void readReportTest2() throws Exception { + ListValue responsesElement = ListValue.newBuilder().build(); + ReadReportResponse expectedResponse = + ReadReportResponse.newBuilder() + .setNextPageToken("") + .addAllRows(Arrays.asList(responsesElement)) + .build(); + mockAppOptimize.addResponse(expectedResponse); + + String name = "name3373707"; + + ReadReportPagedResponse pagedListResponse = client.readReport(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRowsList().get(0), resources.get(0)); + + List actualRequests = mockAppOptimize.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ReadReportRequest actualRequest = ((ReadReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void readReportExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAppOptimize.addException(exception); + + try { + String name = "name3373707"; + client.readReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/MockAppOptimize.java b/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/MockAppOptimize.java new file mode 100644 index 000000000000..831d1beafbe1 --- /dev/null +++ b/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/MockAppOptimize.java @@ -0,0 +1,59 @@ +/* + * 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.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAppOptimize implements MockGrpcService { + private final MockAppOptimizeImpl serviceImpl; + + public MockAppOptimize() { + serviceImpl = new MockAppOptimizeImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/MockAppOptimizeImpl.java b/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/MockAppOptimizeImpl.java new file mode 100644 index 000000000000..b62c9ae1a6db --- /dev/null +++ b/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/MockAppOptimizeImpl.java @@ -0,0 +1,165 @@ +/* + * 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.BetaApi; +import com.google.cloud.appoptimize.v1beta.AppOptimizeGrpc.AppOptimizeImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAppOptimizeImpl extends AppOptimizeImplBase { + private List requests; + private Queue responses; + + public MockAppOptimizeImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createReport( + CreateReportRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateReport, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getReport(GetReportRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Report) { + requests.add(request); + responseObserver.onNext(((Report) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetReport, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Report.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listReports( + ListReportsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListReportsResponse) { + requests.add(request); + responseObserver.onNext(((ListReportsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListReports, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListReportsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteReport(DeleteReportRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteReport, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void readReport( + ReadReportRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ReadReportResponse) { + requests.add(request); + responseObserver.onNext(((ReadReportResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ReadReport, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ReadReportResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/MockLocations.java b/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/MockLocations.java new file mode 100644 index 000000000000..f2ee402159dd --- /dev/null +++ b/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/MockLocations.java @@ -0,0 +1,59 @@ +/* + * 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.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/MockLocationsImpl.java b/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/MockLocationsImpl.java new file mode 100644 index 000000000000..952ccae57116 --- /dev/null +++ b/java-appoptimize/google-cloud-appoptimize/src/test/java/com/google/cloud/appoptimize/v1beta/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * 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.BetaApi; +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.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-appoptimize/grpc-google-cloud-appoptimize-v1beta/pom.xml b/java-appoptimize/grpc-google-cloud-appoptimize-v1beta/pom.xml new file mode 100644 index 000000000000..867a59eaf377 --- /dev/null +++ b/java-appoptimize/grpc-google-cloud-appoptimize-v1beta/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-appoptimize-v1beta + 0.0.1-SNAPSHOT + grpc-google-cloud-appoptimize-v1beta + GRPC library for google-cloud-appoptimize + + com.google.cloud + google-cloud-appoptimize-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-appoptimize-v1beta + + + com.google.guava + guava + + + diff --git a/java-appoptimize/grpc-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/AppOptimizeGrpc.java b/java-appoptimize/grpc-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/AppOptimizeGrpc.java new file mode 100644 index 000000000000..41a99ac17842 --- /dev/null +++ b/java-appoptimize/grpc-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/AppOptimizeGrpc.java @@ -0,0 +1,944 @@ +/* + * 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 io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for managing and querying optimization reports.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class AppOptimizeGrpc { + + private AppOptimizeGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.appoptimize.v1beta.AppOptimize"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.appoptimize.v1beta.CreateReportRequest, com.google.longrunning.Operation> + getCreateReportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateReport", + requestType = com.google.cloud.appoptimize.v1beta.CreateReportRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.appoptimize.v1beta.CreateReportRequest, com.google.longrunning.Operation> + getCreateReportMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.appoptimize.v1beta.CreateReportRequest, + com.google.longrunning.Operation> + getCreateReportMethod; + if ((getCreateReportMethod = AppOptimizeGrpc.getCreateReportMethod) == null) { + synchronized (AppOptimizeGrpc.class) { + if ((getCreateReportMethod = AppOptimizeGrpc.getCreateReportMethod) == null) { + AppOptimizeGrpc.getCreateReportMethod = + getCreateReportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateReport")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.appoptimize.v1beta.CreateReportRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AppOptimizeMethodDescriptorSupplier("CreateReport")) + .build(); + } + } + } + return getCreateReportMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.appoptimize.v1beta.GetReportRequest, + com.google.cloud.appoptimize.v1beta.Report> + getGetReportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetReport", + requestType = com.google.cloud.appoptimize.v1beta.GetReportRequest.class, + responseType = com.google.cloud.appoptimize.v1beta.Report.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.appoptimize.v1beta.GetReportRequest, + com.google.cloud.appoptimize.v1beta.Report> + getGetReportMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.appoptimize.v1beta.GetReportRequest, + com.google.cloud.appoptimize.v1beta.Report> + getGetReportMethod; + if ((getGetReportMethod = AppOptimizeGrpc.getGetReportMethod) == null) { + synchronized (AppOptimizeGrpc.class) { + if ((getGetReportMethod = AppOptimizeGrpc.getGetReportMethod) == null) { + AppOptimizeGrpc.getGetReportMethod = + getGetReportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetReport")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.appoptimize.v1beta.GetReportRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.appoptimize.v1beta.Report.getDefaultInstance())) + .setSchemaDescriptor(new AppOptimizeMethodDescriptorSupplier("GetReport")) + .build(); + } + } + } + return getGetReportMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.appoptimize.v1beta.ListReportsRequest, + com.google.cloud.appoptimize.v1beta.ListReportsResponse> + getListReportsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListReports", + requestType = com.google.cloud.appoptimize.v1beta.ListReportsRequest.class, + responseType = com.google.cloud.appoptimize.v1beta.ListReportsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.appoptimize.v1beta.ListReportsRequest, + com.google.cloud.appoptimize.v1beta.ListReportsResponse> + getListReportsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.appoptimize.v1beta.ListReportsRequest, + com.google.cloud.appoptimize.v1beta.ListReportsResponse> + getListReportsMethod; + if ((getListReportsMethod = AppOptimizeGrpc.getListReportsMethod) == null) { + synchronized (AppOptimizeGrpc.class) { + if ((getListReportsMethod = AppOptimizeGrpc.getListReportsMethod) == null) { + AppOptimizeGrpc.getListReportsMethod = + getListReportsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListReports")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.appoptimize.v1beta.ListReportsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.appoptimize.v1beta.ListReportsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new AppOptimizeMethodDescriptorSupplier("ListReports")) + .build(); + } + } + } + return getListReportsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.appoptimize.v1beta.DeleteReportRequest, com.google.protobuf.Empty> + getDeleteReportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteReport", + requestType = com.google.cloud.appoptimize.v1beta.DeleteReportRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.appoptimize.v1beta.DeleteReportRequest, com.google.protobuf.Empty> + getDeleteReportMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.appoptimize.v1beta.DeleteReportRequest, com.google.protobuf.Empty> + getDeleteReportMethod; + if ((getDeleteReportMethod = AppOptimizeGrpc.getDeleteReportMethod) == null) { + synchronized (AppOptimizeGrpc.class) { + if ((getDeleteReportMethod = AppOptimizeGrpc.getDeleteReportMethod) == null) { + AppOptimizeGrpc.getDeleteReportMethod = + getDeleteReportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteReport")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.appoptimize.v1beta.DeleteReportRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new AppOptimizeMethodDescriptorSupplier("DeleteReport")) + .build(); + } + } + } + return getDeleteReportMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.appoptimize.v1beta.ReadReportRequest, + com.google.cloud.appoptimize.v1beta.ReadReportResponse> + getReadReportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReadReport", + requestType = com.google.cloud.appoptimize.v1beta.ReadReportRequest.class, + responseType = com.google.cloud.appoptimize.v1beta.ReadReportResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.appoptimize.v1beta.ReadReportRequest, + com.google.cloud.appoptimize.v1beta.ReadReportResponse> + getReadReportMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.appoptimize.v1beta.ReadReportRequest, + com.google.cloud.appoptimize.v1beta.ReadReportResponse> + getReadReportMethod; + if ((getReadReportMethod = AppOptimizeGrpc.getReadReportMethod) == null) { + synchronized (AppOptimizeGrpc.class) { + if ((getReadReportMethod = AppOptimizeGrpc.getReadReportMethod) == null) { + AppOptimizeGrpc.getReadReportMethod = + getReadReportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReadReport")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.appoptimize.v1beta.ReadReportRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.appoptimize.v1beta.ReadReportResponse + .getDefaultInstance())) + .setSchemaDescriptor(new AppOptimizeMethodDescriptorSupplier("ReadReport")) + .build(); + } + } + } + return getReadReportMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AppOptimizeStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AppOptimizeStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppOptimizeStub(channel, callOptions); + } + }; + return AppOptimizeStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static AppOptimizeBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AppOptimizeBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppOptimizeBlockingV2Stub(channel, callOptions); + } + }; + return AppOptimizeBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AppOptimizeBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AppOptimizeBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppOptimizeBlockingStub(channel, callOptions); + } + }; + return AppOptimizeBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AppOptimizeFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AppOptimizeFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppOptimizeFutureStub(channel, callOptions); + } + }; + return AppOptimizeFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing and querying optimization reports.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * 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`.
+     * 
+ */ + default void createReport( + com.google.cloud.appoptimize.v1beta.CreateReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateReportMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the details of a report configuration.
+     * 
+ */ + default void getReport( + com.google.cloud.appoptimize.v1beta.GetReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetReportMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists reports within a given project.
+     * 
+ */ + default void listReports( + com.google.cloud.appoptimize.v1beta.ListReportsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListReportsMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified report.
+     * 
+ */ + default void deleteReport( + com.google.cloud.appoptimize.v1beta.DeleteReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteReportMethod(), responseObserver); + } + + /** + * + * + *
+     * Reads data within a specified report.
+     * 
+ */ + default void readReport( + com.google.cloud.appoptimize.v1beta.ReadReportRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getReadReportMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service AppOptimize. + * + *
+   * Service for managing and querying optimization reports.
+   * 
+ */ + public abstract static class AppOptimizeImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return AppOptimizeGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service AppOptimize. + * + *
+   * Service for managing and querying optimization reports.
+   * 
+ */ + public static final class AppOptimizeStub + extends io.grpc.stub.AbstractAsyncStub { + private AppOptimizeStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AppOptimizeStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppOptimizeStub(channel, callOptions); + } + + /** + * + * + *
+     * 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`.
+     * 
+ */ + public void createReport( + com.google.cloud.appoptimize.v1beta.CreateReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateReportMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves the details of a report configuration.
+     * 
+ */ + public void getReport( + com.google.cloud.appoptimize.v1beta.GetReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetReportMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists reports within a given project.
+     * 
+ */ + public void listReports( + com.google.cloud.appoptimize.v1beta.ListReportsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListReportsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the specified report.
+     * 
+ */ + public void deleteReport( + com.google.cloud.appoptimize.v1beta.DeleteReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteReportMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Reads data within a specified report.
+     * 
+ */ + public void readReport( + com.google.cloud.appoptimize.v1beta.ReadReportRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReadReportMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service AppOptimize. + * + *
+   * Service for managing and querying optimization reports.
+   * 
+ */ + public static final class AppOptimizeBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private AppOptimizeBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AppOptimizeBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppOptimizeBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * 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`.
+     * 
+ */ + public com.google.longrunning.Operation createReport( + com.google.cloud.appoptimize.v1beta.CreateReportRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the details of a report configuration.
+     * 
+ */ + public com.google.cloud.appoptimize.v1beta.Report getReport( + com.google.cloud.appoptimize.v1beta.GetReportRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists reports within a given project.
+     * 
+ */ + public com.google.cloud.appoptimize.v1beta.ListReportsResponse listReports( + com.google.cloud.appoptimize.v1beta.ListReportsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListReportsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified report.
+     * 
+ */ + public com.google.protobuf.Empty deleteReport( + com.google.cloud.appoptimize.v1beta.DeleteReportRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reads data within a specified report.
+     * 
+ */ + public com.google.cloud.appoptimize.v1beta.ReadReportResponse readReport( + com.google.cloud.appoptimize.v1beta.ReadReportRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getReadReportMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service AppOptimize. + * + *
+   * Service for managing and querying optimization reports.
+   * 
+ */ + public static final class AppOptimizeBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private AppOptimizeBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AppOptimizeBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppOptimizeBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * 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`.
+     * 
+ */ + public com.google.longrunning.Operation createReport( + com.google.cloud.appoptimize.v1beta.CreateReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the details of a report configuration.
+     * 
+ */ + public com.google.cloud.appoptimize.v1beta.Report getReport( + com.google.cloud.appoptimize.v1beta.GetReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists reports within a given project.
+     * 
+ */ + public com.google.cloud.appoptimize.v1beta.ListReportsResponse listReports( + com.google.cloud.appoptimize.v1beta.ListReportsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListReportsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified report.
+     * 
+ */ + public com.google.protobuf.Empty deleteReport( + com.google.cloud.appoptimize.v1beta.DeleteReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Reads data within a specified report.
+     * 
+ */ + public com.google.cloud.appoptimize.v1beta.ReadReportResponse readReport( + com.google.cloud.appoptimize.v1beta.ReadReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReadReportMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service AppOptimize. + * + *
+   * Service for managing and querying optimization reports.
+   * 
+ */ + public static final class AppOptimizeFutureStub + extends io.grpc.stub.AbstractFutureStub { + private AppOptimizeFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AppOptimizeFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppOptimizeFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * 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`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createReport(com.google.cloud.appoptimize.v1beta.CreateReportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateReportMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves the details of a report configuration.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.appoptimize.v1beta.Report> + getReport(com.google.cloud.appoptimize.v1beta.GetReportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetReportMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists reports within a given project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.appoptimize.v1beta.ListReportsResponse> + listReports(com.google.cloud.appoptimize.v1beta.ListReportsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListReportsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified report.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteReport(com.google.cloud.appoptimize.v1beta.DeleteReportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteReportMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Reads data within a specified report.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.appoptimize.v1beta.ReadReportResponse> + readReport(com.google.cloud.appoptimize.v1beta.ReadReportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReadReportMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_REPORT = 0; + private static final int METHODID_GET_REPORT = 1; + private static final int METHODID_LIST_REPORTS = 2; + private static final int METHODID_DELETE_REPORT = 3; + private static final int METHODID_READ_REPORT = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_REPORT: + serviceImpl.createReport( + (com.google.cloud.appoptimize.v1beta.CreateReportRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_REPORT: + serviceImpl.getReport( + (com.google.cloud.appoptimize.v1beta.GetReportRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_REPORTS: + serviceImpl.listReports( + (com.google.cloud.appoptimize.v1beta.ListReportsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_REPORT: + serviceImpl.deleteReport( + (com.google.cloud.appoptimize.v1beta.DeleteReportRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_READ_REPORT: + serviceImpl.readReport( + (com.google.cloud.appoptimize.v1beta.ReadReportRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateReportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.appoptimize.v1beta.CreateReportRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_REPORT))) + .addMethod( + getGetReportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.appoptimize.v1beta.GetReportRequest, + com.google.cloud.appoptimize.v1beta.Report>(service, METHODID_GET_REPORT))) + .addMethod( + getListReportsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.appoptimize.v1beta.ListReportsRequest, + com.google.cloud.appoptimize.v1beta.ListReportsResponse>( + service, METHODID_LIST_REPORTS))) + .addMethod( + getDeleteReportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.appoptimize.v1beta.DeleteReportRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_REPORT))) + .addMethod( + getReadReportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.appoptimize.v1beta.ReadReportRequest, + com.google.cloud.appoptimize.v1beta.ReadReportResponse>( + service, METHODID_READ_REPORT))) + .build(); + } + + private abstract static class AppOptimizeBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AppOptimizeBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AppOptimize"); + } + } + + private static final class AppOptimizeFileDescriptorSupplier + extends AppOptimizeBaseDescriptorSupplier { + AppOptimizeFileDescriptorSupplier() {} + } + + private static final class AppOptimizeMethodDescriptorSupplier + extends AppOptimizeBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + AppOptimizeMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (AppOptimizeGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AppOptimizeFileDescriptorSupplier()) + .addMethod(getCreateReportMethod()) + .addMethod(getGetReportMethod()) + .addMethod(getListReportsMethod()) + .addMethod(getDeleteReportMethod()) + .addMethod(getReadReportMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-appoptimize/owlbot.py b/java-appoptimize/owlbot.py new file mode 100644 index 000000000000..6da47954339a --- /dev/null +++ b/java-appoptimize/owlbot.py @@ -0,0 +1,38 @@ +# 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 +# +# 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. + +import synthtool as s +from synthtool.languages import java + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates( + monorepo=True, + excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore", + ], +) \ No newline at end of file diff --git a/java-appoptimize/pom.xml b/java-appoptimize/pom.xml new file mode 100644 index 000000000000..30d2291d9e14 --- /dev/null +++ b/java-appoptimize/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + com.google.cloud + google-cloud-appoptimize-parent + pom + 0.0.1-SNAPSHOT + Google App Optimize API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.83.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-appoptimize-parent + + + + + + 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 + + + + + + + google-cloud-appoptimize + grpc-google-cloud-appoptimize-v1beta + proto-google-cloud-appoptimize-v1beta + google-cloud-appoptimize-bom + + + diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/clirr-ignored-differences.xml b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/clirr-ignored-differences.xml new file mode 100644 index 000000000000..9920c05c1eb1 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/clirr-ignored-differences.xml @@ -0,0 +1,80 @@ + + + + + 7012 + com/google/cloud/appoptimize/v1beta/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/appoptimize/v1beta/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/appoptimize/v1beta/*OrBuilder + boolean has*(*) + + + + 7006 + com/google/cloud/appoptimize/v1beta/** + * getDefaultInstanceForType() + ** + + + 7006 + com/google/cloud/appoptimize/v1beta/** + * addRepeatedField(*) + ** + + + 7006 + com/google/cloud/appoptimize/v1beta/** + * clear() + ** + + + 7006 + com/google/cloud/appoptimize/v1beta/** + * clearField(*) + ** + + + 7006 + com/google/cloud/appoptimize/v1beta/** + * clearOneof(*) + ** + + + 7006 + com/google/cloud/appoptimize/v1beta/** + * clone() + ** + + + 7006 + com/google/cloud/appoptimize/v1beta/** + * mergeUnknownFields(*) + ** + + + 7006 + com/google/cloud/appoptimize/v1beta/** + * setField(*) + ** + + + 7006 + com/google/cloud/appoptimize/v1beta/** + * setRepeatedField(*) + ** + + + 7006 + com/google/cloud/appoptimize/v1beta/** + * setUnknownFields(*) + ** + + diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/pom.xml b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/pom.xml new file mode 100644 index 000000000000..d4f15827c9b4 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-appoptimize-v1beta + 0.0.1-SNAPSHOT + proto-google-cloud-appoptimize-v1beta + Proto library for google-cloud-appoptimize + + com.google.cloud + google-cloud-appoptimize-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/AppOptimizeProto.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/AppOptimizeProto.java new file mode 100644 index 000000000000..354f1c76c9c6 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/AppOptimizeProto.java @@ -0,0 +1,307 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +@com.google.protobuf.Generated +public final class AppOptimizeProto extends com.google.protobuf.GeneratedFile { + private AppOptimizeProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AppOptimizeProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_appoptimize_v1beta_CreateReportRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_appoptimize_v1beta_CreateReportRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_appoptimize_v1beta_Report_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_appoptimize_v1beta_Report_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_appoptimize_v1beta_Scope_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_appoptimize_v1beta_Scope_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_appoptimize_v1beta_GetReportRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_appoptimize_v1beta_GetReportRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_appoptimize_v1beta_ListReportsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_appoptimize_v1beta_ListReportsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_appoptimize_v1beta_ListReportsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_appoptimize_v1beta_ListReportsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_appoptimize_v1beta_DeleteReportRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_appoptimize_v1beta_DeleteReportRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_appoptimize_v1beta_ReadReportRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_appoptimize_v1beta_ReadReportRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_appoptimize_v1beta_ReadReportResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_appoptimize_v1beta_ReadReportResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_appoptimize_v1beta_Column_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_appoptimize_v1beta_Column_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_appoptimize_v1beta_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_appoptimize_v1beta_OperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + "2google/cloud/appoptimize/v1beta/app_optimize.proto\022\037google.cloud.appoptimize.v" + + "1beta\032\034google/api/annotations.proto\032\027goo" + + "gle/api/client.proto\032\037google/api/field_b" + + "ehavior.proto\032\031google/api/resource.proto" + + "\032#google/longrunning/operations.proto\032\033g" + + "oogle/protobuf/empty.proto\032\034google/proto" + + "buf/struct.proto\032\037google/protobuf/timestamp.proto\"\246\001\n" + + "\023CreateReportRequest\0229\n" + + "\006parent\030\001 \001(" + + "\tB)\340A\002\372A#\022!appoptimize.googleapis.com/Report\022\026\n" + + "\treport_id\030\002 \001(\tB\003\340A\002\022<\n" + + "\006report\030\003" + + " \001(\0132\'.google.cloud.appoptimize.v1beta.ReportB\003\340A\002\"\325\002\n" + + "\006Report\0226\n" + + "\013expire_time\030\006" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003H\000\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\010\022\027\n\n" + + "dimensions\030\002 \003(\tB\003\340A\002\022\024\n" + + "\007metrics\030\007 \003(\tB\003\340A\002\022;\n" + + "\006scopes\030\003" + + " \003(\0132&.google.cloud.appoptimize.v1beta.ScopeB\003\340A\001\022\023\n" + + "\006filter\030\004 \001(\tB\003\340A\001:q\352An\n" + + "!appoptimize.googleapis.com/Report\0228proje" + + "cts/{project}/locations/{location}/reports/{report}*\007reports2\006reportB\014\n\n" + + "expiration\"\232\001\n" + + "\005Scope\022F\n" + + "\007project\030\001 \001(\tB3\340A\002\372A-\n" + + "+cloudresourcemanager.googleapis.com/ProjectH\000\022@\n" + + "\013application\030\002 \001(\tB)\340A\002\372A#\n" + + "!apphub.googleapis.com/ApplicationH\000B\007\n" + + "\005scope\"K\n" + + "\020GetReportRequest\0227\n" + + "\004name\030\001 \001(\tB)\340A\002\372A#\n" + + "!appoptimize.googleapis.com/Report\"\200\001\n" + + "\022ListReportsRequest\0229\n" + + "\006parent\030\001 \001(\tB)\340A\002" + + "\372A#\022!appoptimize.googleapis.com/Report\022\026\n" + + "\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\n" + + "page_token\030\003 \001(\tB\003\340A\001\"h\n" + + "\023ListReportsResponse\0228\n" + + "\007reports\030\001 \003(\0132\'.google.cloud.appoptimize.v1beta.Report\022\027\n" + + "\017next_page_token\030\002 \001(\t\"j\n" + + "\023DeleteReportRequest\0227\n" + + "\004name\030\001 \001(\tB)\340A\002\372A#\n" + + "!appoptimize.googleapis.com/Report\022\032\n\r" + + "allow_missing\030\002 \001(\010B\003\340A\001\"}\n" + + "\021ReadReportRequest\0227\n" + + "\004name\030\001 \001(\tB)\340A\002\372A#\n" + + "!appoptimize.googleapis.com/Report\022\026\n" + + "\tpage_size\030\004 \001(\005B\003\340A\001\022\027\n\n" + + "page_token\030\005 \001(\tB\003\340A\001\"\221\001\n" + + "\022ReadReportResponse\022(\n" + + "\004rows\030\001 \003(\0132\032.google.protobuf.ListValue\0228\n" + + "\007columns\030\005 \003(\0132\'.google.cloud.appoptimize.v1beta.Column\022\027\n" + + "\017next_page_token\030\003 \001(\t\"l\n" + + "\006Column\022\014\n" + + "\004name\030\001 \001(\t\022\014\n" + + "\004type\030\002 \001(\t\022\014\n" + + "\004mode\030\003 \001(\t\0228\n" + + "\007columns\030\004 \003(\0132\'.google.cloud.appoptimize.v1beta.Column\"\023\n" + + "\021OperationMetadata2\202\010\n" + + "\013AppOptimize\022\334\001\n" + + "\014CreateReport\0224.google.cloud.appo" + + "ptimize.v1beta.CreateReportRequest\032\035.google.longrunning.Operation\"w\312A\033\n" + + "\006Report\022\021OperationMetadata\332A\027parent,report,report" + + "_id\202\323\344\223\0029\"//v1beta/{parent=projects/*/locations/*}/reports:\006report\022\247\001\n" + + "\tGetReport\0221.google.cloud.appoptimize.v1beta.GetRe" + + "portRequest\032\'.google.cloud.appoptimize.v" + + "1beta.Report\">\332A\004name\202\323\344\223\0021\022//v1beta/{name=projects/*/locations/*/reports/*}\022\272\001\n" + + "\013ListReports\0223.google.cloud.appoptimize." + + "v1beta.ListReportsRequest\0324.google.cloud.appoptimize.v1beta.ListReportsResponse\"" + + "@\332A\006parent\202\323\344\223\0021\022//v1beta/{parent=projects/*/locations/*}/reports\022\234\001\n" + + "\014DeleteReport\0224.google.cloud.appoptimize.v1beta.Del" + + "eteReportRequest\032\026.google.protobuf.Empty" + + "\">\332A\004name\202\323\344\223\0021*//v1beta/{name=projects/*/locations/*/reports/*}\022\275\001\n\n" + + "ReadReport\0222.google.cloud.appoptimize.v1beta.ReadRe" + + "portRequest\0323.google.cloud.appoptimize.v" + + "1beta.ReadReportResponse\"F\332A\004name\202\323\344\223\0029\"" + + "4/v1beta/{name=projects/*/locations/*/re" + + "ports/*}:read:\001*\032N\312A\032appoptimize.googlea" + + "pis.com\322A.https://www.googleapis.com/auth/cloud-platformB\352\001\n" + + "#com.google.cloud.appoptimize.v1betaB\020AppOptimizeProtoP\001ZEcl" + + "oud.google.com/go/appoptimize/apiv1beta/appoptimizepb;appoptimizepb\352Ag\n" + + "!apphub.googleapis.com/Application\022Bprojects/{pro" + + "ject}/locations/{location}/applications/{application}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_appoptimize_v1beta_CreateReportRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_appoptimize_v1beta_CreateReportRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_appoptimize_v1beta_CreateReportRequest_descriptor, + new java.lang.String[] { + "Parent", "ReportId", "Report", + }); + internal_static_google_cloud_appoptimize_v1beta_Report_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_appoptimize_v1beta_Report_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_appoptimize_v1beta_Report_descriptor, + new java.lang.String[] { + "ExpireTime", "Name", "Dimensions", "Metrics", "Scopes", "Filter", "Expiration", + }); + internal_static_google_cloud_appoptimize_v1beta_Scope_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_cloud_appoptimize_v1beta_Scope_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_appoptimize_v1beta_Scope_descriptor, + new java.lang.String[] { + "Project", "Application", "Scope", + }); + internal_static_google_cloud_appoptimize_v1beta_GetReportRequest_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_cloud_appoptimize_v1beta_GetReportRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_appoptimize_v1beta_GetReportRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_appoptimize_v1beta_ListReportsRequest_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_cloud_appoptimize_v1beta_ListReportsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_appoptimize_v1beta_ListReportsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_appoptimize_v1beta_ListReportsResponse_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_cloud_appoptimize_v1beta_ListReportsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_appoptimize_v1beta_ListReportsResponse_descriptor, + new java.lang.String[] { + "Reports", "NextPageToken", + }); + internal_static_google_cloud_appoptimize_v1beta_DeleteReportRequest_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_cloud_appoptimize_v1beta_DeleteReportRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_appoptimize_v1beta_DeleteReportRequest_descriptor, + new java.lang.String[] { + "Name", "AllowMissing", + }); + internal_static_google_cloud_appoptimize_v1beta_ReadReportRequest_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_cloud_appoptimize_v1beta_ReadReportRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_appoptimize_v1beta_ReadReportRequest_descriptor, + new java.lang.String[] { + "Name", "PageSize", "PageToken", + }); + internal_static_google_cloud_appoptimize_v1beta_ReadReportResponse_descriptor = + getDescriptor().getMessageType(8); + internal_static_google_cloud_appoptimize_v1beta_ReadReportResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_appoptimize_v1beta_ReadReportResponse_descriptor, + new java.lang.String[] { + "Rows", "Columns", "NextPageToken", + }); + internal_static_google_cloud_appoptimize_v1beta_Column_descriptor = + getDescriptor().getMessageType(9); + internal_static_google_cloud_appoptimize_v1beta_Column_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_appoptimize_v1beta_Column_descriptor, + new java.lang.String[] { + "Name", "Type", "Mode", "Columns", + }); + internal_static_google_cloud_appoptimize_v1beta_OperationMetadata_descriptor = + getDescriptor().getMessageType(10); + internal_static_google_cloud_appoptimize_v1beta_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_appoptimize_v1beta_OperationMetadata_descriptor, + new java.lang.String[] {}); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/Column.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/Column.java new file mode 100644 index 000000000000..0ee1fb9f9059 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/Column.java @@ -0,0 +1,1685 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +/** + * + * + *
+ * Describes a single column within `Columns`.
+ * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.Column} + */ +@com.google.protobuf.Generated +public final class Column extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.appoptimize.v1beta.Column) + ColumnOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Column"); + } + + // Use Column.newBuilder() to construct. + private Column(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Column() { + name_ = ""; + type_ = ""; + mode_ = ""; + columns_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_Column_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_Column_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.Column.class, + com.google.cloud.appoptimize.v1beta.Column.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The name of the column.
+   *
+   * This field:
+   *
+   * * Contains only letters (a-z, A-Z), numbers (0-9), or underscores (_);
+   * * Start with a letter or underscore; and
+   * * Has a maximum length is 128 characters.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * The name of the column.
+   *
+   * This field:
+   *
+   * * Contains only letters (a-z, A-Z), numbers (0-9), or underscores (_);
+   * * Start with a letter or underscore; and
+   * * Has a maximum length is 128 characters.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + + /** + * + * + *
+   * The data type of the column.
+   *
+   * Supported values include:
+   *
+   * * `STRING`
+   * * `INT64`
+   * * `FLOAT64`
+   * * `BOOLEAN`
+   * * `TIMESTAMP`
+   * * `RECORD`
+   *
+   * `RECORD` indicates that the field contains a nested schema, described in
+   * the `columns` property of this `Column`.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + + /** + * + * + *
+   * The data type of the column.
+   *
+   * Supported values include:
+   *
+   * * `STRING`
+   * * `INT64`
+   * * `FLOAT64`
+   * * `BOOLEAN`
+   * * `TIMESTAMP`
+   * * `RECORD`
+   *
+   * `RECORD` indicates that the field contains a nested schema, described in
+   * the `columns` property of this `Column`.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object mode_ = ""; + + /** + * + * + *
+   * The mode of the column, indicating if it is nullable, required, or
+   * repeated.
+   *
+   * Possible values:
+   *
+   * * `NULLABLE`: The column allows NULL values.
+   * * `REQUIRED`: The column does not allow NULL values.
+   * * `REPEATED`: The column contains an array of values.
+   * 
+ * + * string mode = 3; + * + * @return The mode. + */ + @java.lang.Override + public java.lang.String getMode() { + java.lang.Object ref = mode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mode_ = s; + return s; + } + } + + /** + * + * + *
+   * The mode of the column, indicating if it is nullable, required, or
+   * repeated.
+   *
+   * Possible values:
+   *
+   * * `NULLABLE`: The column allows NULL values.
+   * * `REQUIRED`: The column does not allow NULL values.
+   * * `REPEATED`: The column contains an array of values.
+   * 
+ * + * string mode = 3; + * + * @return The bytes for mode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModeBytes() { + java.lang.Object ref = mode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COLUMNS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List columns_; + + /** + * + * + *
+   * If the `type` of this column is `RECORD`, this sub-field describes the
+   * nested structure.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + @java.lang.Override + public java.util.List getColumnsList() { + return columns_; + } + + /** + * + * + *
+   * If the `type` of this column is `RECORD`, this sub-field describes the
+   * nested structure.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + @java.lang.Override + public java.util.List + getColumnsOrBuilderList() { + return columns_; + } + + /** + * + * + *
+   * If the `type` of this column is `RECORD`, this sub-field describes the
+   * nested structure.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + @java.lang.Override + public int getColumnsCount() { + return columns_.size(); + } + + /** + * + * + *
+   * If the `type` of this column is `RECORD`, this sub-field describes the
+   * nested structure.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Column getColumns(int index) { + return columns_.get(index); + } + + /** + * + * + *
+   * If the `type` of this column is `RECORD`, this sub-field describes the
+   * nested structure.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ColumnOrBuilder getColumnsOrBuilder(int index) { + return columns_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(mode_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, mode_); + } + for (int i = 0; i < columns_.size(); i++) { + output.writeMessage(4, columns_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, type_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(mode_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, mode_); + } + for (int i = 0; i < columns_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, columns_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.appoptimize.v1beta.Column)) { + return super.equals(obj); + } + com.google.cloud.appoptimize.v1beta.Column other = + (com.google.cloud.appoptimize.v1beta.Column) obj; + + if (!getName().equals(other.getName())) return false; + if (!getType().equals(other.getType())) return false; + if (!getMode().equals(other.getMode())) return false; + if (!getColumnsList().equals(other.getColumnsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + getMode().hashCode(); + if (getColumnsCount() > 0) { + hash = (37 * hash) + COLUMNS_FIELD_NUMBER; + hash = (53 * hash) + getColumnsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.appoptimize.v1beta.Column parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.Column parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.Column parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.Column parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.Column parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.Column parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.Column parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.Column parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.Column parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.Column parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.Column parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.Column parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.appoptimize.v1beta.Column prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Describes a single column within `Columns`.
+   * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.Column} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.appoptimize.v1beta.Column) + com.google.cloud.appoptimize.v1beta.ColumnOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_Column_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_Column_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.Column.class, + com.google.cloud.appoptimize.v1beta.Column.Builder.class); + } + + // Construct using com.google.cloud.appoptimize.v1beta.Column.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + type_ = ""; + mode_ = ""; + if (columnsBuilder_ == null) { + columns_ = java.util.Collections.emptyList(); + } else { + columns_ = null; + columnsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_Column_descriptor; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Column getDefaultInstanceForType() { + return com.google.cloud.appoptimize.v1beta.Column.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Column build() { + com.google.cloud.appoptimize.v1beta.Column result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Column buildPartial() { + com.google.cloud.appoptimize.v1beta.Column result = + new com.google.cloud.appoptimize.v1beta.Column(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.appoptimize.v1beta.Column result) { + if (columnsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + columns_ = java.util.Collections.unmodifiableList(columns_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.columns_ = columns_; + } else { + result.columns_ = columnsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.appoptimize.v1beta.Column result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.mode_ = mode_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.appoptimize.v1beta.Column) { + return mergeFrom((com.google.cloud.appoptimize.v1beta.Column) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.appoptimize.v1beta.Column other) { + if (other == com.google.cloud.appoptimize.v1beta.Column.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getMode().isEmpty()) { + mode_ = other.mode_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (columnsBuilder_ == null) { + if (!other.columns_.isEmpty()) { + if (columns_.isEmpty()) { + columns_ = other.columns_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureColumnsIsMutable(); + columns_.addAll(other.columns_); + } + onChanged(); + } + } else { + if (!other.columns_.isEmpty()) { + if (columnsBuilder_.isEmpty()) { + columnsBuilder_.dispose(); + columnsBuilder_ = null; + columns_ = other.columns_; + bitField0_ = (bitField0_ & ~0x00000008); + columnsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetColumnsFieldBuilder() + : null; + } else { + columnsBuilder_.addAllMessages(other.columns_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + type_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + mode_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.cloud.appoptimize.v1beta.Column m = + input.readMessage( + com.google.cloud.appoptimize.v1beta.Column.parser(), extensionRegistry); + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(m); + } else { + columnsBuilder_.addMessage(m); + } + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The name of the column.
+     *
+     * This field:
+     *
+     * * Contains only letters (a-z, A-Z), numbers (0-9), or underscores (_);
+     * * Start with a letter or underscore; and
+     * * Has a maximum length is 128 characters.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The name of the column.
+     *
+     * This field:
+     *
+     * * Contains only letters (a-z, A-Z), numbers (0-9), or underscores (_);
+     * * Start with a letter or underscore; and
+     * * Has a maximum length is 128 characters.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The name of the column.
+     *
+     * This field:
+     *
+     * * Contains only letters (a-z, A-Z), numbers (0-9), or underscores (_);
+     * * Start with a letter or underscore; and
+     * * Has a maximum length is 128 characters.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the column.
+     *
+     * This field:
+     *
+     * * Contains only letters (a-z, A-Z), numbers (0-9), or underscores (_);
+     * * Start with a letter or underscore; and
+     * * Has a maximum length is 128 characters.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The name of the column.
+     *
+     * This field:
+     *
+     * * Contains only letters (a-z, A-Z), numbers (0-9), or underscores (_);
+     * * Start with a letter or underscore; and
+     * * Has a maximum length is 128 characters.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + + /** + * + * + *
+     * The data type of the column.
+     *
+     * Supported values include:
+     *
+     * * `STRING`
+     * * `INT64`
+     * * `FLOAT64`
+     * * `BOOLEAN`
+     * * `TIMESTAMP`
+     * * `RECORD`
+     *
+     * `RECORD` indicates that the field contains a nested schema, described in
+     * the `columns` property of this `Column`.
+     * 
+ * + * string type = 2; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The data type of the column.
+     *
+     * Supported values include:
+     *
+     * * `STRING`
+     * * `INT64`
+     * * `FLOAT64`
+     * * `BOOLEAN`
+     * * `TIMESTAMP`
+     * * `RECORD`
+     *
+     * `RECORD` indicates that the field contains a nested schema, described in
+     * the `columns` property of this `Column`.
+     * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The data type of the column.
+     *
+     * Supported values include:
+     *
+     * * `STRING`
+     * * `INT64`
+     * * `FLOAT64`
+     * * `BOOLEAN`
+     * * `TIMESTAMP`
+     * * `RECORD`
+     *
+     * `RECORD` indicates that the field contains a nested schema, described in
+     * the `columns` property of this `Column`.
+     * 
+ * + * string type = 2; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The data type of the column.
+     *
+     * Supported values include:
+     *
+     * * `STRING`
+     * * `INT64`
+     * * `FLOAT64`
+     * * `BOOLEAN`
+     * * `TIMESTAMP`
+     * * `RECORD`
+     *
+     * `RECORD` indicates that the field contains a nested schema, described in
+     * the `columns` property of this `Column`.
+     * 
+ * + * string type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The data type of the column.
+     *
+     * Supported values include:
+     *
+     * * `STRING`
+     * * `INT64`
+     * * `FLOAT64`
+     * * `BOOLEAN`
+     * * `TIMESTAMP`
+     * * `RECORD`
+     *
+     * `RECORD` indicates that the field contains a nested schema, described in
+     * the `columns` property of this `Column`.
+     * 
+ * + * string type = 2; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object mode_ = ""; + + /** + * + * + *
+     * The mode of the column, indicating if it is nullable, required, or
+     * repeated.
+     *
+     * Possible values:
+     *
+     * * `NULLABLE`: The column allows NULL values.
+     * * `REQUIRED`: The column does not allow NULL values.
+     * * `REPEATED`: The column contains an array of values.
+     * 
+ * + * string mode = 3; + * + * @return The mode. + */ + public java.lang.String getMode() { + java.lang.Object ref = mode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The mode of the column, indicating if it is nullable, required, or
+     * repeated.
+     *
+     * Possible values:
+     *
+     * * `NULLABLE`: The column allows NULL values.
+     * * `REQUIRED`: The column does not allow NULL values.
+     * * `REPEATED`: The column contains an array of values.
+     * 
+ * + * string mode = 3; + * + * @return The bytes for mode. + */ + public com.google.protobuf.ByteString getModeBytes() { + java.lang.Object ref = mode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The mode of the column, indicating if it is nullable, required, or
+     * repeated.
+     *
+     * Possible values:
+     *
+     * * `NULLABLE`: The column allows NULL values.
+     * * `REQUIRED`: The column does not allow NULL values.
+     * * `REPEATED`: The column contains an array of values.
+     * 
+ * + * string mode = 3; + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + mode_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The mode of the column, indicating if it is nullable, required, or
+     * repeated.
+     *
+     * Possible values:
+     *
+     * * `NULLABLE`: The column allows NULL values.
+     * * `REQUIRED`: The column does not allow NULL values.
+     * * `REPEATED`: The column contains an array of values.
+     * 
+ * + * string mode = 3; + * + * @return This builder for chaining. + */ + public Builder clearMode() { + mode_ = getDefaultInstance().getMode(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The mode of the column, indicating if it is nullable, required, or
+     * repeated.
+     *
+     * Possible values:
+     *
+     * * `NULLABLE`: The column allows NULL values.
+     * * `REQUIRED`: The column does not allow NULL values.
+     * * `REPEATED`: The column contains an array of values.
+     * 
+ * + * string mode = 3; + * + * @param value The bytes for mode to set. + * @return This builder for chaining. + */ + public Builder setModeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + mode_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.util.List columns_ = + java.util.Collections.emptyList(); + + private void ensureColumnsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + columns_ = new java.util.ArrayList(columns_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.appoptimize.v1beta.Column, + com.google.cloud.appoptimize.v1beta.Column.Builder, + com.google.cloud.appoptimize.v1beta.ColumnOrBuilder> + columnsBuilder_; + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public java.util.List getColumnsList() { + if (columnsBuilder_ == null) { + return java.util.Collections.unmodifiableList(columns_); + } else { + return columnsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public int getColumnsCount() { + if (columnsBuilder_ == null) { + return columns_.size(); + } else { + return columnsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public com.google.cloud.appoptimize.v1beta.Column getColumns(int index) { + if (columnsBuilder_ == null) { + return columns_.get(index); + } else { + return columnsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public Builder setColumns(int index, com.google.cloud.appoptimize.v1beta.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.set(index, value); + onChanged(); + } else { + columnsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public Builder setColumns( + int index, com.google.cloud.appoptimize.v1beta.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.set(index, builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public Builder addColumns(com.google.cloud.appoptimize.v1beta.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(value); + onChanged(); + } else { + columnsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public Builder addColumns(int index, com.google.cloud.appoptimize.v1beta.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(index, value); + onChanged(); + } else { + columnsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public Builder addColumns(com.google.cloud.appoptimize.v1beta.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public Builder addColumns( + int index, com.google.cloud.appoptimize.v1beta.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(index, builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public Builder addAllColumns( + java.lang.Iterable values) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, columns_); + onChanged(); + } else { + columnsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public Builder clearColumns() { + if (columnsBuilder_ == null) { + columns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + columnsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public Builder removeColumns(int index) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.remove(index); + onChanged(); + } else { + columnsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public com.google.cloud.appoptimize.v1beta.Column.Builder getColumnsBuilder(int index) { + return internalGetColumnsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public com.google.cloud.appoptimize.v1beta.ColumnOrBuilder getColumnsOrBuilder(int index) { + if (columnsBuilder_ == null) { + return columns_.get(index); + } else { + return columnsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public java.util.List + getColumnsOrBuilderList() { + if (columnsBuilder_ != null) { + return columnsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(columns_); + } + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public com.google.cloud.appoptimize.v1beta.Column.Builder addColumnsBuilder() { + return internalGetColumnsFieldBuilder() + .addBuilder(com.google.cloud.appoptimize.v1beta.Column.getDefaultInstance()); + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public com.google.cloud.appoptimize.v1beta.Column.Builder addColumnsBuilder(int index) { + return internalGetColumnsFieldBuilder() + .addBuilder(index, com.google.cloud.appoptimize.v1beta.Column.getDefaultInstance()); + } + + /** + * + * + *
+     * If the `type` of this column is `RECORD`, this sub-field describes the
+     * nested structure.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + public java.util.List + getColumnsBuilderList() { + return internalGetColumnsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.appoptimize.v1beta.Column, + com.google.cloud.appoptimize.v1beta.Column.Builder, + com.google.cloud.appoptimize.v1beta.ColumnOrBuilder> + internalGetColumnsFieldBuilder() { + if (columnsBuilder_ == null) { + columnsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.appoptimize.v1beta.Column, + com.google.cloud.appoptimize.v1beta.Column.Builder, + com.google.cloud.appoptimize.v1beta.ColumnOrBuilder>( + columns_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + columns_ = null; + } + return columnsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.appoptimize.v1beta.Column) + } + + // @@protoc_insertion_point(class_scope:google.cloud.appoptimize.v1beta.Column) + private static final com.google.cloud.appoptimize.v1beta.Column DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.appoptimize.v1beta.Column(); + } + + public static com.google.cloud.appoptimize.v1beta.Column getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Column parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Column getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ColumnOrBuilder.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ColumnOrBuilder.java new file mode 100644 index 000000000000..6b8007818625 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ColumnOrBuilder.java @@ -0,0 +1,217 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +@com.google.protobuf.Generated +public interface ColumnOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.appoptimize.v1beta.Column) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the column.
+   *
+   * This field:
+   *
+   * * Contains only letters (a-z, A-Z), numbers (0-9), or underscores (_);
+   * * Start with a letter or underscore; and
+   * * Has a maximum length is 128 characters.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The name of the column.
+   *
+   * This field:
+   *
+   * * Contains only letters (a-z, A-Z), numbers (0-9), or underscores (_);
+   * * Start with a letter or underscore; and
+   * * Has a maximum length is 128 characters.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The data type of the column.
+   *
+   * Supported values include:
+   *
+   * * `STRING`
+   * * `INT64`
+   * * `FLOAT64`
+   * * `BOOLEAN`
+   * * `TIMESTAMP`
+   * * `RECORD`
+   *
+   * `RECORD` indicates that the field contains a nested schema, described in
+   * the `columns` property of this `Column`.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + java.lang.String getType(); + + /** + * + * + *
+   * The data type of the column.
+   *
+   * Supported values include:
+   *
+   * * `STRING`
+   * * `INT64`
+   * * `FLOAT64`
+   * * `BOOLEAN`
+   * * `TIMESTAMP`
+   * * `RECORD`
+   *
+   * `RECORD` indicates that the field contains a nested schema, described in
+   * the `columns` property of this `Column`.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * The mode of the column, indicating if it is nullable, required, or
+   * repeated.
+   *
+   * Possible values:
+   *
+   * * `NULLABLE`: The column allows NULL values.
+   * * `REQUIRED`: The column does not allow NULL values.
+   * * `REPEATED`: The column contains an array of values.
+   * 
+ * + * string mode = 3; + * + * @return The mode. + */ + java.lang.String getMode(); + + /** + * + * + *
+   * The mode of the column, indicating if it is nullable, required, or
+   * repeated.
+   *
+   * Possible values:
+   *
+   * * `NULLABLE`: The column allows NULL values.
+   * * `REQUIRED`: The column does not allow NULL values.
+   * * `REPEATED`: The column contains an array of values.
+   * 
+ * + * string mode = 3; + * + * @return The bytes for mode. + */ + com.google.protobuf.ByteString getModeBytes(); + + /** + * + * + *
+   * If the `type` of this column is `RECORD`, this sub-field describes the
+   * nested structure.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + java.util.List getColumnsList(); + + /** + * + * + *
+   * If the `type` of this column is `RECORD`, this sub-field describes the
+   * nested structure.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + com.google.cloud.appoptimize.v1beta.Column getColumns(int index); + + /** + * + * + *
+   * If the `type` of this column is `RECORD`, this sub-field describes the
+   * nested structure.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + int getColumnsCount(); + + /** + * + * + *
+   * If the `type` of this column is `RECORD`, this sub-field describes the
+   * nested structure.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + java.util.List + getColumnsOrBuilderList(); + + /** + * + * + *
+   * If the `type` of this column is `RECORD`, this sub-field describes the
+   * nested structure.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 4; + */ + com.google.cloud.appoptimize.v1beta.ColumnOrBuilder getColumnsOrBuilder(int index); +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/CreateReportRequest.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/CreateReportRequest.java new file mode 100644 index 000000000000..6642c26c7dd8 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/CreateReportRequest.java @@ -0,0 +1,1171 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +/** + * + * + *
+ * Request message for the `CreateReport` method.
+ * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.CreateReportRequest} + */ +@com.google.protobuf.Generated +public final class CreateReportRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.appoptimize.v1beta.CreateReportRequest) + CreateReportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateReportRequest"); + } + + // Use CreateReportRequest.newBuilder() to construct. + private CreateReportRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateReportRequest() { + parent_ = ""; + reportId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_CreateReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_CreateReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.CreateReportRequest.class, + com.google.cloud.appoptimize.v1beta.CreateReportRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The 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}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPORT_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object 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).
+   * 
+ * + * string report_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The reportId. + */ + @java.lang.Override + public java.lang.String getReportId() { + java.lang.Object ref = reportId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reportId_ = s; + return s; + } + } + + /** + * + * + *
+   * 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).
+   * 
+ * + * string report_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for reportId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReportIdBytes() { + java.lang.Object ref = reportId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reportId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPORT_FIELD_NUMBER = 3; + private com.google.cloud.appoptimize.v1beta.Report report_; + + /** + * + * + *
+   * Required. The report resource to create.
+   * 
+ * + * + * .google.cloud.appoptimize.v1beta.Report report = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the report field is set. + */ + @java.lang.Override + public boolean hasReport() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The report resource to create.
+   * 
+ * + * + * .google.cloud.appoptimize.v1beta.Report report = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The report. + */ + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Report getReport() { + return report_ == null + ? com.google.cloud.appoptimize.v1beta.Report.getDefaultInstance() + : report_; + } + + /** + * + * + *
+   * Required. The report resource to create.
+   * 
+ * + * + * .google.cloud.appoptimize.v1beta.Report report = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ReportOrBuilder getReportOrBuilder() { + return report_ == null + ? com.google.cloud.appoptimize.v1beta.Report.getDefaultInstance() + : report_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(reportId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, reportId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getReport()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(reportId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, reportId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getReport()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.appoptimize.v1beta.CreateReportRequest)) { + return super.equals(obj); + } + com.google.cloud.appoptimize.v1beta.CreateReportRequest other = + (com.google.cloud.appoptimize.v1beta.CreateReportRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getReportId().equals(other.getReportId())) return false; + if (hasReport() != other.hasReport()) return false; + if (hasReport()) { + if (!getReport().equals(other.getReport())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + REPORT_ID_FIELD_NUMBER; + hash = (53 * hash) + getReportId().hashCode(); + if (hasReport()) { + hash = (37 * hash) + REPORT_FIELD_NUMBER; + hash = (53 * hash) + getReport().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.appoptimize.v1beta.CreateReportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.CreateReportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.CreateReportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.CreateReportRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.CreateReportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.CreateReportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.CreateReportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.CreateReportRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.CreateReportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.CreateReportRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.CreateReportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.CreateReportRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.appoptimize.v1beta.CreateReportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for the `CreateReport` method.
+   * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.CreateReportRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.appoptimize.v1beta.CreateReportRequest) + com.google.cloud.appoptimize.v1beta.CreateReportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_CreateReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_CreateReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.CreateReportRequest.class, + com.google.cloud.appoptimize.v1beta.CreateReportRequest.Builder.class); + } + + // Construct using com.google.cloud.appoptimize.v1beta.CreateReportRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetReportFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + reportId_ = ""; + report_ = null; + if (reportBuilder_ != null) { + reportBuilder_.dispose(); + reportBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_CreateReportRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.CreateReportRequest getDefaultInstanceForType() { + return com.google.cloud.appoptimize.v1beta.CreateReportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.CreateReportRequest build() { + com.google.cloud.appoptimize.v1beta.CreateReportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.CreateReportRequest buildPartial() { + com.google.cloud.appoptimize.v1beta.CreateReportRequest result = + new com.google.cloud.appoptimize.v1beta.CreateReportRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.appoptimize.v1beta.CreateReportRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.reportId_ = reportId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.report_ = reportBuilder_ == null ? report_ : reportBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.appoptimize.v1beta.CreateReportRequest) { + return mergeFrom((com.google.cloud.appoptimize.v1beta.CreateReportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.appoptimize.v1beta.CreateReportRequest other) { + if (other == com.google.cloud.appoptimize.v1beta.CreateReportRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getReportId().isEmpty()) { + reportId_ = other.reportId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasReport()) { + mergeReport(other.getReport()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + reportId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetReportFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object 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}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The 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}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The 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}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * 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}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * 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}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object 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).
+     * 
+ * + * string report_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The reportId. + */ + public java.lang.String getReportId() { + java.lang.Object ref = reportId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reportId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * 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).
+     * 
+ * + * string report_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for reportId. + */ + public com.google.protobuf.ByteString getReportIdBytes() { + java.lang.Object ref = reportId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reportId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * 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).
+     * 
+ * + * string report_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The reportId to set. + * @return This builder for chaining. + */ + public Builder setReportId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + reportId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * 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).
+     * 
+ * + * string report_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearReportId() { + reportId_ = getDefaultInstance().getReportId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * 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).
+     * 
+ * + * string report_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for reportId to set. + * @return This builder for chaining. + */ + public Builder setReportIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + reportId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.appoptimize.v1beta.Report report_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.appoptimize.v1beta.Report, + com.google.cloud.appoptimize.v1beta.Report.Builder, + com.google.cloud.appoptimize.v1beta.ReportOrBuilder> + reportBuilder_; + + /** + * + * + *
+     * Required. The report resource to create.
+     * 
+ * + * + * .google.cloud.appoptimize.v1beta.Report report = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the report field is set. + */ + public boolean hasReport() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. The report resource to create.
+     * 
+ * + * + * .google.cloud.appoptimize.v1beta.Report report = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The report. + */ + public com.google.cloud.appoptimize.v1beta.Report getReport() { + if (reportBuilder_ == null) { + return report_ == null + ? com.google.cloud.appoptimize.v1beta.Report.getDefaultInstance() + : report_; + } else { + return reportBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The report resource to create.
+     * 
+ * + * + * .google.cloud.appoptimize.v1beta.Report report = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setReport(com.google.cloud.appoptimize.v1beta.Report value) { + if (reportBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + report_ = value; + } else { + reportBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The report resource to create.
+     * 
+ * + * + * .google.cloud.appoptimize.v1beta.Report report = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setReport(com.google.cloud.appoptimize.v1beta.Report.Builder builderForValue) { + if (reportBuilder_ == null) { + report_ = builderForValue.build(); + } else { + reportBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The report resource to create.
+     * 
+ * + * + * .google.cloud.appoptimize.v1beta.Report report = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeReport(com.google.cloud.appoptimize.v1beta.Report value) { + if (reportBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && report_ != null + && report_ != com.google.cloud.appoptimize.v1beta.Report.getDefaultInstance()) { + getReportBuilder().mergeFrom(value); + } else { + report_ = value; + } + } else { + reportBuilder_.mergeFrom(value); + } + if (report_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The report resource to create.
+     * 
+ * + * + * .google.cloud.appoptimize.v1beta.Report report = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearReport() { + bitField0_ = (bitField0_ & ~0x00000004); + report_ = null; + if (reportBuilder_ != null) { + reportBuilder_.dispose(); + reportBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The report resource to create.
+     * 
+ * + * + * .google.cloud.appoptimize.v1beta.Report report = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.appoptimize.v1beta.Report.Builder getReportBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetReportFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The report resource to create.
+     * 
+ * + * + * .google.cloud.appoptimize.v1beta.Report report = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.appoptimize.v1beta.ReportOrBuilder getReportOrBuilder() { + if (reportBuilder_ != null) { + return reportBuilder_.getMessageOrBuilder(); + } else { + return report_ == null + ? com.google.cloud.appoptimize.v1beta.Report.getDefaultInstance() + : report_; + } + } + + /** + * + * + *
+     * Required. The report resource to create.
+     * 
+ * + * + * .google.cloud.appoptimize.v1beta.Report report = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.appoptimize.v1beta.Report, + com.google.cloud.appoptimize.v1beta.Report.Builder, + com.google.cloud.appoptimize.v1beta.ReportOrBuilder> + internalGetReportFieldBuilder() { + if (reportBuilder_ == null) { + reportBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.appoptimize.v1beta.Report, + com.google.cloud.appoptimize.v1beta.Report.Builder, + com.google.cloud.appoptimize.v1beta.ReportOrBuilder>( + getReport(), getParentForChildren(), isClean()); + report_ = null; + } + return reportBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.appoptimize.v1beta.CreateReportRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.appoptimize.v1beta.CreateReportRequest) + private static final com.google.cloud.appoptimize.v1beta.CreateReportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.appoptimize.v1beta.CreateReportRequest(); + } + + public static com.google.cloud.appoptimize.v1beta.CreateReportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateReportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.CreateReportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/CreateReportRequestOrBuilder.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/CreateReportRequestOrBuilder.java new file mode 100644 index 000000000000..ff4912f33e8c --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/CreateReportRequestOrBuilder.java @@ -0,0 +1,143 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +@com.google.protobuf.Generated +public interface CreateReportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.appoptimize.v1beta.CreateReportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * 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}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * 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).
+   * 
+ * + * string report_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The reportId. + */ + java.lang.String getReportId(); + + /** + * + * + *
+   * 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).
+   * 
+ * + * string report_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for reportId. + */ + com.google.protobuf.ByteString getReportIdBytes(); + + /** + * + * + *
+   * Required. The report resource to create.
+   * 
+ * + * + * .google.cloud.appoptimize.v1beta.Report report = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the report field is set. + */ + boolean hasReport(); + + /** + * + * + *
+   * Required. The report resource to create.
+   * 
+ * + * + * .google.cloud.appoptimize.v1beta.Report report = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The report. + */ + com.google.cloud.appoptimize.v1beta.Report getReport(); + + /** + * + * + *
+   * Required. The report resource to create.
+   * 
+ * + * + * .google.cloud.appoptimize.v1beta.Report report = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.appoptimize.v1beta.ReportOrBuilder getReportOrBuilder(); +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/DeleteReportRequest.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/DeleteReportRequest.java new file mode 100644 index 000000000000..0d31d5d3cff8 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/DeleteReportRequest.java @@ -0,0 +1,726 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +/** + * + * + *
+ * Request message for the `DeleteReport` method.
+ * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.DeleteReportRequest} + */ +@com.google.protobuf.Generated +public final class DeleteReportRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.appoptimize.v1beta.DeleteReportRequest) + DeleteReportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteReportRequest"); + } + + // Use DeleteReportRequest.newBuilder() to construct. + private DeleteReportRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteReportRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_DeleteReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_DeleteReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.DeleteReportRequest.class, + com.google.cloud.appoptimize.v1beta.DeleteReportRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The name of the report to delete.
+   *
+   * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The name of the report to delete.
+   *
+   * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 2; + private boolean allowMissing_ = false; + + /** + * + * + *
+   * Optional. If set to true, and the report is not found, the request will
+   * succeed but no action will be taken on the server.
+   * 
+ * + * bool allow_missing = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (allowMissing_ != false) { + output.writeBool(2, allowMissing_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, allowMissing_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.appoptimize.v1beta.DeleteReportRequest)) { + return super.equals(obj); + } + com.google.cloud.appoptimize.v1beta.DeleteReportRequest other = + (com.google.cloud.appoptimize.v1beta.DeleteReportRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getAllowMissing() != other.getAllowMissing()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.appoptimize.v1beta.DeleteReportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.DeleteReportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.DeleteReportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.DeleteReportRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.DeleteReportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.DeleteReportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.DeleteReportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.DeleteReportRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.DeleteReportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.DeleteReportRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.DeleteReportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.DeleteReportRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.appoptimize.v1beta.DeleteReportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for the `DeleteReport` method.
+   * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.DeleteReportRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.appoptimize.v1beta.DeleteReportRequest) + com.google.cloud.appoptimize.v1beta.DeleteReportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_DeleteReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_DeleteReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.DeleteReportRequest.class, + com.google.cloud.appoptimize.v1beta.DeleteReportRequest.Builder.class); + } + + // Construct using com.google.cloud.appoptimize.v1beta.DeleteReportRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + allowMissing_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_DeleteReportRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.DeleteReportRequest getDefaultInstanceForType() { + return com.google.cloud.appoptimize.v1beta.DeleteReportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.DeleteReportRequest build() { + com.google.cloud.appoptimize.v1beta.DeleteReportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.DeleteReportRequest buildPartial() { + com.google.cloud.appoptimize.v1beta.DeleteReportRequest result = + new com.google.cloud.appoptimize.v1beta.DeleteReportRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.appoptimize.v1beta.DeleteReportRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.allowMissing_ = allowMissing_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.appoptimize.v1beta.DeleteReportRequest) { + return mergeFrom((com.google.cloud.appoptimize.v1beta.DeleteReportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.appoptimize.v1beta.DeleteReportRequest other) { + if (other == com.google.cloud.appoptimize.v1beta.DeleteReportRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The name of the report to delete.
+     *
+     * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The name of the report to delete.
+     *
+     * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The name of the report to delete.
+     *
+     * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the report to delete.
+     *
+     * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the report to delete.
+     *
+     * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean allowMissing_; + + /** + * + * + *
+     * Optional. If set to true, and the report is not found, the request will
+     * succeed but no action will be taken on the server.
+     * 
+ * + * bool allow_missing = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + /** + * + * + *
+     * Optional. If set to true, and the report is not found, the request will
+     * succeed but no action will be taken on the server.
+     * 
+ * + * bool allow_missing = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If set to true, and the report is not found, the request will
+     * succeed but no action will be taken on the server.
+     * 
+ * + * bool allow_missing = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000002); + allowMissing_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.appoptimize.v1beta.DeleteReportRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.appoptimize.v1beta.DeleteReportRequest) + private static final com.google.cloud.appoptimize.v1beta.DeleteReportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.appoptimize.v1beta.DeleteReportRequest(); + } + + public static com.google.cloud.appoptimize.v1beta.DeleteReportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteReportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.DeleteReportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/DeleteReportRequestOrBuilder.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/DeleteReportRequestOrBuilder.java new file mode 100644 index 000000000000..ec28d9f4829c --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/DeleteReportRequestOrBuilder.java @@ -0,0 +1,76 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +@com.google.protobuf.Generated +public interface DeleteReportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.appoptimize.v1beta.DeleteReportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the report to delete.
+   *
+   * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The name of the report to delete.
+   *
+   * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. If set to true, and the report is not found, the request will
+   * succeed but no action will be taken on the server.
+   * 
+ * + * bool allow_missing = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/GetReportRequest.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/GetReportRequest.java new file mode 100644 index 000000000000..a81b84d740e8 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/GetReportRequest.java @@ -0,0 +1,624 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +/** + * + * + *
+ * Request message for the `GetReport` method.
+ * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.GetReportRequest} + */ +@com.google.protobuf.Generated +public final class GetReportRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.appoptimize.v1beta.GetReportRequest) + GetReportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetReportRequest"); + } + + // Use GetReportRequest.newBuilder() to construct. + private GetReportRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetReportRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_GetReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_GetReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.GetReportRequest.class, + com.google.cloud.appoptimize.v1beta.GetReportRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The name of the report to retrieve.
+   *
+   * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The name of the report to retrieve.
+   *
+   * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.appoptimize.v1beta.GetReportRequest)) { + return super.equals(obj); + } + com.google.cloud.appoptimize.v1beta.GetReportRequest other = + (com.google.cloud.appoptimize.v1beta.GetReportRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.appoptimize.v1beta.GetReportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.GetReportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.GetReportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.GetReportRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.GetReportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.GetReportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.GetReportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.GetReportRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.GetReportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.GetReportRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.GetReportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.GetReportRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.appoptimize.v1beta.GetReportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for the `GetReport` method.
+   * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.GetReportRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.appoptimize.v1beta.GetReportRequest) + com.google.cloud.appoptimize.v1beta.GetReportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_GetReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_GetReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.GetReportRequest.class, + com.google.cloud.appoptimize.v1beta.GetReportRequest.Builder.class); + } + + // Construct using com.google.cloud.appoptimize.v1beta.GetReportRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_GetReportRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.GetReportRequest getDefaultInstanceForType() { + return com.google.cloud.appoptimize.v1beta.GetReportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.GetReportRequest build() { + com.google.cloud.appoptimize.v1beta.GetReportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.GetReportRequest buildPartial() { + com.google.cloud.appoptimize.v1beta.GetReportRequest result = + new com.google.cloud.appoptimize.v1beta.GetReportRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.appoptimize.v1beta.GetReportRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.appoptimize.v1beta.GetReportRequest) { + return mergeFrom((com.google.cloud.appoptimize.v1beta.GetReportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.appoptimize.v1beta.GetReportRequest other) { + if (other == com.google.cloud.appoptimize.v1beta.GetReportRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The name of the report to retrieve.
+     *
+     * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The name of the report to retrieve.
+     *
+     * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The name of the report to retrieve.
+     *
+     * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the report to retrieve.
+     *
+     * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the report to retrieve.
+     *
+     * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.appoptimize.v1beta.GetReportRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.appoptimize.v1beta.GetReportRequest) + private static final com.google.cloud.appoptimize.v1beta.GetReportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.appoptimize.v1beta.GetReportRequest(); + } + + public static com.google.cloud.appoptimize.v1beta.GetReportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetReportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.GetReportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/GetReportRequestOrBuilder.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/GetReportRequestOrBuilder.java new file mode 100644 index 000000000000..8ad41124d892 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/GetReportRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +@com.google.protobuf.Generated +public interface GetReportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.appoptimize.v1beta.GetReportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the report to retrieve.
+   *
+   * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The name of the report to retrieve.
+   *
+   * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ListReportsRequest.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ListReportsRequest.java new file mode 100644 index 000000000000..849118e3881c --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ListReportsRequest.java @@ -0,0 +1,947 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +/** + * + * + *
+ * Request message for the `ListReports` method.
+ * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.ListReportsRequest} + */ +@com.google.protobuf.Generated +public final class ListReportsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.appoptimize.v1beta.ListReportsRequest) + ListReportsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListReportsRequest"); + } + + // Use ListReportsRequest.newBuilder() to construct. + private ListReportsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListReportsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ListReportsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ListReportsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.ListReportsRequest.class, + com.google.cloud.appoptimize.v1beta.ListReportsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The parent project whose reports are to be listed.
+   *
+   * Format: `projects/{project}/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The parent project whose reports are to be listed.
+   *
+   * Format: `projects/{project}/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. The maximum number of reports to return. The service may return
+   * fewer than this value. If unspecified, the server will determine the number
+   * of results to return.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListReports` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListReports` must match
+   * the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListReports` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListReports` must match
+   * the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.appoptimize.v1beta.ListReportsRequest)) { + return super.equals(obj); + } + com.google.cloud.appoptimize.v1beta.ListReportsRequest other = + (com.google.cloud.appoptimize.v1beta.ListReportsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.appoptimize.v1beta.ListReportsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for the `ListReports` method.
+   * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.ListReportsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.appoptimize.v1beta.ListReportsRequest) + com.google.cloud.appoptimize.v1beta.ListReportsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ListReportsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ListReportsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.ListReportsRequest.class, + com.google.cloud.appoptimize.v1beta.ListReportsRequest.Builder.class); + } + + // Construct using com.google.cloud.appoptimize.v1beta.ListReportsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ListReportsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ListReportsRequest getDefaultInstanceForType() { + return com.google.cloud.appoptimize.v1beta.ListReportsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ListReportsRequest build() { + com.google.cloud.appoptimize.v1beta.ListReportsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ListReportsRequest buildPartial() { + com.google.cloud.appoptimize.v1beta.ListReportsRequest result = + new com.google.cloud.appoptimize.v1beta.ListReportsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.appoptimize.v1beta.ListReportsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.appoptimize.v1beta.ListReportsRequest) { + return mergeFrom((com.google.cloud.appoptimize.v1beta.ListReportsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.appoptimize.v1beta.ListReportsRequest other) { + if (other == com.google.cloud.appoptimize.v1beta.ListReportsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The parent project whose reports are to be listed.
+     *
+     * Format: `projects/{project}/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The parent project whose reports are to be listed.
+     *
+     * Format: `projects/{project}/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The parent project whose reports are to be listed.
+     *
+     * Format: `projects/{project}/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent project whose reports are to be listed.
+     *
+     * Format: `projects/{project}/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent project whose reports are to be listed.
+     *
+     * Format: `projects/{project}/locations/{location}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. The maximum number of reports to return. The service may return
+     * fewer than this value. If unspecified, the server will determine the number
+     * of results to return.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. The maximum number of reports to return. The service may return
+     * fewer than this value. If unspecified, the server will determine the number
+     * of results to return.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of reports to return. The service may return
+     * fewer than this value. If unspecified, the server will determine the number
+     * of results to return.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListReports` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListReports` must match
+     * the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListReports` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListReports` must match
+     * the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListReports` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListReports` must match
+     * the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListReports` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListReports` must match
+     * the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListReports` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListReports` must match
+     * the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.appoptimize.v1beta.ListReportsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.appoptimize.v1beta.ListReportsRequest) + private static final com.google.cloud.appoptimize.v1beta.ListReportsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.appoptimize.v1beta.ListReportsRequest(); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListReportsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ListReportsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ListReportsRequestOrBuilder.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ListReportsRequestOrBuilder.java new file mode 100644 index 000000000000..604e1d317d9f --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ListReportsRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +@com.google.protobuf.Generated +public interface ListReportsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.appoptimize.v1beta.ListReportsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent project whose reports are to be listed.
+   *
+   * Format: `projects/{project}/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The parent project whose reports are to be listed.
+   *
+   * Format: `projects/{project}/locations/{location}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of reports to return. The service may return
+   * fewer than this value. If unspecified, the server will determine the number
+   * of results to return.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListReports` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListReports` must match
+   * the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListReports` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListReports` must match
+   * the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ListReportsResponse.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ListReportsResponse.java new file mode 100644 index 000000000000..683d8b099f1d --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ListReportsResponse.java @@ -0,0 +1,1119 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +/** + * + * + *
+ * Response message for the `ListReports` method.
+ * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.ListReportsResponse} + */ +@com.google.protobuf.Generated +public final class ListReportsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.appoptimize.v1beta.ListReportsResponse) + ListReportsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListReportsResponse"); + } + + // Use ListReportsResponse.newBuilder() to construct. + private ListReportsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListReportsResponse() { + reports_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ListReportsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ListReportsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.ListReportsResponse.class, + com.google.cloud.appoptimize.v1beta.ListReportsResponse.Builder.class); + } + + public static final int REPORTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List reports_; + + /** + * + * + *
+   * The list of reports.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + @java.lang.Override + public java.util.List getReportsList() { + return reports_; + } + + /** + * + * + *
+   * The list of reports.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + @java.lang.Override + public java.util.List + getReportsOrBuilderList() { + return reports_; + } + + /** + * + * + *
+   * The list of reports.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + @java.lang.Override + public int getReportsCount() { + return reports_.size(); + } + + /** + * + * + *
+   * The list of reports.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Report getReports(int index) { + return reports_.get(index); + } + + /** + * + * + *
+   * The list of reports.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ReportOrBuilder getReportsOrBuilder(int index) { + return reports_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * A token that can be sent as `page_token` to retrieve the next page.
+   * If this field is empty, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A token that can be sent as `page_token` to retrieve the next page.
+   * If this field is empty, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < reports_.size(); i++) { + output.writeMessage(1, reports_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < reports_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, reports_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.appoptimize.v1beta.ListReportsResponse)) { + return super.equals(obj); + } + com.google.cloud.appoptimize.v1beta.ListReportsResponse other = + (com.google.cloud.appoptimize.v1beta.ListReportsResponse) obj; + + if (!getReportsList().equals(other.getReportsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getReportsCount() > 0) { + hash = (37 * hash) + REPORTS_FIELD_NUMBER; + hash = (53 * hash) + getReportsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.appoptimize.v1beta.ListReportsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for the `ListReports` method.
+   * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.ListReportsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.appoptimize.v1beta.ListReportsResponse) + com.google.cloud.appoptimize.v1beta.ListReportsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ListReportsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ListReportsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.ListReportsResponse.class, + com.google.cloud.appoptimize.v1beta.ListReportsResponse.Builder.class); + } + + // Construct using com.google.cloud.appoptimize.v1beta.ListReportsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (reportsBuilder_ == null) { + reports_ = java.util.Collections.emptyList(); + } else { + reports_ = null; + reportsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ListReportsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ListReportsResponse getDefaultInstanceForType() { + return com.google.cloud.appoptimize.v1beta.ListReportsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ListReportsResponse build() { + com.google.cloud.appoptimize.v1beta.ListReportsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ListReportsResponse buildPartial() { + com.google.cloud.appoptimize.v1beta.ListReportsResponse result = + new com.google.cloud.appoptimize.v1beta.ListReportsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.appoptimize.v1beta.ListReportsResponse result) { + if (reportsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + reports_ = java.util.Collections.unmodifiableList(reports_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.reports_ = reports_; + } else { + result.reports_ = reportsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.appoptimize.v1beta.ListReportsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.appoptimize.v1beta.ListReportsResponse) { + return mergeFrom((com.google.cloud.appoptimize.v1beta.ListReportsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.appoptimize.v1beta.ListReportsResponse other) { + if (other == com.google.cloud.appoptimize.v1beta.ListReportsResponse.getDefaultInstance()) + return this; + if (reportsBuilder_ == null) { + if (!other.reports_.isEmpty()) { + if (reports_.isEmpty()) { + reports_ = other.reports_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureReportsIsMutable(); + reports_.addAll(other.reports_); + } + onChanged(); + } + } else { + if (!other.reports_.isEmpty()) { + if (reportsBuilder_.isEmpty()) { + reportsBuilder_.dispose(); + reportsBuilder_ = null; + reports_ = other.reports_; + bitField0_ = (bitField0_ & ~0x00000001); + reportsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetReportsFieldBuilder() + : null; + } else { + reportsBuilder_.addAllMessages(other.reports_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.appoptimize.v1beta.Report m = + input.readMessage( + com.google.cloud.appoptimize.v1beta.Report.parser(), extensionRegistry); + if (reportsBuilder_ == null) { + ensureReportsIsMutable(); + reports_.add(m); + } else { + reportsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List reports_ = + java.util.Collections.emptyList(); + + private void ensureReportsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + reports_ = new java.util.ArrayList(reports_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.appoptimize.v1beta.Report, + com.google.cloud.appoptimize.v1beta.Report.Builder, + com.google.cloud.appoptimize.v1beta.ReportOrBuilder> + reportsBuilder_; + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public java.util.List getReportsList() { + if (reportsBuilder_ == null) { + return java.util.Collections.unmodifiableList(reports_); + } else { + return reportsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public int getReportsCount() { + if (reportsBuilder_ == null) { + return reports_.size(); + } else { + return reportsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public com.google.cloud.appoptimize.v1beta.Report getReports(int index) { + if (reportsBuilder_ == null) { + return reports_.get(index); + } else { + return reportsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public Builder setReports(int index, com.google.cloud.appoptimize.v1beta.Report value) { + if (reportsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReportsIsMutable(); + reports_.set(index, value); + onChanged(); + } else { + reportsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public Builder setReports( + int index, com.google.cloud.appoptimize.v1beta.Report.Builder builderForValue) { + if (reportsBuilder_ == null) { + ensureReportsIsMutable(); + reports_.set(index, builderForValue.build()); + onChanged(); + } else { + reportsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public Builder addReports(com.google.cloud.appoptimize.v1beta.Report value) { + if (reportsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReportsIsMutable(); + reports_.add(value); + onChanged(); + } else { + reportsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public Builder addReports(int index, com.google.cloud.appoptimize.v1beta.Report value) { + if (reportsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReportsIsMutable(); + reports_.add(index, value); + onChanged(); + } else { + reportsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public Builder addReports(com.google.cloud.appoptimize.v1beta.Report.Builder builderForValue) { + if (reportsBuilder_ == null) { + ensureReportsIsMutable(); + reports_.add(builderForValue.build()); + onChanged(); + } else { + reportsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public Builder addReports( + int index, com.google.cloud.appoptimize.v1beta.Report.Builder builderForValue) { + if (reportsBuilder_ == null) { + ensureReportsIsMutable(); + reports_.add(index, builderForValue.build()); + onChanged(); + } else { + reportsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public Builder addAllReports( + java.lang.Iterable values) { + if (reportsBuilder_ == null) { + ensureReportsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, reports_); + onChanged(); + } else { + reportsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public Builder clearReports() { + if (reportsBuilder_ == null) { + reports_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + reportsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public Builder removeReports(int index) { + if (reportsBuilder_ == null) { + ensureReportsIsMutable(); + reports_.remove(index); + onChanged(); + } else { + reportsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public com.google.cloud.appoptimize.v1beta.Report.Builder getReportsBuilder(int index) { + return internalGetReportsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public com.google.cloud.appoptimize.v1beta.ReportOrBuilder getReportsOrBuilder(int index) { + if (reportsBuilder_ == null) { + return reports_.get(index); + } else { + return reportsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public java.util.List + getReportsOrBuilderList() { + if (reportsBuilder_ != null) { + return reportsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(reports_); + } + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public com.google.cloud.appoptimize.v1beta.Report.Builder addReportsBuilder() { + return internalGetReportsFieldBuilder() + .addBuilder(com.google.cloud.appoptimize.v1beta.Report.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public com.google.cloud.appoptimize.v1beta.Report.Builder addReportsBuilder(int index) { + return internalGetReportsFieldBuilder() + .addBuilder(index, com.google.cloud.appoptimize.v1beta.Report.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of reports.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + public java.util.List + getReportsBuilderList() { + return internalGetReportsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.appoptimize.v1beta.Report, + com.google.cloud.appoptimize.v1beta.Report.Builder, + com.google.cloud.appoptimize.v1beta.ReportOrBuilder> + internalGetReportsFieldBuilder() { + if (reportsBuilder_ == null) { + reportsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.appoptimize.v1beta.Report, + com.google.cloud.appoptimize.v1beta.Report.Builder, + com.google.cloud.appoptimize.v1beta.ReportOrBuilder>( + reports_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + reports_ = null; + } + return reportsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is empty, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is empty, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is empty, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is empty, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is empty, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.appoptimize.v1beta.ListReportsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.appoptimize.v1beta.ListReportsResponse) + private static final com.google.cloud.appoptimize.v1beta.ListReportsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.appoptimize.v1beta.ListReportsResponse(); + } + + public static com.google.cloud.appoptimize.v1beta.ListReportsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListReportsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ListReportsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ListReportsResponseOrBuilder.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ListReportsResponseOrBuilder.java new file mode 100644 index 000000000000..6142855a52b9 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ListReportsResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +@com.google.protobuf.Generated +public interface ListReportsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.appoptimize.v1beta.ListReportsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of reports.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + java.util.List getReportsList(); + + /** + * + * + *
+   * The list of reports.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + com.google.cloud.appoptimize.v1beta.Report getReports(int index); + + /** + * + * + *
+   * The list of reports.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + int getReportsCount(); + + /** + * + * + *
+   * The list of reports.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + java.util.List + getReportsOrBuilderList(); + + /** + * + * + *
+   * The list of reports.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Report reports = 1; + */ + com.google.cloud.appoptimize.v1beta.ReportOrBuilder getReportsOrBuilder(int index); + + /** + * + * + *
+   * A token that can be sent as `page_token` to retrieve the next page.
+   * If this field is empty, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * A token that can be sent as `page_token` to retrieve the next page.
+   * If this field is empty, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/LocationName.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/LocationName.java new file mode 100644 index 000000000000..3db54c6d3ab8 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/LocationName.java @@ -0,0 +1,192 @@ +/* + * 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.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/OperationMetadata.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/OperationMetadata.java new file mode 100644 index 000000000000..db44b37816f0 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/OperationMetadata.java @@ -0,0 +1,399 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +/** + * + * + *
+ * Represents metadata related to the creation of a Report. This value is
+ * embedded in the Operation object returned by `CreateReport`.
+ * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.OperationMetadata} + */ +@com.google.protobuf.Generated +public final class OperationMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.appoptimize.v1beta.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OperationMetadata"); + } + + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OperationMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.OperationMetadata.class, + com.google.cloud.appoptimize.v1beta.OperationMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.appoptimize.v1beta.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.appoptimize.v1beta.OperationMetadata other = + (com.google.cloud.appoptimize.v1beta.OperationMetadata) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.appoptimize.v1beta.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.OperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.OperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.OperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.OperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.appoptimize.v1beta.OperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Represents metadata related to the creation of a Report. This value is
+   * embedded in the Operation object returned by `CreateReport`.
+   * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.appoptimize.v1beta.OperationMetadata) + com.google.cloud.appoptimize.v1beta.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.OperationMetadata.class, + com.google.cloud.appoptimize.v1beta.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.appoptimize.v1beta.OperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.appoptimize.v1beta.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.OperationMetadata build() { + com.google.cloud.appoptimize.v1beta.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.OperationMetadata buildPartial() { + com.google.cloud.appoptimize.v1beta.OperationMetadata result = + new com.google.cloud.appoptimize.v1beta.OperationMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.appoptimize.v1beta.OperationMetadata) { + return mergeFrom((com.google.cloud.appoptimize.v1beta.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.appoptimize.v1beta.OperationMetadata other) { + if (other == com.google.cloud.appoptimize.v1beta.OperationMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.appoptimize.v1beta.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.appoptimize.v1beta.OperationMetadata) + private static final com.google.cloud.appoptimize.v1beta.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.appoptimize.v1beta.OperationMetadata(); + } + + public static com.google.cloud.appoptimize.v1beta.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/OperationMetadataOrBuilder.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..73c2fd37e8a5 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/OperationMetadataOrBuilder.java @@ -0,0 +1,27 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +@com.google.protobuf.Generated +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.appoptimize.v1beta.OperationMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReadReportRequest.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReadReportRequest.java new file mode 100644 index 000000000000..5518439bfc48 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReadReportRequest.java @@ -0,0 +1,944 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +/** + * + * + *
+ * Request message for the `ReadReport` method.
+ * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.ReadReportRequest} + */ +@com.google.protobuf.Generated +public final class ReadReportRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.appoptimize.v1beta.ReadReportRequest) + ReadReportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReadReportRequest"); + } + + // Use ReadReportRequest.newBuilder() to construct. + private ReadReportRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReadReportRequest() { + name_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ReadReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ReadReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.ReadReportRequest.class, + com.google.cloud.appoptimize.v1beta.ReadReportRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The resource name of the report to query.
+   *
+   * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of the report to query.
+   *
+   * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. The maximum number of rows to return. The service may return
+   * fewer than this value. If unspecified, at most 10,000 rows will be returned
+   * per page. The maximum allowed value is 25,000; values above 25,000 are
+   * coerced to 25,000.
+   * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. A page token, received from a previous `ReadReport` call, to
+   * retrieve the subsequent page of results. When `page_token` is specified,
+   * `job_reference` must also be provided from the previous response, and the
+   * `statement` field must not be set.
+   * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A page token, received from a previous `ReadReport` call, to
+   * retrieve the subsequent page of results. When `page_token` is specified,
+   * `job_reference` must also be provided from the previous response, and the
+   * `statement` field must not be set.
+   * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.appoptimize.v1beta.ReadReportRequest)) { + return super.equals(obj); + } + com.google.cloud.appoptimize.v1beta.ReadReportRequest other = + (com.google.cloud.appoptimize.v1beta.ReadReportRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.appoptimize.v1beta.ReadReportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for the `ReadReport` method.
+   * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.ReadReportRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.appoptimize.v1beta.ReadReportRequest) + com.google.cloud.appoptimize.v1beta.ReadReportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ReadReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ReadReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.ReadReportRequest.class, + com.google.cloud.appoptimize.v1beta.ReadReportRequest.Builder.class); + } + + // Construct using com.google.cloud.appoptimize.v1beta.ReadReportRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ReadReportRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ReadReportRequest getDefaultInstanceForType() { + return com.google.cloud.appoptimize.v1beta.ReadReportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ReadReportRequest build() { + com.google.cloud.appoptimize.v1beta.ReadReportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ReadReportRequest buildPartial() { + com.google.cloud.appoptimize.v1beta.ReadReportRequest result = + new com.google.cloud.appoptimize.v1beta.ReadReportRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.appoptimize.v1beta.ReadReportRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.appoptimize.v1beta.ReadReportRequest) { + return mergeFrom((com.google.cloud.appoptimize.v1beta.ReadReportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.appoptimize.v1beta.ReadReportRequest other) { + if (other == com.google.cloud.appoptimize.v1beta.ReadReportRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 32: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 32 + case 42: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The resource name of the report to query.
+     *
+     * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the report to query.
+     *
+     * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the report to query.
+     *
+     * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the report to query.
+     *
+     * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the report to query.
+     *
+     * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. The maximum number of rows to return. The service may return
+     * fewer than this value. If unspecified, at most 10,000 rows will be returned
+     * per page. The maximum allowed value is 25,000; values above 25,000 are
+     * coerced to 25,000.
+     * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. The maximum number of rows to return. The service may return
+     * fewer than this value. If unspecified, at most 10,000 rows will be returned
+     * per page. The maximum allowed value is 25,000; values above 25,000 are
+     * coerced to 25,000.
+     * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of rows to return. The service may return
+     * fewer than this value. If unspecified, at most 10,000 rows will be returned
+     * per page. The maximum allowed value is 25,000; values above 25,000 are
+     * coerced to 25,000.
+     * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. A page token, received from a previous `ReadReport` call, to
+     * retrieve the subsequent page of results. When `page_token` is specified,
+     * `job_reference` must also be provided from the previous response, and the
+     * `statement` field must not be set.
+     * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ReadReport` call, to
+     * retrieve the subsequent page of results. When `page_token` is specified,
+     * `job_reference` must also be provided from the previous response, and the
+     * `statement` field must not be set.
+     * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ReadReport` call, to
+     * retrieve the subsequent page of results. When `page_token` is specified,
+     * `job_reference` must also be provided from the previous response, and the
+     * `statement` field must not be set.
+     * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ReadReport` call, to
+     * retrieve the subsequent page of results. When `page_token` is specified,
+     * `job_reference` must also be provided from the previous response, and the
+     * `statement` field must not be set.
+     * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ReadReport` call, to
+     * retrieve the subsequent page of results. When `page_token` is specified,
+     * `job_reference` must also be provided from the previous response, and the
+     * `statement` field must not be set.
+     * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.appoptimize.v1beta.ReadReportRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.appoptimize.v1beta.ReadReportRequest) + private static final com.google.cloud.appoptimize.v1beta.ReadReportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.appoptimize.v1beta.ReadReportRequest(); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadReportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ReadReportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReadReportRequestOrBuilder.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReadReportRequestOrBuilder.java new file mode 100644 index 000000000000..b97cab4f8f68 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReadReportRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +@com.google.protobuf.Generated +public interface ReadReportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.appoptimize.v1beta.ReadReportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the report to query.
+   *
+   * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The resource name of the report to query.
+   *
+   * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The maximum number of rows to return. The service may return
+   * fewer than this value. If unspecified, at most 10,000 rows will be returned
+   * per page. The maximum allowed value is 25,000; values above 25,000 are
+   * coerced to 25,000.
+   * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ReadReport` call, to
+   * retrieve the subsequent page of results. When `page_token` is specified,
+   * `job_reference` must also be provided from the previous response, and the
+   * `statement` field must not be set.
+   * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ReadReport` call, to
+   * retrieve the subsequent page of results. When `page_token` is specified,
+   * `job_reference` must also be provided from the previous response, and the
+   * `statement` field must not be set.
+   * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReadReportResponse.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReadReportResponse.java new file mode 100644 index 000000000000..ca400053fb57 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReadReportResponse.java @@ -0,0 +1,1628 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +/** + * + * + *
+ * Response message for the `ReadReport` method.
+ * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.ReadReportResponse} + */ +@com.google.protobuf.Generated +public final class ReadReportResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.appoptimize.v1beta.ReadReportResponse) + ReadReportResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReadReportResponse"); + } + + // Use ReadReportResponse.newBuilder() to construct. + private ReadReportResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReadReportResponse() { + rows_ = java.util.Collections.emptyList(); + columns_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ReadReportResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ReadReportResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.ReadReportResponse.class, + com.google.cloud.appoptimize.v1beta.ReadReportResponse.Builder.class); + } + + public static final int ROWS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List rows_; + + /** + * + * + *
+   * A list of rows, where each row represents a record from the report.
+   * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + @java.lang.Override + public java.util.List getRowsList() { + return rows_; + } + + /** + * + * + *
+   * A list of rows, where each row represents a record from the report.
+   * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + @java.lang.Override + public java.util.List getRowsOrBuilderList() { + return rows_; + } + + /** + * + * + *
+   * A list of rows, where each row represents a record from the report.
+   * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + @java.lang.Override + public int getRowsCount() { + return rows_.size(); + } + + /** + * + * + *
+   * A list of rows, where each row represents a record from the report.
+   * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + @java.lang.Override + public com.google.protobuf.ListValue getRows(int index) { + return rows_.get(index); + } + + /** + * + * + *
+   * A list of rows, where each row represents a record from the report.
+   * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + @java.lang.Override + public com.google.protobuf.ListValueOrBuilder getRowsOrBuilder(int index) { + return rows_.get(index); + } + + public static final int COLUMNS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List columns_; + + /** + * + * + *
+   * The columns describing the structure of the data in the `rows` field.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + @java.lang.Override + public java.util.List getColumnsList() { + return columns_; + } + + /** + * + * + *
+   * The columns describing the structure of the data in the `rows` field.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + @java.lang.Override + public java.util.List + getColumnsOrBuilderList() { + return columns_; + } + + /** + * + * + *
+   * The columns describing the structure of the data in the `rows` field.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + @java.lang.Override + public int getColumnsCount() { + return columns_.size(); + } + + /** + * + * + *
+   * The columns describing the structure of the data in the `rows` field.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Column getColumns(int index) { + return columns_.get(index); + } + + /** + * + * + *
+   * The columns describing the structure of the data in the `rows` field.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ColumnOrBuilder getColumnsOrBuilder(int index) { + return columns_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * A token that can be sent as `page_token` in a subsequent `ReadReport`
+   * request to retrieve the next page of results. If this field is empty,
+   * there are no further pages.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A token that can be sent as `page_token` in a subsequent `ReadReport`
+   * request to retrieve the next page of results. If this field is empty,
+   * there are no further pages.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < rows_.size(); i++) { + output.writeMessage(1, rows_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, nextPageToken_); + } + for (int i = 0; i < columns_.size(); i++) { + output.writeMessage(5, columns_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < rows_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, rows_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, nextPageToken_); + } + for (int i = 0; i < columns_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, columns_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.appoptimize.v1beta.ReadReportResponse)) { + return super.equals(obj); + } + com.google.cloud.appoptimize.v1beta.ReadReportResponse other = + (com.google.cloud.appoptimize.v1beta.ReadReportResponse) obj; + + if (!getRowsList().equals(other.getRowsList())) return false; + if (!getColumnsList().equals(other.getColumnsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRowsCount() > 0) { + hash = (37 * hash) + ROWS_FIELD_NUMBER; + hash = (53 * hash) + getRowsList().hashCode(); + } + if (getColumnsCount() > 0) { + hash = (37 * hash) + COLUMNS_FIELD_NUMBER; + hash = (53 * hash) + getColumnsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.appoptimize.v1beta.ReadReportResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for the `ReadReport` method.
+   * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.ReadReportResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.appoptimize.v1beta.ReadReportResponse) + com.google.cloud.appoptimize.v1beta.ReadReportResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ReadReportResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ReadReportResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.ReadReportResponse.class, + com.google.cloud.appoptimize.v1beta.ReadReportResponse.Builder.class); + } + + // Construct using com.google.cloud.appoptimize.v1beta.ReadReportResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (rowsBuilder_ == null) { + rows_ = java.util.Collections.emptyList(); + } else { + rows_ = null; + rowsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (columnsBuilder_ == null) { + columns_ = java.util.Collections.emptyList(); + } else { + columns_ = null; + columnsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_ReadReportResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ReadReportResponse getDefaultInstanceForType() { + return com.google.cloud.appoptimize.v1beta.ReadReportResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ReadReportResponse build() { + com.google.cloud.appoptimize.v1beta.ReadReportResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ReadReportResponse buildPartial() { + com.google.cloud.appoptimize.v1beta.ReadReportResponse result = + new com.google.cloud.appoptimize.v1beta.ReadReportResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.appoptimize.v1beta.ReadReportResponse result) { + if (rowsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + rows_ = java.util.Collections.unmodifiableList(rows_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.rows_ = rows_; + } else { + result.rows_ = rowsBuilder_.build(); + } + if (columnsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + columns_ = java.util.Collections.unmodifiableList(columns_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.columns_ = columns_; + } else { + result.columns_ = columnsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.appoptimize.v1beta.ReadReportResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.appoptimize.v1beta.ReadReportResponse) { + return mergeFrom((com.google.cloud.appoptimize.v1beta.ReadReportResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.appoptimize.v1beta.ReadReportResponse other) { + if (other == com.google.cloud.appoptimize.v1beta.ReadReportResponse.getDefaultInstance()) + return this; + if (rowsBuilder_ == null) { + if (!other.rows_.isEmpty()) { + if (rows_.isEmpty()) { + rows_ = other.rows_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRowsIsMutable(); + rows_.addAll(other.rows_); + } + onChanged(); + } + } else { + if (!other.rows_.isEmpty()) { + if (rowsBuilder_.isEmpty()) { + rowsBuilder_.dispose(); + rowsBuilder_ = null; + rows_ = other.rows_; + bitField0_ = (bitField0_ & ~0x00000001); + rowsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRowsFieldBuilder() + : null; + } else { + rowsBuilder_.addAllMessages(other.rows_); + } + } + } + if (columnsBuilder_ == null) { + if (!other.columns_.isEmpty()) { + if (columns_.isEmpty()) { + columns_ = other.columns_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureColumnsIsMutable(); + columns_.addAll(other.columns_); + } + onChanged(); + } + } else { + if (!other.columns_.isEmpty()) { + if (columnsBuilder_.isEmpty()) { + columnsBuilder_.dispose(); + columnsBuilder_ = null; + columns_ = other.columns_; + bitField0_ = (bitField0_ & ~0x00000002); + columnsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetColumnsFieldBuilder() + : null; + } else { + columnsBuilder_.addAllMessages(other.columns_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.ListValue m = + input.readMessage(com.google.protobuf.ListValue.parser(), extensionRegistry); + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.add(m); + } else { + rowsBuilder_.addMessage(m); + } + break; + } // case 10 + case 26: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + com.google.cloud.appoptimize.v1beta.Column m = + input.readMessage( + com.google.cloud.appoptimize.v1beta.Column.parser(), extensionRegistry); + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(m); + } else { + columnsBuilder_.addMessage(m); + } + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List rows_ = java.util.Collections.emptyList(); + + private void ensureRowsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + rows_ = new java.util.ArrayList(rows_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder> + rowsBuilder_; + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public java.util.List getRowsList() { + if (rowsBuilder_ == null) { + return java.util.Collections.unmodifiableList(rows_); + } else { + return rowsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public int getRowsCount() { + if (rowsBuilder_ == null) { + return rows_.size(); + } else { + return rowsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public com.google.protobuf.ListValue getRows(int index) { + if (rowsBuilder_ == null) { + return rows_.get(index); + } else { + return rowsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public Builder setRows(int index, com.google.protobuf.ListValue value) { + if (rowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowsIsMutable(); + rows_.set(index, value); + onChanged(); + } else { + rowsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public Builder setRows(int index, com.google.protobuf.ListValue.Builder builderForValue) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.set(index, builderForValue.build()); + onChanged(); + } else { + rowsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public Builder addRows(com.google.protobuf.ListValue value) { + if (rowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowsIsMutable(); + rows_.add(value); + onChanged(); + } else { + rowsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public Builder addRows(int index, com.google.protobuf.ListValue value) { + if (rowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRowsIsMutable(); + rows_.add(index, value); + onChanged(); + } else { + rowsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public Builder addRows(com.google.protobuf.ListValue.Builder builderForValue) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.add(builderForValue.build()); + onChanged(); + } else { + rowsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public Builder addRows(int index, com.google.protobuf.ListValue.Builder builderForValue) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.add(index, builderForValue.build()); + onChanged(); + } else { + rowsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public Builder addAllRows(java.lang.Iterable values) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rows_); + onChanged(); + } else { + rowsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public Builder clearRows() { + if (rowsBuilder_ == null) { + rows_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + rowsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public Builder removeRows(int index) { + if (rowsBuilder_ == null) { + ensureRowsIsMutable(); + rows_.remove(index); + onChanged(); + } else { + rowsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public com.google.protobuf.ListValue.Builder getRowsBuilder(int index) { + return internalGetRowsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public com.google.protobuf.ListValueOrBuilder getRowsOrBuilder(int index) { + if (rowsBuilder_ == null) { + return rows_.get(index); + } else { + return rowsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public java.util.List getRowsOrBuilderList() { + if (rowsBuilder_ != null) { + return rowsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rows_); + } + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public com.google.protobuf.ListValue.Builder addRowsBuilder() { + return internalGetRowsFieldBuilder() + .addBuilder(com.google.protobuf.ListValue.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public com.google.protobuf.ListValue.Builder addRowsBuilder(int index) { + return internalGetRowsFieldBuilder() + .addBuilder(index, com.google.protobuf.ListValue.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of rows, where each row represents a record from the report.
+     * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + public java.util.List getRowsBuilderList() { + return internalGetRowsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder> + internalGetRowsFieldBuilder() { + if (rowsBuilder_ == null) { + rowsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder>( + rows_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + rows_ = null; + } + return rowsBuilder_; + } + + private java.util.List columns_ = + java.util.Collections.emptyList(); + + private void ensureColumnsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + columns_ = new java.util.ArrayList(columns_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.appoptimize.v1beta.Column, + com.google.cloud.appoptimize.v1beta.Column.Builder, + com.google.cloud.appoptimize.v1beta.ColumnOrBuilder> + columnsBuilder_; + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public java.util.List getColumnsList() { + if (columnsBuilder_ == null) { + return java.util.Collections.unmodifiableList(columns_); + } else { + return columnsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public int getColumnsCount() { + if (columnsBuilder_ == null) { + return columns_.size(); + } else { + return columnsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public com.google.cloud.appoptimize.v1beta.Column getColumns(int index) { + if (columnsBuilder_ == null) { + return columns_.get(index); + } else { + return columnsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public Builder setColumns(int index, com.google.cloud.appoptimize.v1beta.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.set(index, value); + onChanged(); + } else { + columnsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public Builder setColumns( + int index, com.google.cloud.appoptimize.v1beta.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.set(index, builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public Builder addColumns(com.google.cloud.appoptimize.v1beta.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(value); + onChanged(); + } else { + columnsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public Builder addColumns(int index, com.google.cloud.appoptimize.v1beta.Column value) { + if (columnsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(index, value); + onChanged(); + } else { + columnsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public Builder addColumns(com.google.cloud.appoptimize.v1beta.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public Builder addColumns( + int index, com.google.cloud.appoptimize.v1beta.Column.Builder builderForValue) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.add(index, builderForValue.build()); + onChanged(); + } else { + columnsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public Builder addAllColumns( + java.lang.Iterable values) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, columns_); + onChanged(); + } else { + columnsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public Builder clearColumns() { + if (columnsBuilder_ == null) { + columns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + columnsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public Builder removeColumns(int index) { + if (columnsBuilder_ == null) { + ensureColumnsIsMutable(); + columns_.remove(index); + onChanged(); + } else { + columnsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public com.google.cloud.appoptimize.v1beta.Column.Builder getColumnsBuilder(int index) { + return internalGetColumnsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public com.google.cloud.appoptimize.v1beta.ColumnOrBuilder getColumnsOrBuilder(int index) { + if (columnsBuilder_ == null) { + return columns_.get(index); + } else { + return columnsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public java.util.List + getColumnsOrBuilderList() { + if (columnsBuilder_ != null) { + return columnsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(columns_); + } + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public com.google.cloud.appoptimize.v1beta.Column.Builder addColumnsBuilder() { + return internalGetColumnsFieldBuilder() + .addBuilder(com.google.cloud.appoptimize.v1beta.Column.getDefaultInstance()); + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public com.google.cloud.appoptimize.v1beta.Column.Builder addColumnsBuilder(int index) { + return internalGetColumnsFieldBuilder() + .addBuilder(index, com.google.cloud.appoptimize.v1beta.Column.getDefaultInstance()); + } + + /** + * + * + *
+     * The columns describing the structure of the data in the `rows` field.
+     * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + public java.util.List + getColumnsBuilderList() { + return internalGetColumnsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.appoptimize.v1beta.Column, + com.google.cloud.appoptimize.v1beta.Column.Builder, + com.google.cloud.appoptimize.v1beta.ColumnOrBuilder> + internalGetColumnsFieldBuilder() { + if (columnsBuilder_ == null) { + columnsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.appoptimize.v1beta.Column, + com.google.cloud.appoptimize.v1beta.Column.Builder, + com.google.cloud.appoptimize.v1beta.ColumnOrBuilder>( + columns_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + columns_ = null; + } + return columnsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * A token that can be sent as `page_token` in a subsequent `ReadReport`
+     * request to retrieve the next page of results. If this field is empty,
+     * there are no further pages.
+     * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A token that can be sent as `page_token` in a subsequent `ReadReport`
+     * request to retrieve the next page of results. If this field is empty,
+     * there are no further pages.
+     * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A token that can be sent as `page_token` in a subsequent `ReadReport`
+     * request to retrieve the next page of results. If this field is empty,
+     * there are no further pages.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * A token that can be sent as `page_token` in a subsequent `ReadReport`
+     * request to retrieve the next page of results. If this field is empty,
+     * there are no further pages.
+     * 
+ * + * string next_page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * A token that can be sent as `page_token` in a subsequent `ReadReport`
+     * request to retrieve the next page of results. If this field is empty,
+     * there are no further pages.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.appoptimize.v1beta.ReadReportResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.appoptimize.v1beta.ReadReportResponse) + private static final com.google.cloud.appoptimize.v1beta.ReadReportResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.appoptimize.v1beta.ReadReportResponse(); + } + + public static com.google.cloud.appoptimize.v1beta.ReadReportResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadReportResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ReadReportResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReadReportResponseOrBuilder.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReadReportResponseOrBuilder.java new file mode 100644 index 000000000000..a847062a1982 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReadReportResponseOrBuilder.java @@ -0,0 +1,169 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +@com.google.protobuf.Generated +public interface ReadReportResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.appoptimize.v1beta.ReadReportResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of rows, where each row represents a record from the report.
+   * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + java.util.List getRowsList(); + + /** + * + * + *
+   * A list of rows, where each row represents a record from the report.
+   * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + com.google.protobuf.ListValue getRows(int index); + + /** + * + * + *
+   * A list of rows, where each row represents a record from the report.
+   * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + int getRowsCount(); + + /** + * + * + *
+   * A list of rows, where each row represents a record from the report.
+   * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + java.util.List getRowsOrBuilderList(); + + /** + * + * + *
+   * A list of rows, where each row represents a record from the report.
+   * 
+ * + * repeated .google.protobuf.ListValue rows = 1; + */ + com.google.protobuf.ListValueOrBuilder getRowsOrBuilder(int index); + + /** + * + * + *
+   * The columns describing the structure of the data in the `rows` field.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + java.util.List getColumnsList(); + + /** + * + * + *
+   * The columns describing the structure of the data in the `rows` field.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + com.google.cloud.appoptimize.v1beta.Column getColumns(int index); + + /** + * + * + *
+   * The columns describing the structure of the data in the `rows` field.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + int getColumnsCount(); + + /** + * + * + *
+   * The columns describing the structure of the data in the `rows` field.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + java.util.List + getColumnsOrBuilderList(); + + /** + * + * + *
+   * The columns describing the structure of the data in the `rows` field.
+   * 
+ * + * repeated .google.cloud.appoptimize.v1beta.Column columns = 5; + */ + com.google.cloud.appoptimize.v1beta.ColumnOrBuilder getColumnsOrBuilder(int index); + + /** + * + * + *
+   * A token that can be sent as `page_token` in a subsequent `ReadReport`
+   * request to retrieve the next page of results. If this field is empty,
+   * there are no further pages.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * A token that can be sent as `page_token` in a subsequent `ReadReport`
+   * request to retrieve the next page of results. If this field is empty,
+   * there are no further pages.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/Report.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/Report.java new file mode 100644 index 000000000000..6abaa6f24291 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/Report.java @@ -0,0 +1,3146 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +/** + * + * + *
+ * A configuration that defines the parameters for the data represented by a
+ * report.
+ * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.Report} + */ +@com.google.protobuf.Generated +public final class Report extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.appoptimize.v1beta.Report) + ReportOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Report"); + } + + // Use Report.newBuilder() to construct. + private Report(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Report() { + name_ = ""; + dimensions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + metrics_ = com.google.protobuf.LazyStringArrayList.emptyList(); + scopes_ = java.util.Collections.emptyList(); + filter_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_Report_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_Report_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.Report.class, + com.google.cloud.appoptimize.v1beta.Report.Builder.class); + } + + private int expirationCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object expiration_; + + public enum ExpirationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + EXPIRE_TIME(6), + EXPIRATION_NOT_SET(0); + private final int value; + + private ExpirationCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExpirationCase valueOf(int value) { + return forNumber(value); + } + + public static ExpirationCase forNumber(int value) { + switch (value) { + case 6: + return EXPIRE_TIME; + case 0: + return EXPIRATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 6; + + /** + * + * + *
+   * Output only. Timestamp in UTC of when this report expires. Once the
+   * report expires, it will no longer be accessible and the report's
+   * underlying data will be deleted.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expirationCase_ == 6; + } + + /** + * + * + *
+   * Output only. Timestamp in UTC of when this report expires. Once the
+   * report expires, it will no longer be accessible and the report's
+   * underlying data will be deleted.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + if (expirationCase_ == 6) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + /** + * + * + *
+   * Output only. Timestamp in UTC of when this report expires. Once the
+   * report expires, it will no longer be accessible and the report's
+   * underlying data will be deleted.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expirationCase_ == 6) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Identifier. The name of this report.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Identifier. The name of this report.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DIMENSIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList dimensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Required. A list of dimensions to include in the report. Supported values:
+   *
+   * * `project`
+   * * `application`
+   * * `service_or_workload`
+   * * `resource`
+   * * `resource_type`
+   * * `location`
+   * * `product_display_name`
+   * * `sku`
+   * * `month`
+   * * `day`
+   * * `hour`
+   *
+   * To aggregate results by time, specify at least one time dimension
+   * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+   * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+   *
+   * * `month`: `YYYY-MM` (e.g., `2024-01`)
+   * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+   * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+   *
+   * If the time range filter does not align with the selected time dimension,
+   * the range is expanded to encompass the full period of the finest-grained
+   * time dimension.
+   *
+   * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+   * `month` dimension is selected, the effective time range expands to include
+   * all of January (`2026-01-01` to `2026-02-01`).
+   * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the dimensions. + */ + public com.google.protobuf.ProtocolStringList getDimensionsList() { + return dimensions_; + } + + /** + * + * + *
+   * Required. A list of dimensions to include in the report. Supported values:
+   *
+   * * `project`
+   * * `application`
+   * * `service_or_workload`
+   * * `resource`
+   * * `resource_type`
+   * * `location`
+   * * `product_display_name`
+   * * `sku`
+   * * `month`
+   * * `day`
+   * * `hour`
+   *
+   * To aggregate results by time, specify at least one time dimension
+   * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+   * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+   *
+   * * `month`: `YYYY-MM` (e.g., `2024-01`)
+   * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+   * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+   *
+   * If the time range filter does not align with the selected time dimension,
+   * the range is expanded to encompass the full period of the finest-grained
+   * time dimension.
+   *
+   * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+   * `month` dimension is selected, the effective time range expands to include
+   * all of January (`2026-01-01` to `2026-02-01`).
+   * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of dimensions. + */ + public int getDimensionsCount() { + return dimensions_.size(); + } + + /** + * + * + *
+   * Required. A list of dimensions to include in the report. Supported values:
+   *
+   * * `project`
+   * * `application`
+   * * `service_or_workload`
+   * * `resource`
+   * * `resource_type`
+   * * `location`
+   * * `product_display_name`
+   * * `sku`
+   * * `month`
+   * * `day`
+   * * `hour`
+   *
+   * To aggregate results by time, specify at least one time dimension
+   * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+   * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+   *
+   * * `month`: `YYYY-MM` (e.g., `2024-01`)
+   * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+   * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+   *
+   * If the time range filter does not align with the selected time dimension,
+   * the range is expanded to encompass the full period of the finest-grained
+   * time dimension.
+   *
+   * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+   * `month` dimension is selected, the effective time range expands to include
+   * all of January (`2026-01-01` to `2026-02-01`).
+   * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The dimensions at the given index. + */ + public java.lang.String getDimensions(int index) { + return dimensions_.get(index); + } + + /** + * + * + *
+   * Required. A list of dimensions to include in the report. Supported values:
+   *
+   * * `project`
+   * * `application`
+   * * `service_or_workload`
+   * * `resource`
+   * * `resource_type`
+   * * `location`
+   * * `product_display_name`
+   * * `sku`
+   * * `month`
+   * * `day`
+   * * `hour`
+   *
+   * To aggregate results by time, specify at least one time dimension
+   * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+   * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+   *
+   * * `month`: `YYYY-MM` (e.g., `2024-01`)
+   * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+   * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+   *
+   * If the time range filter does not align with the selected time dimension,
+   * the range is expanded to encompass the full period of the finest-grained
+   * time dimension.
+   *
+   * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+   * `month` dimension is selected, the effective time range expands to include
+   * all of January (`2026-01-01` to `2026-02-01`).
+   * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the dimensions at the given index. + */ + public com.google.protobuf.ByteString getDimensionsBytes(int index) { + return dimensions_.getByteString(index); + } + + public static final int METRICS_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList metrics_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Required. A list of metrics to include in the report. Supported values:
+   *
+   * * `cost`
+   * * `cpu_mean_utilization`
+   * * `cpu_usage_core_seconds`
+   * * `cpu_allocation_core_seconds`
+   * * `cpu_p95_utilization`
+   * * `memory_mean_utilization`
+   * * `memory_usage_byte_seconds`
+   * * `memory_allocation_byte_seconds`
+   * * `memory_p95_utilization`
+   * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the metrics. + */ + public com.google.protobuf.ProtocolStringList getMetricsList() { + return metrics_; + } + + /** + * + * + *
+   * Required. A list of metrics to include in the report. Supported values:
+   *
+   * * `cost`
+   * * `cpu_mean_utilization`
+   * * `cpu_usage_core_seconds`
+   * * `cpu_allocation_core_seconds`
+   * * `cpu_p95_utilization`
+   * * `memory_mean_utilization`
+   * * `memory_usage_byte_seconds`
+   * * `memory_allocation_byte_seconds`
+   * * `memory_p95_utilization`
+   * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of metrics. + */ + public int getMetricsCount() { + return metrics_.size(); + } + + /** + * + * + *
+   * Required. A list of metrics to include in the report. Supported values:
+   *
+   * * `cost`
+   * * `cpu_mean_utilization`
+   * * `cpu_usage_core_seconds`
+   * * `cpu_allocation_core_seconds`
+   * * `cpu_p95_utilization`
+   * * `memory_mean_utilization`
+   * * `memory_usage_byte_seconds`
+   * * `memory_allocation_byte_seconds`
+   * * `memory_p95_utilization`
+   * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The metrics at the given index. + */ + public java.lang.String getMetrics(int index) { + return metrics_.get(index); + } + + /** + * + * + *
+   * Required. A list of metrics to include in the report. Supported values:
+   *
+   * * `cost`
+   * * `cpu_mean_utilization`
+   * * `cpu_usage_core_seconds`
+   * * `cpu_allocation_core_seconds`
+   * * `cpu_p95_utilization`
+   * * `memory_mean_utilization`
+   * * `memory_usage_byte_seconds`
+   * * `memory_allocation_byte_seconds`
+   * * `memory_p95_utilization`
+   * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the metrics at the given index. + */ + public com.google.protobuf.ByteString getMetricsBytes(int index) { + return metrics_.getByteString(index); + } + + public static final int SCOPES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List scopes_; + + /** + * + * + *
+   * Optional. The resource containers for which to fetch data. Default is the
+   * project specified in the report's parent.
+   * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getScopesList() { + return scopes_; + } + + /** + * + * + *
+   * Optional. The resource containers for which to fetch data. Default is the
+   * project specified in the report's parent.
+   * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getScopesOrBuilderList() { + return scopes_; + } + + /** + * + * + *
+   * Optional. The resource containers for which to fetch data. Default is the
+   * project specified in the report's parent.
+   * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getScopesCount() { + return scopes_.size(); + } + + /** + * + * + *
+   * Optional. The resource containers for which to fetch data. Default is the
+   * project specified in the report's parent.
+   * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Scope getScopes(int index) { + return scopes_.get(index); + } + + /** + * + * + *
+   * Optional. The resource containers for which to fetch data. Default is the
+   * project specified in the report's parent.
+   * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.ScopeOrBuilder getScopesOrBuilder(int index) { + return scopes_.get(index); + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * Optional. A Common Expression Language (CEL) expression used to filter the
+   * data for the report.
+   *
+   * Predicates may refer to any dimension. Filtering must conform to these
+   * constraints:
+   *
+   * * All string field predicates must use exact string matches.
+   * * Multiple predicates referring to the same string field must be joined
+   * using the logical OR operator ('||').
+   * * All other predicates must be joined using the logical AND operator
+   * (`&&`).
+   * * A predicate on a time dimension (e.g., `day`) specifying the start time
+   * must use a greater-than-or-equal-to comparison (`>=`).
+   * * A predicate on a time dimension specifying the end time must use a
+   * less-than comparison (`<`).
+   *
+   * Examples:
+   *
+   * 1. Filter by a specific resource type:
+   * `"resource_type == 'compute.googleapis.com/Instance'"`
+   *
+   * 2. Filter data points that fall within a specific absolute time interval:
+   * `"hour >= timestamp('2024-01-01T00:00:00Z') &&
+   * hour < timestamp('2024-02-01T00:00:00Z')"`
+   *
+   * 3. Filter data points that fall within the past 72 hours:
+   * `"hour >= now - duration('72h')"`
+   *
+   * 4. Combine string predicate with time interval predicate:
+   * `"(location == 'us-east1' || location == 'us-west1') &&
+   * hour >= timestamp('2023-12-01T00:00:00Z') &&
+   * hour < timestamp('2024-02-01T00:00:00Z')"`
+   *
+   * If the filter omits time dimensions (`month`, `day`, `hour`), the report
+   * defaults to a 7-day range ending at the previous Pacific Time midnight,
+   * with Daylight Saving Time (DST) applied.
+   *
+   * For example, if the current Pacific Time is `2026-01-05T12:00:00`,
+   * the default range is `2025-12-29T00:00:00` to `2026-01-05T00:00:00` Pacific
+   * time.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A Common Expression Language (CEL) expression used to filter the
+   * data for the report.
+   *
+   * Predicates may refer to any dimension. Filtering must conform to these
+   * constraints:
+   *
+   * * All string field predicates must use exact string matches.
+   * * Multiple predicates referring to the same string field must be joined
+   * using the logical OR operator ('||').
+   * * All other predicates must be joined using the logical AND operator
+   * (`&&`).
+   * * A predicate on a time dimension (e.g., `day`) specifying the start time
+   * must use a greater-than-or-equal-to comparison (`>=`).
+   * * A predicate on a time dimension specifying the end time must use a
+   * less-than comparison (`<`).
+   *
+   * Examples:
+   *
+   * 1. Filter by a specific resource type:
+   * `"resource_type == 'compute.googleapis.com/Instance'"`
+   *
+   * 2. Filter data points that fall within a specific absolute time interval:
+   * `"hour >= timestamp('2024-01-01T00:00:00Z') &&
+   * hour < timestamp('2024-02-01T00:00:00Z')"`
+   *
+   * 3. Filter data points that fall within the past 72 hours:
+   * `"hour >= now - duration('72h')"`
+   *
+   * 4. Combine string predicate with time interval predicate:
+   * `"(location == 'us-east1' || location == 'us-west1') &&
+   * hour >= timestamp('2023-12-01T00:00:00Z') &&
+   * hour < timestamp('2024-02-01T00:00:00Z')"`
+   *
+   * If the filter omits time dimensions (`month`, `day`, `hour`), the report
+   * defaults to a 7-day range ending at the previous Pacific Time midnight,
+   * with Daylight Saving Time (DST) applied.
+   *
+   * For example, if the current Pacific Time is `2026-01-05T12:00:00`,
+   * the default range is `2025-12-29T00:00:00` to `2026-01-05T00:00:00` Pacific
+   * time.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + for (int i = 0; i < dimensions_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, dimensions_.getRaw(i)); + } + for (int i = 0; i < scopes_.size(); i++) { + output.writeMessage(3, scopes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, filter_); + } + if (expirationCase_ == 6) { + output.writeMessage(6, (com.google.protobuf.Timestamp) expiration_); + } + for (int i = 0; i < metrics_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, metrics_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + { + int dataSize = 0; + for (int i = 0; i < dimensions_.size(); i++) { + dataSize += computeStringSizeNoTag(dimensions_.getRaw(i)); + } + size += dataSize; + size += 1 * getDimensionsList().size(); + } + for (int i = 0; i < scopes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, scopes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, filter_); + } + if (expirationCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.protobuf.Timestamp) expiration_); + } + { + int dataSize = 0; + for (int i = 0; i < metrics_.size(); i++) { + dataSize += computeStringSizeNoTag(metrics_.getRaw(i)); + } + size += dataSize; + size += 1 * getMetricsList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.appoptimize.v1beta.Report)) { + return super.equals(obj); + } + com.google.cloud.appoptimize.v1beta.Report other = + (com.google.cloud.appoptimize.v1beta.Report) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDimensionsList().equals(other.getDimensionsList())) return false; + if (!getMetricsList().equals(other.getMetricsList())) return false; + if (!getScopesList().equals(other.getScopesList())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getExpirationCase().equals(other.getExpirationCase())) return false; + switch (expirationCase_) { + case 6: + if (!getExpireTime().equals(other.getExpireTime())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getDimensionsCount() > 0) { + hash = (37 * hash) + DIMENSIONS_FIELD_NUMBER; + hash = (53 * hash) + getDimensionsList().hashCode(); + } + if (getMetricsCount() > 0) { + hash = (37 * hash) + METRICS_FIELD_NUMBER; + hash = (53 * hash) + getMetricsList().hashCode(); + } + if (getScopesCount() > 0) { + hash = (37 * hash) + SCOPES_FIELD_NUMBER; + hash = (53 * hash) + getScopesList().hashCode(); + } + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + switch (expirationCase_) { + case 6: + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.appoptimize.v1beta.Report parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.Report parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.Report parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.Report parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.Report parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.Report parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.Report parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.Report parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.Report parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.Report parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.Report parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.Report parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.appoptimize.v1beta.Report prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A configuration that defines the parameters for the data represented by a
+   * report.
+   * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.Report} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.appoptimize.v1beta.Report) + com.google.cloud.appoptimize.v1beta.ReportOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_Report_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_Report_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.Report.class, + com.google.cloud.appoptimize.v1beta.Report.Builder.class); + } + + // Construct using com.google.cloud.appoptimize.v1beta.Report.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.clear(); + } + name_ = ""; + dimensions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + metrics_ = com.google.protobuf.LazyStringArrayList.emptyList(); + if (scopesBuilder_ == null) { + scopes_ = java.util.Collections.emptyList(); + } else { + scopes_ = null; + scopesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + filter_ = ""; + expirationCase_ = 0; + expiration_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_Report_descriptor; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Report getDefaultInstanceForType() { + return com.google.cloud.appoptimize.v1beta.Report.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Report build() { + com.google.cloud.appoptimize.v1beta.Report result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Report buildPartial() { + com.google.cloud.appoptimize.v1beta.Report result = + new com.google.cloud.appoptimize.v1beta.Report(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.appoptimize.v1beta.Report result) { + if (scopesBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + scopes_ = java.util.Collections.unmodifiableList(scopes_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.scopes_ = scopes_; + } else { + result.scopes_ = scopesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.appoptimize.v1beta.Report result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + dimensions_.makeImmutable(); + result.dimensions_ = dimensions_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + metrics_.makeImmutable(); + result.metrics_ = metrics_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.filter_ = filter_; + } + } + + private void buildPartialOneofs(com.google.cloud.appoptimize.v1beta.Report result) { + result.expirationCase_ = expirationCase_; + result.expiration_ = this.expiration_; + if (expirationCase_ == 6 && expireTimeBuilder_ != null) { + result.expiration_ = expireTimeBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.appoptimize.v1beta.Report) { + return mergeFrom((com.google.cloud.appoptimize.v1beta.Report) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.appoptimize.v1beta.Report other) { + if (other == com.google.cloud.appoptimize.v1beta.Report.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.dimensions_.isEmpty()) { + if (dimensions_.isEmpty()) { + dimensions_ = other.dimensions_; + bitField0_ |= 0x00000004; + } else { + ensureDimensionsIsMutable(); + dimensions_.addAll(other.dimensions_); + } + onChanged(); + } + if (!other.metrics_.isEmpty()) { + if (metrics_.isEmpty()) { + metrics_ = other.metrics_; + bitField0_ |= 0x00000008; + } else { + ensureMetricsIsMutable(); + metrics_.addAll(other.metrics_); + } + onChanged(); + } + if (scopesBuilder_ == null) { + if (!other.scopes_.isEmpty()) { + if (scopes_.isEmpty()) { + scopes_ = other.scopes_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureScopesIsMutable(); + scopes_.addAll(other.scopes_); + } + onChanged(); + } + } else { + if (!other.scopes_.isEmpty()) { + if (scopesBuilder_.isEmpty()) { + scopesBuilder_.dispose(); + scopesBuilder_ = null; + scopes_ = other.scopes_; + bitField0_ = (bitField0_ & ~0x00000010); + scopesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetScopesFieldBuilder() + : null; + } else { + scopesBuilder_.addAllMessages(other.scopes_); + } + } + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000020; + onChanged(); + } + switch (other.getExpirationCase()) { + case EXPIRE_TIME: + { + mergeExpireTime(other.getExpireTime()); + break; + } + case EXPIRATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDimensionsIsMutable(); + dimensions_.add(s); + break; + } // case 18 + case 26: + { + com.google.cloud.appoptimize.v1beta.Scope m = + input.readMessage( + com.google.cloud.appoptimize.v1beta.Scope.parser(), extensionRegistry); + if (scopesBuilder_ == null) { + ensureScopesIsMutable(); + scopes_.add(m); + } else { + scopesBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 34 + case 50: + { + input.readMessage( + internalGetExpireTimeFieldBuilder().getBuilder(), extensionRegistry); + expirationCase_ = 6; + break; + } // case 50 + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureMetricsIsMutable(); + metrics_.add(s); + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int expirationCase_ = 0; + private java.lang.Object expiration_; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public Builder clearExpiration() { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + + /** + * + * + *
+     * Output only. Timestamp in UTC of when this report expires. Once the
+     * report expires, it will no longer be accessible and the report's
+     * underlying data will be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expirationCase_ == 6; + } + + /** + * + * + *
+     * Output only. Timestamp in UTC of when this report expires. Once the
+     * report expires, it will no longer be accessible and the report's
+     * underlying data will be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 6) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (expirationCase_ == 6) { + return expireTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Output only. Timestamp in UTC of when this report expires. Once the
+     * report expires, it will no longer be accessible and the report's
+     * underlying data will be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + expireTimeBuilder_.setMessage(value); + } + expirationCase_ = 6; + return this; + } + + /** + * + * + *
+     * Output only. Timestamp in UTC of when this report expires. Once the
+     * report expires, it will no longer be accessible and the report's
+     * underlying data will be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 6; + return this; + } + + /** + * + * + *
+     * Output only. Timestamp in UTC of when this report expires. Once the
+     * report expires, it will no longer be accessible and the report's
+     * underlying data will be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 6 + && expiration_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 6) { + expireTimeBuilder_.mergeFrom(value); + } else { + expireTimeBuilder_.setMessage(value); + } + } + expirationCase_ = 6; + return this; + } + + /** + * + * + *
+     * Output only. Timestamp in UTC of when this report expires. Once the
+     * report expires, it will no longer be accessible and the report's
+     * underlying data will be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearExpireTime() { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 6) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 6) { + expirationCase_ = 0; + expiration_ = null; + } + expireTimeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. Timestamp in UTC of when this report expires. Once the
+     * report expires, it will no longer be accessible and the report's
+     * underlying data will be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + return internalGetExpireTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. Timestamp in UTC of when this report expires. Once the
+     * report expires, it will no longer be accessible and the report's
+     * underlying data will be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if ((expirationCase_ == 6) && (expireTimeBuilder_ != null)) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 6) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Output only. Timestamp in UTC of when this report expires. Once the
+     * report expires, it will no longer be accessible and the report's
+     * underlying data will be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + if (!(expirationCase_ == 6)) { + expiration_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 6; + onChanged(); + return expireTimeBuilder_; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Identifier. The name of this report.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Identifier. The name of this report.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Identifier. The name of this report.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The name of this report.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The name of this report.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList dimensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDimensionsIsMutable() { + if (!dimensions_.isModifiable()) { + dimensions_ = new com.google.protobuf.LazyStringArrayList(dimensions_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
+     * Required. A list of dimensions to include in the report. Supported values:
+     *
+     * * `project`
+     * * `application`
+     * * `service_or_workload`
+     * * `resource`
+     * * `resource_type`
+     * * `location`
+     * * `product_display_name`
+     * * `sku`
+     * * `month`
+     * * `day`
+     * * `hour`
+     *
+     * To aggregate results by time, specify at least one time dimension
+     * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+     * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+     *
+     * * `month`: `YYYY-MM` (e.g., `2024-01`)
+     * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+     * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+     *
+     * If the time range filter does not align with the selected time dimension,
+     * the range is expanded to encompass the full period of the finest-grained
+     * time dimension.
+     *
+     * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+     * `month` dimension is selected, the effective time range expands to include
+     * all of January (`2026-01-01` to `2026-02-01`).
+     * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the dimensions. + */ + public com.google.protobuf.ProtocolStringList getDimensionsList() { + dimensions_.makeImmutable(); + return dimensions_; + } + + /** + * + * + *
+     * Required. A list of dimensions to include in the report. Supported values:
+     *
+     * * `project`
+     * * `application`
+     * * `service_or_workload`
+     * * `resource`
+     * * `resource_type`
+     * * `location`
+     * * `product_display_name`
+     * * `sku`
+     * * `month`
+     * * `day`
+     * * `hour`
+     *
+     * To aggregate results by time, specify at least one time dimension
+     * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+     * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+     *
+     * * `month`: `YYYY-MM` (e.g., `2024-01`)
+     * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+     * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+     *
+     * If the time range filter does not align with the selected time dimension,
+     * the range is expanded to encompass the full period of the finest-grained
+     * time dimension.
+     *
+     * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+     * `month` dimension is selected, the effective time range expands to include
+     * all of January (`2026-01-01` to `2026-02-01`).
+     * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of dimensions. + */ + public int getDimensionsCount() { + return dimensions_.size(); + } + + /** + * + * + *
+     * Required. A list of dimensions to include in the report. Supported values:
+     *
+     * * `project`
+     * * `application`
+     * * `service_or_workload`
+     * * `resource`
+     * * `resource_type`
+     * * `location`
+     * * `product_display_name`
+     * * `sku`
+     * * `month`
+     * * `day`
+     * * `hour`
+     *
+     * To aggregate results by time, specify at least one time dimension
+     * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+     * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+     *
+     * * `month`: `YYYY-MM` (e.g., `2024-01`)
+     * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+     * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+     *
+     * If the time range filter does not align with the selected time dimension,
+     * the range is expanded to encompass the full period of the finest-grained
+     * time dimension.
+     *
+     * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+     * `month` dimension is selected, the effective time range expands to include
+     * all of January (`2026-01-01` to `2026-02-01`).
+     * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The dimensions at the given index. + */ + public java.lang.String getDimensions(int index) { + return dimensions_.get(index); + } + + /** + * + * + *
+     * Required. A list of dimensions to include in the report. Supported values:
+     *
+     * * `project`
+     * * `application`
+     * * `service_or_workload`
+     * * `resource`
+     * * `resource_type`
+     * * `location`
+     * * `product_display_name`
+     * * `sku`
+     * * `month`
+     * * `day`
+     * * `hour`
+     *
+     * To aggregate results by time, specify at least one time dimension
+     * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+     * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+     *
+     * * `month`: `YYYY-MM` (e.g., `2024-01`)
+     * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+     * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+     *
+     * If the time range filter does not align with the selected time dimension,
+     * the range is expanded to encompass the full period of the finest-grained
+     * time dimension.
+     *
+     * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+     * `month` dimension is selected, the effective time range expands to include
+     * all of January (`2026-01-01` to `2026-02-01`).
+     * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the dimensions at the given index. + */ + public com.google.protobuf.ByteString getDimensionsBytes(int index) { + return dimensions_.getByteString(index); + } + + /** + * + * + *
+     * Required. A list of dimensions to include in the report. Supported values:
+     *
+     * * `project`
+     * * `application`
+     * * `service_or_workload`
+     * * `resource`
+     * * `resource_type`
+     * * `location`
+     * * `product_display_name`
+     * * `sku`
+     * * `month`
+     * * `day`
+     * * `hour`
+     *
+     * To aggregate results by time, specify at least one time dimension
+     * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+     * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+     *
+     * * `month`: `YYYY-MM` (e.g., `2024-01`)
+     * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+     * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+     *
+     * If the time range filter does not align with the selected time dimension,
+     * the range is expanded to encompass the full period of the finest-grained
+     * time dimension.
+     *
+     * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+     * `month` dimension is selected, the effective time range expands to include
+     * all of January (`2026-01-01` to `2026-02-01`).
+     * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The dimensions to set. + * @return This builder for chaining. + */ + public Builder setDimensions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDimensionsIsMutable(); + dimensions_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A list of dimensions to include in the report. Supported values:
+     *
+     * * `project`
+     * * `application`
+     * * `service_or_workload`
+     * * `resource`
+     * * `resource_type`
+     * * `location`
+     * * `product_display_name`
+     * * `sku`
+     * * `month`
+     * * `day`
+     * * `hour`
+     *
+     * To aggregate results by time, specify at least one time dimension
+     * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+     * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+     *
+     * * `month`: `YYYY-MM` (e.g., `2024-01`)
+     * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+     * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+     *
+     * If the time range filter does not align with the selected time dimension,
+     * the range is expanded to encompass the full period of the finest-grained
+     * time dimension.
+     *
+     * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+     * `month` dimension is selected, the effective time range expands to include
+     * all of January (`2026-01-01` to `2026-02-01`).
+     * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The dimensions to add. + * @return This builder for chaining. + */ + public Builder addDimensions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDimensionsIsMutable(); + dimensions_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A list of dimensions to include in the report. Supported values:
+     *
+     * * `project`
+     * * `application`
+     * * `service_or_workload`
+     * * `resource`
+     * * `resource_type`
+     * * `location`
+     * * `product_display_name`
+     * * `sku`
+     * * `month`
+     * * `day`
+     * * `hour`
+     *
+     * To aggregate results by time, specify at least one time dimension
+     * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+     * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+     *
+     * * `month`: `YYYY-MM` (e.g., `2024-01`)
+     * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+     * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+     *
+     * If the time range filter does not align with the selected time dimension,
+     * the range is expanded to encompass the full period of the finest-grained
+     * time dimension.
+     *
+     * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+     * `month` dimension is selected, the effective time range expands to include
+     * all of January (`2026-01-01` to `2026-02-01`).
+     * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The dimensions to add. + * @return This builder for chaining. + */ + public Builder addAllDimensions(java.lang.Iterable values) { + ensureDimensionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dimensions_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A list of dimensions to include in the report. Supported values:
+     *
+     * * `project`
+     * * `application`
+     * * `service_or_workload`
+     * * `resource`
+     * * `resource_type`
+     * * `location`
+     * * `product_display_name`
+     * * `sku`
+     * * `month`
+     * * `day`
+     * * `hour`
+     *
+     * To aggregate results by time, specify at least one time dimension
+     * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+     * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+     *
+     * * `month`: `YYYY-MM` (e.g., `2024-01`)
+     * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+     * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+     *
+     * If the time range filter does not align with the selected time dimension,
+     * the range is expanded to encompass the full period of the finest-grained
+     * time dimension.
+     *
+     * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+     * `month` dimension is selected, the effective time range expands to include
+     * all of January (`2026-01-01` to `2026-02-01`).
+     * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDimensions() { + dimensions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A list of dimensions to include in the report. Supported values:
+     *
+     * * `project`
+     * * `application`
+     * * `service_or_workload`
+     * * `resource`
+     * * `resource_type`
+     * * `location`
+     * * `product_display_name`
+     * * `sku`
+     * * `month`
+     * * `day`
+     * * `hour`
+     *
+     * To aggregate results by time, specify at least one time dimension
+     * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+     * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+     *
+     * * `month`: `YYYY-MM` (e.g., `2024-01`)
+     * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+     * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+     *
+     * If the time range filter does not align with the selected time dimension,
+     * the range is expanded to encompass the full period of the finest-grained
+     * time dimension.
+     *
+     * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+     * `month` dimension is selected, the effective time range expands to include
+     * all of January (`2026-01-01` to `2026-02-01`).
+     * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the dimensions to add. + * @return This builder for chaining. + */ + public Builder addDimensionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDimensionsIsMutable(); + dimensions_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList metrics_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureMetricsIsMutable() { + if (!metrics_.isModifiable()) { + metrics_ = new com.google.protobuf.LazyStringArrayList(metrics_); + } + bitField0_ |= 0x00000008; + } + + /** + * + * + *
+     * Required. A list of metrics to include in the report. Supported values:
+     *
+     * * `cost`
+     * * `cpu_mean_utilization`
+     * * `cpu_usage_core_seconds`
+     * * `cpu_allocation_core_seconds`
+     * * `cpu_p95_utilization`
+     * * `memory_mean_utilization`
+     * * `memory_usage_byte_seconds`
+     * * `memory_allocation_byte_seconds`
+     * * `memory_p95_utilization`
+     * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the metrics. + */ + public com.google.protobuf.ProtocolStringList getMetricsList() { + metrics_.makeImmutable(); + return metrics_; + } + + /** + * + * + *
+     * Required. A list of metrics to include in the report. Supported values:
+     *
+     * * `cost`
+     * * `cpu_mean_utilization`
+     * * `cpu_usage_core_seconds`
+     * * `cpu_allocation_core_seconds`
+     * * `cpu_p95_utilization`
+     * * `memory_mean_utilization`
+     * * `memory_usage_byte_seconds`
+     * * `memory_allocation_byte_seconds`
+     * * `memory_p95_utilization`
+     * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of metrics. + */ + public int getMetricsCount() { + return metrics_.size(); + } + + /** + * + * + *
+     * Required. A list of metrics to include in the report. Supported values:
+     *
+     * * `cost`
+     * * `cpu_mean_utilization`
+     * * `cpu_usage_core_seconds`
+     * * `cpu_allocation_core_seconds`
+     * * `cpu_p95_utilization`
+     * * `memory_mean_utilization`
+     * * `memory_usage_byte_seconds`
+     * * `memory_allocation_byte_seconds`
+     * * `memory_p95_utilization`
+     * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The metrics at the given index. + */ + public java.lang.String getMetrics(int index) { + return metrics_.get(index); + } + + /** + * + * + *
+     * Required. A list of metrics to include in the report. Supported values:
+     *
+     * * `cost`
+     * * `cpu_mean_utilization`
+     * * `cpu_usage_core_seconds`
+     * * `cpu_allocation_core_seconds`
+     * * `cpu_p95_utilization`
+     * * `memory_mean_utilization`
+     * * `memory_usage_byte_seconds`
+     * * `memory_allocation_byte_seconds`
+     * * `memory_p95_utilization`
+     * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the metrics at the given index. + */ + public com.google.protobuf.ByteString getMetricsBytes(int index) { + return metrics_.getByteString(index); + } + + /** + * + * + *
+     * Required. A list of metrics to include in the report. Supported values:
+     *
+     * * `cost`
+     * * `cpu_mean_utilization`
+     * * `cpu_usage_core_seconds`
+     * * `cpu_allocation_core_seconds`
+     * * `cpu_p95_utilization`
+     * * `memory_mean_utilization`
+     * * `memory_usage_byte_seconds`
+     * * `memory_allocation_byte_seconds`
+     * * `memory_p95_utilization`
+     * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The metrics to set. + * @return This builder for chaining. + */ + public Builder setMetrics(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricsIsMutable(); + metrics_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A list of metrics to include in the report. Supported values:
+     *
+     * * `cost`
+     * * `cpu_mean_utilization`
+     * * `cpu_usage_core_seconds`
+     * * `cpu_allocation_core_seconds`
+     * * `cpu_p95_utilization`
+     * * `memory_mean_utilization`
+     * * `memory_usage_byte_seconds`
+     * * `memory_allocation_byte_seconds`
+     * * `memory_p95_utilization`
+     * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The metrics to add. + * @return This builder for chaining. + */ + public Builder addMetrics(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricsIsMutable(); + metrics_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A list of metrics to include in the report. Supported values:
+     *
+     * * `cost`
+     * * `cpu_mean_utilization`
+     * * `cpu_usage_core_seconds`
+     * * `cpu_allocation_core_seconds`
+     * * `cpu_p95_utilization`
+     * * `memory_mean_utilization`
+     * * `memory_usage_byte_seconds`
+     * * `memory_allocation_byte_seconds`
+     * * `memory_p95_utilization`
+     * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The metrics to add. + * @return This builder for chaining. + */ + public Builder addAllMetrics(java.lang.Iterable values) { + ensureMetricsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, metrics_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A list of metrics to include in the report. Supported values:
+     *
+     * * `cost`
+     * * `cpu_mean_utilization`
+     * * `cpu_usage_core_seconds`
+     * * `cpu_allocation_core_seconds`
+     * * `cpu_p95_utilization`
+     * * `memory_mean_utilization`
+     * * `memory_usage_byte_seconds`
+     * * `memory_allocation_byte_seconds`
+     * * `memory_p95_utilization`
+     * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearMetrics() { + metrics_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A list of metrics to include in the report. Supported values:
+     *
+     * * `cost`
+     * * `cpu_mean_utilization`
+     * * `cpu_usage_core_seconds`
+     * * `cpu_allocation_core_seconds`
+     * * `cpu_p95_utilization`
+     * * `memory_mean_utilization`
+     * * `memory_usage_byte_seconds`
+     * * `memory_allocation_byte_seconds`
+     * * `memory_p95_utilization`
+     * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the metrics to add. + * @return This builder for chaining. + */ + public Builder addMetricsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMetricsIsMutable(); + metrics_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.util.List scopes_ = + java.util.Collections.emptyList(); + + private void ensureScopesIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + scopes_ = new java.util.ArrayList(scopes_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.appoptimize.v1beta.Scope, + com.google.cloud.appoptimize.v1beta.Scope.Builder, + com.google.cloud.appoptimize.v1beta.ScopeOrBuilder> + scopesBuilder_; + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getScopesList() { + if (scopesBuilder_ == null) { + return java.util.Collections.unmodifiableList(scopes_); + } else { + return scopesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getScopesCount() { + if (scopesBuilder_ == null) { + return scopes_.size(); + } else { + return scopesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.appoptimize.v1beta.Scope getScopes(int index) { + if (scopesBuilder_ == null) { + return scopes_.get(index); + } else { + return scopesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setScopes(int index, com.google.cloud.appoptimize.v1beta.Scope value) { + if (scopesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScopesIsMutable(); + scopes_.set(index, value); + onChanged(); + } else { + scopesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setScopes( + int index, com.google.cloud.appoptimize.v1beta.Scope.Builder builderForValue) { + if (scopesBuilder_ == null) { + ensureScopesIsMutable(); + scopes_.set(index, builderForValue.build()); + onChanged(); + } else { + scopesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addScopes(com.google.cloud.appoptimize.v1beta.Scope value) { + if (scopesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScopesIsMutable(); + scopes_.add(value); + onChanged(); + } else { + scopesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addScopes(int index, com.google.cloud.appoptimize.v1beta.Scope value) { + if (scopesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScopesIsMutable(); + scopes_.add(index, value); + onChanged(); + } else { + scopesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addScopes(com.google.cloud.appoptimize.v1beta.Scope.Builder builderForValue) { + if (scopesBuilder_ == null) { + ensureScopesIsMutable(); + scopes_.add(builderForValue.build()); + onChanged(); + } else { + scopesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addScopes( + int index, com.google.cloud.appoptimize.v1beta.Scope.Builder builderForValue) { + if (scopesBuilder_ == null) { + ensureScopesIsMutable(); + scopes_.add(index, builderForValue.build()); + onChanged(); + } else { + scopesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllScopes( + java.lang.Iterable values) { + if (scopesBuilder_ == null) { + ensureScopesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, scopes_); + onChanged(); + } else { + scopesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearScopes() { + if (scopesBuilder_ == null) { + scopes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + scopesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeScopes(int index) { + if (scopesBuilder_ == null) { + ensureScopesIsMutable(); + scopes_.remove(index); + onChanged(); + } else { + scopesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.appoptimize.v1beta.Scope.Builder getScopesBuilder(int index) { + return internalGetScopesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.appoptimize.v1beta.ScopeOrBuilder getScopesOrBuilder(int index) { + if (scopesBuilder_ == null) { + return scopes_.get(index); + } else { + return scopesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getScopesOrBuilderList() { + if (scopesBuilder_ != null) { + return scopesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(scopes_); + } + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.appoptimize.v1beta.Scope.Builder addScopesBuilder() { + return internalGetScopesFieldBuilder() + .addBuilder(com.google.cloud.appoptimize.v1beta.Scope.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.appoptimize.v1beta.Scope.Builder addScopesBuilder(int index) { + return internalGetScopesFieldBuilder() + .addBuilder(index, com.google.cloud.appoptimize.v1beta.Scope.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. The resource containers for which to fetch data. Default is the
+     * project specified in the report's parent.
+     * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getScopesBuilderList() { + return internalGetScopesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.appoptimize.v1beta.Scope, + com.google.cloud.appoptimize.v1beta.Scope.Builder, + com.google.cloud.appoptimize.v1beta.ScopeOrBuilder> + internalGetScopesFieldBuilder() { + if (scopesBuilder_ == null) { + scopesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.appoptimize.v1beta.Scope, + com.google.cloud.appoptimize.v1beta.Scope.Builder, + com.google.cloud.appoptimize.v1beta.ScopeOrBuilder>( + scopes_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); + scopes_ = null; + } + return scopesBuilder_; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * Optional. A Common Expression Language (CEL) expression used to filter the
+     * data for the report.
+     *
+     * Predicates may refer to any dimension. Filtering must conform to these
+     * constraints:
+     *
+     * * All string field predicates must use exact string matches.
+     * * Multiple predicates referring to the same string field must be joined
+     * using the logical OR operator ('||').
+     * * All other predicates must be joined using the logical AND operator
+     * (`&&`).
+     * * A predicate on a time dimension (e.g., `day`) specifying the start time
+     * must use a greater-than-or-equal-to comparison (`>=`).
+     * * A predicate on a time dimension specifying the end time must use a
+     * less-than comparison (`<`).
+     *
+     * Examples:
+     *
+     * 1. Filter by a specific resource type:
+     * `"resource_type == 'compute.googleapis.com/Instance'"`
+     *
+     * 2. Filter data points that fall within a specific absolute time interval:
+     * `"hour >= timestamp('2024-01-01T00:00:00Z') &&
+     * hour < timestamp('2024-02-01T00:00:00Z')"`
+     *
+     * 3. Filter data points that fall within the past 72 hours:
+     * `"hour >= now - duration('72h')"`
+     *
+     * 4. Combine string predicate with time interval predicate:
+     * `"(location == 'us-east1' || location == 'us-west1') &&
+     * hour >= timestamp('2023-12-01T00:00:00Z') &&
+     * hour < timestamp('2024-02-01T00:00:00Z')"`
+     *
+     * If the filter omits time dimensions (`month`, `day`, `hour`), the report
+     * defaults to a 7-day range ending at the previous Pacific Time midnight,
+     * with Daylight Saving Time (DST) applied.
+     *
+     * For example, if the current Pacific Time is `2026-01-05T12:00:00`,
+     * the default range is `2025-12-29T00:00:00` to `2026-01-05T00:00:00` Pacific
+     * time.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A Common Expression Language (CEL) expression used to filter the
+     * data for the report.
+     *
+     * Predicates may refer to any dimension. Filtering must conform to these
+     * constraints:
+     *
+     * * All string field predicates must use exact string matches.
+     * * Multiple predicates referring to the same string field must be joined
+     * using the logical OR operator ('||').
+     * * All other predicates must be joined using the logical AND operator
+     * (`&&`).
+     * * A predicate on a time dimension (e.g., `day`) specifying the start time
+     * must use a greater-than-or-equal-to comparison (`>=`).
+     * * A predicate on a time dimension specifying the end time must use a
+     * less-than comparison (`<`).
+     *
+     * Examples:
+     *
+     * 1. Filter by a specific resource type:
+     * `"resource_type == 'compute.googleapis.com/Instance'"`
+     *
+     * 2. Filter data points that fall within a specific absolute time interval:
+     * `"hour >= timestamp('2024-01-01T00:00:00Z') &&
+     * hour < timestamp('2024-02-01T00:00:00Z')"`
+     *
+     * 3. Filter data points that fall within the past 72 hours:
+     * `"hour >= now - duration('72h')"`
+     *
+     * 4. Combine string predicate with time interval predicate:
+     * `"(location == 'us-east1' || location == 'us-west1') &&
+     * hour >= timestamp('2023-12-01T00:00:00Z') &&
+     * hour < timestamp('2024-02-01T00:00:00Z')"`
+     *
+     * If the filter omits time dimensions (`month`, `day`, `hour`), the report
+     * defaults to a 7-day range ending at the previous Pacific Time midnight,
+     * with Daylight Saving Time (DST) applied.
+     *
+     * For example, if the current Pacific Time is `2026-01-05T12:00:00`,
+     * the default range is `2025-12-29T00:00:00` to `2026-01-05T00:00:00` Pacific
+     * time.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A Common Expression Language (CEL) expression used to filter the
+     * data for the report.
+     *
+     * Predicates may refer to any dimension. Filtering must conform to these
+     * constraints:
+     *
+     * * All string field predicates must use exact string matches.
+     * * Multiple predicates referring to the same string field must be joined
+     * using the logical OR operator ('||').
+     * * All other predicates must be joined using the logical AND operator
+     * (`&&`).
+     * * A predicate on a time dimension (e.g., `day`) specifying the start time
+     * must use a greater-than-or-equal-to comparison (`>=`).
+     * * A predicate on a time dimension specifying the end time must use a
+     * less-than comparison (`<`).
+     *
+     * Examples:
+     *
+     * 1. Filter by a specific resource type:
+     * `"resource_type == 'compute.googleapis.com/Instance'"`
+     *
+     * 2. Filter data points that fall within a specific absolute time interval:
+     * `"hour >= timestamp('2024-01-01T00:00:00Z') &&
+     * hour < timestamp('2024-02-01T00:00:00Z')"`
+     *
+     * 3. Filter data points that fall within the past 72 hours:
+     * `"hour >= now - duration('72h')"`
+     *
+     * 4. Combine string predicate with time interval predicate:
+     * `"(location == 'us-east1' || location == 'us-west1') &&
+     * hour >= timestamp('2023-12-01T00:00:00Z') &&
+     * hour < timestamp('2024-02-01T00:00:00Z')"`
+     *
+     * If the filter omits time dimensions (`month`, `day`, `hour`), the report
+     * defaults to a 7-day range ending at the previous Pacific Time midnight,
+     * with Daylight Saving Time (DST) applied.
+     *
+     * For example, if the current Pacific Time is `2026-01-05T12:00:00`,
+     * the default range is `2025-12-29T00:00:00` to `2026-01-05T00:00:00` Pacific
+     * time.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A Common Expression Language (CEL) expression used to filter the
+     * data for the report.
+     *
+     * Predicates may refer to any dimension. Filtering must conform to these
+     * constraints:
+     *
+     * * All string field predicates must use exact string matches.
+     * * Multiple predicates referring to the same string field must be joined
+     * using the logical OR operator ('||').
+     * * All other predicates must be joined using the logical AND operator
+     * (`&&`).
+     * * A predicate on a time dimension (e.g., `day`) specifying the start time
+     * must use a greater-than-or-equal-to comparison (`>=`).
+     * * A predicate on a time dimension specifying the end time must use a
+     * less-than comparison (`<`).
+     *
+     * Examples:
+     *
+     * 1. Filter by a specific resource type:
+     * `"resource_type == 'compute.googleapis.com/Instance'"`
+     *
+     * 2. Filter data points that fall within a specific absolute time interval:
+     * `"hour >= timestamp('2024-01-01T00:00:00Z') &&
+     * hour < timestamp('2024-02-01T00:00:00Z')"`
+     *
+     * 3. Filter data points that fall within the past 72 hours:
+     * `"hour >= now - duration('72h')"`
+     *
+     * 4. Combine string predicate with time interval predicate:
+     * `"(location == 'us-east1' || location == 'us-west1') &&
+     * hour >= timestamp('2023-12-01T00:00:00Z') &&
+     * hour < timestamp('2024-02-01T00:00:00Z')"`
+     *
+     * If the filter omits time dimensions (`month`, `day`, `hour`), the report
+     * defaults to a 7-day range ending at the previous Pacific Time midnight,
+     * with Daylight Saving Time (DST) applied.
+     *
+     * For example, if the current Pacific Time is `2026-01-05T12:00:00`,
+     * the default range is `2025-12-29T00:00:00` to `2026-01-05T00:00:00` Pacific
+     * time.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A Common Expression Language (CEL) expression used to filter the
+     * data for the report.
+     *
+     * Predicates may refer to any dimension. Filtering must conform to these
+     * constraints:
+     *
+     * * All string field predicates must use exact string matches.
+     * * Multiple predicates referring to the same string field must be joined
+     * using the logical OR operator ('||').
+     * * All other predicates must be joined using the logical AND operator
+     * (`&&`).
+     * * A predicate on a time dimension (e.g., `day`) specifying the start time
+     * must use a greater-than-or-equal-to comparison (`>=`).
+     * * A predicate on a time dimension specifying the end time must use a
+     * less-than comparison (`<`).
+     *
+     * Examples:
+     *
+     * 1. Filter by a specific resource type:
+     * `"resource_type == 'compute.googleapis.com/Instance'"`
+     *
+     * 2. Filter data points that fall within a specific absolute time interval:
+     * `"hour >= timestamp('2024-01-01T00:00:00Z') &&
+     * hour < timestamp('2024-02-01T00:00:00Z')"`
+     *
+     * 3. Filter data points that fall within the past 72 hours:
+     * `"hour >= now - duration('72h')"`
+     *
+     * 4. Combine string predicate with time interval predicate:
+     * `"(location == 'us-east1' || location == 'us-west1') &&
+     * hour >= timestamp('2023-12-01T00:00:00Z') &&
+     * hour < timestamp('2024-02-01T00:00:00Z')"`
+     *
+     * If the filter omits time dimensions (`month`, `day`, `hour`), the report
+     * defaults to a 7-day range ending at the previous Pacific Time midnight,
+     * with Daylight Saving Time (DST) applied.
+     *
+     * For example, if the current Pacific Time is `2026-01-05T12:00:00`,
+     * the default range is `2025-12-29T00:00:00` to `2026-01-05T00:00:00` Pacific
+     * time.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.appoptimize.v1beta.Report) + } + + // @@protoc_insertion_point(class_scope:google.cloud.appoptimize.v1beta.Report) + private static final com.google.cloud.appoptimize.v1beta.Report DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.appoptimize.v1beta.Report(); + } + + public static com.google.cloud.appoptimize.v1beta.Report getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Report parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Report getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReportName.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReportName.java new file mode 100644 index 000000000000..22393f79582f --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReportName.java @@ -0,0 +1,223 @@ +/* + * 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.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ReportName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_REPORT = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/reports/{report}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String report; + + @Deprecated + protected ReportName() { + project = null; + location = null; + report = null; + } + + private ReportName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + report = Preconditions.checkNotNull(builder.getReport()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getReport() { + return report; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ReportName of(String project, String location, String report) { + return newBuilder().setProject(project).setLocation(location).setReport(report).build(); + } + + public static String format(String project, String location, String report) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setReport(report) + .build() + .toString(); + } + + public static ReportName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_REPORT.validatedMatch( + formattedString, "ReportName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("report")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (ReportName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_REPORT.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (report != null) { + fieldMapBuilder.put("report", report); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_REPORT.instantiate( + "project", project, "location", location, "report", report); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ReportName that = ((ReportName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.report, that.report); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(report); + return h; + } + + /** Builder for projects/{project}/locations/{location}/reports/{report}. */ + public static class Builder { + private String project; + private String location; + private String report; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getReport() { + return report; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setReport(String report) { + this.report = report; + return this; + } + + private Builder(ReportName reportName) { + this.project = reportName.project; + this.location = reportName.location; + this.report = reportName.report; + } + + public ReportName build() { + return new ReportName(this); + } + } +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReportOrBuilder.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReportOrBuilder.java new file mode 100644 index 000000000000..fe8aa422e523 --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ReportOrBuilder.java @@ -0,0 +1,537 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +@com.google.protobuf.Generated +public interface ReportOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.appoptimize.v1beta.Report) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Timestamp in UTC of when this report expires. Once the
+   * report expires, it will no longer be accessible and the report's
+   * underlying data will be deleted.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + + /** + * + * + *
+   * Output only. Timestamp in UTC of when this report expires. Once the
+   * report expires, it will no longer be accessible and the report's
+   * underlying data will be deleted.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + + /** + * + * + *
+   * Output only. Timestamp in UTC of when this report expires. Once the
+   * report expires, it will no longer be accessible and the report's
+   * underlying data will be deleted.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); + + /** + * + * + *
+   * Identifier. The name of this report.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Identifier. The name of this report.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. A list of dimensions to include in the report. Supported values:
+   *
+   * * `project`
+   * * `application`
+   * * `service_or_workload`
+   * * `resource`
+   * * `resource_type`
+   * * `location`
+   * * `product_display_name`
+   * * `sku`
+   * * `month`
+   * * `day`
+   * * `hour`
+   *
+   * To aggregate results by time, specify at least one time dimension
+   * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+   * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+   *
+   * * `month`: `YYYY-MM` (e.g., `2024-01`)
+   * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+   * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+   *
+   * If the time range filter does not align with the selected time dimension,
+   * the range is expanded to encompass the full period of the finest-grained
+   * time dimension.
+   *
+   * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+   * `month` dimension is selected, the effective time range expands to include
+   * all of January (`2026-01-01` to `2026-02-01`).
+   * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the dimensions. + */ + java.util.List getDimensionsList(); + + /** + * + * + *
+   * Required. A list of dimensions to include in the report. Supported values:
+   *
+   * * `project`
+   * * `application`
+   * * `service_or_workload`
+   * * `resource`
+   * * `resource_type`
+   * * `location`
+   * * `product_display_name`
+   * * `sku`
+   * * `month`
+   * * `day`
+   * * `hour`
+   *
+   * To aggregate results by time, specify at least one time dimension
+   * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+   * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+   *
+   * * `month`: `YYYY-MM` (e.g., `2024-01`)
+   * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+   * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+   *
+   * If the time range filter does not align with the selected time dimension,
+   * the range is expanded to encompass the full period of the finest-grained
+   * time dimension.
+   *
+   * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+   * `month` dimension is selected, the effective time range expands to include
+   * all of January (`2026-01-01` to `2026-02-01`).
+   * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of dimensions. + */ + int getDimensionsCount(); + + /** + * + * + *
+   * Required. A list of dimensions to include in the report. Supported values:
+   *
+   * * `project`
+   * * `application`
+   * * `service_or_workload`
+   * * `resource`
+   * * `resource_type`
+   * * `location`
+   * * `product_display_name`
+   * * `sku`
+   * * `month`
+   * * `day`
+   * * `hour`
+   *
+   * To aggregate results by time, specify at least one time dimension
+   * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+   * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+   *
+   * * `month`: `YYYY-MM` (e.g., `2024-01`)
+   * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+   * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+   *
+   * If the time range filter does not align with the selected time dimension,
+   * the range is expanded to encompass the full period of the finest-grained
+   * time dimension.
+   *
+   * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+   * `month` dimension is selected, the effective time range expands to include
+   * all of January (`2026-01-01` to `2026-02-01`).
+   * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The dimensions at the given index. + */ + java.lang.String getDimensions(int index); + + /** + * + * + *
+   * Required. A list of dimensions to include in the report. Supported values:
+   *
+   * * `project`
+   * * `application`
+   * * `service_or_workload`
+   * * `resource`
+   * * `resource_type`
+   * * `location`
+   * * `product_display_name`
+   * * `sku`
+   * * `month`
+   * * `day`
+   * * `hour`
+   *
+   * To aggregate results by time, specify at least one time dimension
+   * (`month`, `day`, or `hour`). All time dimensions use Pacific Time,
+   * respect Daylight Saving Time (DST), and follow these ISO 8601 formats:
+   *
+   * * `month`: `YYYY-MM` (e.g., `2024-01`)
+   * * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`)
+   * * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`)
+   *
+   * If the time range filter does not align with the selected time dimension,
+   * the range is expanded to encompass the full period of the finest-grained
+   * time dimension.
+   *
+   * For example, if the filter is `2026-01-10` through `2026-01-12` and the
+   * `month` dimension is selected, the effective time range expands to include
+   * all of January (`2026-01-01` to `2026-02-01`).
+   * 
+ * + * repeated string dimensions = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the dimensions at the given index. + */ + com.google.protobuf.ByteString getDimensionsBytes(int index); + + /** + * + * + *
+   * Required. A list of metrics to include in the report. Supported values:
+   *
+   * * `cost`
+   * * `cpu_mean_utilization`
+   * * `cpu_usage_core_seconds`
+   * * `cpu_allocation_core_seconds`
+   * * `cpu_p95_utilization`
+   * * `memory_mean_utilization`
+   * * `memory_usage_byte_seconds`
+   * * `memory_allocation_byte_seconds`
+   * * `memory_p95_utilization`
+   * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the metrics. + */ + java.util.List getMetricsList(); + + /** + * + * + *
+   * Required. A list of metrics to include in the report. Supported values:
+   *
+   * * `cost`
+   * * `cpu_mean_utilization`
+   * * `cpu_usage_core_seconds`
+   * * `cpu_allocation_core_seconds`
+   * * `cpu_p95_utilization`
+   * * `memory_mean_utilization`
+   * * `memory_usage_byte_seconds`
+   * * `memory_allocation_byte_seconds`
+   * * `memory_p95_utilization`
+   * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of metrics. + */ + int getMetricsCount(); + + /** + * + * + *
+   * Required. A list of metrics to include in the report. Supported values:
+   *
+   * * `cost`
+   * * `cpu_mean_utilization`
+   * * `cpu_usage_core_seconds`
+   * * `cpu_allocation_core_seconds`
+   * * `cpu_p95_utilization`
+   * * `memory_mean_utilization`
+   * * `memory_usage_byte_seconds`
+   * * `memory_allocation_byte_seconds`
+   * * `memory_p95_utilization`
+   * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The metrics at the given index. + */ + java.lang.String getMetrics(int index); + + /** + * + * + *
+   * Required. A list of metrics to include in the report. Supported values:
+   *
+   * * `cost`
+   * * `cpu_mean_utilization`
+   * * `cpu_usage_core_seconds`
+   * * `cpu_allocation_core_seconds`
+   * * `cpu_p95_utilization`
+   * * `memory_mean_utilization`
+   * * `memory_usage_byte_seconds`
+   * * `memory_allocation_byte_seconds`
+   * * `memory_p95_utilization`
+   * 
+ * + * repeated string metrics = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the metrics at the given index. + */ + com.google.protobuf.ByteString getMetricsBytes(int index); + + /** + * + * + *
+   * Optional. The resource containers for which to fetch data. Default is the
+   * project specified in the report's parent.
+   * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getScopesList(); + + /** + * + * + *
+   * Optional. The resource containers for which to fetch data. Default is the
+   * project specified in the report's parent.
+   * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.appoptimize.v1beta.Scope getScopes(int index); + + /** + * + * + *
+   * Optional. The resource containers for which to fetch data. Default is the
+   * project specified in the report's parent.
+   * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getScopesCount(); + + /** + * + * + *
+   * Optional. The resource containers for which to fetch data. Default is the
+   * project specified in the report's parent.
+   * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getScopesOrBuilderList(); + + /** + * + * + *
+   * Optional. The resource containers for which to fetch data. Default is the
+   * project specified in the report's parent.
+   * 
+ * + * + * repeated .google.cloud.appoptimize.v1beta.Scope scopes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.appoptimize.v1beta.ScopeOrBuilder getScopesOrBuilder(int index); + + /** + * + * + *
+   * Optional. A Common Expression Language (CEL) expression used to filter the
+   * data for the report.
+   *
+   * Predicates may refer to any dimension. Filtering must conform to these
+   * constraints:
+   *
+   * * All string field predicates must use exact string matches.
+   * * Multiple predicates referring to the same string field must be joined
+   * using the logical OR operator ('||').
+   * * All other predicates must be joined using the logical AND operator
+   * (`&&`).
+   * * A predicate on a time dimension (e.g., `day`) specifying the start time
+   * must use a greater-than-or-equal-to comparison (`>=`).
+   * * A predicate on a time dimension specifying the end time must use a
+   * less-than comparison (`<`).
+   *
+   * Examples:
+   *
+   * 1. Filter by a specific resource type:
+   * `"resource_type == 'compute.googleapis.com/Instance'"`
+   *
+   * 2. Filter data points that fall within a specific absolute time interval:
+   * `"hour >= timestamp('2024-01-01T00:00:00Z') &&
+   * hour < timestamp('2024-02-01T00:00:00Z')"`
+   *
+   * 3. Filter data points that fall within the past 72 hours:
+   * `"hour >= now - duration('72h')"`
+   *
+   * 4. Combine string predicate with time interval predicate:
+   * `"(location == 'us-east1' || location == 'us-west1') &&
+   * hour >= timestamp('2023-12-01T00:00:00Z') &&
+   * hour < timestamp('2024-02-01T00:00:00Z')"`
+   *
+   * If the filter omits time dimensions (`month`, `day`, `hour`), the report
+   * defaults to a 7-day range ending at the previous Pacific Time midnight,
+   * with Daylight Saving Time (DST) applied.
+   *
+   * For example, if the current Pacific Time is `2026-01-05T12:00:00`,
+   * the default range is `2025-12-29T00:00:00` to `2026-01-05T00:00:00` Pacific
+   * time.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * Optional. A Common Expression Language (CEL) expression used to filter the
+   * data for the report.
+   *
+   * Predicates may refer to any dimension. Filtering must conform to these
+   * constraints:
+   *
+   * * All string field predicates must use exact string matches.
+   * * Multiple predicates referring to the same string field must be joined
+   * using the logical OR operator ('||').
+   * * All other predicates must be joined using the logical AND operator
+   * (`&&`).
+   * * A predicate on a time dimension (e.g., `day`) specifying the start time
+   * must use a greater-than-or-equal-to comparison (`>=`).
+   * * A predicate on a time dimension specifying the end time must use a
+   * less-than comparison (`<`).
+   *
+   * Examples:
+   *
+   * 1. Filter by a specific resource type:
+   * `"resource_type == 'compute.googleapis.com/Instance'"`
+   *
+   * 2. Filter data points that fall within a specific absolute time interval:
+   * `"hour >= timestamp('2024-01-01T00:00:00Z') &&
+   * hour < timestamp('2024-02-01T00:00:00Z')"`
+   *
+   * 3. Filter data points that fall within the past 72 hours:
+   * `"hour >= now - duration('72h')"`
+   *
+   * 4. Combine string predicate with time interval predicate:
+   * `"(location == 'us-east1' || location == 'us-west1') &&
+   * hour >= timestamp('2023-12-01T00:00:00Z') &&
+   * hour < timestamp('2024-02-01T00:00:00Z')"`
+   *
+   * If the filter omits time dimensions (`month`, `day`, `hour`), the report
+   * defaults to a 7-day range ending at the previous Pacific Time midnight,
+   * with Daylight Saving Time (DST) applied.
+   *
+   * For example, if the current Pacific Time is `2026-01-05T12:00:00`,
+   * the default range is `2025-12-29T00:00:00` to `2026-01-05T00:00:00` Pacific
+   * time.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + com.google.cloud.appoptimize.v1beta.Report.ExpirationCase getExpirationCase(); +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/Scope.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/Scope.java new file mode 100644 index 000000000000..185bcb432b7c --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/Scope.java @@ -0,0 +1,1051 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +/** + * + * + *
+ * Specifies the report scope.
+ * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.Scope} + */ +@com.google.protobuf.Generated +public final class Scope extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.appoptimize.v1beta.Scope) + ScopeOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Scope"); + } + + // Use Scope.newBuilder() to construct. + private Scope(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Scope() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_Scope_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_Scope_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.Scope.class, + com.google.cloud.appoptimize.v1beta.Scope.Builder.class); + } + + private int scopeCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object scope_; + + public enum ScopeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PROJECT(1), + APPLICATION(2), + SCOPE_NOT_SET(0); + private final int value; + + private ScopeCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ScopeCase valueOf(int value) { + return forNumber(value); + } + + public static ScopeCase forNumber(int value) { + switch (value) { + case 1: + return PROJECT; + case 2: + return APPLICATION; + case 0: + return SCOPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ScopeCase getScopeCase() { + return ScopeCase.forNumber(scopeCase_); + } + + public static final int PROJECT_FIELD_NUMBER = 1; + + /** + * + * + *
+   * Required. A Google Cloud Platform project to fetch data from.
+   *
+   * Format: `"projects/{project}"`.
+   * 
+ * + * + * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the project field is set. + */ + public boolean hasProject() { + return scopeCase_ == 1; + } + + /** + * + * + *
+   * Required. A Google Cloud Platform project to fetch data from.
+   *
+   * Format: `"projects/{project}"`.
+   * 
+ * + * + * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = ""; + if (scopeCase_ == 1) { + ref = scope_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (scopeCase_ == 1) { + scope_ = s; + } + return s; + } + } + + /** + * + * + *
+   * Required. A Google Cloud Platform project to fetch data from.
+   *
+   * Format: `"projects/{project}"`.
+   * 
+ * + * + * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = ""; + if (scopeCase_ == 1) { + ref = scope_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (scopeCase_ == 1) { + scope_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APPLICATION_FIELD_NUMBER = 2; + + /** + * + * + *
+   * Required. An App Hub Application to fetch data from.
+   *
+   * Format:
+   * `"projects/{project}/locations/{location}/applications/{application}"`.
+   * 
+ * + * + * string application = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the application field is set. + */ + public boolean hasApplication() { + return scopeCase_ == 2; + } + + /** + * + * + *
+   * Required. An App Hub Application to fetch data from.
+   *
+   * Format:
+   * `"projects/{project}/locations/{location}/applications/{application}"`.
+   * 
+ * + * + * string application = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The application. + */ + public java.lang.String getApplication() { + java.lang.Object ref = ""; + if (scopeCase_ == 2) { + ref = scope_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (scopeCase_ == 2) { + scope_ = s; + } + return s; + } + } + + /** + * + * + *
+   * Required. An App Hub Application to fetch data from.
+   *
+   * Format:
+   * `"projects/{project}/locations/{location}/applications/{application}"`.
+   * 
+ * + * + * string application = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for application. + */ + public com.google.protobuf.ByteString getApplicationBytes() { + java.lang.Object ref = ""; + if (scopeCase_ == 2) { + ref = scope_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (scopeCase_ == 2) { + scope_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (scopeCase_ == 1) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, scope_); + } + if (scopeCase_ == 2) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, scope_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (scopeCase_ == 1) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, scope_); + } + if (scopeCase_ == 2) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, scope_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.appoptimize.v1beta.Scope)) { + return super.equals(obj); + } + com.google.cloud.appoptimize.v1beta.Scope other = + (com.google.cloud.appoptimize.v1beta.Scope) obj; + + if (!getScopeCase().equals(other.getScopeCase())) return false; + switch (scopeCase_) { + case 1: + if (!getProject().equals(other.getProject())) return false; + break; + case 2: + if (!getApplication().equals(other.getApplication())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (scopeCase_) { + case 1: + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + break; + case 2: + hash = (37 * hash) + APPLICATION_FIELD_NUMBER; + hash = (53 * hash) + getApplication().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.appoptimize.v1beta.Scope parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.Scope parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.Scope parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.Scope parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.Scope parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.appoptimize.v1beta.Scope parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.Scope parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.Scope parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.Scope parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.Scope parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.appoptimize.v1beta.Scope parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.appoptimize.v1beta.Scope parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.appoptimize.v1beta.Scope prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Specifies the report scope.
+   * 
+ * + * Protobuf type {@code google.cloud.appoptimize.v1beta.Scope} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.appoptimize.v1beta.Scope) + com.google.cloud.appoptimize.v1beta.ScopeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_Scope_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_Scope_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.appoptimize.v1beta.Scope.class, + com.google.cloud.appoptimize.v1beta.Scope.Builder.class); + } + + // Construct using com.google.cloud.appoptimize.v1beta.Scope.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + scopeCase_ = 0; + scope_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.appoptimize.v1beta.AppOptimizeProto + .internal_static_google_cloud_appoptimize_v1beta_Scope_descriptor; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Scope getDefaultInstanceForType() { + return com.google.cloud.appoptimize.v1beta.Scope.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Scope build() { + com.google.cloud.appoptimize.v1beta.Scope result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Scope buildPartial() { + com.google.cloud.appoptimize.v1beta.Scope result = + new com.google.cloud.appoptimize.v1beta.Scope(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.appoptimize.v1beta.Scope result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.appoptimize.v1beta.Scope result) { + result.scopeCase_ = scopeCase_; + result.scope_ = this.scope_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.appoptimize.v1beta.Scope) { + return mergeFrom((com.google.cloud.appoptimize.v1beta.Scope) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.appoptimize.v1beta.Scope other) { + if (other == com.google.cloud.appoptimize.v1beta.Scope.getDefaultInstance()) return this; + switch (other.getScopeCase()) { + case PROJECT: + { + scopeCase_ = 1; + scope_ = other.scope_; + onChanged(); + break; + } + case APPLICATION: + { + scopeCase_ = 2; + scope_ = other.scope_; + onChanged(); + break; + } + case SCOPE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + scopeCase_ = 1; + scope_ = s; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + scopeCase_ = 2; + scope_ = s; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int scopeCase_ = 0; + private java.lang.Object scope_; + + public ScopeCase getScopeCase() { + return ScopeCase.forNumber(scopeCase_); + } + + public Builder clearScope() { + scopeCase_ = 0; + scope_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * Required. A Google Cloud Platform project to fetch data from.
+     *
+     * Format: `"projects/{project}"`.
+     * 
+ * + * + * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the project field is set. + */ + @java.lang.Override + public boolean hasProject() { + return scopeCase_ == 1; + } + + /** + * + * + *
+     * Required. A Google Cloud Platform project to fetch data from.
+     *
+     * Format: `"projects/{project}"`.
+     * 
+ * + * + * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = ""; + if (scopeCase_ == 1) { + ref = scope_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (scopeCase_ == 1) { + scope_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. A Google Cloud Platform project to fetch data from.
+     *
+     * Format: `"projects/{project}"`.
+     * 
+ * + * + * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = ""; + if (scopeCase_ == 1) { + ref = scope_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (scopeCase_ == 1) { + scope_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. A Google Cloud Platform project to fetch data from.
+     *
+     * Format: `"projects/{project}"`.
+     * 
+ * + * + * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + scopeCase_ = 1; + scope_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A Google Cloud Platform project to fetch data from.
+     *
+     * Format: `"projects/{project}"`.
+     * 
+ * + * + * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearProject() { + if (scopeCase_ == 1) { + scopeCase_ = 0; + scope_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. A Google Cloud Platform project to fetch data from.
+     *
+     * Format: `"projects/{project}"`.
+     * 
+ * + * + * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + scopeCase_ = 1; + scope_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. An App Hub Application to fetch data from.
+     *
+     * Format:
+     * `"projects/{project}/locations/{location}/applications/{application}"`.
+     * 
+ * + * + * string application = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the application field is set. + */ + @java.lang.Override + public boolean hasApplication() { + return scopeCase_ == 2; + } + + /** + * + * + *
+     * Required. An App Hub Application to fetch data from.
+     *
+     * Format:
+     * `"projects/{project}/locations/{location}/applications/{application}"`.
+     * 
+ * + * + * string application = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The application. + */ + @java.lang.Override + public java.lang.String getApplication() { + java.lang.Object ref = ""; + if (scopeCase_ == 2) { + ref = scope_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (scopeCase_ == 2) { + scope_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. An App Hub Application to fetch data from.
+     *
+     * Format:
+     * `"projects/{project}/locations/{location}/applications/{application}"`.
+     * 
+ * + * + * string application = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for application. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApplicationBytes() { + java.lang.Object ref = ""; + if (scopeCase_ == 2) { + ref = scope_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (scopeCase_ == 2) { + scope_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. An App Hub Application to fetch data from.
+     *
+     * Format:
+     * `"projects/{project}/locations/{location}/applications/{application}"`.
+     * 
+ * + * + * string application = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The application to set. + * @return This builder for chaining. + */ + public Builder setApplication(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + scopeCase_ = 2; + scope_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. An App Hub Application to fetch data from.
+     *
+     * Format:
+     * `"projects/{project}/locations/{location}/applications/{application}"`.
+     * 
+ * + * + * string application = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearApplication() { + if (scopeCase_ == 2) { + scopeCase_ = 0; + scope_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. An App Hub Application to fetch data from.
+     *
+     * Format:
+     * `"projects/{project}/locations/{location}/applications/{application}"`.
+     * 
+ * + * + * string application = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for application to set. + * @return This builder for chaining. + */ + public Builder setApplicationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + scopeCase_ = 2; + scope_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.appoptimize.v1beta.Scope) + } + + // @@protoc_insertion_point(class_scope:google.cloud.appoptimize.v1beta.Scope) + private static final com.google.cloud.appoptimize.v1beta.Scope DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.appoptimize.v1beta.Scope(); + } + + public static com.google.cloud.appoptimize.v1beta.Scope getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Scope parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.appoptimize.v1beta.Scope getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ScopeOrBuilder.java b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ScopeOrBuilder.java new file mode 100644 index 000000000000..13755087f75f --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/java/com/google/cloud/appoptimize/v1beta/ScopeOrBuilder.java @@ -0,0 +1,135 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/appoptimize/v1beta/app_optimize.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.appoptimize.v1beta; + +@com.google.protobuf.Generated +public interface ScopeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.appoptimize.v1beta.Scope) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A Google Cloud Platform project to fetch data from.
+   *
+   * Format: `"projects/{project}"`.
+   * 
+ * + * + * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the project field is set. + */ + boolean hasProject(); + + /** + * + * + *
+   * Required. A Google Cloud Platform project to fetch data from.
+   *
+   * Format: `"projects/{project}"`.
+   * 
+ * + * + * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The project. + */ + java.lang.String getProject(); + + /** + * + * + *
+   * Required. A Google Cloud Platform project to fetch data from.
+   *
+   * Format: `"projects/{project}"`.
+   * 
+ * + * + * string project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Required. An App Hub Application to fetch data from.
+   *
+   * Format:
+   * `"projects/{project}/locations/{location}/applications/{application}"`.
+   * 
+ * + * + * string application = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the application field is set. + */ + boolean hasApplication(); + + /** + * + * + *
+   * Required. An App Hub Application to fetch data from.
+   *
+   * Format:
+   * `"projects/{project}/locations/{location}/applications/{application}"`.
+   * 
+ * + * + * string application = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The application. + */ + java.lang.String getApplication(); + + /** + * + * + *
+   * Required. An App Hub Application to fetch data from.
+   *
+   * Format:
+   * `"projects/{project}/locations/{location}/applications/{application}"`.
+   * 
+ * + * + * string application = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for application. + */ + com.google.protobuf.ByteString getApplicationBytes(); + + com.google.cloud.appoptimize.v1beta.Scope.ScopeCase getScopeCase(); +} diff --git a/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/proto/google/cloud/appoptimize/v1beta/app_optimize.proto b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/proto/google/cloud/appoptimize/v1beta/app_optimize.proto new file mode 100644 index 000000000000..b5b735beaf1c --- /dev/null +++ b/java-appoptimize/proto-google-cloud-appoptimize-v1beta/src/main/proto/google/cloud/appoptimize/v1beta/app_optimize.proto @@ -0,0 +1,407 @@ +// 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.appoptimize.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/appoptimize/apiv1beta/appoptimizepb;appoptimizepb"; +option java_multiple_files = true; +option java_outer_classname = "AppOptimizeProto"; +option java_package = "com.google.cloud.appoptimize.v1beta"; + +// Resource definition for App Hub Application. +option (google.api.resource_definition) = { + type: "apphub.googleapis.com/Application" + pattern: "projects/{project}/locations/{location}/applications/{application}" +}; + +// Service for managing and querying optimization reports. +service AppOptimize { + option (google.api.default_host) = "appoptimize.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // 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`. + rpc CreateReport(CreateReportRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/reports" + body: "report" + }; + option (google.api.method_signature) = "parent,report,report_id"; + option (google.longrunning.operation_info) = { + response_type: "Report" + metadata_type: "OperationMetadata" + }; + } + + // Retrieves the details of a report configuration. + rpc GetReport(GetReportRequest) returns (Report) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/reports/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists reports within a given project. + rpc ListReports(ListReportsRequest) returns (ListReportsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*}/reports" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes the specified report. + rpc DeleteReport(DeleteReportRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/reports/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Reads data within a specified report. + rpc ReadReport(ReadReportRequest) returns (ReadReportResponse) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/reports/*}:read" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for the `CreateReport` method. +message CreateReportRequest { + // 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}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "appoptimize.googleapis.com/Report" + } + ]; + + // 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). + string report_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The report resource to create. + Report report = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A configuration that defines the parameters for the data represented by a +// report. +message Report { + option (google.api.resource) = { + type: "appoptimize.googleapis.com/Report" + pattern: "projects/{project}/locations/{location}/reports/{report}" + plural: "reports" + singular: "report" + }; + + // Defines this report's expiration time. + oneof expiration { + // Output only. Timestamp in UTC of when this report expires. Once the + // report expires, it will no longer be accessible and the report's + // underlying data will be deleted. + google.protobuf.Timestamp expire_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Identifier. The name of this report. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. A list of dimensions to include in the report. Supported values: + // + // * `project` + // * `application` + // * `service_or_workload` + // * `resource` + // * `resource_type` + // * `location` + // * `product_display_name` + // * `sku` + // * `month` + // * `day` + // * `hour` + // + // To aggregate results by time, specify at least one time dimension + // (`month`, `day`, or `hour`). All time dimensions use Pacific Time, + // respect Daylight Saving Time (DST), and follow these ISO 8601 formats: + // + // * `month`: `YYYY-MM` (e.g., `2024-01`) + // * `day`: `YYYY-MM-DD` (e.g., `2024-01-10`) + // * `hour`: `YYYY-MM-DDTHH` (e.g., `2024-01-10T00`) + // + // If the time range filter does not align with the selected time dimension, + // the range is expanded to encompass the full period of the finest-grained + // time dimension. + // + // For example, if the filter is `2026-01-10` through `2026-01-12` and the + // `month` dimension is selected, the effective time range expands to include + // all of January (`2026-01-01` to `2026-02-01`). + repeated string dimensions = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A list of metrics to include in the report. Supported values: + // + // * `cost` + // * `cpu_mean_utilization` + // * `cpu_usage_core_seconds` + // * `cpu_allocation_core_seconds` + // * `cpu_p95_utilization` + // * `memory_mean_utilization` + // * `memory_usage_byte_seconds` + // * `memory_allocation_byte_seconds` + // * `memory_p95_utilization` + repeated string metrics = 7 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The resource containers for which to fetch data. Default is the + // project specified in the report's parent. + repeated Scope scopes = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A Common Expression Language (CEL) expression used to filter the + // data for the report. + // + // Predicates may refer to any dimension. Filtering must conform to these + // constraints: + // + // * All string field predicates must use exact string matches. + // * Multiple predicates referring to the same string field must be joined + // using the logical OR operator ('||'). + // * All other predicates must be joined using the logical AND operator + // (`&&`). + // * A predicate on a time dimension (e.g., `day`) specifying the start time + // must use a greater-than-or-equal-to comparison (`>=`). + // * A predicate on a time dimension specifying the end time must use a + // less-than comparison (`<`). + // + // Examples: + // + // 1. Filter by a specific resource type: + // `"resource_type == 'compute.googleapis.com/Instance'"` + // + // 2. Filter data points that fall within a specific absolute time interval: + // `"hour >= timestamp('2024-01-01T00:00:00Z') && + // hour < timestamp('2024-02-01T00:00:00Z')"` + // + // 3. Filter data points that fall within the past 72 hours: + // `"hour >= now - duration('72h')"` + // + // 4. Combine string predicate with time interval predicate: + // `"(location == 'us-east1' || location == 'us-west1') && + // hour >= timestamp('2023-12-01T00:00:00Z') && + // hour < timestamp('2024-02-01T00:00:00Z')"` + // + // If the filter omits time dimensions (`month`, `day`, `hour`), the report + // defaults to a 7-day range ending at the previous Pacific Time midnight, + // with Daylight Saving Time (DST) applied. + // + // For example, if the current Pacific Time is `2026-01-05T12:00:00`, + // the default range is `2025-12-29T00:00:00` to `2026-01-05T00:00:00` Pacific + // time. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies the report scope. +message Scope { + oneof scope { + // Required. A Google Cloud Platform project to fetch data from. + // + // Format: `"projects/{project}"`. + string project = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. An App Hub Application to fetch data from. + // + // Format: + // `"projects/{project}/locations/{location}/applications/{application}"`. + string application = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apphub.googleapis.com/Application" + } + ]; + } +} + +// Request message for the `GetReport` method. +message GetReportRequest { + // Required. The name of the report to retrieve. + // + // Format: `projects/{project}/locations/{location}/reports/{report_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "appoptimize.googleapis.com/Report" + } + ]; +} + +// Request message for the `ListReports` method. +message ListReportsRequest { + // Required. The parent project whose reports are to be listed. + // + // Format: `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "appoptimize.googleapis.com/Report" + } + ]; + + // Optional. The maximum number of reports to return. The service may return + // fewer than this value. If unspecified, the server will determine the number + // of results to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListReports` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListReports` must match + // the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the `ListReports` method. +message ListReportsResponse { + // The list of reports. + repeated Report reports = 1; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is empty, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for the `DeleteReport` method. +message DeleteReportRequest { + // Required. The name of the report to delete. + // + // Format: `projects/{project}/locations/{location}/reports/{report_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "appoptimize.googleapis.com/Report" + } + ]; + + // Optional. If set to true, and the report is not found, the request will + // succeed but no action will be taken on the server. + bool allow_missing = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for the `ReadReport` method. +message ReadReportRequest { + // Required. The resource name of the report to query. + // + // Format: `projects/{project}/locations/{location}/reports/{report_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "appoptimize.googleapis.com/Report" + } + ]; + + // Optional. The maximum number of rows to return. The service may return + // fewer than this value. If unspecified, at most 10,000 rows will be returned + // per page. The maximum allowed value is 25,000; values above 25,000 are + // coerced to 25,000. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ReadReport` call, to + // retrieve the subsequent page of results. When `page_token` is specified, + // `job_reference` must also be provided from the previous response, and the + // `statement` field must not be set. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the `ReadReport` method. +message ReadReportResponse { + // A list of rows, where each row represents a record from the report. + repeated google.protobuf.ListValue rows = 1; + + // The columns describing the structure of the data in the `rows` field. + repeated Column columns = 5; + + // A token that can be sent as `page_token` in a subsequent `ReadReport` + // request to retrieve the next page of results. If this field is empty, + // there are no further pages. + string next_page_token = 3; +} + +// Describes a single column within `Columns`. +message Column { + // The name of the column. + // + // This field: + // + // * Contains only letters (a-z, A-Z), numbers (0-9), or underscores (_); + // * Start with a letter or underscore; and + // * Has a maximum length is 128 characters. + string name = 1; + + // The data type of the column. + // + // Supported values include: + // + // * `STRING` + // * `INT64` + // * `FLOAT64` + // * `BOOLEAN` + // * `TIMESTAMP` + // * `RECORD` + // + // `RECORD` indicates that the field contains a nested schema, described in + // the `columns` property of this `Column`. + string type = 2; + + // The mode of the column, indicating if it is nullable, required, or + // repeated. + // + // Possible values: + // + // * `NULLABLE`: The column allows NULL values. + // * `REQUIRED`: The column does not allow NULL values. + // * `REPEATED`: The column contains an array of values. + string mode = 3; + + // If the `type` of this column is `RECORD`, this sub-field describes the + // nested structure. + repeated Column columns = 4; +} + +// Represents metadata related to the creation of a Report. This value is +// embedded in the Operation object returned by `CreateReport`. +message OperationMetadata {} diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/create/SyncCreateSetCredentialsProvider.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..9fe064eb63c7 --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.AppOptimizeSettings; +import com.google.cloud.appoptimize.v1beta.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // 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); + } +} +// [END appoptimize_v1beta_generated_AppOptimize_Create_SetCredentialsProvider_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/create/SyncCreateSetEndpoint.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..f754f9f0d249 --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_Create_SetEndpoint_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.AppOptimizeSettings; +import com.google.cloud.appoptimize.v1beta.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // 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); + } +} +// [END appoptimize_v1beta_generated_AppOptimize_Create_SetEndpoint_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/create/SyncCreateUseHttpJsonTransport.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..344b4ca26387 --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,39 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_Create_UseHttpJsonTransport_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.AppOptimizeSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // 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); + } +} +// [END appoptimize_v1beta_generated_AppOptimize_Create_UseHttpJsonTransport_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/createreport/AsyncCreateReport.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/createreport/AsyncCreateReport.java new file mode 100644 index 000000000000..1f01f905d96a --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/createreport/AsyncCreateReport.java @@ -0,0 +1,52 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_CreateReport_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.CreateReportRequest; +import com.google.cloud.appoptimize.v1beta.LocationName; +import com.google.cloud.appoptimize.v1beta.Report; +import com.google.longrunning.Operation; + +public class AsyncCreateReport { + + public static void main(String[] args) throws Exception { + asyncCreateReport(); + } + + public static void asyncCreateReport() throws Exception { + // 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(); + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_CreateReport_async] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/createreport/AsyncCreateReportLRO.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/createreport/AsyncCreateReportLRO.java new file mode 100644 index 000000000000..a384185daeff --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/createreport/AsyncCreateReportLRO.java @@ -0,0 +1,53 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_CreateReport_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.CreateReportRequest; +import com.google.cloud.appoptimize.v1beta.LocationName; +import com.google.cloud.appoptimize.v1beta.OperationMetadata; +import com.google.cloud.appoptimize.v1beta.Report; + +public class AsyncCreateReportLRO { + + public static void main(String[] args) throws Exception { + asyncCreateReportLRO(); + } + + public static void asyncCreateReportLRO() throws Exception { + // 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(); + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_CreateReport_LRO_async] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/createreport/SyncCreateReport.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/createreport/SyncCreateReport.java new file mode 100644 index 000000000000..db08da135e6c --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/createreport/SyncCreateReport.java @@ -0,0 +1,48 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_CreateReport_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.CreateReportRequest; +import com.google.cloud.appoptimize.v1beta.LocationName; +import com.google.cloud.appoptimize.v1beta.Report; + +public class SyncCreateReport { + + public static void main(String[] args) throws Exception { + syncCreateReport(); + } + + public static void syncCreateReport() throws Exception { + // 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(); + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_CreateReport_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/createreport/SyncCreateReportLocationnameReportString.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/createreport/SyncCreateReportLocationnameReportString.java new file mode 100644 index 000000000000..bae5a4b0b7a2 --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/createreport/SyncCreateReportLocationnameReportString.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_CreateReport_LocationnameReportString_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.LocationName; +import com.google.cloud.appoptimize.v1beta.Report; + +public class SyncCreateReportLocationnameReportString { + + public static void main(String[] args) throws Exception { + syncCreateReportLocationnameReportString(); + } + + public static void syncCreateReportLocationnameReportString() throws Exception { + // 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(); + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_CreateReport_LocationnameReportString_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/createreport/SyncCreateReportStringReportString.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/createreport/SyncCreateReportStringReportString.java new file mode 100644 index 000000000000..4ac320ce47db --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/createreport/SyncCreateReportStringReportString.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_CreateReport_StringReportString_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.LocationName; +import com.google.cloud.appoptimize.v1beta.Report; + +public class SyncCreateReportStringReportString { + + public static void main(String[] args) throws Exception { + syncCreateReportStringReportString(); + } + + public static void syncCreateReportStringReportString() throws Exception { + // 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(); + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_CreateReport_StringReportString_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/deletereport/AsyncDeleteReport.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/deletereport/AsyncDeleteReport.java new file mode 100644 index 000000000000..b1943b4f235c --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/deletereport/AsyncDeleteReport.java @@ -0,0 +1,50 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_DeleteReport_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.DeleteReportRequest; +import com.google.cloud.appoptimize.v1beta.ReportName; +import com.google.protobuf.Empty; + +public class AsyncDeleteReport { + + public static void main(String[] args) throws Exception { + asyncDeleteReport(); + } + + public static void asyncDeleteReport() throws Exception { + // 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(); + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_DeleteReport_async] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/deletereport/SyncDeleteReport.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/deletereport/SyncDeleteReport.java new file mode 100644 index 000000000000..d19ce800c47e --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/deletereport/SyncDeleteReport.java @@ -0,0 +1,47 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_DeleteReport_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.DeleteReportRequest; +import com.google.cloud.appoptimize.v1beta.ReportName; +import com.google.protobuf.Empty; + +public class SyncDeleteReport { + + public static void main(String[] args) throws Exception { + syncDeleteReport(); + } + + public static void syncDeleteReport() throws Exception { + // 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); + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_DeleteReport_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/deletereport/SyncDeleteReportReportname.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/deletereport/SyncDeleteReportReportname.java new file mode 100644 index 000000000000..49f8d6d2b386 --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/deletereport/SyncDeleteReportReportname.java @@ -0,0 +1,42 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_DeleteReport_Reportname_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.ReportName; +import com.google.protobuf.Empty; + +public class SyncDeleteReportReportname { + + public static void main(String[] args) throws Exception { + syncDeleteReportReportname(); + } + + public static void syncDeleteReportReportname() throws Exception { + // 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); + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_DeleteReport_Reportname_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/deletereport/SyncDeleteReportString.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/deletereport/SyncDeleteReportString.java new file mode 100644 index 000000000000..400265bc436e --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/deletereport/SyncDeleteReportString.java @@ -0,0 +1,42 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_DeleteReport_String_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.ReportName; +import com.google.protobuf.Empty; + +public class SyncDeleteReportString { + + public static void main(String[] args) throws Exception { + syncDeleteReportString(); + } + + public static void syncDeleteReportString() throws Exception { + // 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); + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_DeleteReport_String_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getlocation/AsyncGetLocation.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..7fc015b9c24a --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // 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(); + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_GetLocation_async] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getlocation/SyncGetLocation.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..ce61c272671a --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_GetLocation_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // 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); + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_GetLocation_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getreport/AsyncGetReport.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getreport/AsyncGetReport.java new file mode 100644 index 000000000000..b16f6a51e33a --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getreport/AsyncGetReport.java @@ -0,0 +1,49 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_GetReport_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.GetReportRequest; +import com.google.cloud.appoptimize.v1beta.Report; +import com.google.cloud.appoptimize.v1beta.ReportName; + +public class AsyncGetReport { + + public static void main(String[] args) throws Exception { + asyncGetReport(); + } + + public static void asyncGetReport() throws Exception { + // 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(); + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_GetReport_async] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getreport/SyncGetReport.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getreport/SyncGetReport.java new file mode 100644 index 000000000000..cd11e4517f0a --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getreport/SyncGetReport.java @@ -0,0 +1,46 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_GetReport_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.GetReportRequest; +import com.google.cloud.appoptimize.v1beta.Report; +import com.google.cloud.appoptimize.v1beta.ReportName; + +public class SyncGetReport { + + public static void main(String[] args) throws Exception { + syncGetReport(); + } + + public static void syncGetReport() throws Exception { + // 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); + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_GetReport_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getreport/SyncGetReportReportname.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getreport/SyncGetReportReportname.java new file mode 100644 index 000000000000..a1b30fe1d969 --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getreport/SyncGetReportReportname.java @@ -0,0 +1,42 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_GetReport_Reportname_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.Report; +import com.google.cloud.appoptimize.v1beta.ReportName; + +public class SyncGetReportReportname { + + public static void main(String[] args) throws Exception { + syncGetReportReportname(); + } + + public static void syncGetReportReportname() throws Exception { + // 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); + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_GetReport_Reportname_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getreport/SyncGetReportString.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getreport/SyncGetReportString.java new file mode 100644 index 000000000000..3c39cafc7d6f --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/getreport/SyncGetReportString.java @@ -0,0 +1,42 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_GetReport_String_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.Report; +import com.google.cloud.appoptimize.v1beta.ReportName; + +public class SyncGetReportString { + + public static void main(String[] args) throws Exception { + syncGetReportString(); + } + + public static void syncGetReportString() throws Exception { + // 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); + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_GetReport_String_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listlocations/AsyncListLocations.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..0f01fa6fdab4 --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // 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); + } + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_ListLocations_async] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listlocations/AsyncListLocationsPaged.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..714a1531ae71 --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_ListLocations_Paged_async] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // 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; + } + } + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_ListLocations_Paged_async] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listlocations/SyncListLocations.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..532373c3fe50 --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_ListLocations_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // 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); + } + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_ListLocations_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listreports/AsyncListReports.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listreports/AsyncListReports.java new file mode 100644 index 000000000000..3c972e26daca --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listreports/AsyncListReports.java @@ -0,0 +1,53 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_ListReports_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.ListReportsRequest; +import com.google.cloud.appoptimize.v1beta.LocationName; +import com.google.cloud.appoptimize.v1beta.Report; + +public class AsyncListReports { + + public static void main(String[] args) throws Exception { + asyncListReports(); + } + + public static void asyncListReports() throws Exception { + // 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); + } + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_ListReports_async] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listreports/AsyncListReportsPaged.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listreports/AsyncListReportsPaged.java new file mode 100644 index 000000000000..c254029d21fc --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listreports/AsyncListReportsPaged.java @@ -0,0 +1,61 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_ListReports_Paged_async] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.ListReportsRequest; +import com.google.cloud.appoptimize.v1beta.ListReportsResponse; +import com.google.cloud.appoptimize.v1beta.LocationName; +import com.google.cloud.appoptimize.v1beta.Report; +import com.google.common.base.Strings; + +public class AsyncListReportsPaged { + + public static void main(String[] args) throws Exception { + asyncListReportsPaged(); + } + + public static void asyncListReportsPaged() throws Exception { + // 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; + } + } + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_ListReports_Paged_async] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listreports/SyncListReports.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listreports/SyncListReports.java new file mode 100644 index 000000000000..2de351c397c9 --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listreports/SyncListReports.java @@ -0,0 +1,50 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_ListReports_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.ListReportsRequest; +import com.google.cloud.appoptimize.v1beta.LocationName; +import com.google.cloud.appoptimize.v1beta.Report; + +public class SyncListReports { + + public static void main(String[] args) throws Exception { + syncListReports(); + } + + public static void syncListReports() throws Exception { + // 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); + } + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_ListReports_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listreports/SyncListReportsLocationname.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listreports/SyncListReportsLocationname.java new file mode 100644 index 000000000000..a84fcbd6985f --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listreports/SyncListReportsLocationname.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_ListReports_Locationname_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.LocationName; +import com.google.cloud.appoptimize.v1beta.Report; + +public class SyncListReportsLocationname { + + public static void main(String[] args) throws Exception { + syncListReportsLocationname(); + } + + public static void syncListReportsLocationname() throws Exception { + // 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); + } + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_ListReports_Locationname_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listreports/SyncListReportsString.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listreports/SyncListReportsString.java new file mode 100644 index 000000000000..4f71837508b4 --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/listreports/SyncListReportsString.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_ListReports_String_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.LocationName; +import com.google.cloud.appoptimize.v1beta.Report; + +public class SyncListReportsString { + + public static void main(String[] args) throws Exception { + syncListReportsString(); + } + + public static void syncListReportsString() throws Exception { + // 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); + } + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_ListReports_String_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/readreport/AsyncReadReport.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/readreport/AsyncReadReport.java new file mode 100644 index 000000000000..d8434e09ab81 --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/readreport/AsyncReadReport.java @@ -0,0 +1,53 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_ReadReport_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.ReadReportRequest; +import com.google.cloud.appoptimize.v1beta.ReportName; +import com.google.protobuf.ListValue; + +public class AsyncReadReport { + + public static void main(String[] args) throws Exception { + asyncReadReport(); + } + + public static void asyncReadReport() throws Exception { + // 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); + } + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_ReadReport_async] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/readreport/AsyncReadReportPaged.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/readreport/AsyncReadReportPaged.java new file mode 100644 index 000000000000..7a3dd778514d --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/readreport/AsyncReadReportPaged.java @@ -0,0 +1,61 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_ReadReport_Paged_async] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.ReadReportRequest; +import com.google.cloud.appoptimize.v1beta.ReadReportResponse; +import com.google.cloud.appoptimize.v1beta.ReportName; +import com.google.common.base.Strings; +import com.google.protobuf.ListValue; + +public class AsyncReadReportPaged { + + public static void main(String[] args) throws Exception { + asyncReadReportPaged(); + } + + public static void asyncReadReportPaged() throws Exception { + // 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; + } + } + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_ReadReport_Paged_async] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/readreport/SyncReadReport.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/readreport/SyncReadReport.java new file mode 100644 index 000000000000..5fba9575e34d --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/readreport/SyncReadReport.java @@ -0,0 +1,50 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_ReadReport_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.ReadReportRequest; +import com.google.cloud.appoptimize.v1beta.ReportName; +import com.google.protobuf.ListValue; + +public class SyncReadReport { + + public static void main(String[] args) throws Exception { + syncReadReport(); + } + + public static void syncReadReport() throws Exception { + // 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); + } + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_ReadReport_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/readreport/SyncReadReportReportname.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/readreport/SyncReadReportReportname.java new file mode 100644 index 000000000000..76321d84771c --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/readreport/SyncReadReportReportname.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_ReadReport_Reportname_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.ReportName; +import com.google.protobuf.ListValue; + +public class SyncReadReportReportname { + + public static void main(String[] args) throws Exception { + syncReadReportReportname(); + } + + public static void syncReadReportReportname() throws Exception { + // 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); + } + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_ReadReport_Reportname_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/readreport/SyncReadReportString.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/readreport/SyncReadReportString.java new file mode 100644 index 000000000000..a1d910025fa3 --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimize/readreport/SyncReadReportString.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimize_ReadReport_String_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeClient; +import com.google.cloud.appoptimize.v1beta.ReportName; +import com.google.protobuf.ListValue; + +public class SyncReadReportString { + + public static void main(String[] args) throws Exception { + syncReadReportString(); + } + + public static void syncReadReportString() throws Exception { + // 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); + } + } + } +} +// [END appoptimize_v1beta_generated_AppOptimize_ReadReport_String_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimizesettings/createreport/SyncCreateReport.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimizesettings/createreport/SyncCreateReport.java new file mode 100644 index 000000000000..f08b548fe749 --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimizesettings/createreport/SyncCreateReport.java @@ -0,0 +1,53 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimizeSettings_CreateReport_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.appoptimize.v1beta.AppOptimizeSettings; +import java.time.Duration; + +public class SyncCreateReport { + + public static void main(String[] args) throws Exception { + syncCreateReport(); + } + + public static void syncCreateReport() throws Exception { + // 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(); + } +} +// [END appoptimize_v1beta_generated_AppOptimizeSettings_CreateReport_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimizesettings/getreport/SyncGetReport.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimizesettings/getreport/SyncGetReport.java new file mode 100644 index 000000000000..b5c548b8b5ed --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/appoptimizesettings/getreport/SyncGetReport.java @@ -0,0 +1,55 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimizeSettings_GetReport_sync] +import com.google.cloud.appoptimize.v1beta.AppOptimizeSettings; +import java.time.Duration; + +public class SyncGetReport { + + public static void main(String[] args) throws Exception { + syncGetReport(); + } + + public static void syncGetReport() throws Exception { + // 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(); + } +} +// [END appoptimize_v1beta_generated_AppOptimizeSettings_GetReport_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/stub/appoptimizestubsettings/createreport/SyncCreateReport.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/stub/appoptimizestubsettings/createreport/SyncCreateReport.java new file mode 100644 index 000000000000..76894a28c7bd --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/stub/appoptimizestubsettings/createreport/SyncCreateReport.java @@ -0,0 +1,54 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimizeStubSettings_CreateReport_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.appoptimize.v1beta.stub.AppOptimizeStubSettings; +import java.time.Duration; + +public class SyncCreateReport { + + public static void main(String[] args) throws Exception { + syncCreateReport(); + } + + public static void syncCreateReport() throws Exception { + // 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(); + } +} +// [END appoptimize_v1beta_generated_AppOptimizeStubSettings_CreateReport_sync] diff --git a/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/stub/appoptimizestubsettings/getreport/SyncGetReport.java b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/stub/appoptimizestubsettings/getreport/SyncGetReport.java new file mode 100644 index 000000000000..e262f3169d53 --- /dev/null +++ b/java-appoptimize/samples/snippets/generated/com/google/cloud/appoptimize/v1beta/stub/appoptimizestubsettings/getreport/SyncGetReport.java @@ -0,0 +1,56 @@ +/* + * 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.samples; + +// [START appoptimize_v1beta_generated_AppOptimizeStubSettings_GetReport_sync] +import com.google.cloud.appoptimize.v1beta.stub.AppOptimizeStubSettings; +import java.time.Duration; + +public class SyncGetReport { + + public static void main(String[] args) throws Exception { + syncGetReport(); + } + + public static void syncGetReport() throws Exception { + // 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(); + } +} +// [END appoptimize_v1beta_generated_AppOptimizeStubSettings_GetReport_sync] diff --git a/pom.xml b/pom.xml index 4655a17f2e0d..a30ce4561cd9 100644 --- a/pom.xml +++ b/pom.xml @@ -32,6 +32,7 @@ java-apikeys java-appengine-admin java-apphub + java-appoptimize java-area120-tables java-artifact-registry java-asset diff --git a/versions.txt b/versions.txt index 1fc327b4bb5b..0749d580d29c 100644 --- a/versions.txt +++ b/versions.txt @@ -1031,3 +1031,6 @@ google-maps-geocode:0.0.0:0.0.1-SNAPSHOT proto-google-maps-geocode-v4:0.0.0:0.0.1-SNAPSHOT grpc-google-maps-geocode-v4:0.0.0:0.0.1-SNAPSHOT google-cloud-nio:0.128.14:0.128.15-SNAPSHOT +google-cloud-appoptimize:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-appoptimize-v1beta:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-appoptimize-v1beta:0.0.0:0.0.1-SNAPSHOT