diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index 5f9cfdaf53b1..4099cebd8ff9 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -903,6 +903,13 @@ pom import + + com.google.cloud + google-cloud-storageinsights-bom + 0.0.1-SNAPSHOT + pom + import + com.google.cloud google-cloud-storage-transfer-bom diff --git a/java-storageinsights/.OwlBot.yaml b/java-storageinsights/.OwlBot.yaml new file mode 100644 index 000000000000..f1bea3025b34 --- /dev/null +++ b/java-storageinsights/.OwlBot.yaml @@ -0,0 +1,36 @@ +# Copyright 2022 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-storageinsights/grpc-google-.*/src" +- "/java-storageinsights/proto-google-.*/src" +- "/java-storageinsights/google-.*/src" +- "/java-storageinsights/samples/snippets/generated" + +deep-preserve-regex: +- "/java-storageinsights/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/cloud/storageinsights/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-storageinsights/$1/proto-google-cloud-storageinsights-$1/src" +- source: "/google/cloud/storageinsights/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-storageinsights/$1/grpc-google-cloud-storageinsights-$1/src" +- source: "/google/cloud/storageinsights/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-storageinsights/$1/google-cloud-storageinsights/src" +- source: "/google/cloud/storageinsights/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-storageinsights/$1/samples/snippets/generated" + + +api-name: storageinsights \ No newline at end of file diff --git a/java-storageinsights/.repo-metadata.json b/java-storageinsights/.repo-metadata.json new file mode 100644 index 000000000000..e7655bef068c --- /dev/null +++ b/java-storageinsights/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "storageinsights", + "name_pretty": "Storage Insights API", + "product_documentation": "https://cloud.google.com/storage/docs/insights/storage-insights/", + "api_description": "Provides insights capability on Google Cloud Storage", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-storageinsights/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-storageinsights", + "repo_short": "java-storageinsights", + "distribution_name": "com.google.cloud:google-cloud-storageinsights", + "api_id": "storageinsights.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-storageinsights/README.md b/java-storageinsights/README.md new file mode 100644 index 000000000000..3d622d187d9b --- /dev/null +++ b/java-storageinsights/README.md @@ -0,0 +1,225 @@ +# Google Storage Insights API Client for Java + +Java idiomatic client for [Storage Insights 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.13.0 + pom + import + + + + + + + com.google.cloud + google-cloud-storageinsights + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.cloud + google-cloud-storageinsights + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-storageinsights:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-storageinsights" % "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 Storage Insights API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Storage Insights API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Storage Insights API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Storage Insights 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-storageinsights` library. See the [Quickstart](#quickstart) section +to add `google-cloud-storageinsights` as a dependency in your code. + +## About Storage Insights API + + +[Storage Insights API][product-docs] Provides insights capability on Google Cloud Storage + +See the [Storage Insights API client library docs][javadocs] to learn how to +use this Storage Insights API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Storage Insights API uses gRPC 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. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/storage/docs/insights/storage-insights/ +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-storageinsights/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storageinsights/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storageinsights/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storageinsights/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storageinsights/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storageinsights/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storageinsights/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storageinsights/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storageinsights/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storageinsights/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storageinsights/java11.html +[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-storageinsights.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-storageinsights/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/java-storageinsights/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-storageinsights/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-storageinsights/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=storageinsights.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-storageinsights/google-cloud-storageinsights-bom/pom.xml b/java-storageinsights/google-cloud-storageinsights-bom/pom.xml new file mode 100644 index 000000000000..2926dd44c731 --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights-bom/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + com.google.cloud + google-cloud-storageinsights-bom + 0.0.1-SNAPSHOT + pom + + + com.google.cloud + google-cloud-pom-parent + 1.10.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Storage Insights API BOM + + BOM for Storage Insights API + + + + true + + + + + + com.google.cloud + google-cloud-storageinsights + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-storageinsights-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-storageinsights-v1 + 0.0.1-SNAPSHOT + + + + diff --git a/java-storageinsights/google-cloud-storageinsights/pom.xml b/java-storageinsights/google-cloud-storageinsights/pom.xml new file mode 100644 index 000000000000..2f6530ed6624 --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.cloud + google-cloud-storageinsights + 0.0.1-SNAPSHOT + jar + Google Storage Insights API + Storage Insights API Provides insights capability on Google Cloud Storage + + com.google.cloud + google-cloud-storageinsights-parent + 0.0.1-SNAPSHOT + + + google-cloud-storageinsights + + + + 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-storageinsights-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.api.grpc + grpc-google-cloud-storageinsights-v1 + 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-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/StorageInsightsClient.java b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/StorageInsightsClient.java new file mode 100644 index 000000000000..fed01f9e1b61 --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/StorageInsightsClient.java @@ -0,0 +1,1512 @@ +/* + * Copyright 2022 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.storageinsights.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.storageinsights.v1.stub.StorageInsightsStub; +import com.google.cloud.storageinsights.v1.stub.StorageInsightsStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +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 describing handlers for resources + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+ *   ReportConfigName name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]");
+ *   ReportConfig response = storageInsightsClient.getReportConfig(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the StorageInsightsClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of StorageInsightsSettings 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
+ * StorageInsightsSettings storageInsightsSettings =
+ *     StorageInsightsSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * StorageInsightsClient storageInsightsClient =
+ *     StorageInsightsClient.create(storageInsightsSettings);
+ * }
+ * + *

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
+ * StorageInsightsSettings storageInsightsSettings =
+ *     StorageInsightsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * StorageInsightsClient storageInsightsClient =
+ *     StorageInsightsClient.create(storageInsightsSettings);
+ * }
+ * + *

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
+ * StorageInsightsSettings storageInsightsSettings =
+ *     StorageInsightsSettings.newHttpJsonBuilder().build();
+ * StorageInsightsClient storageInsightsClient =
+ *     StorageInsightsClient.create(storageInsightsSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class StorageInsightsClient implements BackgroundResource { + private final StorageInsightsSettings settings; + private final StorageInsightsStub stub; + + /** Constructs an instance of StorageInsightsClient with default settings. */ + public static final StorageInsightsClient create() throws IOException { + return create(StorageInsightsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of StorageInsightsClient, 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 StorageInsightsClient create(StorageInsightsSettings settings) + throws IOException { + return new StorageInsightsClient(settings); + } + + /** + * Constructs an instance of StorageInsightsClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(StorageInsightsSettings). + */ + public static final StorageInsightsClient create(StorageInsightsStub stub) { + return new StorageInsightsClient(stub); + } + + /** + * Constructs an instance of StorageInsightsClient, 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 StorageInsightsClient(StorageInsightsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((StorageInsightsStubSettings) settings.getStubSettings()).createStub(); + } + + protected StorageInsightsClient(StorageInsightsStub stub) { + this.settings = null; + this.stub = stub; + } + + public final StorageInsightsSettings getSettings() { + return settings; + } + + public StorageInsightsStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ReportConfigs in a given project and 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (ReportConfig element : storageInsightsClient.listReportConfigs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListReportConfigsRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListReportConfigsPagedResponse listReportConfigs(LocationName parent) { + ListReportConfigsRequest request = + ListReportConfigsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listReportConfigs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ReportConfigs in a given project and 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (ReportConfig element : storageInsightsClient.listReportConfigs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListReportConfigsRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListReportConfigsPagedResponse listReportConfigs(String parent) { + ListReportConfigsRequest request = + ListReportConfigsRequest.newBuilder().setParent(parent).build(); + return listReportConfigs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ReportConfigs in a given project and 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   ListReportConfigsRequest request =
+   *       ListReportConfigsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (ReportConfig element : storageInsightsClient.listReportConfigs(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 ListReportConfigsPagedResponse listReportConfigs(ListReportConfigsRequest request) { + return listReportConfigsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ReportConfigs in a given project and 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   ListReportConfigsRequest request =
+   *       ListReportConfigsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       storageInsightsClient.listReportConfigsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (ReportConfig element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listReportConfigsPagedCallable() { + return stub.listReportConfigsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ReportConfigs in a given project and 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   ListReportConfigsRequest request =
+   *       ListReportConfigsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListReportConfigsResponse response =
+   *         storageInsightsClient.listReportConfigsCallable().call(request);
+   *     for (ReportConfig element : response.getReportConfigsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listReportConfigsCallable() { + return stub.listReportConfigsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ReportConfig. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   ReportConfigName name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]");
+   *   ReportConfig response = storageInsightsClient.getReportConfig(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ReportConfig getReportConfig(ReportConfigName name) { + GetReportConfigRequest request = + GetReportConfigRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getReportConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ReportConfig. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   String name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString();
+   *   ReportConfig response = storageInsightsClient.getReportConfig(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ReportConfig getReportConfig(String name) { + GetReportConfigRequest request = GetReportConfigRequest.newBuilder().setName(name).build(); + return getReportConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ReportConfig. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   GetReportConfigRequest request =
+   *       GetReportConfigRequest.newBuilder()
+   *           .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString())
+   *           .build();
+   *   ReportConfig response = storageInsightsClient.getReportConfig(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 ReportConfig getReportConfig(GetReportConfigRequest request) { + return getReportConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ReportConfig. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   GetReportConfigRequest request =
+   *       GetReportConfigRequest.newBuilder()
+   *           .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       storageInsightsClient.getReportConfigCallable().futureCall(request);
+   *   // Do something.
+   *   ReportConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getReportConfigCallable() { + return stub.getReportConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ReportConfig in a given project and 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ReportConfig reportConfig = ReportConfig.newBuilder().build();
+   *   ReportConfig response = storageInsightsClient.createReportConfig(parent, reportConfig);
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + * @param reportConfig Required. The resource being created + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ReportConfig createReportConfig(LocationName parent, ReportConfig reportConfig) { + CreateReportConfigRequest request = + CreateReportConfigRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setReportConfig(reportConfig) + .build(); + return createReportConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ReportConfig in a given project and 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   ReportConfig reportConfig = ReportConfig.newBuilder().build();
+   *   ReportConfig response = storageInsightsClient.createReportConfig(parent, reportConfig);
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + * @param reportConfig Required. The resource being created + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ReportConfig createReportConfig(String parent, ReportConfig reportConfig) { + CreateReportConfigRequest request = + CreateReportConfigRequest.newBuilder() + .setParent(parent) + .setReportConfig(reportConfig) + .build(); + return createReportConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ReportConfig in a given project and 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   CreateReportConfigRequest request =
+   *       CreateReportConfigRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setReportConfig(ReportConfig.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ReportConfig response = storageInsightsClient.createReportConfig(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 ReportConfig createReportConfig(CreateReportConfigRequest request) { + return createReportConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new ReportConfig in a given project and 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   CreateReportConfigRequest request =
+   *       CreateReportConfigRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setReportConfig(ReportConfig.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       storageInsightsClient.createReportConfigCallable().futureCall(request);
+   *   // Do something.
+   *   ReportConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createReportConfigCallable() { + return stub.createReportConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single ReportConfig. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   ReportConfig reportConfig = ReportConfig.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   ReportConfig response = storageInsightsClient.updateReportConfig(reportConfig, updateMask);
+   * }
+   * }
+ * + * @param reportConfig Required. The resource being updated + * @param updateMask Required. Field mask is used to specify the fields to be overwritten in the + * ReportConfig resource by the update. The fields specified in the update_mask are relative + * to the resource, not the full request. A field will be overwritten if it is in the mask. If + * the user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ReportConfig updateReportConfig(ReportConfig reportConfig, FieldMask updateMask) { + UpdateReportConfigRequest request = + UpdateReportConfigRequest.newBuilder() + .setReportConfig(reportConfig) + .setUpdateMask(updateMask) + .build(); + return updateReportConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single ReportConfig. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   UpdateReportConfigRequest request =
+   *       UpdateReportConfigRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setReportConfig(ReportConfig.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ReportConfig response = storageInsightsClient.updateReportConfig(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 ReportConfig updateReportConfig(UpdateReportConfigRequest request) { + return updateReportConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single ReportConfig. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   UpdateReportConfigRequest request =
+   *       UpdateReportConfigRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setReportConfig(ReportConfig.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       storageInsightsClient.updateReportConfigCallable().futureCall(request);
+   *   // Do something.
+   *   ReportConfig response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateReportConfigCallable() { + return stub.updateReportConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ReportConfig. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   ReportConfigName name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]");
+   *   storageInsightsClient.deleteReportConfig(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteReportConfig(ReportConfigName name) { + DeleteReportConfigRequest request = + DeleteReportConfigRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteReportConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ReportConfig. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   String name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString();
+   *   storageInsightsClient.deleteReportConfig(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteReportConfig(String name) { + DeleteReportConfigRequest request = + DeleteReportConfigRequest.newBuilder().setName(name).build(); + deleteReportConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ReportConfig. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   DeleteReportConfigRequest request =
+   *       DeleteReportConfigRequest.newBuilder()
+   *           .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString())
+   *           .setForce(true)
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   storageInsightsClient.deleteReportConfig(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 deleteReportConfig(DeleteReportConfigRequest request) { + deleteReportConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single ReportConfig. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   DeleteReportConfigRequest request =
+   *       DeleteReportConfigRequest.newBuilder()
+   *           .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString())
+   *           .setForce(true)
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       storageInsightsClient.deleteReportConfigCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteReportConfigCallable() { + return stub.deleteReportConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ReportDetails in a given project and 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   ReportConfigName parent = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]");
+   *   for (ReportDetail element : storageInsightsClient.listReportDetails(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListReportDetailsRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListReportDetailsPagedResponse listReportDetails(ReportConfigName parent) { + ListReportDetailsRequest request = + ListReportDetailsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listReportDetails(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ReportDetails in a given project and 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   String parent = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString();
+   *   for (ReportDetail element : storageInsightsClient.listReportDetails(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListReportDetailsRequest + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListReportDetailsPagedResponse listReportDetails(String parent) { + ListReportDetailsRequest request = + ListReportDetailsRequest.newBuilder().setParent(parent).build(); + return listReportDetails(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ReportDetails in a given project and 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   ListReportDetailsRequest request =
+   *       ListReportDetailsRequest.newBuilder()
+   *           .setParent(
+   *               ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (ReportDetail element : storageInsightsClient.listReportDetails(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 ListReportDetailsPagedResponse listReportDetails(ListReportDetailsRequest request) { + return listReportDetailsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ReportDetails in a given project and 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   ListReportDetailsRequest request =
+   *       ListReportDetailsRequest.newBuilder()
+   *           .setParent(
+   *               ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       storageInsightsClient.listReportDetailsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (ReportDetail element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listReportDetailsPagedCallable() { + return stub.listReportDetailsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ReportDetails in a given project and 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   ListReportDetailsRequest request =
+   *       ListReportDetailsRequest.newBuilder()
+   *           .setParent(
+   *               ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListReportDetailsResponse response =
+   *         storageInsightsClient.listReportDetailsCallable().call(request);
+   *     for (ReportDetail element : response.getReportDetailsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listReportDetailsCallable() { + return stub.listReportDetailsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ReportDetail. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   ReportDetailName name =
+   *       ReportDetailName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]", "[REPORT_DETAIL]");
+   *   ReportDetail response = storageInsightsClient.getReportDetail(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ReportDetail getReportDetail(ReportDetailName name) { + GetReportDetailRequest request = + GetReportDetailRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getReportDetail(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ReportDetail. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   String name =
+   *       ReportDetailName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]", "[REPORT_DETAIL]")
+   *           .toString();
+   *   ReportDetail response = storageInsightsClient.getReportDetail(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ReportDetail getReportDetail(String name) { + GetReportDetailRequest request = GetReportDetailRequest.newBuilder().setName(name).build(); + return getReportDetail(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ReportDetail. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   GetReportDetailRequest request =
+   *       GetReportDetailRequest.newBuilder()
+   *           .setName(
+   *               ReportDetailName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]", "[REPORT_DETAIL]")
+   *                   .toString())
+   *           .build();
+   *   ReportDetail response = storageInsightsClient.getReportDetail(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 ReportDetail getReportDetail(GetReportDetailRequest request) { + return getReportDetailCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single ReportDetail. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   GetReportDetailRequest request =
+   *       GetReportDetailRequest.newBuilder()
+   *           .setName(
+   *               ReportDetailName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]", "[REPORT_DETAIL]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       storageInsightsClient.getReportDetailCallable().futureCall(request);
+   *   // Do something.
+   *   ReportDetail response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getReportDetailCallable() { + return stub.getReportDetailCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : storageInsightsClient.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. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       storageInsightsClient.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. + * + *

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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         storageInsightsClient.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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = storageInsightsClient.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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = storageInsightsClient.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 ListReportConfigsPagedResponse + extends AbstractPagedListResponse< + ListReportConfigsRequest, + ListReportConfigsResponse, + ReportConfig, + ListReportConfigsPage, + ListReportConfigsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListReportConfigsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListReportConfigsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListReportConfigsPagedResponse(ListReportConfigsPage page) { + super(page, ListReportConfigsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListReportConfigsPage + extends AbstractPage< + ListReportConfigsRequest, + ListReportConfigsResponse, + ReportConfig, + ListReportConfigsPage> { + + private ListReportConfigsPage( + PageContext context, + ListReportConfigsResponse response) { + super(context, response); + } + + private static ListReportConfigsPage createEmptyPage() { + return new ListReportConfigsPage(null, null); + } + + @Override + protected ListReportConfigsPage createPage( + PageContext context, + ListReportConfigsResponse response) { + return new ListReportConfigsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListReportConfigsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListReportConfigsRequest, + ListReportConfigsResponse, + ReportConfig, + ListReportConfigsPage, + ListReportConfigsFixedSizeCollection> { + + private ListReportConfigsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListReportConfigsFixedSizeCollection createEmptyCollection() { + return new ListReportConfigsFixedSizeCollection(null, 0); + } + + @Override + protected ListReportConfigsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListReportConfigsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListReportDetailsPagedResponse + extends AbstractPagedListResponse< + ListReportDetailsRequest, + ListReportDetailsResponse, + ReportDetail, + ListReportDetailsPage, + ListReportDetailsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListReportDetailsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListReportDetailsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListReportDetailsPagedResponse(ListReportDetailsPage page) { + super(page, ListReportDetailsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListReportDetailsPage + extends AbstractPage< + ListReportDetailsRequest, + ListReportDetailsResponse, + ReportDetail, + ListReportDetailsPage> { + + private ListReportDetailsPage( + PageContext context, + ListReportDetailsResponse response) { + super(context, response); + } + + private static ListReportDetailsPage createEmptyPage() { + return new ListReportDetailsPage(null, null); + } + + @Override + protected ListReportDetailsPage createPage( + PageContext context, + ListReportDetailsResponse response) { + return new ListReportDetailsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListReportDetailsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListReportDetailsRequest, + ListReportDetailsResponse, + ReportDetail, + ListReportDetailsPage, + ListReportDetailsFixedSizeCollection> { + + private ListReportDetailsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListReportDetailsFixedSizeCollection createEmptyCollection() { + return new ListReportDetailsFixedSizeCollection(null, 0); + } + + @Override + protected ListReportDetailsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListReportDetailsFixedSizeCollection(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-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/StorageInsightsSettings.java b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/StorageInsightsSettings.java new file mode 100644 index 000000000000..dbf2a954e62f --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/StorageInsightsSettings.java @@ -0,0 +1,312 @@ +/* + * Copyright 2022 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.storageinsights.v1; + +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListLocationsPagedResponse; +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListReportConfigsPagedResponse; +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListReportDetailsPagedResponse; + +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.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +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.storageinsights.v1.stub.StorageInsightsStubSettings; +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 StorageInsightsClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (storageinsights.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getReportConfig to 30 seconds: + * + *

{@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
+ * StorageInsightsSettings.Builder storageInsightsSettingsBuilder =
+ *     StorageInsightsSettings.newBuilder();
+ * storageInsightsSettingsBuilder
+ *     .getReportConfigSettings()
+ *     .setRetrySettings(
+ *         storageInsightsSettingsBuilder
+ *             .getReportConfigSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * StorageInsightsSettings storageInsightsSettings = storageInsightsSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class StorageInsightsSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listReportConfigs. */ + public PagedCallSettings< + ListReportConfigsRequest, ListReportConfigsResponse, ListReportConfigsPagedResponse> + listReportConfigsSettings() { + return ((StorageInsightsStubSettings) getStubSettings()).listReportConfigsSettings(); + } + + /** Returns the object with the settings used for calls to getReportConfig. */ + public UnaryCallSettings getReportConfigSettings() { + return ((StorageInsightsStubSettings) getStubSettings()).getReportConfigSettings(); + } + + /** Returns the object with the settings used for calls to createReportConfig. */ + public UnaryCallSettings createReportConfigSettings() { + return ((StorageInsightsStubSettings) getStubSettings()).createReportConfigSettings(); + } + + /** Returns the object with the settings used for calls to updateReportConfig. */ + public UnaryCallSettings updateReportConfigSettings() { + return ((StorageInsightsStubSettings) getStubSettings()).updateReportConfigSettings(); + } + + /** Returns the object with the settings used for calls to deleteReportConfig. */ + public UnaryCallSettings deleteReportConfigSettings() { + return ((StorageInsightsStubSettings) getStubSettings()).deleteReportConfigSettings(); + } + + /** Returns the object with the settings used for calls to listReportDetails. */ + public PagedCallSettings< + ListReportDetailsRequest, ListReportDetailsResponse, ListReportDetailsPagedResponse> + listReportDetailsSettings() { + return ((StorageInsightsStubSettings) getStubSettings()).listReportDetailsSettings(); + } + + /** Returns the object with the settings used for calls to getReportDetail. */ + public UnaryCallSettings getReportDetailSettings() { + return ((StorageInsightsStubSettings) getStubSettings()).getReportDetailSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((StorageInsightsStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((StorageInsightsStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final StorageInsightsSettings create(StorageInsightsStubSettings stub) + throws IOException { + return new StorageInsightsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return StorageInsightsStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return StorageInsightsStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return StorageInsightsStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return StorageInsightsStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return StorageInsightsStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return StorageInsightsStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return StorageInsightsStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return StorageInsightsStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + 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 StorageInsightsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for StorageInsightsSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(StorageInsightsStubSettings.newBuilder(clientContext)); + } + + protected Builder(StorageInsightsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(StorageInsightsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(StorageInsightsStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(StorageInsightsStubSettings.newHttpJsonBuilder()); + } + + public StorageInsightsStubSettings.Builder getStubSettingsBuilder() { + return ((StorageInsightsStubSettings.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 listReportConfigs. */ + public PagedCallSettings.Builder< + ListReportConfigsRequest, ListReportConfigsResponse, ListReportConfigsPagedResponse> + listReportConfigsSettings() { + return getStubSettingsBuilder().listReportConfigsSettings(); + } + + /** Returns the builder for the settings used for calls to getReportConfig. */ + public UnaryCallSettings.Builder + getReportConfigSettings() { + return getStubSettingsBuilder().getReportConfigSettings(); + } + + /** Returns the builder for the settings used for calls to createReportConfig. */ + public UnaryCallSettings.Builder + createReportConfigSettings() { + return getStubSettingsBuilder().createReportConfigSettings(); + } + + /** Returns the builder for the settings used for calls to updateReportConfig. */ + public UnaryCallSettings.Builder + updateReportConfigSettings() { + return getStubSettingsBuilder().updateReportConfigSettings(); + } + + /** Returns the builder for the settings used for calls to deleteReportConfig. */ + public UnaryCallSettings.Builder + deleteReportConfigSettings() { + return getStubSettingsBuilder().deleteReportConfigSettings(); + } + + /** Returns the builder for the settings used for calls to listReportDetails. */ + public PagedCallSettings.Builder< + ListReportDetailsRequest, ListReportDetailsResponse, ListReportDetailsPagedResponse> + listReportDetailsSettings() { + return getStubSettingsBuilder().listReportDetailsSettings(); + } + + /** Returns the builder for the settings used for calls to getReportDetail. */ + public UnaryCallSettings.Builder + getReportDetailSettings() { + return getStubSettingsBuilder().getReportDetailSettings(); + } + + /** 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 StorageInsightsSettings build() throws IOException { + return new StorageInsightsSettings(this); + } + } +} diff --git a/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/gapic_metadata.json b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/gapic_metadata.json new file mode 100644 index 000000000000..b0fbc4a38c3f --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/gapic_metadata.json @@ -0,0 +1,45 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.storageinsights.v1", + "libraryPackage": "com.google.cloud.storageinsights.v1", + "services": { + "StorageInsights": { + "clients": { + "grpc": { + "libraryClient": "StorageInsightsClient", + "rpcs": { + "CreateReportConfig": { + "methods": ["createReportConfig", "createReportConfig", "createReportConfig", "createReportConfigCallable"] + }, + "DeleteReportConfig": { + "methods": ["deleteReportConfig", "deleteReportConfig", "deleteReportConfig", "deleteReportConfigCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetReportConfig": { + "methods": ["getReportConfig", "getReportConfig", "getReportConfig", "getReportConfigCallable"] + }, + "GetReportDetail": { + "methods": ["getReportDetail", "getReportDetail", "getReportDetail", "getReportDetailCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListReportConfigs": { + "methods": ["listReportConfigs", "listReportConfigs", "listReportConfigs", "listReportConfigsPagedCallable", "listReportConfigsCallable"] + }, + "ListReportDetails": { + "methods": ["listReportDetails", "listReportDetails", "listReportDetails", "listReportDetailsPagedCallable", "listReportDetailsCallable"] + }, + "UpdateReportConfig": { + "methods": ["updateReportConfig", "updateReportConfig", "updateReportConfigCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/package-info.java b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/package-info.java new file mode 100644 index 000000000000..74621b310c65 --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/package-info.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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 Storage Insights API + * + *

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

======================= StorageInsightsClient ======================= + * + *

Service Description: Service describing handlers for resources + * + *

Sample for StorageInsightsClient: + * + *

{@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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) {
+ *   ReportConfigName name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]");
+ *   ReportConfig response = storageInsightsClient.getReportConfig(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.storageinsights.v1; + +import javax.annotation.Generated; diff --git a/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/GrpcStorageInsightsCallableFactory.java b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/GrpcStorageInsightsCallableFactory.java new file mode 100644 index 000000000000..d1b9fdb93bdb --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/GrpcStorageInsightsCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2022 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.storageinsights.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the StorageInsights service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcStorageInsightsCallableFactory 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-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/GrpcStorageInsightsStub.java b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/GrpcStorageInsightsStub.java new file mode 100644 index 000000000000..0299d1b9fc7d --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/GrpcStorageInsightsStub.java @@ -0,0 +1,472 @@ +/* + * Copyright 2022 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.storageinsights.v1.stub; + +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListLocationsPagedResponse; +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListReportConfigsPagedResponse; +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListReportDetailsPagedResponse; + +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.UnaryCallable; +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.storageinsights.v1.CreateReportConfigRequest; +import com.google.cloud.storageinsights.v1.DeleteReportConfigRequest; +import com.google.cloud.storageinsights.v1.GetReportConfigRequest; +import com.google.cloud.storageinsights.v1.GetReportDetailRequest; +import com.google.cloud.storageinsights.v1.ListReportConfigsRequest; +import com.google.cloud.storageinsights.v1.ListReportConfigsResponse; +import com.google.cloud.storageinsights.v1.ListReportDetailsRequest; +import com.google.cloud.storageinsights.v1.ListReportDetailsResponse; +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.ReportDetail; +import com.google.cloud.storageinsights.v1.UpdateReportConfigRequest; +import com.google.common.collect.ImmutableMap; +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 StorageInsights service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcStorageInsightsStub extends StorageInsightsStub { + private static final MethodDescriptor + listReportConfigsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.storageinsights.v1.StorageInsights/ListReportConfigs") + .setRequestMarshaller( + ProtoUtils.marshaller(ListReportConfigsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListReportConfigsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getReportConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.storageinsights.v1.StorageInsights/GetReportConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(GetReportConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ReportConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createReportConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.storageinsights.v1.StorageInsights/CreateReportConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateReportConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ReportConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateReportConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.storageinsights.v1.StorageInsights/UpdateReportConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateReportConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ReportConfig.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteReportConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.storageinsights.v1.StorageInsights/DeleteReportConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteReportConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listReportDetailsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.storageinsights.v1.StorageInsights/ListReportDetails") + .setRequestMarshaller( + ProtoUtils.marshaller(ListReportDetailsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListReportDetailsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getReportDetailMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.storageinsights.v1.StorageInsights/GetReportDetail") + .setRequestMarshaller( + ProtoUtils.marshaller(GetReportDetailRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ReportDetail.getDefaultInstance())) + .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())) + .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())) + .build(); + + private final UnaryCallable + listReportConfigsCallable; + private final UnaryCallable + listReportConfigsPagedCallable; + private final UnaryCallable getReportConfigCallable; + private final UnaryCallable createReportConfigCallable; + private final UnaryCallable updateReportConfigCallable; + private final UnaryCallable deleteReportConfigCallable; + private final UnaryCallable + listReportDetailsCallable; + private final UnaryCallable + listReportDetailsPagedCallable; + private final UnaryCallable getReportDetailCallable; + 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 GrpcStorageInsightsStub create(StorageInsightsStubSettings settings) + throws IOException { + return new GrpcStorageInsightsStub(settings, ClientContext.create(settings)); + } + + public static final GrpcStorageInsightsStub create(ClientContext clientContext) + throws IOException { + return new GrpcStorageInsightsStub( + StorageInsightsStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcStorageInsightsStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcStorageInsightsStub( + StorageInsightsStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcStorageInsightsStub, 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 GrpcStorageInsightsStub( + StorageInsightsStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcStorageInsightsCallableFactory()); + } + + /** + * Constructs an instance of GrpcStorageInsightsStub, 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 GrpcStorageInsightsStub( + StorageInsightsStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listReportConfigsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listReportConfigsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getReportConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getReportConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createReportConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createReportConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateReportConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateReportConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "report_config.name", String.valueOf(request.getReportConfig().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteReportConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteReportConfigMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listReportDetailsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listReportDetailsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getReportDetailTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getReportDetailMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + + this.listReportConfigsCallable = + callableFactory.createUnaryCallable( + listReportConfigsTransportSettings, + settings.listReportConfigsSettings(), + clientContext); + this.listReportConfigsPagedCallable = + callableFactory.createPagedCallable( + listReportConfigsTransportSettings, + settings.listReportConfigsSettings(), + clientContext); + this.getReportConfigCallable = + callableFactory.createUnaryCallable( + getReportConfigTransportSettings, settings.getReportConfigSettings(), clientContext); + this.createReportConfigCallable = + callableFactory.createUnaryCallable( + createReportConfigTransportSettings, + settings.createReportConfigSettings(), + clientContext); + this.updateReportConfigCallable = + callableFactory.createUnaryCallable( + updateReportConfigTransportSettings, + settings.updateReportConfigSettings(), + clientContext); + this.deleteReportConfigCallable = + callableFactory.createUnaryCallable( + deleteReportConfigTransportSettings, + settings.deleteReportConfigSettings(), + clientContext); + this.listReportDetailsCallable = + callableFactory.createUnaryCallable( + listReportDetailsTransportSettings, + settings.listReportDetailsSettings(), + clientContext); + this.listReportDetailsPagedCallable = + callableFactory.createPagedCallable( + listReportDetailsTransportSettings, + settings.listReportDetailsSettings(), + clientContext); + this.getReportDetailCallable = + callableFactory.createUnaryCallable( + getReportDetailTransportSettings, settings.getReportDetailSettings(), 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 + listReportConfigsCallable() { + return listReportConfigsCallable; + } + + @Override + public UnaryCallable + listReportConfigsPagedCallable() { + return listReportConfigsPagedCallable; + } + + @Override + public UnaryCallable getReportConfigCallable() { + return getReportConfigCallable; + } + + @Override + public UnaryCallable createReportConfigCallable() { + return createReportConfigCallable; + } + + @Override + public UnaryCallable updateReportConfigCallable() { + return updateReportConfigCallable; + } + + @Override + public UnaryCallable deleteReportConfigCallable() { + return deleteReportConfigCallable; + } + + @Override + public UnaryCallable + listReportDetailsCallable() { + return listReportDetailsCallable; + } + + @Override + public UnaryCallable + listReportDetailsPagedCallable() { + return listReportDetailsPagedCallable; + } + + @Override + public UnaryCallable getReportDetailCallable() { + return getReportDetailCallable; + } + + @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-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/HttpJsonStorageInsightsCallableFactory.java b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/HttpJsonStorageInsightsCallableFactory.java new file mode 100644 index 000000000000..b7444463cbd1 --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/HttpJsonStorageInsightsCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 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.storageinsights.v1.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 StorageInsights service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonStorageInsightsCallableFactory + 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); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @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-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/HttpJsonStorageInsightsStub.java b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/HttpJsonStorageInsightsStub.java new file mode 100644 index 000000000000..2b173f34bb2a --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/HttpJsonStorageInsightsStub.java @@ -0,0 +1,683 @@ +/* + * Copyright 2022 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.storageinsights.v1.stub; + +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListLocationsPagedResponse; +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListReportConfigsPagedResponse; +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListReportDetailsPagedResponse; + +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.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.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +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.storageinsights.v1.CreateReportConfigRequest; +import com.google.cloud.storageinsights.v1.DeleteReportConfigRequest; +import com.google.cloud.storageinsights.v1.GetReportConfigRequest; +import com.google.cloud.storageinsights.v1.GetReportDetailRequest; +import com.google.cloud.storageinsights.v1.ListReportConfigsRequest; +import com.google.cloud.storageinsights.v1.ListReportConfigsResponse; +import com.google.cloud.storageinsights.v1.ListReportDetailsRequest; +import com.google.cloud.storageinsights.v1.ListReportDetailsResponse; +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.ReportDetail; +import com.google.cloud.storageinsights.v1.UpdateReportConfigRequest; +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 StorageInsights service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonStorageInsightsStub extends StorageInsightsStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + listReportConfigsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.storageinsights.v1.StorageInsights/ListReportConfigs") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/reportConfigs", + 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, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + 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(ListReportConfigsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getReportConfigMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.storageinsights.v1.StorageInsights/GetReportConfig") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/reportConfigs/*}", + 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(ReportConfig.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createReportConfigMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.storageinsights.v1.StorageInsights/CreateReportConfig") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/reportConfigs", + 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, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("reportConfig", request.getReportConfig(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ReportConfig.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateReportConfigMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.storageinsights.v1.StorageInsights/UpdateReportConfig") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{reportConfig.name=projects/*/locations/*/reportConfigs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "reportConfig.name", request.getReportConfig().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("reportConfig", request.getReportConfig(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ReportConfig.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteReportConfigMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.storageinsights.v1.StorageInsights/DeleteReportConfig") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/reportConfigs/*}", + 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, "force", request.getForce()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + 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 + listReportDetailsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.storageinsights.v1.StorageInsights/ListReportDetails") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/reportConfigs/*}/reportDetails", + 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, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + 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(ListReportDetailsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getReportDetailMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.storageinsights.v1.StorageInsights/GetReportDetail") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/reportConfigs/*/reportDetails/*}", + 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(ReportDetail.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( + "/v1/{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( + "/v1/{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 + listReportConfigsCallable; + private final UnaryCallable + listReportConfigsPagedCallable; + private final UnaryCallable getReportConfigCallable; + private final UnaryCallable createReportConfigCallable; + private final UnaryCallable updateReportConfigCallable; + private final UnaryCallable deleteReportConfigCallable; + private final UnaryCallable + listReportDetailsCallable; + private final UnaryCallable + listReportDetailsPagedCallable; + private final UnaryCallable getReportDetailCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonStorageInsightsStub create(StorageInsightsStubSettings settings) + throws IOException { + return new HttpJsonStorageInsightsStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonStorageInsightsStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonStorageInsightsStub( + StorageInsightsStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonStorageInsightsStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonStorageInsightsStub( + StorageInsightsStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonStorageInsightsStub, 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 HttpJsonStorageInsightsStub( + StorageInsightsStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonStorageInsightsCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonStorageInsightsStub, 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 HttpJsonStorageInsightsStub( + StorageInsightsStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + listReportConfigsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listReportConfigsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getReportConfigTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getReportConfigMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + createReportConfigTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createReportConfigMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + updateReportConfigTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateReportConfigMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteReportConfigTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteReportConfigMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listReportDetailsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listReportDetailsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getReportDetailTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getReportDetailMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listReportConfigsCallable = + callableFactory.createUnaryCallable( + listReportConfigsTransportSettings, + settings.listReportConfigsSettings(), + clientContext); + this.listReportConfigsPagedCallable = + callableFactory.createPagedCallable( + listReportConfigsTransportSettings, + settings.listReportConfigsSettings(), + clientContext); + this.getReportConfigCallable = + callableFactory.createUnaryCallable( + getReportConfigTransportSettings, settings.getReportConfigSettings(), clientContext); + this.createReportConfigCallable = + callableFactory.createUnaryCallable( + createReportConfigTransportSettings, + settings.createReportConfigSettings(), + clientContext); + this.updateReportConfigCallable = + callableFactory.createUnaryCallable( + updateReportConfigTransportSettings, + settings.updateReportConfigSettings(), + clientContext); + this.deleteReportConfigCallable = + callableFactory.createUnaryCallable( + deleteReportConfigTransportSettings, + settings.deleteReportConfigSettings(), + clientContext); + this.listReportDetailsCallable = + callableFactory.createUnaryCallable( + listReportDetailsTransportSettings, + settings.listReportDetailsSettings(), + clientContext); + this.listReportDetailsPagedCallable = + callableFactory.createPagedCallable( + listReportDetailsTransportSettings, + settings.listReportDetailsSettings(), + clientContext); + this.getReportDetailCallable = + callableFactory.createUnaryCallable( + getReportDetailTransportSettings, settings.getReportDetailSettings(), 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(listReportConfigsMethodDescriptor); + methodDescriptors.add(getReportConfigMethodDescriptor); + methodDescriptors.add(createReportConfigMethodDescriptor); + methodDescriptors.add(updateReportConfigMethodDescriptor); + methodDescriptors.add(deleteReportConfigMethodDescriptor); + methodDescriptors.add(listReportDetailsMethodDescriptor); + methodDescriptors.add(getReportDetailMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + listReportConfigsCallable() { + return listReportConfigsCallable; + } + + @Override + public UnaryCallable + listReportConfigsPagedCallable() { + return listReportConfigsPagedCallable; + } + + @Override + public UnaryCallable getReportConfigCallable() { + return getReportConfigCallable; + } + + @Override + public UnaryCallable createReportConfigCallable() { + return createReportConfigCallable; + } + + @Override + public UnaryCallable updateReportConfigCallable() { + return updateReportConfigCallable; + } + + @Override + public UnaryCallable deleteReportConfigCallable() { + return deleteReportConfigCallable; + } + + @Override + public UnaryCallable + listReportDetailsCallable() { + return listReportDetailsCallable; + } + + @Override + public UnaryCallable + listReportDetailsPagedCallable() { + return listReportDetailsPagedCallable; + } + + @Override + public UnaryCallable getReportDetailCallable() { + return getReportDetailCallable; + } + + @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-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/StorageInsightsStub.java b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/StorageInsightsStub.java new file mode 100644 index 000000000000..0820cf69e70c --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/StorageInsightsStub.java @@ -0,0 +1,107 @@ +/* + * Copyright 2022 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.storageinsights.v1.stub; + +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListLocationsPagedResponse; +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListReportConfigsPagedResponse; +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListReportDetailsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +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.storageinsights.v1.CreateReportConfigRequest; +import com.google.cloud.storageinsights.v1.DeleteReportConfigRequest; +import com.google.cloud.storageinsights.v1.GetReportConfigRequest; +import com.google.cloud.storageinsights.v1.GetReportDetailRequest; +import com.google.cloud.storageinsights.v1.ListReportConfigsRequest; +import com.google.cloud.storageinsights.v1.ListReportConfigsResponse; +import com.google.cloud.storageinsights.v1.ListReportDetailsRequest; +import com.google.cloud.storageinsights.v1.ListReportDetailsResponse; +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.ReportDetail; +import com.google.cloud.storageinsights.v1.UpdateReportConfigRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the StorageInsights service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class StorageInsightsStub implements BackgroundResource { + + public UnaryCallable + listReportConfigsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listReportConfigsPagedCallable()"); + } + + public UnaryCallable + listReportConfigsCallable() { + throw new UnsupportedOperationException("Not implemented: listReportConfigsCallable()"); + } + + public UnaryCallable getReportConfigCallable() { + throw new UnsupportedOperationException("Not implemented: getReportConfigCallable()"); + } + + public UnaryCallable createReportConfigCallable() { + throw new UnsupportedOperationException("Not implemented: createReportConfigCallable()"); + } + + public UnaryCallable updateReportConfigCallable() { + throw new UnsupportedOperationException("Not implemented: updateReportConfigCallable()"); + } + + public UnaryCallable deleteReportConfigCallable() { + throw new UnsupportedOperationException("Not implemented: deleteReportConfigCallable()"); + } + + public UnaryCallable + listReportDetailsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listReportDetailsPagedCallable()"); + } + + public UnaryCallable + listReportDetailsCallable() { + throw new UnsupportedOperationException("Not implemented: listReportDetailsCallable()"); + } + + public UnaryCallable getReportDetailCallable() { + throw new UnsupportedOperationException("Not implemented: getReportDetailCallable()"); + } + + 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-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/StorageInsightsStubSettings.java b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/StorageInsightsStubSettings.java new file mode 100644 index 000000000000..c866b5676c34 --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/src/main/java/com/google/cloud/storageinsights/v1/stub/StorageInsightsStubSettings.java @@ -0,0 +1,749 @@ +/* + * Copyright 2022 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.storageinsights.v1.stub; + +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListLocationsPagedResponse; +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListReportConfigsPagedResponse; +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListReportDetailsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.storageinsights.v1.CreateReportConfigRequest; +import com.google.cloud.storageinsights.v1.DeleteReportConfigRequest; +import com.google.cloud.storageinsights.v1.GetReportConfigRequest; +import com.google.cloud.storageinsights.v1.GetReportDetailRequest; +import com.google.cloud.storageinsights.v1.ListReportConfigsRequest; +import com.google.cloud.storageinsights.v1.ListReportConfigsResponse; +import com.google.cloud.storageinsights.v1.ListReportDetailsRequest; +import com.google.cloud.storageinsights.v1.ListReportDetailsResponse; +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.ReportDetail; +import com.google.cloud.storageinsights.v1.UpdateReportConfigRequest; +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.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link StorageInsightsStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (storageinsights.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getReportConfig to 30 seconds: + * + *

{@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
+ * StorageInsightsStubSettings.Builder storageInsightsSettingsBuilder =
+ *     StorageInsightsStubSettings.newBuilder();
+ * storageInsightsSettingsBuilder
+ *     .getReportConfigSettings()
+ *     .setRetrySettings(
+ *         storageInsightsSettingsBuilder
+ *             .getReportConfigSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * StorageInsightsStubSettings storageInsightsSettings = storageInsightsSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class StorageInsightsStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + ListReportConfigsRequest, ListReportConfigsResponse, ListReportConfigsPagedResponse> + listReportConfigsSettings; + private final UnaryCallSettings getReportConfigSettings; + private final UnaryCallSettings + createReportConfigSettings; + private final UnaryCallSettings + updateReportConfigSettings; + private final UnaryCallSettings deleteReportConfigSettings; + private final PagedCallSettings< + ListReportDetailsRequest, ListReportDetailsResponse, ListReportDetailsPagedResponse> + listReportDetailsSettings; + private final UnaryCallSettings getReportDetailSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor< + ListReportConfigsRequest, ListReportConfigsResponse, ReportConfig> + LIST_REPORT_CONFIGS_PAGE_STR_DESC = + new PagedListDescriptor< + ListReportConfigsRequest, ListReportConfigsResponse, ReportConfig>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListReportConfigsRequest injectToken( + ListReportConfigsRequest payload, String token) { + return ListReportConfigsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListReportConfigsRequest injectPageSize( + ListReportConfigsRequest payload, int pageSize) { + return ListReportConfigsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListReportConfigsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListReportConfigsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListReportConfigsResponse payload) { + return payload.getReportConfigsList() == null + ? ImmutableList.of() + : payload.getReportConfigsList(); + } + }; + + private static final PagedListDescriptor< + ListReportDetailsRequest, ListReportDetailsResponse, ReportDetail> + LIST_REPORT_DETAILS_PAGE_STR_DESC = + new PagedListDescriptor< + ListReportDetailsRequest, ListReportDetailsResponse, ReportDetail>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListReportDetailsRequest injectToken( + ListReportDetailsRequest payload, String token) { + return ListReportDetailsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListReportDetailsRequest injectPageSize( + ListReportDetailsRequest payload, int pageSize) { + return ListReportDetailsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListReportDetailsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListReportDetailsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListReportDetailsResponse payload) { + return payload.getReportDetailsList() == null + ? ImmutableList.of() + : payload.getReportDetailsList(); + } + }; + + 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() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListReportConfigsRequest, ListReportConfigsResponse, ListReportConfigsPagedResponse> + LIST_REPORT_CONFIGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListReportConfigsRequest, + ListReportConfigsResponse, + ListReportConfigsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListReportConfigsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_REPORT_CONFIGS_PAGE_STR_DESC, request, context); + return ListReportConfigsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListReportDetailsRequest, ListReportDetailsResponse, ListReportDetailsPagedResponse> + LIST_REPORT_DETAILS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListReportDetailsRequest, + ListReportDetailsResponse, + ListReportDetailsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListReportDetailsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_REPORT_DETAILS_PAGE_STR_DESC, request, context); + return ListReportDetailsPagedResponse.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 listReportConfigs. */ + public PagedCallSettings< + ListReportConfigsRequest, ListReportConfigsResponse, ListReportConfigsPagedResponse> + listReportConfigsSettings() { + return listReportConfigsSettings; + } + + /** Returns the object with the settings used for calls to getReportConfig. */ + public UnaryCallSettings getReportConfigSettings() { + return getReportConfigSettings; + } + + /** Returns the object with the settings used for calls to createReportConfig. */ + public UnaryCallSettings createReportConfigSettings() { + return createReportConfigSettings; + } + + /** Returns the object with the settings used for calls to updateReportConfig. */ + public UnaryCallSettings updateReportConfigSettings() { + return updateReportConfigSettings; + } + + /** Returns the object with the settings used for calls to deleteReportConfig. */ + public UnaryCallSettings deleteReportConfigSettings() { + return deleteReportConfigSettings; + } + + /** Returns the object with the settings used for calls to listReportDetails. */ + public PagedCallSettings< + ListReportDetailsRequest, ListReportDetailsResponse, ListReportDetailsPagedResponse> + listReportDetailsSettings() { + return listReportDetailsSettings; + } + + /** Returns the object with the settings used for calls to getReportDetail. */ + public UnaryCallSettings getReportDetailSettings() { + return getReportDetailSettings; + } + + /** 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 StorageInsightsStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcStorageInsightsStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonStorageInsightsStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "storageinsights.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "storageinsights.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(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(StorageInsightsStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(StorageInsightsStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return StorageInsightsStubSettings.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 StorageInsightsStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listReportConfigsSettings = settingsBuilder.listReportConfigsSettings().build(); + getReportConfigSettings = settingsBuilder.getReportConfigSettings().build(); + createReportConfigSettings = settingsBuilder.createReportConfigSettings().build(); + updateReportConfigSettings = settingsBuilder.updateReportConfigSettings().build(); + deleteReportConfigSettings = settingsBuilder.deleteReportConfigSettings().build(); + listReportDetailsSettings = settingsBuilder.listReportDetailsSettings().build(); + getReportDetailSettings = settingsBuilder.getReportDetailSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for StorageInsightsStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListReportConfigsRequest, ListReportConfigsResponse, ListReportConfigsPagedResponse> + listReportConfigsSettings; + private final UnaryCallSettings.Builder + getReportConfigSettings; + private final UnaryCallSettings.Builder + createReportConfigSettings; + private final UnaryCallSettings.Builder + updateReportConfigSettings; + private final UnaryCallSettings.Builder + deleteReportConfigSettings; + private final PagedCallSettings.Builder< + ListReportDetailsRequest, ListReportDetailsResponse, ListReportDetailsPagedResponse> + listReportDetailsSettings; + private final UnaryCallSettings.Builder + getReportDetailSettings; + 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( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_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() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listReportConfigsSettings = PagedCallSettings.newBuilder(LIST_REPORT_CONFIGS_PAGE_STR_FACT); + getReportConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createReportConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateReportConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteReportConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listReportDetailsSettings = PagedCallSettings.newBuilder(LIST_REPORT_DETAILS_PAGE_STR_FACT); + getReportDetailSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listReportConfigsSettings, + getReportConfigSettings, + createReportConfigSettings, + updateReportConfigSettings, + deleteReportConfigSettings, + listReportDetailsSettings, + getReportDetailSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(StorageInsightsStubSettings settings) { + super(settings); + + listReportConfigsSettings = settings.listReportConfigsSettings.toBuilder(); + getReportConfigSettings = settings.getReportConfigSettings.toBuilder(); + createReportConfigSettings = settings.createReportConfigSettings.toBuilder(); + updateReportConfigSettings = settings.updateReportConfigSettings.toBuilder(); + deleteReportConfigSettings = settings.deleteReportConfigSettings.toBuilder(); + listReportDetailsSettings = settings.listReportDetailsSettings.toBuilder(); + getReportDetailSettings = settings.getReportDetailSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listReportConfigsSettings, + getReportConfigSettings, + createReportConfigSettings, + updateReportConfigSettings, + deleteReportConfigSettings, + listReportDetailsSettings, + getReportDetailSettings, + listLocationsSettings, + getLocationSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + 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.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listReportConfigsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getReportConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createReportConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateReportConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteReportConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listReportDetailsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getReportDetailSettings() + .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_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + 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 listReportConfigs. */ + public PagedCallSettings.Builder< + ListReportConfigsRequest, ListReportConfigsResponse, ListReportConfigsPagedResponse> + listReportConfigsSettings() { + return listReportConfigsSettings; + } + + /** Returns the builder for the settings used for calls to getReportConfig. */ + public UnaryCallSettings.Builder + getReportConfigSettings() { + return getReportConfigSettings; + } + + /** Returns the builder for the settings used for calls to createReportConfig. */ + public UnaryCallSettings.Builder + createReportConfigSettings() { + return createReportConfigSettings; + } + + /** Returns the builder for the settings used for calls to updateReportConfig. */ + public UnaryCallSettings.Builder + updateReportConfigSettings() { + return updateReportConfigSettings; + } + + /** Returns the builder for the settings used for calls to deleteReportConfig. */ + public UnaryCallSettings.Builder + deleteReportConfigSettings() { + return deleteReportConfigSettings; + } + + /** Returns the builder for the settings used for calls to listReportDetails. */ + public PagedCallSettings.Builder< + ListReportDetailsRequest, ListReportDetailsResponse, ListReportDetailsPagedResponse> + listReportDetailsSettings() { + return listReportDetailsSettings; + } + + /** Returns the builder for the settings used for calls to getReportDetail. */ + public UnaryCallSettings.Builder + getReportDetailSettings() { + return getReportDetailSettings; + } + + /** 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 StorageInsightsStubSettings build() throws IOException { + return new StorageInsightsStubSettings(this); + } + } +} diff --git a/java-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/MockLocations.java b/java-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/MockLocations.java new file mode 100644 index 000000000000..d702b8d6bbe3 --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.storageinsights.v1; + +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-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/MockLocationsImpl.java b/java-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/MockLocationsImpl.java new file mode 100644 index 000000000000..7587df25829d --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 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.storageinsights.v1; + +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-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/MockStorageInsights.java b/java-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/MockStorageInsights.java new file mode 100644 index 000000000000..8b2c432fa002 --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/MockStorageInsights.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.storageinsights.v1; + +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 MockStorageInsights implements MockGrpcService { + private final MockStorageInsightsImpl serviceImpl; + + public MockStorageInsights() { + serviceImpl = new MockStorageInsightsImpl(); + } + + @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-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/MockStorageInsightsImpl.java b/java-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/MockStorageInsightsImpl.java new file mode 100644 index 000000000000..d995876f7273 --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/MockStorageInsightsImpl.java @@ -0,0 +1,210 @@ +/* + * Copyright 2022 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.storageinsights.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.storageinsights.v1.StorageInsightsGrpc.StorageInsightsImplBase; +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 MockStorageInsightsImpl extends StorageInsightsImplBase { + private List requests; + private Queue responses; + + public MockStorageInsightsImpl() { + 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 listReportConfigs( + ListReportConfigsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListReportConfigsResponse) { + requests.add(request); + responseObserver.onNext(((ListReportConfigsResponse) 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 ListReportConfigs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListReportConfigsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getReportConfig( + GetReportConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ReportConfig) { + requests.add(request); + responseObserver.onNext(((ReportConfig) 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 GetReportConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ReportConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createReportConfig( + CreateReportConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ReportConfig) { + requests.add(request); + responseObserver.onNext(((ReportConfig) 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 CreateReportConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ReportConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateReportConfig( + UpdateReportConfigRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ReportConfig) { + requests.add(request); + responseObserver.onNext(((ReportConfig) 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 UpdateReportConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ReportConfig.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteReportConfig( + DeleteReportConfigRequest 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 DeleteReportConfig, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listReportDetails( + ListReportDetailsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListReportDetailsResponse) { + requests.add(request); + responseObserver.onNext(((ListReportDetailsResponse) 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 ListReportDetails, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListReportDetailsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getReportDetail( + GetReportDetailRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ReportDetail) { + requests.add(request); + responseObserver.onNext(((ReportDetail) 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 GetReportDetail, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ReportDetail.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/StorageInsightsClientHttpJsonTest.java b/java-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/StorageInsightsClientHttpJsonTest.java new file mode 100644 index 000000000000..3aa27ee96dfe --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/StorageInsightsClientHttpJsonTest.java @@ -0,0 +1,864 @@ +/* + * Copyright 2022 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.storageinsights.v1; + +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListLocationsPagedResponse; +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListReportConfigsPagedResponse; +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListReportDetailsPagedResponse; + +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.storageinsights.v1.stub.HttpJsonStorageInsightsStub; +import com.google.common.collect.Lists; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import com.google.type.DateTime; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 StorageInsightsClientHttpJsonTest { + private static MockHttpService mockService; + private static StorageInsightsClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonStorageInsightsStub.getMethodDescriptors(), + StorageInsightsSettings.getDefaultEndpoint()); + StorageInsightsSettings settings = + StorageInsightsSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + StorageInsightsSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = StorageInsightsClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listReportConfigsTest() throws Exception { + ReportConfig responsesElement = ReportConfig.newBuilder().build(); + ListReportConfigsResponse expectedResponse = + ListReportConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllReportConfigs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListReportConfigsPagedResponse pagedListResponse = client.listReportConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReportConfigsList().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 listReportConfigsExceptionTest() 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.listReportConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listReportConfigsTest2() throws Exception { + ReportConfig responsesElement = ReportConfig.newBuilder().build(); + ListReportConfigsResponse expectedResponse = + ListReportConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllReportConfigs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListReportConfigsPagedResponse pagedListResponse = client.listReportConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReportConfigsList().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 listReportConfigsExceptionTest2() 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.listReportConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getReportConfigTest() throws Exception { + ReportConfig expectedResponse = + ReportConfig.newBuilder() + .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setFrequencyOptions(FrequencyOptions.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .build(); + mockService.addResponse(expectedResponse); + + ReportConfigName name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]"); + + ReportConfig actualResponse = client.getReportConfig(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 getReportConfigExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ReportConfigName name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]"); + client.getReportConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getReportConfigTest2() throws Exception { + ReportConfig expectedResponse = + ReportConfig.newBuilder() + .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setFrequencyOptions(FrequencyOptions.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-2365/locations/location-2365/reportConfigs/reportConfig-2365"; + + ReportConfig actualResponse = client.getReportConfig(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 getReportConfigExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2365/locations/location-2365/reportConfigs/reportConfig-2365"; + client.getReportConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createReportConfigTest() throws Exception { + ReportConfig expectedResponse = + ReportConfig.newBuilder() + .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setFrequencyOptions(FrequencyOptions.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ReportConfig reportConfig = ReportConfig.newBuilder().build(); + + ReportConfig actualResponse = client.createReportConfig(parent, reportConfig); + 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 createReportConfigExceptionTest() 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]"); + ReportConfig reportConfig = ReportConfig.newBuilder().build(); + client.createReportConfig(parent, reportConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createReportConfigTest2() throws Exception { + ReportConfig expectedResponse = + ReportConfig.newBuilder() + .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setFrequencyOptions(FrequencyOptions.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + ReportConfig reportConfig = ReportConfig.newBuilder().build(); + + ReportConfig actualResponse = client.createReportConfig(parent, reportConfig); + 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 createReportConfigExceptionTest2() 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"; + ReportConfig reportConfig = ReportConfig.newBuilder().build(); + client.createReportConfig(parent, reportConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateReportConfigTest() throws Exception { + ReportConfig expectedResponse = + ReportConfig.newBuilder() + .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setFrequencyOptions(FrequencyOptions.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .build(); + mockService.addResponse(expectedResponse); + + ReportConfig reportConfig = + ReportConfig.newBuilder() + .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setFrequencyOptions(FrequencyOptions.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + ReportConfig actualResponse = client.updateReportConfig(reportConfig, updateMask); + 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 updateReportConfigExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ReportConfig reportConfig = + ReportConfig.newBuilder() + .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setFrequencyOptions(FrequencyOptions.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateReportConfig(reportConfig, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteReportConfigTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ReportConfigName name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]"); + + client.deleteReportConfig(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 deleteReportConfigExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ReportConfigName name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]"); + client.deleteReportConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteReportConfigTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-2365/locations/location-2365/reportConfigs/reportConfig-2365"; + + client.deleteReportConfig(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 deleteReportConfigExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2365/locations/location-2365/reportConfigs/reportConfig-2365"; + client.deleteReportConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listReportDetailsTest() throws Exception { + ReportDetail responsesElement = ReportDetail.newBuilder().build(); + ListReportDetailsResponse expectedResponse = + ListReportDetailsResponse.newBuilder() + .setNextPageToken("") + .addAllReportDetails(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ReportConfigName parent = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]"); + + ListReportDetailsPagedResponse pagedListResponse = client.listReportDetails(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReportDetailsList().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 listReportDetailsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ReportConfigName parent = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]"); + client.listReportDetails(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listReportDetailsTest2() throws Exception { + ReportDetail responsesElement = ReportDetail.newBuilder().build(); + ListReportDetailsResponse expectedResponse = + ListReportDetailsResponse.newBuilder() + .setNextPageToken("") + .addAllReportDetails(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9026/locations/location-9026/reportConfigs/reportConfig-9026"; + + ListReportDetailsPagedResponse pagedListResponse = client.listReportDetails(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReportDetailsList().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 listReportDetailsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "projects/project-9026/locations/location-9026/reportConfigs/reportConfig-9026"; + client.listReportDetails(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getReportDetailTest() throws Exception { + ReportDetail expectedResponse = + ReportDetail.newBuilder() + .setName( + ReportDetailName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]", "[REPORT_DETAIL]") + .toString()) + .setSnapshotTime(Timestamp.newBuilder().build()) + .setReportPathPrefix("reportPathPrefix-1434070165") + .setShardsCount(-2027352923) + .setStatus(Status.newBuilder().build()) + .putAllLabels(new HashMap()) + .setTargetDatetime(DateTime.newBuilder().build()) + .setReportMetrics(ReportDetail.Metrics.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ReportDetailName name = + ReportDetailName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]", "[REPORT_DETAIL]"); + + ReportDetail actualResponse = client.getReportDetail(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 getReportDetailExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ReportDetailName name = + ReportDetailName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]", "[REPORT_DETAIL]"); + client.getReportDetail(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getReportDetailTest2() throws Exception { + ReportDetail expectedResponse = + ReportDetail.newBuilder() + .setName( + ReportDetailName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]", "[REPORT_DETAIL]") + .toString()) + .setSnapshotTime(Timestamp.newBuilder().build()) + .setReportPathPrefix("reportPathPrefix-1434070165") + .setShardsCount(-2027352923) + .setStatus(Status.newBuilder().build()) + .putAllLabels(new HashMap()) + .setTargetDatetime(DateTime.newBuilder().build()) + .setReportMetrics(ReportDetail.Metrics.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-3517/locations/location-3517/reportConfigs/reportConfig-3517/reportDetails/reportDetail-3517"; + + ReportDetail actualResponse = client.getReportDetail(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 getReportDetailExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-3517/locations/location-3517/reportConfigs/reportConfig-3517/reportDetails/reportDetail-3517"; + client.getReportDetail(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-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/StorageInsightsClientTest.java b/java-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/StorageInsightsClientTest.java new file mode 100644 index 000000000000..c8bab48bd4d8 --- /dev/null +++ b/java-storageinsights/google-cloud-storageinsights/src/test/java/com/google/cloud/storageinsights/v1/StorageInsightsClientTest.java @@ -0,0 +1,761 @@ +/* + * Copyright 2022 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.storageinsights.v1; + +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListLocationsPagedResponse; +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListReportConfigsPagedResponse; +import static com.google.cloud.storageinsights.v1.StorageInsightsClient.ListReportDetailsPagedResponse; + +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.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.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.rpc.Status; +import com.google.type.DateTime; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +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 StorageInsightsClientTest { + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockStorageInsights mockStorageInsights; + private LocalChannelProvider channelProvider; + private StorageInsightsClient client; + + @BeforeClass + public static void startStaticServer() { + mockStorageInsights = new MockStorageInsights(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockStorageInsights, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + StorageInsightsSettings settings = + StorageInsightsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = StorageInsightsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listReportConfigsTest() throws Exception { + ReportConfig responsesElement = ReportConfig.newBuilder().build(); + ListReportConfigsResponse expectedResponse = + ListReportConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllReportConfigs(Arrays.asList(responsesElement)) + .build(); + mockStorageInsights.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListReportConfigsPagedResponse pagedListResponse = client.listReportConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReportConfigsList().get(0), resources.get(0)); + + List actualRequests = mockStorageInsights.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListReportConfigsRequest actualRequest = ((ListReportConfigsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listReportConfigsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageInsights.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listReportConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listReportConfigsTest2() throws Exception { + ReportConfig responsesElement = ReportConfig.newBuilder().build(); + ListReportConfigsResponse expectedResponse = + ListReportConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllReportConfigs(Arrays.asList(responsesElement)) + .build(); + mockStorageInsights.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListReportConfigsPagedResponse pagedListResponse = client.listReportConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReportConfigsList().get(0), resources.get(0)); + + List actualRequests = mockStorageInsights.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListReportConfigsRequest actualRequest = ((ListReportConfigsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listReportConfigsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageInsights.addException(exception); + + try { + String parent = "parent-995424086"; + client.listReportConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getReportConfigTest() throws Exception { + ReportConfig expectedResponse = + ReportConfig.newBuilder() + .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setFrequencyOptions(FrequencyOptions.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .build(); + mockStorageInsights.addResponse(expectedResponse); + + ReportConfigName name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]"); + + ReportConfig actualResponse = client.getReportConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorageInsights.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetReportConfigRequest actualRequest = ((GetReportConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getReportConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageInsights.addException(exception); + + try { + ReportConfigName name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]"); + client.getReportConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getReportConfigTest2() throws Exception { + ReportConfig expectedResponse = + ReportConfig.newBuilder() + .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setFrequencyOptions(FrequencyOptions.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .build(); + mockStorageInsights.addResponse(expectedResponse); + + String name = "name3373707"; + + ReportConfig actualResponse = client.getReportConfig(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorageInsights.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetReportConfigRequest actualRequest = ((GetReportConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getReportConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageInsights.addException(exception); + + try { + String name = "name3373707"; + client.getReportConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createReportConfigTest() throws Exception { + ReportConfig expectedResponse = + ReportConfig.newBuilder() + .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setFrequencyOptions(FrequencyOptions.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .build(); + mockStorageInsights.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ReportConfig reportConfig = ReportConfig.newBuilder().build(); + + ReportConfig actualResponse = client.createReportConfig(parent, reportConfig); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorageInsights.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateReportConfigRequest actualRequest = ((CreateReportConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(reportConfig, actualRequest.getReportConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createReportConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageInsights.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ReportConfig reportConfig = ReportConfig.newBuilder().build(); + client.createReportConfig(parent, reportConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createReportConfigTest2() throws Exception { + ReportConfig expectedResponse = + ReportConfig.newBuilder() + .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setFrequencyOptions(FrequencyOptions.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .build(); + mockStorageInsights.addResponse(expectedResponse); + + String parent = "parent-995424086"; + ReportConfig reportConfig = ReportConfig.newBuilder().build(); + + ReportConfig actualResponse = client.createReportConfig(parent, reportConfig); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorageInsights.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateReportConfigRequest actualRequest = ((CreateReportConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(reportConfig, actualRequest.getReportConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createReportConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageInsights.addException(exception); + + try { + String parent = "parent-995424086"; + ReportConfig reportConfig = ReportConfig.newBuilder().build(); + client.createReportConfig(parent, reportConfig); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateReportConfigTest() throws Exception { + ReportConfig expectedResponse = + ReportConfig.newBuilder() + .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setFrequencyOptions(FrequencyOptions.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .build(); + mockStorageInsights.addResponse(expectedResponse); + + ReportConfig reportConfig = ReportConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + ReportConfig actualResponse = client.updateReportConfig(reportConfig, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorageInsights.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateReportConfigRequest actualRequest = ((UpdateReportConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(reportConfig, actualRequest.getReportConfig()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateReportConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageInsights.addException(exception); + + try { + ReportConfig reportConfig = ReportConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateReportConfig(reportConfig, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteReportConfigTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockStorageInsights.addResponse(expectedResponse); + + ReportConfigName name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]"); + + client.deleteReportConfig(name); + + List actualRequests = mockStorageInsights.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteReportConfigRequest actualRequest = ((DeleteReportConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteReportConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageInsights.addException(exception); + + try { + ReportConfigName name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]"); + client.deleteReportConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteReportConfigTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockStorageInsights.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteReportConfig(name); + + List actualRequests = mockStorageInsights.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteReportConfigRequest actualRequest = ((DeleteReportConfigRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteReportConfigExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageInsights.addException(exception); + + try { + String name = "name3373707"; + client.deleteReportConfig(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listReportDetailsTest() throws Exception { + ReportDetail responsesElement = ReportDetail.newBuilder().build(); + ListReportDetailsResponse expectedResponse = + ListReportDetailsResponse.newBuilder() + .setNextPageToken("") + .addAllReportDetails(Arrays.asList(responsesElement)) + .build(); + mockStorageInsights.addResponse(expectedResponse); + + ReportConfigName parent = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]"); + + ListReportDetailsPagedResponse pagedListResponse = client.listReportDetails(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReportDetailsList().get(0), resources.get(0)); + + List actualRequests = mockStorageInsights.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListReportDetailsRequest actualRequest = ((ListReportDetailsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listReportDetailsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageInsights.addException(exception); + + try { + ReportConfigName parent = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]"); + client.listReportDetails(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listReportDetailsTest2() throws Exception { + ReportDetail responsesElement = ReportDetail.newBuilder().build(); + ListReportDetailsResponse expectedResponse = + ListReportDetailsResponse.newBuilder() + .setNextPageToken("") + .addAllReportDetails(Arrays.asList(responsesElement)) + .build(); + mockStorageInsights.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListReportDetailsPagedResponse pagedListResponse = client.listReportDetails(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getReportDetailsList().get(0), resources.get(0)); + + List actualRequests = mockStorageInsights.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListReportDetailsRequest actualRequest = ((ListReportDetailsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listReportDetailsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageInsights.addException(exception); + + try { + String parent = "parent-995424086"; + client.listReportDetails(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getReportDetailTest() throws Exception { + ReportDetail expectedResponse = + ReportDetail.newBuilder() + .setName( + ReportDetailName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]", "[REPORT_DETAIL]") + .toString()) + .setSnapshotTime(Timestamp.newBuilder().build()) + .setReportPathPrefix("reportPathPrefix-1434070165") + .setShardsCount(-2027352923) + .setStatus(Status.newBuilder().build()) + .putAllLabels(new HashMap()) + .setTargetDatetime(DateTime.newBuilder().build()) + .setReportMetrics(ReportDetail.Metrics.newBuilder().build()) + .build(); + mockStorageInsights.addResponse(expectedResponse); + + ReportDetailName name = + ReportDetailName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]", "[REPORT_DETAIL]"); + + ReportDetail actualResponse = client.getReportDetail(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorageInsights.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetReportDetailRequest actualRequest = ((GetReportDetailRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getReportDetailExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageInsights.addException(exception); + + try { + ReportDetailName name = + ReportDetailName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]", "[REPORT_DETAIL]"); + client.getReportDetail(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getReportDetailTest2() throws Exception { + ReportDetail expectedResponse = + ReportDetail.newBuilder() + .setName( + ReportDetailName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]", "[REPORT_DETAIL]") + .toString()) + .setSnapshotTime(Timestamp.newBuilder().build()) + .setReportPathPrefix("reportPathPrefix-1434070165") + .setShardsCount(-2027352923) + .setStatus(Status.newBuilder().build()) + .putAllLabels(new HashMap()) + .setTargetDatetime(DateTime.newBuilder().build()) + .setReportMetrics(ReportDetail.Metrics.newBuilder().build()) + .build(); + mockStorageInsights.addResponse(expectedResponse); + + String name = "name3373707"; + + ReportDetail actualResponse = client.getReportDetail(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorageInsights.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetReportDetailRequest actualRequest = ((GetReportDetailRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getReportDetailExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageInsights.addException(exception); + + try { + String name = "name3373707"; + client.getReportDetail(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-storageinsights/grpc-google-cloud-storageinsights-v1/pom.xml b/java-storageinsights/grpc-google-cloud-storageinsights-v1/pom.xml new file mode 100644 index 000000000000..cf18a820f900 --- /dev/null +++ b/java-storageinsights/grpc-google-cloud-storageinsights-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-storageinsights-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-storageinsights-v1 + GRPC library for google-cloud-storageinsights + + com.google.cloud + google-cloud-storageinsights-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-storageinsights-v1 + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-storageinsights/grpc-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/StorageInsightsGrpc.java b/java-storageinsights/grpc-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/StorageInsightsGrpc.java new file mode 100644 index 000000000000..b24cfec3b24c --- /dev/null +++ b/java-storageinsights/grpc-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/StorageInsightsGrpc.java @@ -0,0 +1,1101 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.storageinsights.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service describing handlers for resources
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/storageinsights/v1/storageinsights.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class StorageInsightsGrpc { + + private StorageInsightsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.storageinsights.v1.StorageInsights"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.ListReportConfigsRequest, + com.google.cloud.storageinsights.v1.ListReportConfigsResponse> + getListReportConfigsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListReportConfigs", + requestType = com.google.cloud.storageinsights.v1.ListReportConfigsRequest.class, + responseType = com.google.cloud.storageinsights.v1.ListReportConfigsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.ListReportConfigsRequest, + com.google.cloud.storageinsights.v1.ListReportConfigsResponse> + getListReportConfigsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.ListReportConfigsRequest, + com.google.cloud.storageinsights.v1.ListReportConfigsResponse> + getListReportConfigsMethod; + if ((getListReportConfigsMethod = StorageInsightsGrpc.getListReportConfigsMethod) == null) { + synchronized (StorageInsightsGrpc.class) { + if ((getListReportConfigsMethod = StorageInsightsGrpc.getListReportConfigsMethod) == null) { + StorageInsightsGrpc.getListReportConfigsMethod = + getListReportConfigsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListReportConfigs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.storageinsights.v1.ListReportConfigsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.storageinsights.v1.ListReportConfigsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new StorageInsightsMethodDescriptorSupplier("ListReportConfigs")) + .build(); + } + } + } + return getListReportConfigsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.GetReportConfigRequest, + com.google.cloud.storageinsights.v1.ReportConfig> + getGetReportConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetReportConfig", + requestType = com.google.cloud.storageinsights.v1.GetReportConfigRequest.class, + responseType = com.google.cloud.storageinsights.v1.ReportConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.GetReportConfigRequest, + com.google.cloud.storageinsights.v1.ReportConfig> + getGetReportConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.GetReportConfigRequest, + com.google.cloud.storageinsights.v1.ReportConfig> + getGetReportConfigMethod; + if ((getGetReportConfigMethod = StorageInsightsGrpc.getGetReportConfigMethod) == null) { + synchronized (StorageInsightsGrpc.class) { + if ((getGetReportConfigMethod = StorageInsightsGrpc.getGetReportConfigMethod) == null) { + StorageInsightsGrpc.getGetReportConfigMethod = + getGetReportConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetReportConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.storageinsights.v1.GetReportConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.storageinsights.v1.ReportConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new StorageInsightsMethodDescriptorSupplier("GetReportConfig")) + .build(); + } + } + } + return getGetReportConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.CreateReportConfigRequest, + com.google.cloud.storageinsights.v1.ReportConfig> + getCreateReportConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateReportConfig", + requestType = com.google.cloud.storageinsights.v1.CreateReportConfigRequest.class, + responseType = com.google.cloud.storageinsights.v1.ReportConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.CreateReportConfigRequest, + com.google.cloud.storageinsights.v1.ReportConfig> + getCreateReportConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.CreateReportConfigRequest, + com.google.cloud.storageinsights.v1.ReportConfig> + getCreateReportConfigMethod; + if ((getCreateReportConfigMethod = StorageInsightsGrpc.getCreateReportConfigMethod) == null) { + synchronized (StorageInsightsGrpc.class) { + if ((getCreateReportConfigMethod = StorageInsightsGrpc.getCreateReportConfigMethod) + == null) { + StorageInsightsGrpc.getCreateReportConfigMethod = + getCreateReportConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateReportConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.storageinsights.v1.CreateReportConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.storageinsights.v1.ReportConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new StorageInsightsMethodDescriptorSupplier("CreateReportConfig")) + .build(); + } + } + } + return getCreateReportConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest, + com.google.cloud.storageinsights.v1.ReportConfig> + getUpdateReportConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateReportConfig", + requestType = com.google.cloud.storageinsights.v1.UpdateReportConfigRequest.class, + responseType = com.google.cloud.storageinsights.v1.ReportConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest, + com.google.cloud.storageinsights.v1.ReportConfig> + getUpdateReportConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest, + com.google.cloud.storageinsights.v1.ReportConfig> + getUpdateReportConfigMethod; + if ((getUpdateReportConfigMethod = StorageInsightsGrpc.getUpdateReportConfigMethod) == null) { + synchronized (StorageInsightsGrpc.class) { + if ((getUpdateReportConfigMethod = StorageInsightsGrpc.getUpdateReportConfigMethod) + == null) { + StorageInsightsGrpc.getUpdateReportConfigMethod = + getUpdateReportConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateReportConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.storageinsights.v1.ReportConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new StorageInsightsMethodDescriptorSupplier("UpdateReportConfig")) + .build(); + } + } + } + return getUpdateReportConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest, com.google.protobuf.Empty> + getDeleteReportConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteReportConfig", + requestType = com.google.cloud.storageinsights.v1.DeleteReportConfigRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest, com.google.protobuf.Empty> + getDeleteReportConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest, + com.google.protobuf.Empty> + getDeleteReportConfigMethod; + if ((getDeleteReportConfigMethod = StorageInsightsGrpc.getDeleteReportConfigMethod) == null) { + synchronized (StorageInsightsGrpc.class) { + if ((getDeleteReportConfigMethod = StorageInsightsGrpc.getDeleteReportConfigMethod) + == null) { + StorageInsightsGrpc.getDeleteReportConfigMethod = + getDeleteReportConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteReportConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new StorageInsightsMethodDescriptorSupplier("DeleteReportConfig")) + .build(); + } + } + } + return getDeleteReportConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.ListReportDetailsRequest, + com.google.cloud.storageinsights.v1.ListReportDetailsResponse> + getListReportDetailsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListReportDetails", + requestType = com.google.cloud.storageinsights.v1.ListReportDetailsRequest.class, + responseType = com.google.cloud.storageinsights.v1.ListReportDetailsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.ListReportDetailsRequest, + com.google.cloud.storageinsights.v1.ListReportDetailsResponse> + getListReportDetailsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.ListReportDetailsRequest, + com.google.cloud.storageinsights.v1.ListReportDetailsResponse> + getListReportDetailsMethod; + if ((getListReportDetailsMethod = StorageInsightsGrpc.getListReportDetailsMethod) == null) { + synchronized (StorageInsightsGrpc.class) { + if ((getListReportDetailsMethod = StorageInsightsGrpc.getListReportDetailsMethod) == null) { + StorageInsightsGrpc.getListReportDetailsMethod = + getListReportDetailsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListReportDetails")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.storageinsights.v1.ListReportDetailsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.storageinsights.v1.ListReportDetailsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new StorageInsightsMethodDescriptorSupplier("ListReportDetails")) + .build(); + } + } + } + return getListReportDetailsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.GetReportDetailRequest, + com.google.cloud.storageinsights.v1.ReportDetail> + getGetReportDetailMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetReportDetail", + requestType = com.google.cloud.storageinsights.v1.GetReportDetailRequest.class, + responseType = com.google.cloud.storageinsights.v1.ReportDetail.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.GetReportDetailRequest, + com.google.cloud.storageinsights.v1.ReportDetail> + getGetReportDetailMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.storageinsights.v1.GetReportDetailRequest, + com.google.cloud.storageinsights.v1.ReportDetail> + getGetReportDetailMethod; + if ((getGetReportDetailMethod = StorageInsightsGrpc.getGetReportDetailMethod) == null) { + synchronized (StorageInsightsGrpc.class) { + if ((getGetReportDetailMethod = StorageInsightsGrpc.getGetReportDetailMethod) == null) { + StorageInsightsGrpc.getGetReportDetailMethod = + getGetReportDetailMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetReportDetail")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.storageinsights.v1.GetReportDetailRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.storageinsights.v1.ReportDetail + .getDefaultInstance())) + .setSchemaDescriptor( + new StorageInsightsMethodDescriptorSupplier("GetReportDetail")) + .build(); + } + } + } + return getGetReportDetailMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static StorageInsightsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public StorageInsightsStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageInsightsStub(channel, callOptions); + } + }; + return StorageInsightsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static StorageInsightsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public StorageInsightsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageInsightsBlockingStub(channel, callOptions); + } + }; + return StorageInsightsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static StorageInsightsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public StorageInsightsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageInsightsFutureStub(channel, callOptions); + } + }; + return StorageInsightsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists ReportConfigs in a given project and location.
+     * 
+ */ + default void listReportConfigs( + com.google.cloud.storageinsights.v1.ListReportConfigsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListReportConfigsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single ReportConfig.
+     * 
+ */ + default void getReportConfig( + com.google.cloud.storageinsights.v1.GetReportConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetReportConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new ReportConfig in a given project and location.
+     * 
+ */ + default void createReportConfig( + com.google.cloud.storageinsights.v1.CreateReportConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateReportConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single ReportConfig.
+     * 
+ */ + default void updateReportConfig( + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateReportConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single ReportConfig.
+     * 
+ */ + default void deleteReportConfig( + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteReportConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists ReportDetails in a given project and location.
+     * 
+ */ + default void listReportDetails( + com.google.cloud.storageinsights.v1.ListReportDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListReportDetailsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single ReportDetail.
+     * 
+ */ + default void getReportDetail( + com.google.cloud.storageinsights.v1.GetReportDetailRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetReportDetailMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service StorageInsights. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public abstract static class StorageInsightsImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return StorageInsightsGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service StorageInsights. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class StorageInsightsStub + extends io.grpc.stub.AbstractAsyncStub { + private StorageInsightsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected StorageInsightsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageInsightsStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists ReportConfigs in a given project and location.
+     * 
+ */ + public void listReportConfigs( + com.google.cloud.storageinsights.v1.ListReportConfigsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListReportConfigsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single ReportConfig.
+     * 
+ */ + public void getReportConfig( + com.google.cloud.storageinsights.v1.GetReportConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetReportConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new ReportConfig in a given project and location.
+     * 
+ */ + public void createReportConfig( + com.google.cloud.storageinsights.v1.CreateReportConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateReportConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single ReportConfig.
+     * 
+ */ + public void updateReportConfig( + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateReportConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single ReportConfig.
+     * 
+ */ + public void deleteReportConfig( + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteReportConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists ReportDetails in a given project and location.
+     * 
+ */ + public void listReportDetails( + com.google.cloud.storageinsights.v1.ListReportDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListReportDetailsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single ReportDetail.
+     * 
+ */ + public void getReportDetail( + com.google.cloud.storageinsights.v1.GetReportDetailRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetReportDetailMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service StorageInsights. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class StorageInsightsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private StorageInsightsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected StorageInsightsBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageInsightsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists ReportConfigs in a given project and location.
+     * 
+ */ + public com.google.cloud.storageinsights.v1.ListReportConfigsResponse listReportConfigs( + com.google.cloud.storageinsights.v1.ListReportConfigsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListReportConfigsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single ReportConfig.
+     * 
+ */ + public com.google.cloud.storageinsights.v1.ReportConfig getReportConfig( + com.google.cloud.storageinsights.v1.GetReportConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetReportConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new ReportConfig in a given project and location.
+     * 
+ */ + public com.google.cloud.storageinsights.v1.ReportConfig createReportConfig( + com.google.cloud.storageinsights.v1.CreateReportConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateReportConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single ReportConfig.
+     * 
+ */ + public com.google.cloud.storageinsights.v1.ReportConfig updateReportConfig( + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateReportConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single ReportConfig.
+     * 
+ */ + public com.google.protobuf.Empty deleteReportConfig( + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteReportConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists ReportDetails in a given project and location.
+     * 
+ */ + public com.google.cloud.storageinsights.v1.ListReportDetailsResponse listReportDetails( + com.google.cloud.storageinsights.v1.ListReportDetailsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListReportDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single ReportDetail.
+     * 
+ */ + public com.google.cloud.storageinsights.v1.ReportDetail getReportDetail( + com.google.cloud.storageinsights.v1.GetReportDetailRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetReportDetailMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service StorageInsights. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class StorageInsightsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private StorageInsightsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected StorageInsightsFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageInsightsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists ReportConfigs in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.storageinsights.v1.ListReportConfigsResponse> + listReportConfigs(com.google.cloud.storageinsights.v1.ListReportConfigsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListReportConfigsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single ReportConfig.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.storageinsights.v1.ReportConfig> + getReportConfig(com.google.cloud.storageinsights.v1.GetReportConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetReportConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new ReportConfig in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.storageinsights.v1.ReportConfig> + createReportConfig(com.google.cloud.storageinsights.v1.CreateReportConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateReportConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single ReportConfig.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.storageinsights.v1.ReportConfig> + updateReportConfig(com.google.cloud.storageinsights.v1.UpdateReportConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateReportConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single ReportConfig.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteReportConfig(com.google.cloud.storageinsights.v1.DeleteReportConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteReportConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists ReportDetails in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.storageinsights.v1.ListReportDetailsResponse> + listReportDetails(com.google.cloud.storageinsights.v1.ListReportDetailsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListReportDetailsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single ReportDetail.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.storageinsights.v1.ReportDetail> + getReportDetail(com.google.cloud.storageinsights.v1.GetReportDetailRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetReportDetailMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_REPORT_CONFIGS = 0; + private static final int METHODID_GET_REPORT_CONFIG = 1; + private static final int METHODID_CREATE_REPORT_CONFIG = 2; + private static final int METHODID_UPDATE_REPORT_CONFIG = 3; + private static final int METHODID_DELETE_REPORT_CONFIG = 4; + private static final int METHODID_LIST_REPORT_DETAILS = 5; + private static final int METHODID_GET_REPORT_DETAIL = 6; + + 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_LIST_REPORT_CONFIGS: + serviceImpl.listReportConfigs( + (com.google.cloud.storageinsights.v1.ListReportConfigsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.storageinsights.v1.ListReportConfigsResponse>) + responseObserver); + break; + case METHODID_GET_REPORT_CONFIG: + serviceImpl.getReportConfig( + (com.google.cloud.storageinsights.v1.GetReportConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_REPORT_CONFIG: + serviceImpl.createReportConfig( + (com.google.cloud.storageinsights.v1.CreateReportConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_REPORT_CONFIG: + serviceImpl.updateReportConfig( + (com.google.cloud.storageinsights.v1.UpdateReportConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_REPORT_CONFIG: + serviceImpl.deleteReportConfig( + (com.google.cloud.storageinsights.v1.DeleteReportConfigRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_REPORT_DETAILS: + serviceImpl.listReportDetails( + (com.google.cloud.storageinsights.v1.ListReportDetailsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.storageinsights.v1.ListReportDetailsResponse>) + responseObserver); + break; + case METHODID_GET_REPORT_DETAIL: + serviceImpl.getReportDetail( + (com.google.cloud.storageinsights.v1.GetReportDetailRequest) 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( + getListReportConfigsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.storageinsights.v1.ListReportConfigsRequest, + com.google.cloud.storageinsights.v1.ListReportConfigsResponse>( + service, METHODID_LIST_REPORT_CONFIGS))) + .addMethod( + getGetReportConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.storageinsights.v1.GetReportConfigRequest, + com.google.cloud.storageinsights.v1.ReportConfig>( + service, METHODID_GET_REPORT_CONFIG))) + .addMethod( + getCreateReportConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.storageinsights.v1.CreateReportConfigRequest, + com.google.cloud.storageinsights.v1.ReportConfig>( + service, METHODID_CREATE_REPORT_CONFIG))) + .addMethod( + getUpdateReportConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest, + com.google.cloud.storageinsights.v1.ReportConfig>( + service, METHODID_UPDATE_REPORT_CONFIG))) + .addMethod( + getDeleteReportConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_REPORT_CONFIG))) + .addMethod( + getListReportDetailsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.storageinsights.v1.ListReportDetailsRequest, + com.google.cloud.storageinsights.v1.ListReportDetailsResponse>( + service, METHODID_LIST_REPORT_DETAILS))) + .addMethod( + getGetReportDetailMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.storageinsights.v1.GetReportDetailRequest, + com.google.cloud.storageinsights.v1.ReportDetail>( + service, METHODID_GET_REPORT_DETAIL))) + .build(); + } + + private abstract static class StorageInsightsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + StorageInsightsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("StorageInsights"); + } + } + + private static final class StorageInsightsFileDescriptorSupplier + extends StorageInsightsBaseDescriptorSupplier { + StorageInsightsFileDescriptorSupplier() {} + } + + private static final class StorageInsightsMethodDescriptorSupplier + extends StorageInsightsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + StorageInsightsMethodDescriptorSupplier(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 (StorageInsightsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new StorageInsightsFileDescriptorSupplier()) + .addMethod(getListReportConfigsMethod()) + .addMethod(getGetReportConfigMethod()) + .addMethod(getCreateReportConfigMethod()) + .addMethod(getUpdateReportConfigMethod()) + .addMethod(getDeleteReportConfigMethod()) + .addMethod(getListReportDetailsMethod()) + .addMethod(getGetReportDetailMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-storageinsights/owlbot.py b/java-storageinsights/owlbot.py new file mode 100644 index 000000000000..03c0f6686d3f --- /dev/null +++ b/java-storageinsights/owlbot.py @@ -0,0 +1,36 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +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-storageinsights/pom.xml b/java-storageinsights/pom.xml new file mode 100644 index 000000000000..b590b792a2bf --- /dev/null +++ b/java-storageinsights/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + com.google.cloud + google-cloud-storageinsights-parent + pom + 0.0.1-SNAPSHOT + Google Storage Insights API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.10.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-storageinsights-parent + + + + + + com.google.cloud + google-cloud-storageinsights + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-storageinsights-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-storageinsights-v1 + 0.0.1-SNAPSHOT + + + + + + google-cloud-storageinsights + grpc-google-cloud-storageinsights-v1 + proto-google-cloud-storageinsights-v1 + google-cloud-storageinsights-bom + + + diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/clirr-ignored-differences.xml b/java-storageinsights/proto-google-cloud-storageinsights-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..edabca471116 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/storageinsights/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/storageinsights/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/storageinsights/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/pom.xml b/java-storageinsights/proto-google-cloud-storageinsights-v1/pom.xml new file mode 100644 index 000000000000..8b0417d98972 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-storageinsights-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-storageinsights-v1 + Proto library for google-cloud-storageinsights + + com.google.cloud + google-cloud-storageinsights-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-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CSVOptions.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CSVOptions.java new file mode 100644 index 000000000000..2aa350362bfd --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CSVOptions.java @@ -0,0 +1,903 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Options to configure CSV formatted reports.
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.CSVOptions} + */ +public final class CSVOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.CSVOptions) + CSVOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use CSVOptions.newBuilder() to construct. + private CSVOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CSVOptions() { + recordSeparator_ = ""; + delimiter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CSVOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CSVOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CSVOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.CSVOptions.class, + com.google.cloud.storageinsights.v1.CSVOptions.Builder.class); + } + + public static final int RECORD_SEPARATOR_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object recordSeparator_ = ""; + /** + * + * + *
+   * Record separator characters in CSV.
+   * 
+ * + * string record_separator = 1; + * + * @return The recordSeparator. + */ + @java.lang.Override + public java.lang.String getRecordSeparator() { + java.lang.Object ref = recordSeparator_; + 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(); + recordSeparator_ = s; + return s; + } + } + /** + * + * + *
+   * Record separator characters in CSV.
+   * 
+ * + * string record_separator = 1; + * + * @return The bytes for recordSeparator. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRecordSeparatorBytes() { + java.lang.Object ref = recordSeparator_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recordSeparator_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DELIMITER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object delimiter_ = ""; + /** + * + * + *
+   * Delimiter characters in CSV.
+   * 
+ * + * string delimiter = 2; + * + * @return The delimiter. + */ + @java.lang.Override + public java.lang.String getDelimiter() { + java.lang.Object ref = delimiter_; + 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(); + delimiter_ = s; + return s; + } + } + /** + * + * + *
+   * Delimiter characters in CSV.
+   * 
+ * + * string delimiter = 2; + * + * @return The bytes for delimiter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDelimiterBytes() { + java.lang.Object ref = delimiter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + delimiter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HEADER_REQUIRED_FIELD_NUMBER = 3; + private boolean headerRequired_ = false; + /** + * + * + *
+   * If set, will include a header row in the CSV report.
+   * 
+ * + * bool header_required = 3; + * + * @return The headerRequired. + */ + @java.lang.Override + public boolean getHeaderRequired() { + return headerRequired_; + } + + 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.GeneratedMessageV3.isStringEmpty(recordSeparator_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, recordSeparator_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(delimiter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, delimiter_); + } + if (headerRequired_ != false) { + output.writeBool(3, headerRequired_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordSeparator_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, recordSeparator_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(delimiter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, delimiter_); + } + if (headerRequired_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, headerRequired_); + } + 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.storageinsights.v1.CSVOptions)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.CSVOptions other = + (com.google.cloud.storageinsights.v1.CSVOptions) obj; + + if (!getRecordSeparator().equals(other.getRecordSeparator())) return false; + if (!getDelimiter().equals(other.getDelimiter())) return false; + if (getHeaderRequired() != other.getHeaderRequired()) 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) + RECORD_SEPARATOR_FIELD_NUMBER; + hash = (53 * hash) + getRecordSeparator().hashCode(); + hash = (37 * hash) + DELIMITER_FIELD_NUMBER; + hash = (53 * hash) + getDelimiter().hashCode(); + hash = (37 * hash) + HEADER_REQUIRED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getHeaderRequired()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.storageinsights.v1.CSVOptions parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.CSVOptions 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.storageinsights.v1.CSVOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.CSVOptions 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.storageinsights.v1.CSVOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.CSVOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.CSVOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.CSVOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.CSVOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.CSVOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.CSVOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.CSVOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.storageinsights.v1.CSVOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Options to configure CSV formatted reports.
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.CSVOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.CSVOptions) + com.google.cloud.storageinsights.v1.CSVOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CSVOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CSVOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.CSVOptions.class, + com.google.cloud.storageinsights.v1.CSVOptions.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.CSVOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + recordSeparator_ = ""; + delimiter_ = ""; + headerRequired_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CSVOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.CSVOptions getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.CSVOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.CSVOptions build() { + com.google.cloud.storageinsights.v1.CSVOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.CSVOptions buildPartial() { + com.google.cloud.storageinsights.v1.CSVOptions result = + new com.google.cloud.storageinsights.v1.CSVOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.storageinsights.v1.CSVOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.recordSeparator_ = recordSeparator_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.delimiter_ = delimiter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.headerRequired_ = headerRequired_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.CSVOptions) { + return mergeFrom((com.google.cloud.storageinsights.v1.CSVOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.CSVOptions other) { + if (other == com.google.cloud.storageinsights.v1.CSVOptions.getDefaultInstance()) return this; + if (!other.getRecordSeparator().isEmpty()) { + recordSeparator_ = other.recordSeparator_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDelimiter().isEmpty()) { + delimiter_ = other.delimiter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getHeaderRequired() != false) { + setHeaderRequired(other.getHeaderRequired()); + } + 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: + { + recordSeparator_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + delimiter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + headerRequired_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + 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 recordSeparator_ = ""; + /** + * + * + *
+     * Record separator characters in CSV.
+     * 
+ * + * string record_separator = 1; + * + * @return The recordSeparator. + */ + public java.lang.String getRecordSeparator() { + java.lang.Object ref = recordSeparator_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recordSeparator_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Record separator characters in CSV.
+     * 
+ * + * string record_separator = 1; + * + * @return The bytes for recordSeparator. + */ + public com.google.protobuf.ByteString getRecordSeparatorBytes() { + java.lang.Object ref = recordSeparator_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recordSeparator_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Record separator characters in CSV.
+     * 
+ * + * string record_separator = 1; + * + * @param value The recordSeparator to set. + * @return This builder for chaining. + */ + public Builder setRecordSeparator(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + recordSeparator_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Record separator characters in CSV.
+     * 
+ * + * string record_separator = 1; + * + * @return This builder for chaining. + */ + public Builder clearRecordSeparator() { + recordSeparator_ = getDefaultInstance().getRecordSeparator(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Record separator characters in CSV.
+     * 
+ * + * string record_separator = 1; + * + * @param value The bytes for recordSeparator to set. + * @return This builder for chaining. + */ + public Builder setRecordSeparatorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + recordSeparator_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object delimiter_ = ""; + /** + * + * + *
+     * Delimiter characters in CSV.
+     * 
+ * + * string delimiter = 2; + * + * @return The delimiter. + */ + public java.lang.String getDelimiter() { + java.lang.Object ref = delimiter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + delimiter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Delimiter characters in CSV.
+     * 
+ * + * string delimiter = 2; + * + * @return The bytes for delimiter. + */ + public com.google.protobuf.ByteString getDelimiterBytes() { + java.lang.Object ref = delimiter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + delimiter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Delimiter characters in CSV.
+     * 
+ * + * string delimiter = 2; + * + * @param value The delimiter to set. + * @return This builder for chaining. + */ + public Builder setDelimiter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + delimiter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Delimiter characters in CSV.
+     * 
+ * + * string delimiter = 2; + * + * @return This builder for chaining. + */ + public Builder clearDelimiter() { + delimiter_ = getDefaultInstance().getDelimiter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Delimiter characters in CSV.
+     * 
+ * + * string delimiter = 2; + * + * @param value The bytes for delimiter to set. + * @return This builder for chaining. + */ + public Builder setDelimiterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + delimiter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean headerRequired_; + /** + * + * + *
+     * If set, will include a header row in the CSV report.
+     * 
+ * + * bool header_required = 3; + * + * @return The headerRequired. + */ + @java.lang.Override + public boolean getHeaderRequired() { + return headerRequired_; + } + /** + * + * + *
+     * If set, will include a header row in the CSV report.
+     * 
+ * + * bool header_required = 3; + * + * @param value The headerRequired to set. + * @return This builder for chaining. + */ + public Builder setHeaderRequired(boolean value) { + + headerRequired_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, will include a header row in the CSV report.
+     * 
+ * + * bool header_required = 3; + * + * @return This builder for chaining. + */ + public Builder clearHeaderRequired() { + bitField0_ = (bitField0_ & ~0x00000004); + headerRequired_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.CSVOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.CSVOptions) + private static final com.google.cloud.storageinsights.v1.CSVOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.CSVOptions(); + } + + public static com.google.cloud.storageinsights.v1.CSVOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CSVOptions 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.storageinsights.v1.CSVOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CSVOptionsOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CSVOptionsOrBuilder.java new file mode 100644 index 000000000000..3159a2d1abc8 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CSVOptionsOrBuilder.java @@ -0,0 +1,88 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface CSVOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.CSVOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Record separator characters in CSV.
+   * 
+ * + * string record_separator = 1; + * + * @return The recordSeparator. + */ + java.lang.String getRecordSeparator(); + /** + * + * + *
+   * Record separator characters in CSV.
+   * 
+ * + * string record_separator = 1; + * + * @return The bytes for recordSeparator. + */ + com.google.protobuf.ByteString getRecordSeparatorBytes(); + + /** + * + * + *
+   * Delimiter characters in CSV.
+   * 
+ * + * string delimiter = 2; + * + * @return The delimiter. + */ + java.lang.String getDelimiter(); + /** + * + * + *
+   * Delimiter characters in CSV.
+   * 
+ * + * string delimiter = 2; + * + * @return The bytes for delimiter. + */ + com.google.protobuf.ByteString getDelimiterBytes(); + + /** + * + * + *
+   * If set, will include a header row in the CSV report.
+   * 
+ * + * bool header_required = 3; + * + * @return The headerRequired. + */ + boolean getHeaderRequired(); +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CloudStorageDestinationOptions.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CloudStorageDestinationOptions.java new file mode 100644 index 000000000000..4e0d2fb45c17 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CloudStorageDestinationOptions.java @@ -0,0 +1,833 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Options to store reports in storage systems.
+ * Next ID: 3
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.CloudStorageDestinationOptions} + */ +public final class CloudStorageDestinationOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.CloudStorageDestinationOptions) + CloudStorageDestinationOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use CloudStorageDestinationOptions.newBuilder() to construct. + private CloudStorageDestinationOptions( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CloudStorageDestinationOptions() { + bucket_ = ""; + destinationPath_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CloudStorageDestinationOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CloudStorageDestinationOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CloudStorageDestinationOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions.class, + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions.Builder.class); + } + + public static final int BUCKET_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object bucket_ = ""; + /** + * + * + *
+   * Destination bucket.
+   * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + @java.lang.Override + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + 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(); + bucket_ = s; + return s; + } + } + /** + * + * + *
+   * Destination bucket.
+   * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESTINATION_PATH_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object destinationPath_ = ""; + /** + * + * + *
+   * Destination path is the path in the bucket where the report should be
+   * generated.
+   * 
+ * + * string destination_path = 2; + * + * @return The destinationPath. + */ + @java.lang.Override + public java.lang.String getDestinationPath() { + java.lang.Object ref = destinationPath_; + 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(); + destinationPath_ = s; + return s; + } + } + /** + * + * + *
+   * Destination path is the path in the bucket where the report should be
+   * generated.
+   * 
+ * + * string destination_path = 2; + * + * @return The bytes for destinationPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationPathBytes() { + java.lang.Object ref = destinationPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationPath_ = 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.GeneratedMessageV3.isStringEmpty(bucket_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, bucket_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationPath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, destinationPath_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bucket_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationPath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, destinationPath_); + } + 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.storageinsights.v1.CloudStorageDestinationOptions)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions other = + (com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions) obj; + + if (!getBucket().equals(other.getBucket())) return false; + if (!getDestinationPath().equals(other.getDestinationPath())) 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) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucket().hashCode(); + hash = (37 * hash) + DESTINATION_PATH_FIELD_NUMBER; + hash = (53 * hash) + getDestinationPath().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions 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.storageinsights.v1.CloudStorageDestinationOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions 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.storageinsights.v1.CloudStorageDestinationOptions parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Options to store reports in storage systems.
+   * Next ID: 3
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.CloudStorageDestinationOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.CloudStorageDestinationOptions) + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CloudStorageDestinationOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CloudStorageDestinationOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions.class, + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions.Builder.class); + } + + // Construct using + // com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bucket_ = ""; + destinationPath_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CloudStorageDestinationOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions + getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions build() { + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions buildPartial() { + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions result = + new com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.bucket_ = bucket_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.destinationPath_ = destinationPath_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions) { + return mergeFrom( + (com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions other) { + if (other + == com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions + .getDefaultInstance()) return this; + if (!other.getBucket().isEmpty()) { + bucket_ = other.bucket_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDestinationPath().isEmpty()) { + destinationPath_ = other.destinationPath_; + 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: + { + bucket_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + destinationPath_ = 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.lang.Object bucket_ = ""; + /** + * + * + *
+     * Destination bucket.
+     * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Destination bucket.
+     * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Destination bucket.
+     * 
+ * + * string bucket = 1; + * + * @param value The bucket to set. + * @return This builder for chaining. + */ + public Builder setBucket(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bucket_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Destination bucket.
+     * 
+ * + * string bucket = 1; + * + * @return This builder for chaining. + */ + public Builder clearBucket() { + bucket_ = getDefaultInstance().getBucket(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Destination bucket.
+     * 
+ * + * string bucket = 1; + * + * @param value The bytes for bucket to set. + * @return This builder for chaining. + */ + public Builder setBucketBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bucket_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object destinationPath_ = ""; + /** + * + * + *
+     * Destination path is the path in the bucket where the report should be
+     * generated.
+     * 
+ * + * string destination_path = 2; + * + * @return The destinationPath. + */ + public java.lang.String getDestinationPath() { + java.lang.Object ref = destinationPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Destination path is the path in the bucket where the report should be
+     * generated.
+     * 
+ * + * string destination_path = 2; + * + * @return The bytes for destinationPath. + */ + public com.google.protobuf.ByteString getDestinationPathBytes() { + java.lang.Object ref = destinationPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Destination path is the path in the bucket where the report should be
+     * generated.
+     * 
+ * + * string destination_path = 2; + * + * @param value The destinationPath to set. + * @return This builder for chaining. + */ + public Builder setDestinationPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destinationPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Destination path is the path in the bucket where the report should be
+     * generated.
+     * 
+ * + * string destination_path = 2; + * + * @return This builder for chaining. + */ + public Builder clearDestinationPath() { + destinationPath_ = getDefaultInstance().getDestinationPath(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Destination path is the path in the bucket where the report should be
+     * generated.
+     * 
+ * + * string destination_path = 2; + * + * @param value The bytes for destinationPath to set. + * @return This builder for chaining. + */ + public Builder setDestinationPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destinationPath_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.CloudStorageDestinationOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.CloudStorageDestinationOptions) + private static final com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions(); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloudStorageDestinationOptions 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.storageinsights.v1.CloudStorageDestinationOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CloudStorageDestinationOptionsOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CloudStorageDestinationOptionsOrBuilder.java new file mode 100644 index 000000000000..4074072a7e20 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CloudStorageDestinationOptionsOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface CloudStorageDestinationOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.CloudStorageDestinationOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Destination bucket.
+   * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + java.lang.String getBucket(); + /** + * + * + *
+   * Destination bucket.
+   * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + com.google.protobuf.ByteString getBucketBytes(); + + /** + * + * + *
+   * Destination path is the path in the bucket where the report should be
+   * generated.
+   * 
+ * + * string destination_path = 2; + * + * @return The destinationPath. + */ + java.lang.String getDestinationPath(); + /** + * + * + *
+   * Destination path is the path in the bucket where the report should be
+   * generated.
+   * 
+ * + * string destination_path = 2; + * + * @return The bytes for destinationPath. + */ + com.google.protobuf.ByteString getDestinationPathBytes(); +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CloudStorageFilters.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CloudStorageFilters.java new file mode 100644 index 000000000000..b5c5e2cbc960 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CloudStorageFilters.java @@ -0,0 +1,632 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Options to filter data on storage systems.
+ * Next ID: 2
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.CloudStorageFilters} + */ +public final class CloudStorageFilters extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.CloudStorageFilters) + CloudStorageFiltersOrBuilder { + private static final long serialVersionUID = 0L; + // Use CloudStorageFilters.newBuilder() to construct. + private CloudStorageFilters(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CloudStorageFilters() { + bucket_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CloudStorageFilters(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CloudStorageFilters_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CloudStorageFilters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.CloudStorageFilters.class, + com.google.cloud.storageinsights.v1.CloudStorageFilters.Builder.class); + } + + public static final int BUCKET_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object bucket_ = ""; + /** + * + * + *
+   * Bucket for which the report will be generated.
+   * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + @java.lang.Override + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + 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(); + bucket_ = s; + return s; + } + } + /** + * + * + *
+   * Bucket for which the report will be generated.
+   * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = 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.GeneratedMessageV3.isStringEmpty(bucket_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, bucket_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bucket_); + } + 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.storageinsights.v1.CloudStorageFilters)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.CloudStorageFilters other = + (com.google.cloud.storageinsights.v1.CloudStorageFilters) obj; + + if (!getBucket().equals(other.getBucket())) 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) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucket().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.storageinsights.v1.CloudStorageFilters parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageFilters 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.storageinsights.v1.CloudStorageFilters parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageFilters 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.storageinsights.v1.CloudStorageFilters parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageFilters parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageFilters parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageFilters parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageFilters parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageFilters parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageFilters parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageFilters parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.storageinsights.v1.CloudStorageFilters prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Options to filter data on storage systems.
+   * Next ID: 2
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.CloudStorageFilters} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.CloudStorageFilters) + com.google.cloud.storageinsights.v1.CloudStorageFiltersOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CloudStorageFilters_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CloudStorageFilters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.CloudStorageFilters.class, + com.google.cloud.storageinsights.v1.CloudStorageFilters.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.CloudStorageFilters.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bucket_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CloudStorageFilters_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.CloudStorageFilters getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.CloudStorageFilters.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.CloudStorageFilters build() { + com.google.cloud.storageinsights.v1.CloudStorageFilters result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.CloudStorageFilters buildPartial() { + com.google.cloud.storageinsights.v1.CloudStorageFilters result = + new com.google.cloud.storageinsights.v1.CloudStorageFilters(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.storageinsights.v1.CloudStorageFilters result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.bucket_ = bucket_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.CloudStorageFilters) { + return mergeFrom((com.google.cloud.storageinsights.v1.CloudStorageFilters) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.CloudStorageFilters other) { + if (other == com.google.cloud.storageinsights.v1.CloudStorageFilters.getDefaultInstance()) + return this; + if (!other.getBucket().isEmpty()) { + bucket_ = other.bucket_; + 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: + { + bucket_ = 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 bucket_ = ""; + /** + * + * + *
+     * Bucket for which the report will be generated.
+     * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Bucket for which the report will be generated.
+     * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Bucket for which the report will be generated.
+     * 
+ * + * string bucket = 1; + * + * @param value The bucket to set. + * @return This builder for chaining. + */ + public Builder setBucket(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bucket_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Bucket for which the report will be generated.
+     * 
+ * + * string bucket = 1; + * + * @return This builder for chaining. + */ + public Builder clearBucket() { + bucket_ = getDefaultInstance().getBucket(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Bucket for which the report will be generated.
+     * 
+ * + * string bucket = 1; + * + * @param value The bytes for bucket to set. + * @return This builder for chaining. + */ + public Builder setBucketBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bucket_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.CloudStorageFilters) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.CloudStorageFilters) + private static final com.google.cloud.storageinsights.v1.CloudStorageFilters DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.CloudStorageFilters(); + } + + public static com.google.cloud.storageinsights.v1.CloudStorageFilters getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloudStorageFilters 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.storageinsights.v1.CloudStorageFilters getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CloudStorageFiltersOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CloudStorageFiltersOrBuilder.java new file mode 100644 index 000000000000..9b1681b61023 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CloudStorageFiltersOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface CloudStorageFiltersOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.CloudStorageFilters) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Bucket for which the report will be generated.
+   * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + java.lang.String getBucket(); + /** + * + * + *
+   * Bucket for which the report will be generated.
+   * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + com.google.protobuf.ByteString getBucketBytes(); +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CreateReportConfigRequest.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CreateReportConfigRequest.java new file mode 100644 index 000000000000..498b173d05fd --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CreateReportConfigRequest.java @@ -0,0 +1,1191 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Message for creating a ReportConfig
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.CreateReportConfigRequest} + */ +public final class CreateReportConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.CreateReportConfigRequest) + CreateReportConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateReportConfigRequest.newBuilder() to construct. + private CreateReportConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateReportConfigRequest() { + parent_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateReportConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CreateReportConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CreateReportConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.CreateReportConfigRequest.class, + com.google.cloud.storageinsights.v1.CreateReportConfigRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * 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. Value for parent.
+   * 
+ * + * + * 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_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.storageinsights.v1.ReportConfig reportConfig_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the reportConfig field is set. + */ + @java.lang.Override + public boolean hasReportConfig() { + return reportConfig_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The reportConfig. + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportConfig getReportConfig() { + return reportConfig_ == null + ? com.google.cloud.storageinsights.v1.ReportConfig.getDefaultInstance() + : reportConfig_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportConfigOrBuilder getReportConfigOrBuilder() { + return reportConfig_ == null + ? com.google.cloud.storageinsights.v1.ReportConfig.getDefaultInstance() + : reportConfig_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = 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.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (reportConfig_ != null) { + output.writeMessage(3, getReportConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (reportConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getReportConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); + } + 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.storageinsights.v1.CreateReportConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.CreateReportConfigRequest other = + (com.google.cloud.storageinsights.v1.CreateReportConfigRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasReportConfig() != other.hasReportConfig()) return false; + if (hasReportConfig()) { + if (!getReportConfig().equals(other.getReportConfig())) return false; + } + if (!getRequestId().equals(other.getRequestId())) 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(); + if (hasReportConfig()) { + hash = (37 * hash) + REPORT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getReportConfig().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.storageinsights.v1.CreateReportConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.CreateReportConfigRequest 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.storageinsights.v1.CreateReportConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.CreateReportConfigRequest 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.storageinsights.v1.CreateReportConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.CreateReportConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.CreateReportConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.CreateReportConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.CreateReportConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.CreateReportConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.CreateReportConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.CreateReportConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.storageinsights.v1.CreateReportConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for creating a ReportConfig
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.CreateReportConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.CreateReportConfigRequest) + com.google.cloud.storageinsights.v1.CreateReportConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CreateReportConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CreateReportConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.CreateReportConfigRequest.class, + com.google.cloud.storageinsights.v1.CreateReportConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.CreateReportConfigRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + reportConfig_ = null; + if (reportConfigBuilder_ != null) { + reportConfigBuilder_.dispose(); + reportConfigBuilder_ = null; + } + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_CreateReportConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.CreateReportConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.CreateReportConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.CreateReportConfigRequest build() { + com.google.cloud.storageinsights.v1.CreateReportConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.CreateReportConfigRequest buildPartial() { + com.google.cloud.storageinsights.v1.CreateReportConfigRequest result = + new com.google.cloud.storageinsights.v1.CreateReportConfigRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.storageinsights.v1.CreateReportConfigRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.reportConfig_ = + reportConfigBuilder_ == null ? reportConfig_ : reportConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.CreateReportConfigRequest) { + return mergeFrom((com.google.cloud.storageinsights.v1.CreateReportConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.CreateReportConfigRequest other) { + if (other + == com.google.cloud.storageinsights.v1.CreateReportConfigRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasReportConfig()) { + mergeReportConfig(other.getReportConfig()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + 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 26: + { + input.readMessage(getReportConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + 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 parent_ = ""; + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * 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. Value for parent.
+     * 
+ * + * + * 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. Value for parent.
+     * 
+ * + * + * 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. Value for parent.
+     * 
+ * + * + * 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. Value for parent.
+     * 
+ * + * + * 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 com.google.cloud.storageinsights.v1.ReportConfig reportConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.ReportConfig, + com.google.cloud.storageinsights.v1.ReportConfig.Builder, + com.google.cloud.storageinsights.v1.ReportConfigOrBuilder> + reportConfigBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the reportConfig field is set. + */ + public boolean hasReportConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The reportConfig. + */ + public com.google.cloud.storageinsights.v1.ReportConfig getReportConfig() { + if (reportConfigBuilder_ == null) { + return reportConfig_ == null + ? com.google.cloud.storageinsights.v1.ReportConfig.getDefaultInstance() + : reportConfig_; + } else { + return reportConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setReportConfig(com.google.cloud.storageinsights.v1.ReportConfig value) { + if (reportConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + reportConfig_ = value; + } else { + reportConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setReportConfig( + com.google.cloud.storageinsights.v1.ReportConfig.Builder builderForValue) { + if (reportConfigBuilder_ == null) { + reportConfig_ = builderForValue.build(); + } else { + reportConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeReportConfig(com.google.cloud.storageinsights.v1.ReportConfig value) { + if (reportConfigBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && reportConfig_ != null + && reportConfig_ + != com.google.cloud.storageinsights.v1.ReportConfig.getDefaultInstance()) { + getReportConfigBuilder().mergeFrom(value); + } else { + reportConfig_ = value; + } + } else { + reportConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearReportConfig() { + bitField0_ = (bitField0_ & ~0x00000002); + reportConfig_ = null; + if (reportConfigBuilder_ != null) { + reportConfigBuilder_.dispose(); + reportConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.storageinsights.v1.ReportConfig.Builder getReportConfigBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getReportConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.storageinsights.v1.ReportConfigOrBuilder getReportConfigOrBuilder() { + if (reportConfigBuilder_ != null) { + return reportConfigBuilder_.getMessageOrBuilder(); + } else { + return reportConfig_ == null + ? com.google.cloud.storageinsights.v1.ReportConfig.getDefaultInstance() + : reportConfig_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.ReportConfig, + com.google.cloud.storageinsights.v1.ReportConfig.Builder, + com.google.cloud.storageinsights.v1.ReportConfigOrBuilder> + getReportConfigFieldBuilder() { + if (reportConfigBuilder_ == null) { + reportConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.ReportConfig, + com.google.cloud.storageinsights.v1.ReportConfig.Builder, + com.google.cloud.storageinsights.v1.ReportConfigOrBuilder>( + getReportConfig(), getParentForChildren(), isClean()); + reportConfig_ = null; + } + return reportConfigBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.CreateReportConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.CreateReportConfigRequest) + private static final com.google.cloud.storageinsights.v1.CreateReportConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.CreateReportConfigRequest(); + } + + public static com.google.cloud.storageinsights.v1.CreateReportConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateReportConfigRequest 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.storageinsights.v1.CreateReportConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CreateReportConfigRequestOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CreateReportConfigRequestOrBuilder.java new file mode 100644 index 000000000000..ef653eb532d7 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/CreateReportConfigRequestOrBuilder.java @@ -0,0 +1,140 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface CreateReportConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.CreateReportConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the reportConfig field is set. + */ + boolean hasReportConfig(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The reportConfig. + */ + com.google.cloud.storageinsights.v1.ReportConfig getReportConfig(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.storageinsights.v1.ReportConfigOrBuilder getReportConfigOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/DeleteReportConfigRequest.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/DeleteReportConfigRequest.java new file mode 100644 index 000000000000..6a67a9a627c9 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/DeleteReportConfigRequest.java @@ -0,0 +1,993 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Message for deleting a ReportConfig
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.DeleteReportConfigRequest} + */ +public final class DeleteReportConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.DeleteReportConfigRequest) + DeleteReportConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteReportConfigRequest.newBuilder() to construct. + private DeleteReportConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteReportConfigRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteReportConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_DeleteReportConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_DeleteReportConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest.class, + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * 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. Name of the resource
+   * 
+ * + * + * 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 FORCE_FIELD_NUMBER = 2; + private boolean force_ = false; + /** + * + * + *
+   * Optional. If set, all ReportDetails for this ReportConfig will be deleted.
+   * 
+ * + * bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = 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.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (force_ != false) { + output.writeBool(2, force_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, force_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + 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.storageinsights.v1.DeleteReportConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest other = + (com.google.cloud.storageinsights.v1.DeleteReportConfigRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getForce() != other.getForce()) return false; + if (!getRequestId().equals(other.getRequestId())) 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) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.storageinsights.v1.DeleteReportConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.DeleteReportConfigRequest 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.storageinsights.v1.DeleteReportConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.DeleteReportConfigRequest 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.storageinsights.v1.DeleteReportConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.DeleteReportConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.DeleteReportConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.DeleteReportConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.DeleteReportConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.DeleteReportConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.DeleteReportConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.DeleteReportConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for deleting a ReportConfig
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.DeleteReportConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.DeleteReportConfigRequest) + com.google.cloud.storageinsights.v1.DeleteReportConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_DeleteReportConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_DeleteReportConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest.class, + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.DeleteReportConfigRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + force_ = false; + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_DeleteReportConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.DeleteReportConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.DeleteReportConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.DeleteReportConfigRequest build() { + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.DeleteReportConfigRequest buildPartial() { + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest result = + new com.google.cloud.storageinsights.v1.DeleteReportConfigRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.storageinsights.v1.DeleteReportConfigRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.force_ = force_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.DeleteReportConfigRequest) { + return mergeFrom((com.google.cloud.storageinsights.v1.DeleteReportConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.DeleteReportConfigRequest other) { + if (other + == com.google.cloud.storageinsights.v1.DeleteReportConfigRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + 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 16: + { + force_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + requestId_ = 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 name_ = ""; + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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 force_; + /** + * + * + *
+     * Optional. If set, all ReportDetails for this ReportConfig will be deleted.
+     * 
+ * + * bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * Optional. If set, all ReportDetails for this ReportConfig will be deleted.
+     * 
+ * + * bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, all ReportDetails for this ReportConfig will be deleted.
+     * 
+ * + * bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + bitField0_ = (bitField0_ & ~0x00000002); + force_ = false; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.DeleteReportConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.DeleteReportConfigRequest) + private static final com.google.cloud.storageinsights.v1.DeleteReportConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.DeleteReportConfigRequest(); + } + + public static com.google.cloud.storageinsights.v1.DeleteReportConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteReportConfigRequest 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.storageinsights.v1.DeleteReportConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/DeleteReportConfigRequestOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/DeleteReportConfigRequestOrBuilder.java new file mode 100644 index 000000000000..edecd7cb7afa --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/DeleteReportConfigRequestOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface DeleteReportConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.DeleteReportConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * 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, all ReportDetails for this ReportConfig will be deleted.
+   * 
+ * + * bool force = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + boolean getForce(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/FrequencyOptions.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/FrequencyOptions.java new file mode 100644 index 000000000000..9482acabd113 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/FrequencyOptions.java @@ -0,0 +1,1289 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * ReportConfig Resource:
+ * Options to setup frequency of report generation.
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.FrequencyOptions} + */ +public final class FrequencyOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.FrequencyOptions) + FrequencyOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use FrequencyOptions.newBuilder() to construct. + private FrequencyOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FrequencyOptions() { + frequency_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FrequencyOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_FrequencyOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_FrequencyOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.FrequencyOptions.class, + com.google.cloud.storageinsights.v1.FrequencyOptions.Builder.class); + } + + /** + * + * + *
+   * This ENUM specifies possible frequencies of report generation.
+   * 
+ * + * Protobuf enum {@code google.cloud.storageinsights.v1.FrequencyOptions.Frequency} + */ + public enum Frequency implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * FREQUENCY_UNSPECIFIED = 0; + */ + FREQUENCY_UNSPECIFIED(0), + /** + * + * + *
+     * Report will be generated daily.
+     * 
+ * + * DAILY = 1; + */ + DAILY(1), + /** + * + * + *
+     * Report will be generated weekly.
+     * 
+ * + * WEEKLY = 2; + */ + WEEKLY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * FREQUENCY_UNSPECIFIED = 0; + */ + public static final int FREQUENCY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Report will be generated daily.
+     * 
+ * + * DAILY = 1; + */ + public static final int DAILY_VALUE = 1; + /** + * + * + *
+     * Report will be generated weekly.
+     * 
+ * + * WEEKLY = 2; + */ + public static final int WEEKLY_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Frequency valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Frequency forNumber(int value) { + switch (value) { + case 0: + return FREQUENCY_UNSPECIFIED; + case 1: + return DAILY; + case 2: + return WEEKLY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Frequency findValueByNumber(int number) { + return Frequency.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.FrequencyOptions.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Frequency[] VALUES = values(); + + public static Frequency valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Frequency(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.storageinsights.v1.FrequencyOptions.Frequency) + } + + public static final int FREQUENCY_FIELD_NUMBER = 1; + private int frequency_ = 0; + /** + * + * + *
+   * Frequency of report generation.
+   * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions.Frequency frequency = 1; + * + * @return The enum numeric value on the wire for frequency. + */ + @java.lang.Override + public int getFrequencyValue() { + return frequency_; + } + /** + * + * + *
+   * Frequency of report generation.
+   * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions.Frequency frequency = 1; + * + * @return The frequency. + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.FrequencyOptions.Frequency getFrequency() { + com.google.cloud.storageinsights.v1.FrequencyOptions.Frequency result = + com.google.cloud.storageinsights.v1.FrequencyOptions.Frequency.forNumber(frequency_); + return result == null + ? com.google.cloud.storageinsights.v1.FrequencyOptions.Frequency.UNRECOGNIZED + : result; + } + + public static final int START_DATE_FIELD_NUMBER = 2; + private com.google.type.Date startDate_; + /** + * + * + *
+   * The date from which report generation should start.
+   * UTC time zone.
+   * 
+ * + * .google.type.Date start_date = 2; + * + * @return Whether the startDate field is set. + */ + @java.lang.Override + public boolean hasStartDate() { + return startDate_ != null; + } + /** + * + * + *
+   * The date from which report generation should start.
+   * UTC time zone.
+   * 
+ * + * .google.type.Date start_date = 2; + * + * @return The startDate. + */ + @java.lang.Override + public com.google.type.Date getStartDate() { + return startDate_ == null ? com.google.type.Date.getDefaultInstance() : startDate_; + } + /** + * + * + *
+   * The date from which report generation should start.
+   * UTC time zone.
+   * 
+ * + * .google.type.Date start_date = 2; + */ + @java.lang.Override + public com.google.type.DateOrBuilder getStartDateOrBuilder() { + return startDate_ == null ? com.google.type.Date.getDefaultInstance() : startDate_; + } + + public static final int END_DATE_FIELD_NUMBER = 3; + private com.google.type.Date endDate_; + /** + * + * + *
+   * The date on which report generation should stop (Inclusive).
+   * UTC time zone.
+   * 
+ * + * .google.type.Date end_date = 3; + * + * @return Whether the endDate field is set. + */ + @java.lang.Override + public boolean hasEndDate() { + return endDate_ != null; + } + /** + * + * + *
+   * The date on which report generation should stop (Inclusive).
+   * UTC time zone.
+   * 
+ * + * .google.type.Date end_date = 3; + * + * @return The endDate. + */ + @java.lang.Override + public com.google.type.Date getEndDate() { + return endDate_ == null ? com.google.type.Date.getDefaultInstance() : endDate_; + } + /** + * + * + *
+   * The date on which report generation should stop (Inclusive).
+   * UTC time zone.
+   * 
+ * + * .google.type.Date end_date = 3; + */ + @java.lang.Override + public com.google.type.DateOrBuilder getEndDateOrBuilder() { + return endDate_ == null ? com.google.type.Date.getDefaultInstance() : endDate_; + } + + 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 (frequency_ + != com.google.cloud.storageinsights.v1.FrequencyOptions.Frequency.FREQUENCY_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, frequency_); + } + if (startDate_ != null) { + output.writeMessage(2, getStartDate()); + } + if (endDate_ != null) { + output.writeMessage(3, getEndDate()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (frequency_ + != com.google.cloud.storageinsights.v1.FrequencyOptions.Frequency.FREQUENCY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, frequency_); + } + if (startDate_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartDate()); + } + if (endDate_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndDate()); + } + 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.storageinsights.v1.FrequencyOptions)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.FrequencyOptions other = + (com.google.cloud.storageinsights.v1.FrequencyOptions) obj; + + if (frequency_ != other.frequency_) return false; + if (hasStartDate() != other.hasStartDate()) return false; + if (hasStartDate()) { + if (!getStartDate().equals(other.getStartDate())) return false; + } + if (hasEndDate() != other.hasEndDate()) return false; + if (hasEndDate()) { + if (!getEndDate().equals(other.getEndDate())) 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) + FREQUENCY_FIELD_NUMBER; + hash = (53 * hash) + frequency_; + if (hasStartDate()) { + hash = (37 * hash) + START_DATE_FIELD_NUMBER; + hash = (53 * hash) + getStartDate().hashCode(); + } + if (hasEndDate()) { + hash = (37 * hash) + END_DATE_FIELD_NUMBER; + hash = (53 * hash) + getEndDate().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.storageinsights.v1.FrequencyOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.FrequencyOptions 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.storageinsights.v1.FrequencyOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.FrequencyOptions 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.storageinsights.v1.FrequencyOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.FrequencyOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.FrequencyOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.FrequencyOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.FrequencyOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.FrequencyOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.FrequencyOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.FrequencyOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.storageinsights.v1.FrequencyOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * ReportConfig Resource:
+   * Options to setup frequency of report generation.
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.FrequencyOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.FrequencyOptions) + com.google.cloud.storageinsights.v1.FrequencyOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_FrequencyOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_FrequencyOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.FrequencyOptions.class, + com.google.cloud.storageinsights.v1.FrequencyOptions.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.FrequencyOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + frequency_ = 0; + startDate_ = null; + if (startDateBuilder_ != null) { + startDateBuilder_.dispose(); + startDateBuilder_ = null; + } + endDate_ = null; + if (endDateBuilder_ != null) { + endDateBuilder_.dispose(); + endDateBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_FrequencyOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.FrequencyOptions getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.FrequencyOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.FrequencyOptions build() { + com.google.cloud.storageinsights.v1.FrequencyOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.FrequencyOptions buildPartial() { + com.google.cloud.storageinsights.v1.FrequencyOptions result = + new com.google.cloud.storageinsights.v1.FrequencyOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.storageinsights.v1.FrequencyOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.frequency_ = frequency_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startDate_ = startDateBuilder_ == null ? startDate_ : startDateBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endDate_ = endDateBuilder_ == null ? endDate_ : endDateBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.FrequencyOptions) { + return mergeFrom((com.google.cloud.storageinsights.v1.FrequencyOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.FrequencyOptions other) { + if (other == com.google.cloud.storageinsights.v1.FrequencyOptions.getDefaultInstance()) + return this; + if (other.frequency_ != 0) { + setFrequencyValue(other.getFrequencyValue()); + } + if (other.hasStartDate()) { + mergeStartDate(other.getStartDate()); + } + if (other.hasEndDate()) { + mergeEndDate(other.getEndDate()); + } + 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 8: + { + frequency_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getStartDateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getEndDateFieldBuilder().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 int frequency_ = 0; + /** + * + * + *
+     * Frequency of report generation.
+     * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions.Frequency frequency = 1; + * + * @return The enum numeric value on the wire for frequency. + */ + @java.lang.Override + public int getFrequencyValue() { + return frequency_; + } + /** + * + * + *
+     * Frequency of report generation.
+     * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions.Frequency frequency = 1; + * + * @param value The enum numeric value on the wire for frequency to set. + * @return This builder for chaining. + */ + public Builder setFrequencyValue(int value) { + frequency_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Frequency of report generation.
+     * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions.Frequency frequency = 1; + * + * @return The frequency. + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.FrequencyOptions.Frequency getFrequency() { + com.google.cloud.storageinsights.v1.FrequencyOptions.Frequency result = + com.google.cloud.storageinsights.v1.FrequencyOptions.Frequency.forNumber(frequency_); + return result == null + ? com.google.cloud.storageinsights.v1.FrequencyOptions.Frequency.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Frequency of report generation.
+     * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions.Frequency frequency = 1; + * + * @param value The frequency to set. + * @return This builder for chaining. + */ + public Builder setFrequency( + com.google.cloud.storageinsights.v1.FrequencyOptions.Frequency value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + frequency_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Frequency of report generation.
+     * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions.Frequency frequency = 1; + * + * @return This builder for chaining. + */ + public Builder clearFrequency() { + bitField0_ = (bitField0_ & ~0x00000001); + frequency_ = 0; + onChanged(); + return this; + } + + private com.google.type.Date startDate_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + startDateBuilder_; + /** + * + * + *
+     * The date from which report generation should start.
+     * UTC time zone.
+     * 
+ * + * .google.type.Date start_date = 2; + * + * @return Whether the startDate field is set. + */ + public boolean hasStartDate() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The date from which report generation should start.
+     * UTC time zone.
+     * 
+ * + * .google.type.Date start_date = 2; + * + * @return The startDate. + */ + public com.google.type.Date getStartDate() { + if (startDateBuilder_ == null) { + return startDate_ == null ? com.google.type.Date.getDefaultInstance() : startDate_; + } else { + return startDateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The date from which report generation should start.
+     * UTC time zone.
+     * 
+ * + * .google.type.Date start_date = 2; + */ + public Builder setStartDate(com.google.type.Date value) { + if (startDateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startDate_ = value; + } else { + startDateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The date from which report generation should start.
+     * UTC time zone.
+     * 
+ * + * .google.type.Date start_date = 2; + */ + public Builder setStartDate(com.google.type.Date.Builder builderForValue) { + if (startDateBuilder_ == null) { + startDate_ = builderForValue.build(); + } else { + startDateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The date from which report generation should start.
+     * UTC time zone.
+     * 
+ * + * .google.type.Date start_date = 2; + */ + public Builder mergeStartDate(com.google.type.Date value) { + if (startDateBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startDate_ != null + && startDate_ != com.google.type.Date.getDefaultInstance()) { + getStartDateBuilder().mergeFrom(value); + } else { + startDate_ = value; + } + } else { + startDateBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The date from which report generation should start.
+     * UTC time zone.
+     * 
+ * + * .google.type.Date start_date = 2; + */ + public Builder clearStartDate() { + bitField0_ = (bitField0_ & ~0x00000002); + startDate_ = null; + if (startDateBuilder_ != null) { + startDateBuilder_.dispose(); + startDateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The date from which report generation should start.
+     * UTC time zone.
+     * 
+ * + * .google.type.Date start_date = 2; + */ + public com.google.type.Date.Builder getStartDateBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getStartDateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The date from which report generation should start.
+     * UTC time zone.
+     * 
+ * + * .google.type.Date start_date = 2; + */ + public com.google.type.DateOrBuilder getStartDateOrBuilder() { + if (startDateBuilder_ != null) { + return startDateBuilder_.getMessageOrBuilder(); + } else { + return startDate_ == null ? com.google.type.Date.getDefaultInstance() : startDate_; + } + } + /** + * + * + *
+     * The date from which report generation should start.
+     * UTC time zone.
+     * 
+ * + * .google.type.Date start_date = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + getStartDateFieldBuilder() { + if (startDateBuilder_ == null) { + startDateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder>( + getStartDate(), getParentForChildren(), isClean()); + startDate_ = null; + } + return startDateBuilder_; + } + + private com.google.type.Date endDate_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + endDateBuilder_; + /** + * + * + *
+     * The date on which report generation should stop (Inclusive).
+     * UTC time zone.
+     * 
+ * + * .google.type.Date end_date = 3; + * + * @return Whether the endDate field is set. + */ + public boolean hasEndDate() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The date on which report generation should stop (Inclusive).
+     * UTC time zone.
+     * 
+ * + * .google.type.Date end_date = 3; + * + * @return The endDate. + */ + public com.google.type.Date getEndDate() { + if (endDateBuilder_ == null) { + return endDate_ == null ? com.google.type.Date.getDefaultInstance() : endDate_; + } else { + return endDateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The date on which report generation should stop (Inclusive).
+     * UTC time zone.
+     * 
+ * + * .google.type.Date end_date = 3; + */ + public Builder setEndDate(com.google.type.Date value) { + if (endDateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endDate_ = value; + } else { + endDateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The date on which report generation should stop (Inclusive).
+     * UTC time zone.
+     * 
+ * + * .google.type.Date end_date = 3; + */ + public Builder setEndDate(com.google.type.Date.Builder builderForValue) { + if (endDateBuilder_ == null) { + endDate_ = builderForValue.build(); + } else { + endDateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The date on which report generation should stop (Inclusive).
+     * UTC time zone.
+     * 
+ * + * .google.type.Date end_date = 3; + */ + public Builder mergeEndDate(com.google.type.Date value) { + if (endDateBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && endDate_ != null + && endDate_ != com.google.type.Date.getDefaultInstance()) { + getEndDateBuilder().mergeFrom(value); + } else { + endDate_ = value; + } + } else { + endDateBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The date on which report generation should stop (Inclusive).
+     * UTC time zone.
+     * 
+ * + * .google.type.Date end_date = 3; + */ + public Builder clearEndDate() { + bitField0_ = (bitField0_ & ~0x00000004); + endDate_ = null; + if (endDateBuilder_ != null) { + endDateBuilder_.dispose(); + endDateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The date on which report generation should stop (Inclusive).
+     * UTC time zone.
+     * 
+ * + * .google.type.Date end_date = 3; + */ + public com.google.type.Date.Builder getEndDateBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getEndDateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The date on which report generation should stop (Inclusive).
+     * UTC time zone.
+     * 
+ * + * .google.type.Date end_date = 3; + */ + public com.google.type.DateOrBuilder getEndDateOrBuilder() { + if (endDateBuilder_ != null) { + return endDateBuilder_.getMessageOrBuilder(); + } else { + return endDate_ == null ? com.google.type.Date.getDefaultInstance() : endDate_; + } + } + /** + * + * + *
+     * The date on which report generation should stop (Inclusive).
+     * UTC time zone.
+     * 
+ * + * .google.type.Date end_date = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + getEndDateFieldBuilder() { + if (endDateBuilder_ == null) { + endDateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder>( + getEndDate(), getParentForChildren(), isClean()); + endDate_ = null; + } + return endDateBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.FrequencyOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.FrequencyOptions) + private static final com.google.cloud.storageinsights.v1.FrequencyOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.FrequencyOptions(); + } + + public static com.google.cloud.storageinsights.v1.FrequencyOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FrequencyOptions 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.storageinsights.v1.FrequencyOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/FrequencyOptionsOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/FrequencyOptionsOrBuilder.java new file mode 100644 index 000000000000..36feb0d24554 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/FrequencyOptionsOrBuilder.java @@ -0,0 +1,126 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface FrequencyOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.FrequencyOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Frequency of report generation.
+   * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions.Frequency frequency = 1; + * + * @return The enum numeric value on the wire for frequency. + */ + int getFrequencyValue(); + /** + * + * + *
+   * Frequency of report generation.
+   * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions.Frequency frequency = 1; + * + * @return The frequency. + */ + com.google.cloud.storageinsights.v1.FrequencyOptions.Frequency getFrequency(); + + /** + * + * + *
+   * The date from which report generation should start.
+   * UTC time zone.
+   * 
+ * + * .google.type.Date start_date = 2; + * + * @return Whether the startDate field is set. + */ + boolean hasStartDate(); + /** + * + * + *
+   * The date from which report generation should start.
+   * UTC time zone.
+   * 
+ * + * .google.type.Date start_date = 2; + * + * @return The startDate. + */ + com.google.type.Date getStartDate(); + /** + * + * + *
+   * The date from which report generation should start.
+   * UTC time zone.
+   * 
+ * + * .google.type.Date start_date = 2; + */ + com.google.type.DateOrBuilder getStartDateOrBuilder(); + + /** + * + * + *
+   * The date on which report generation should stop (Inclusive).
+   * UTC time zone.
+   * 
+ * + * .google.type.Date end_date = 3; + * + * @return Whether the endDate field is set. + */ + boolean hasEndDate(); + /** + * + * + *
+   * The date on which report generation should stop (Inclusive).
+   * UTC time zone.
+   * 
+ * + * .google.type.Date end_date = 3; + * + * @return The endDate. + */ + com.google.type.Date getEndDate(); + /** + * + * + *
+   * The date on which report generation should stop (Inclusive).
+   * UTC time zone.
+   * 
+ * + * .google.type.Date end_date = 3; + */ + com.google.type.DateOrBuilder getEndDateOrBuilder(); +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/GetReportConfigRequest.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/GetReportConfigRequest.java new file mode 100644 index 000000000000..eafc42bc11c4 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/GetReportConfigRequest.java @@ -0,0 +1,644 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Message for getting a ReportConfig
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.GetReportConfigRequest} + */ +public final class GetReportConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.GetReportConfigRequest) + GetReportConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetReportConfigRequest.newBuilder() to construct. + private GetReportConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetReportConfigRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetReportConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_GetReportConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_GetReportConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.GetReportConfigRequest.class, + com.google.cloud.storageinsights.v1.GetReportConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * 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. Name of the resource
+   * 
+ * + * + * 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.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.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.storageinsights.v1.GetReportConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.GetReportConfigRequest other = + (com.google.cloud.storageinsights.v1.GetReportConfigRequest) 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.storageinsights.v1.GetReportConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.GetReportConfigRequest 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.storageinsights.v1.GetReportConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.GetReportConfigRequest 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.storageinsights.v1.GetReportConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.GetReportConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.GetReportConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.GetReportConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.GetReportConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.GetReportConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.GetReportConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.GetReportConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.storageinsights.v1.GetReportConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for getting a ReportConfig
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.GetReportConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.GetReportConfigRequest) + com.google.cloud.storageinsights.v1.GetReportConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_GetReportConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_GetReportConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.GetReportConfigRequest.class, + com.google.cloud.storageinsights.v1.GetReportConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.GetReportConfigRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.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.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_GetReportConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.GetReportConfigRequest getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.GetReportConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.GetReportConfigRequest build() { + com.google.cloud.storageinsights.v1.GetReportConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.GetReportConfigRequest buildPartial() { + com.google.cloud.storageinsights.v1.GetReportConfigRequest result = + new com.google.cloud.storageinsights.v1.GetReportConfigRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.storageinsights.v1.GetReportConfigRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.GetReportConfigRequest) { + return mergeFrom((com.google.cloud.storageinsights.v1.GetReportConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.GetReportConfigRequest other) { + if (other == com.google.cloud.storageinsights.v1.GetReportConfigRequest.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. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.GetReportConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.GetReportConfigRequest) + private static final com.google.cloud.storageinsights.v1.GetReportConfigRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.GetReportConfigRequest(); + } + + public static com.google.cloud.storageinsights.v1.GetReportConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetReportConfigRequest 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.storageinsights.v1.GetReportConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/GetReportConfigRequestOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/GetReportConfigRequestOrBuilder.java new file mode 100644 index 000000000000..5f69ca5c416a --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/GetReportConfigRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface GetReportConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.GetReportConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * 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-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/GetReportDetailRequest.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/GetReportDetailRequest.java new file mode 100644 index 000000000000..2dfc4e9b7c12 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/GetReportDetailRequest.java @@ -0,0 +1,644 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Message for getting a ReportDetail
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.GetReportDetailRequest} + */ +public final class GetReportDetailRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.GetReportDetailRequest) + GetReportDetailRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetReportDetailRequest.newBuilder() to construct. + private GetReportDetailRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetReportDetailRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetReportDetailRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_GetReportDetailRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_GetReportDetailRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.GetReportDetailRequest.class, + com.google.cloud.storageinsights.v1.GetReportDetailRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * 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. Name of the resource
+   * 
+ * + * + * 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.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.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.storageinsights.v1.GetReportDetailRequest)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.GetReportDetailRequest other = + (com.google.cloud.storageinsights.v1.GetReportDetailRequest) 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.storageinsights.v1.GetReportDetailRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.GetReportDetailRequest 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.storageinsights.v1.GetReportDetailRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.GetReportDetailRequest 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.storageinsights.v1.GetReportDetailRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.GetReportDetailRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.GetReportDetailRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.GetReportDetailRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.GetReportDetailRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.GetReportDetailRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.GetReportDetailRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.GetReportDetailRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.storageinsights.v1.GetReportDetailRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for getting a ReportDetail
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.GetReportDetailRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.GetReportDetailRequest) + com.google.cloud.storageinsights.v1.GetReportDetailRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_GetReportDetailRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_GetReportDetailRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.GetReportDetailRequest.class, + com.google.cloud.storageinsights.v1.GetReportDetailRequest.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.GetReportDetailRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.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.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_GetReportDetailRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.GetReportDetailRequest getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.GetReportDetailRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.GetReportDetailRequest build() { + com.google.cloud.storageinsights.v1.GetReportDetailRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.GetReportDetailRequest buildPartial() { + com.google.cloud.storageinsights.v1.GetReportDetailRequest result = + new com.google.cloud.storageinsights.v1.GetReportDetailRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.storageinsights.v1.GetReportDetailRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.GetReportDetailRequest) { + return mergeFrom((com.google.cloud.storageinsights.v1.GetReportDetailRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.GetReportDetailRequest other) { + if (other == com.google.cloud.storageinsights.v1.GetReportDetailRequest.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. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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. Name of the resource
+     * 
+ * + * + * 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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.GetReportDetailRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.GetReportDetailRequest) + private static final com.google.cloud.storageinsights.v1.GetReportDetailRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.GetReportDetailRequest(); + } + + public static com.google.cloud.storageinsights.v1.GetReportDetailRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetReportDetailRequest 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.storageinsights.v1.GetReportDetailRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/GetReportDetailRequestOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/GetReportDetailRequestOrBuilder.java new file mode 100644 index 000000000000..989d13af96df --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/GetReportDetailRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface GetReportDetailRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.GetReportDetailRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * 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-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportConfigsRequest.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportConfigsRequest.java new file mode 100644 index 000000000000..1bd36583dce1 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportConfigsRequest.java @@ -0,0 +1,1291 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Message for requesting list of ReportConfigs
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ListReportConfigsRequest} + */ +public final class ListReportConfigsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.ListReportConfigsRequest) + ListReportConfigsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListReportConfigsRequest.newBuilder() to construct. + private ListReportConfigsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListReportConfigsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListReportConfigsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportConfigsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportConfigsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ListReportConfigsRequest.class, + com.google.cloud.storageinsights.v1.ListReportConfigsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value for ListReportConfigsRequest
+   * 
+ * + * + * 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. Parent value for ListReportConfigsRequest
+   * 
+ * + * + * 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; + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @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_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @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; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @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; + } + } + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @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; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = 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.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.storageinsights.v1.ListReportConfigsRequest)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.ListReportConfigsRequest other = + (com.google.cloud.storageinsights.v1.ListReportConfigsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsRequest 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.storageinsights.v1.ListReportConfigsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsRequest 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.storageinsights.v1.ListReportConfigsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.storageinsights.v1.ListReportConfigsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for requesting list of ReportConfigs
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ListReportConfigsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.ListReportConfigsRequest) + com.google.cloud.storageinsights.v1.ListReportConfigsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportConfigsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportConfigsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ListReportConfigsRequest.class, + com.google.cloud.storageinsights.v1.ListReportConfigsRequest.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.ListReportConfigsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportConfigsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ListReportConfigsRequest + getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.ListReportConfigsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ListReportConfigsRequest build() { + com.google.cloud.storageinsights.v1.ListReportConfigsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ListReportConfigsRequest buildPartial() { + com.google.cloud.storageinsights.v1.ListReportConfigsRequest result = + new com.google.cloud.storageinsights.v1.ListReportConfigsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.storageinsights.v1.ListReportConfigsRequest 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_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.ListReportConfigsRequest) { + return mergeFrom((com.google.cloud.storageinsights.v1.ListReportConfigsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.ListReportConfigsRequest other) { + if (other + == com.google.cloud.storageinsights.v1.ListReportConfigsRequest.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(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + 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 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + 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 parent_ = ""; + /** + * + * + *
+     * Required. Parent value for ListReportConfigsRequest
+     * 
+ * + * + * 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. Parent value for ListReportConfigsRequest
+     * 
+ * + * + * 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. Parent value for ListReportConfigsRequest
+     * 
+ * + * + * 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. Parent value for ListReportConfigsRequest
+     * 
+ * + * + * 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. Parent value for ListReportConfigsRequest
+     * 
+ * + * + * 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_; + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @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; + } + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @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; + } + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.ListReportConfigsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.ListReportConfigsRequest) + private static final com.google.cloud.storageinsights.v1.ListReportConfigsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.ListReportConfigsRequest(); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListReportConfigsRequest 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.storageinsights.v1.ListReportConfigsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportConfigsRequestOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportConfigsRequestOrBuilder.java new file mode 100644 index 000000000000..c38a02f9c858 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportConfigsRequestOrBuilder.java @@ -0,0 +1,143 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface ListReportConfigsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.ListReportConfigsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value for ListReportConfigsRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value for ListReportConfigsRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportConfigsResponse.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportConfigsResponse.java new file mode 100644 index 000000000000..8ce4fbb44dac --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportConfigsResponse.java @@ -0,0 +1,1412 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Message for response to listing ReportConfigs
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ListReportConfigsResponse} + */ +public final class ListReportConfigsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.ListReportConfigsResponse) + ListReportConfigsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListReportConfigsResponse.newBuilder() to construct. + private ListReportConfigsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListReportConfigsResponse() { + reportConfigs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListReportConfigsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportConfigsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportConfigsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ListReportConfigsResponse.class, + com.google.cloud.storageinsights.v1.ListReportConfigsResponse.Builder.class); + } + + public static final int REPORT_CONFIGS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List reportConfigs_; + /** + * + * + *
+   * The list of ReportConfig
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + @java.lang.Override + public java.util.List getReportConfigsList() { + return reportConfigs_; + } + /** + * + * + *
+   * The list of ReportConfig
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + @java.lang.Override + public java.util.List + getReportConfigsOrBuilderList() { + return reportConfigs_; + } + /** + * + * + *
+   * The list of ReportConfig
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + @java.lang.Override + public int getReportConfigsCount() { + return reportConfigs_.size(); + } + /** + * + * + *
+   * The list of ReportConfig
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportConfig getReportConfigs(int index) { + return reportConfigs_.get(index); + } + /** + * + * + *
+   * The list of ReportConfig
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportConfigOrBuilder getReportConfigsOrBuilder( + int index) { + return reportConfigs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * 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; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < reportConfigs_.size(); i++) { + output.writeMessage(1, reportConfigs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(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 < reportConfigs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, reportConfigs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().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.storageinsights.v1.ListReportConfigsResponse)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.ListReportConfigsResponse other = + (com.google.cloud.storageinsights.v1.ListReportConfigsResponse) obj; + + if (!getReportConfigsList().equals(other.getReportConfigsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) 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 (getReportConfigsCount() > 0) { + hash = (37 * hash) + REPORT_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getReportConfigsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsResponse 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.storageinsights.v1.ListReportConfigsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsResponse 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.storageinsights.v1.ListReportConfigsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.storageinsights.v1.ListReportConfigsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for response to listing ReportConfigs
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ListReportConfigsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.ListReportConfigsResponse) + com.google.cloud.storageinsights.v1.ListReportConfigsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportConfigsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportConfigsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ListReportConfigsResponse.class, + com.google.cloud.storageinsights.v1.ListReportConfigsResponse.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.ListReportConfigsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (reportConfigsBuilder_ == null) { + reportConfigs_ = java.util.Collections.emptyList(); + } else { + reportConfigs_ = null; + reportConfigsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportConfigsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ListReportConfigsResponse + getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.ListReportConfigsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ListReportConfigsResponse build() { + com.google.cloud.storageinsights.v1.ListReportConfigsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ListReportConfigsResponse buildPartial() { + com.google.cloud.storageinsights.v1.ListReportConfigsResponse result = + new com.google.cloud.storageinsights.v1.ListReportConfigsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.storageinsights.v1.ListReportConfigsResponse result) { + if (reportConfigsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + reportConfigs_ = java.util.Collections.unmodifiableList(reportConfigs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.reportConfigs_ = reportConfigs_; + } else { + result.reportConfigs_ = reportConfigsBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; + } + + private void buildPartial0( + com.google.cloud.storageinsights.v1.ListReportConfigsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.ListReportConfigsResponse) { + return mergeFrom((com.google.cloud.storageinsights.v1.ListReportConfigsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.ListReportConfigsResponse other) { + if (other + == com.google.cloud.storageinsights.v1.ListReportConfigsResponse.getDefaultInstance()) + return this; + if (reportConfigsBuilder_ == null) { + if (!other.reportConfigs_.isEmpty()) { + if (reportConfigs_.isEmpty()) { + reportConfigs_ = other.reportConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureReportConfigsIsMutable(); + reportConfigs_.addAll(other.reportConfigs_); + } + onChanged(); + } + } else { + if (!other.reportConfigs_.isEmpty()) { + if (reportConfigsBuilder_.isEmpty()) { + reportConfigsBuilder_.dispose(); + reportConfigsBuilder_ = null; + reportConfigs_ = other.reportConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + reportConfigsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getReportConfigsFieldBuilder() + : null; + } else { + reportConfigsBuilder_.addAllMessages(other.reportConfigs_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.storageinsights.v1.ReportConfig m = + input.readMessage( + com.google.cloud.storageinsights.v1.ReportConfig.parser(), + extensionRegistry); + if (reportConfigsBuilder_ == null) { + ensureReportConfigsIsMutable(); + reportConfigs_.add(m); + } else { + reportConfigsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + 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.util.List reportConfigs_ = + java.util.Collections.emptyList(); + + private void ensureReportConfigsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + reportConfigs_ = + new java.util.ArrayList( + reportConfigs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.storageinsights.v1.ReportConfig, + com.google.cloud.storageinsights.v1.ReportConfig.Builder, + com.google.cloud.storageinsights.v1.ReportConfigOrBuilder> + reportConfigsBuilder_; + + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public java.util.List getReportConfigsList() { + if (reportConfigsBuilder_ == null) { + return java.util.Collections.unmodifiableList(reportConfigs_); + } else { + return reportConfigsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public int getReportConfigsCount() { + if (reportConfigsBuilder_ == null) { + return reportConfigs_.size(); + } else { + return reportConfigsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public com.google.cloud.storageinsights.v1.ReportConfig getReportConfigs(int index) { + if (reportConfigsBuilder_ == null) { + return reportConfigs_.get(index); + } else { + return reportConfigsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public Builder setReportConfigs( + int index, com.google.cloud.storageinsights.v1.ReportConfig value) { + if (reportConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReportConfigsIsMutable(); + reportConfigs_.set(index, value); + onChanged(); + } else { + reportConfigsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public Builder setReportConfigs( + int index, com.google.cloud.storageinsights.v1.ReportConfig.Builder builderForValue) { + if (reportConfigsBuilder_ == null) { + ensureReportConfigsIsMutable(); + reportConfigs_.set(index, builderForValue.build()); + onChanged(); + } else { + reportConfigsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public Builder addReportConfigs(com.google.cloud.storageinsights.v1.ReportConfig value) { + if (reportConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReportConfigsIsMutable(); + reportConfigs_.add(value); + onChanged(); + } else { + reportConfigsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public Builder addReportConfigs( + int index, com.google.cloud.storageinsights.v1.ReportConfig value) { + if (reportConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReportConfigsIsMutable(); + reportConfigs_.add(index, value); + onChanged(); + } else { + reportConfigsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public Builder addReportConfigs( + com.google.cloud.storageinsights.v1.ReportConfig.Builder builderForValue) { + if (reportConfigsBuilder_ == null) { + ensureReportConfigsIsMutable(); + reportConfigs_.add(builderForValue.build()); + onChanged(); + } else { + reportConfigsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public Builder addReportConfigs( + int index, com.google.cloud.storageinsights.v1.ReportConfig.Builder builderForValue) { + if (reportConfigsBuilder_ == null) { + ensureReportConfigsIsMutable(); + reportConfigs_.add(index, builderForValue.build()); + onChanged(); + } else { + reportConfigsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public Builder addAllReportConfigs( + java.lang.Iterable values) { + if (reportConfigsBuilder_ == null) { + ensureReportConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, reportConfigs_); + onChanged(); + } else { + reportConfigsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public Builder clearReportConfigs() { + if (reportConfigsBuilder_ == null) { + reportConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + reportConfigsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public Builder removeReportConfigs(int index) { + if (reportConfigsBuilder_ == null) { + ensureReportConfigsIsMutable(); + reportConfigs_.remove(index); + onChanged(); + } else { + reportConfigsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public com.google.cloud.storageinsights.v1.ReportConfig.Builder getReportConfigsBuilder( + int index) { + return getReportConfigsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public com.google.cloud.storageinsights.v1.ReportConfigOrBuilder getReportConfigsOrBuilder( + int index) { + if (reportConfigsBuilder_ == null) { + return reportConfigs_.get(index); + } else { + return reportConfigsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public java.util.List + getReportConfigsOrBuilderList() { + if (reportConfigsBuilder_ != null) { + return reportConfigsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(reportConfigs_); + } + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public com.google.cloud.storageinsights.v1.ReportConfig.Builder addReportConfigsBuilder() { + return getReportConfigsFieldBuilder() + .addBuilder(com.google.cloud.storageinsights.v1.ReportConfig.getDefaultInstance()); + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public com.google.cloud.storageinsights.v1.ReportConfig.Builder addReportConfigsBuilder( + int index) { + return getReportConfigsFieldBuilder() + .addBuilder(index, com.google.cloud.storageinsights.v1.ReportConfig.getDefaultInstance()); + } + /** + * + * + *
+     * The list of ReportConfig
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + public java.util.List + getReportConfigsBuilderList() { + return getReportConfigsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.storageinsights.v1.ReportConfig, + com.google.cloud.storageinsights.v1.ReportConfig.Builder, + com.google.cloud.storageinsights.v1.ReportConfigOrBuilder> + getReportConfigsFieldBuilder() { + if (reportConfigsBuilder_ == null) { + reportConfigsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.storageinsights.v1.ReportConfig, + com.google.cloud.storageinsights.v1.ReportConfig.Builder, + com.google.cloud.storageinsights.v1.ReportConfigOrBuilder>( + reportConfigs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + reportConfigs_ = null; + } + return reportConfigsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.ListReportConfigsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.ListReportConfigsResponse) + private static final com.google.cloud.storageinsights.v1.ListReportConfigsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.ListReportConfigsResponse(); + } + + public static com.google.cloud.storageinsights.v1.ListReportConfigsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListReportConfigsResponse 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.storageinsights.v1.ListReportConfigsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportConfigsResponseOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportConfigsResponseOrBuilder.java new file mode 100644 index 000000000000..e0c4905550f8 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportConfigsResponseOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface ListReportConfigsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.ListReportConfigsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of ReportConfig
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + java.util.List getReportConfigsList(); + /** + * + * + *
+   * The list of ReportConfig
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + com.google.cloud.storageinsights.v1.ReportConfig getReportConfigs(int index); + /** + * + * + *
+   * The list of ReportConfig
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + int getReportConfigsCount(); + /** + * + * + *
+   * The list of ReportConfig
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + java.util.List + getReportConfigsOrBuilderList(); + /** + * + * + *
+   * The list of ReportConfig
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportConfig report_configs = 1; + */ + com.google.cloud.storageinsights.v1.ReportConfigOrBuilder getReportConfigsOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportDetailsRequest.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportDetailsRequest.java new file mode 100644 index 000000000000..99fd85356111 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportDetailsRequest.java @@ -0,0 +1,1291 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Message for requesting list of ReportDetails
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ListReportDetailsRequest} + */ +public final class ListReportDetailsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.ListReportDetailsRequest) + ListReportDetailsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListReportDetailsRequest.newBuilder() to construct. + private ListReportDetailsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListReportDetailsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListReportDetailsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ListReportDetailsRequest.class, + com.google.cloud.storageinsights.v1.ListReportDetailsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value for ListReportDetailsRequest
+   * 
+ * + * + * 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. Parent value for ListReportDetailsRequest
+   * 
+ * + * + * 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; + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @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_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @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; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @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; + } + } + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @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; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = 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.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.storageinsights.v1.ListReportDetailsRequest)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.ListReportDetailsRequest other = + (com.google.cloud.storageinsights.v1.ListReportDetailsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsRequest 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.storageinsights.v1.ListReportDetailsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsRequest 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.storageinsights.v1.ListReportDetailsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.storageinsights.v1.ListReportDetailsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for requesting list of ReportDetails
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ListReportDetailsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.ListReportDetailsRequest) + com.google.cloud.storageinsights.v1.ListReportDetailsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ListReportDetailsRequest.class, + com.google.cloud.storageinsights.v1.ListReportDetailsRequest.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.ListReportDetailsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportDetailsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ListReportDetailsRequest + getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.ListReportDetailsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ListReportDetailsRequest build() { + com.google.cloud.storageinsights.v1.ListReportDetailsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ListReportDetailsRequest buildPartial() { + com.google.cloud.storageinsights.v1.ListReportDetailsRequest result = + new com.google.cloud.storageinsights.v1.ListReportDetailsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.storageinsights.v1.ListReportDetailsRequest 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_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.ListReportDetailsRequest) { + return mergeFrom((com.google.cloud.storageinsights.v1.ListReportDetailsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.ListReportDetailsRequest other) { + if (other + == com.google.cloud.storageinsights.v1.ListReportDetailsRequest.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(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + 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 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + 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 parent_ = ""; + /** + * + * + *
+     * Required. Parent value for ListReportDetailsRequest
+     * 
+ * + * + * 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. Parent value for ListReportDetailsRequest
+     * 
+ * + * + * 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. Parent value for ListReportDetailsRequest
+     * 
+ * + * + * 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. Parent value for ListReportDetailsRequest
+     * 
+ * + * + * 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. Parent value for ListReportDetailsRequest
+     * 
+ * + * + * 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_; + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @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; + } + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @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; + } + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Filtering results
+     * 
+ * + * string filter = 4; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Hint for how to order the results
+     * 
+ * + * string order_by = 5; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.ListReportDetailsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.ListReportDetailsRequest) + private static final com.google.cloud.storageinsights.v1.ListReportDetailsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.ListReportDetailsRequest(); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListReportDetailsRequest 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.storageinsights.v1.ListReportDetailsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportDetailsRequestOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportDetailsRequestOrBuilder.java new file mode 100644 index 000000000000..31754f11169b --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportDetailsRequestOrBuilder.java @@ -0,0 +1,143 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface ListReportDetailsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.ListReportDetailsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value for ListReportDetailsRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value for ListReportDetailsRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Filtering results
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Hint for how to order the results
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportDetailsResponse.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportDetailsResponse.java new file mode 100644 index 000000000000..05bb3a0ef12f --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportDetailsResponse.java @@ -0,0 +1,1412 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Message for response to listing ReportDetails
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ListReportDetailsResponse} + */ +public final class ListReportDetailsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.ListReportDetailsResponse) + ListReportDetailsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListReportDetailsResponse.newBuilder() to construct. + private ListReportDetailsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListReportDetailsResponse() { + reportDetails_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListReportDetailsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ListReportDetailsResponse.class, + com.google.cloud.storageinsights.v1.ListReportDetailsResponse.Builder.class); + } + + public static final int REPORT_DETAILS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List reportDetails_; + /** + * + * + *
+   * The list of ReportDetail
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + @java.lang.Override + public java.util.List getReportDetailsList() { + return reportDetails_; + } + /** + * + * + *
+   * The list of ReportDetail
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + @java.lang.Override + public java.util.List + getReportDetailsOrBuilderList() { + return reportDetails_; + } + /** + * + * + *
+   * The list of ReportDetail
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + @java.lang.Override + public int getReportDetailsCount() { + return reportDetails_.size(); + } + /** + * + * + *
+   * The list of ReportDetail
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportDetail getReportDetails(int index) { + return reportDetails_.get(index); + } + /** + * + * + *
+   * The list of ReportDetail
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportDetailOrBuilder getReportDetailsOrBuilder( + int index) { + return reportDetails_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * 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; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < reportDetails_.size(); i++) { + output.writeMessage(1, reportDetails_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(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 < reportDetails_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, reportDetails_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().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.storageinsights.v1.ListReportDetailsResponse)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.ListReportDetailsResponse other = + (com.google.cloud.storageinsights.v1.ListReportDetailsResponse) obj; + + if (!getReportDetailsList().equals(other.getReportDetailsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) 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 (getReportDetailsCount() > 0) { + hash = (37 * hash) + REPORT_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getReportDetailsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsResponse 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.storageinsights.v1.ListReportDetailsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsResponse 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.storageinsights.v1.ListReportDetailsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.storageinsights.v1.ListReportDetailsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for response to listing ReportDetails
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ListReportDetailsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.ListReportDetailsResponse) + com.google.cloud.storageinsights.v1.ListReportDetailsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ListReportDetailsResponse.class, + com.google.cloud.storageinsights.v1.ListReportDetailsResponse.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.ListReportDetailsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (reportDetailsBuilder_ == null) { + reportDetails_ = java.util.Collections.emptyList(); + } else { + reportDetails_ = null; + reportDetailsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ListReportDetailsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ListReportDetailsResponse + getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.ListReportDetailsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ListReportDetailsResponse build() { + com.google.cloud.storageinsights.v1.ListReportDetailsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ListReportDetailsResponse buildPartial() { + com.google.cloud.storageinsights.v1.ListReportDetailsResponse result = + new com.google.cloud.storageinsights.v1.ListReportDetailsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.storageinsights.v1.ListReportDetailsResponse result) { + if (reportDetailsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + reportDetails_ = java.util.Collections.unmodifiableList(reportDetails_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.reportDetails_ = reportDetails_; + } else { + result.reportDetails_ = reportDetailsBuilder_.build(); + } + if (((bitField0_ & 0x00000004) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.unreachable_ = unreachable_; + } + + private void buildPartial0( + com.google.cloud.storageinsights.v1.ListReportDetailsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.ListReportDetailsResponse) { + return mergeFrom((com.google.cloud.storageinsights.v1.ListReportDetailsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.ListReportDetailsResponse other) { + if (other + == com.google.cloud.storageinsights.v1.ListReportDetailsResponse.getDefaultInstance()) + return this; + if (reportDetailsBuilder_ == null) { + if (!other.reportDetails_.isEmpty()) { + if (reportDetails_.isEmpty()) { + reportDetails_ = other.reportDetails_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureReportDetailsIsMutable(); + reportDetails_.addAll(other.reportDetails_); + } + onChanged(); + } + } else { + if (!other.reportDetails_.isEmpty()) { + if (reportDetailsBuilder_.isEmpty()) { + reportDetailsBuilder_.dispose(); + reportDetailsBuilder_ = null; + reportDetails_ = other.reportDetails_; + bitField0_ = (bitField0_ & ~0x00000001); + reportDetailsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getReportDetailsFieldBuilder() + : null; + } else { + reportDetailsBuilder_.addAllMessages(other.reportDetails_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.storageinsights.v1.ReportDetail m = + input.readMessage( + com.google.cloud.storageinsights.v1.ReportDetail.parser(), + extensionRegistry); + if (reportDetailsBuilder_ == null) { + ensureReportDetailsIsMutable(); + reportDetails_.add(m); + } else { + reportDetailsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + 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.util.List reportDetails_ = + java.util.Collections.emptyList(); + + private void ensureReportDetailsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + reportDetails_ = + new java.util.ArrayList( + reportDetails_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.storageinsights.v1.ReportDetail, + com.google.cloud.storageinsights.v1.ReportDetail.Builder, + com.google.cloud.storageinsights.v1.ReportDetailOrBuilder> + reportDetailsBuilder_; + + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public java.util.List getReportDetailsList() { + if (reportDetailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(reportDetails_); + } else { + return reportDetailsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public int getReportDetailsCount() { + if (reportDetailsBuilder_ == null) { + return reportDetails_.size(); + } else { + return reportDetailsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public com.google.cloud.storageinsights.v1.ReportDetail getReportDetails(int index) { + if (reportDetailsBuilder_ == null) { + return reportDetails_.get(index); + } else { + return reportDetailsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public Builder setReportDetails( + int index, com.google.cloud.storageinsights.v1.ReportDetail value) { + if (reportDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReportDetailsIsMutable(); + reportDetails_.set(index, value); + onChanged(); + } else { + reportDetailsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public Builder setReportDetails( + int index, com.google.cloud.storageinsights.v1.ReportDetail.Builder builderForValue) { + if (reportDetailsBuilder_ == null) { + ensureReportDetailsIsMutable(); + reportDetails_.set(index, builderForValue.build()); + onChanged(); + } else { + reportDetailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public Builder addReportDetails(com.google.cloud.storageinsights.v1.ReportDetail value) { + if (reportDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReportDetailsIsMutable(); + reportDetails_.add(value); + onChanged(); + } else { + reportDetailsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public Builder addReportDetails( + int index, com.google.cloud.storageinsights.v1.ReportDetail value) { + if (reportDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReportDetailsIsMutable(); + reportDetails_.add(index, value); + onChanged(); + } else { + reportDetailsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public Builder addReportDetails( + com.google.cloud.storageinsights.v1.ReportDetail.Builder builderForValue) { + if (reportDetailsBuilder_ == null) { + ensureReportDetailsIsMutable(); + reportDetails_.add(builderForValue.build()); + onChanged(); + } else { + reportDetailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public Builder addReportDetails( + int index, com.google.cloud.storageinsights.v1.ReportDetail.Builder builderForValue) { + if (reportDetailsBuilder_ == null) { + ensureReportDetailsIsMutable(); + reportDetails_.add(index, builderForValue.build()); + onChanged(); + } else { + reportDetailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public Builder addAllReportDetails( + java.lang.Iterable values) { + if (reportDetailsBuilder_ == null) { + ensureReportDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, reportDetails_); + onChanged(); + } else { + reportDetailsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public Builder clearReportDetails() { + if (reportDetailsBuilder_ == null) { + reportDetails_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + reportDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public Builder removeReportDetails(int index) { + if (reportDetailsBuilder_ == null) { + ensureReportDetailsIsMutable(); + reportDetails_.remove(index); + onChanged(); + } else { + reportDetailsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public com.google.cloud.storageinsights.v1.ReportDetail.Builder getReportDetailsBuilder( + int index) { + return getReportDetailsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public com.google.cloud.storageinsights.v1.ReportDetailOrBuilder getReportDetailsOrBuilder( + int index) { + if (reportDetailsBuilder_ == null) { + return reportDetails_.get(index); + } else { + return reportDetailsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public java.util.List + getReportDetailsOrBuilderList() { + if (reportDetailsBuilder_ != null) { + return reportDetailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(reportDetails_); + } + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public com.google.cloud.storageinsights.v1.ReportDetail.Builder addReportDetailsBuilder() { + return getReportDetailsFieldBuilder() + .addBuilder(com.google.cloud.storageinsights.v1.ReportDetail.getDefaultInstance()); + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public com.google.cloud.storageinsights.v1.ReportDetail.Builder addReportDetailsBuilder( + int index) { + return getReportDetailsFieldBuilder() + .addBuilder(index, com.google.cloud.storageinsights.v1.ReportDetail.getDefaultInstance()); + } + /** + * + * + *
+     * The list of ReportDetail
+     * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + public java.util.List + getReportDetailsBuilderList() { + return getReportDetailsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.storageinsights.v1.ReportDetail, + com.google.cloud.storageinsights.v1.ReportDetail.Builder, + com.google.cloud.storageinsights.v1.ReportDetailOrBuilder> + getReportDetailsFieldBuilder() { + if (reportDetailsBuilder_ == null) { + reportDetailsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.storageinsights.v1.ReportDetail, + com.google.cloud.storageinsights.v1.ReportDetail.Builder, + com.google.cloud.storageinsights.v1.ReportDetailOrBuilder>( + reportDetails_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + reportDetails_ = null; + } + return reportDetailsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.ListReportDetailsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.ListReportDetailsResponse) + private static final com.google.cloud.storageinsights.v1.ListReportDetailsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.ListReportDetailsResponse(); + } + + public static com.google.cloud.storageinsights.v1.ListReportDetailsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListReportDetailsResponse 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.storageinsights.v1.ListReportDetailsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportDetailsResponseOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportDetailsResponseOrBuilder.java new file mode 100644 index 000000000000..6e071676382e --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ListReportDetailsResponseOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface ListReportDetailsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.ListReportDetailsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of ReportDetail
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + java.util.List getReportDetailsList(); + /** + * + * + *
+   * The list of ReportDetail
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + com.google.cloud.storageinsights.v1.ReportDetail getReportDetails(int index); + /** + * + * + *
+   * The list of ReportDetail
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + int getReportDetailsCount(); + /** + * + * + *
+   * The list of ReportDetail
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + java.util.List + getReportDetailsOrBuilderList(); + /** + * + * + *
+   * The list of ReportDetail
+   * 
+ * + * repeated .google.cloud.storageinsights.v1.ReportDetail report_details = 1; + */ + com.google.cloud.storageinsights.v1.ReportDetailOrBuilder getReportDetailsOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/LocationName.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/LocationName.java new file mode 100644 index 000000000000..152400e8f337 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2022 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.storageinsights.v1; + +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-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ObjectMetadataReportOptions.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ObjectMetadataReportOptions.java new file mode 100644 index 000000000000..9542591408fc --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ObjectMetadataReportOptions.java @@ -0,0 +1,1534 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Report specification for exporting object metadata.
+ * Next ID: 4
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ObjectMetadataReportOptions} + */ +public final class ObjectMetadataReportOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.ObjectMetadataReportOptions) + ObjectMetadataReportOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ObjectMetadataReportOptions.newBuilder() to construct. + private ObjectMetadataReportOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ObjectMetadataReportOptions() { + metadataFields_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ObjectMetadataReportOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ObjectMetadataReportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ObjectMetadataReportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.class, + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.Builder.class); + } + + private int filterCase_ = 0; + private java.lang.Object filter_; + + public enum FilterCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STORAGE_FILTERS(2), + FILTER_NOT_SET(0); + private final int value; + + private FilterCase(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 FilterCase valueOf(int value) { + return forNumber(value); + } + + public static FilterCase forNumber(int value) { + switch (value) { + case 2: + return STORAGE_FILTERS; + case 0: + return FILTER_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public FilterCase getFilterCase() { + return FilterCase.forNumber(filterCase_); + } + + private int destinationOptionsCase_ = 0; + private java.lang.Object destinationOptions_; + + public enum DestinationOptionsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STORAGE_DESTINATION_OPTIONS(3), + DESTINATIONOPTIONS_NOT_SET(0); + private final int value; + + private DestinationOptionsCase(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 DestinationOptionsCase valueOf(int value) { + return forNumber(value); + } + + public static DestinationOptionsCase forNumber(int value) { + switch (value) { + case 3: + return STORAGE_DESTINATION_OPTIONS; + case 0: + return DESTINATIONOPTIONS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DestinationOptionsCase getDestinationOptionsCase() { + return DestinationOptionsCase.forNumber(destinationOptionsCase_); + } + + public static final int METADATA_FIELDS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringList metadataFields_; + /** + * + * + *
+   * Metadata fields to be included in the report.
+   * 
+ * + * repeated string metadata_fields = 1; + * + * @return A list containing the metadataFields. + */ + public com.google.protobuf.ProtocolStringList getMetadataFieldsList() { + return metadataFields_; + } + /** + * + * + *
+   * Metadata fields to be included in the report.
+   * 
+ * + * repeated string metadata_fields = 1; + * + * @return The count of metadataFields. + */ + public int getMetadataFieldsCount() { + return metadataFields_.size(); + } + /** + * + * + *
+   * Metadata fields to be included in the report.
+   * 
+ * + * repeated string metadata_fields = 1; + * + * @param index The index of the element to return. + * @return The metadataFields at the given index. + */ + public java.lang.String getMetadataFields(int index) { + return metadataFields_.get(index); + } + /** + * + * + *
+   * Metadata fields to be included in the report.
+   * 
+ * + * repeated string metadata_fields = 1; + * + * @param index The index of the value to return. + * @return The bytes of the metadataFields at the given index. + */ + public com.google.protobuf.ByteString getMetadataFieldsBytes(int index) { + return metadataFields_.getByteString(index); + } + + public static final int STORAGE_FILTERS_FIELD_NUMBER = 2; + /** + * + * + *
+   * Cloud Storage as the storage system.
+   * 
+ * + * .google.cloud.storageinsights.v1.CloudStorageFilters storage_filters = 2; + * + * @return Whether the storageFilters field is set. + */ + @java.lang.Override + public boolean hasStorageFilters() { + return filterCase_ == 2; + } + /** + * + * + *
+   * Cloud Storage as the storage system.
+   * 
+ * + * .google.cloud.storageinsights.v1.CloudStorageFilters storage_filters = 2; + * + * @return The storageFilters. + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.CloudStorageFilters getStorageFilters() { + if (filterCase_ == 2) { + return (com.google.cloud.storageinsights.v1.CloudStorageFilters) filter_; + } + return com.google.cloud.storageinsights.v1.CloudStorageFilters.getDefaultInstance(); + } + /** + * + * + *
+   * Cloud Storage as the storage system.
+   * 
+ * + * .google.cloud.storageinsights.v1.CloudStorageFilters storage_filters = 2; + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.CloudStorageFiltersOrBuilder + getStorageFiltersOrBuilder() { + if (filterCase_ == 2) { + return (com.google.cloud.storageinsights.v1.CloudStorageFilters) filter_; + } + return com.google.cloud.storageinsights.v1.CloudStorageFilters.getDefaultInstance(); + } + + public static final int STORAGE_DESTINATION_OPTIONS_FIELD_NUMBER = 3; + /** + * + * + *
+   * Cloud Storage as the storage system.
+   * 
+ * + * + * .google.cloud.storageinsights.v1.CloudStorageDestinationOptions storage_destination_options = 3; + * + * + * @return Whether the storageDestinationOptions field is set. + */ + @java.lang.Override + public boolean hasStorageDestinationOptions() { + return destinationOptionsCase_ == 3; + } + /** + * + * + *
+   * Cloud Storage as the storage system.
+   * 
+ * + * + * .google.cloud.storageinsights.v1.CloudStorageDestinationOptions storage_destination_options = 3; + * + * + * @return The storageDestinationOptions. + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions + getStorageDestinationOptions() { + if (destinationOptionsCase_ == 3) { + return (com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions) + destinationOptions_; + } + return com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions.getDefaultInstance(); + } + /** + * + * + *
+   * Cloud Storage as the storage system.
+   * 
+ * + * + * .google.cloud.storageinsights.v1.CloudStorageDestinationOptions storage_destination_options = 3; + * + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.CloudStorageDestinationOptionsOrBuilder + getStorageDestinationOptionsOrBuilder() { + if (destinationOptionsCase_ == 3) { + return (com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions) + destinationOptions_; + } + return com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions.getDefaultInstance(); + } + + 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 < metadataFields_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, metadataFields_.getRaw(i)); + } + if (filterCase_ == 2) { + output.writeMessage(2, (com.google.cloud.storageinsights.v1.CloudStorageFilters) filter_); + } + if (destinationOptionsCase_ == 3) { + output.writeMessage( + 3, + (com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions) destinationOptions_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < metadataFields_.size(); i++) { + dataSize += computeStringSizeNoTag(metadataFields_.getRaw(i)); + } + size += dataSize; + size += 1 * getMetadataFieldsList().size(); + } + if (filterCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.storageinsights.v1.CloudStorageFilters) filter_); + } + if (destinationOptionsCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, + (com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions) + destinationOptions_); + } + 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.storageinsights.v1.ObjectMetadataReportOptions)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions other = + (com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions) obj; + + if (!getMetadataFieldsList().equals(other.getMetadataFieldsList())) return false; + if (!getFilterCase().equals(other.getFilterCase())) return false; + switch (filterCase_) { + case 2: + if (!getStorageFilters().equals(other.getStorageFilters())) return false; + break; + case 0: + default: + } + if (!getDestinationOptionsCase().equals(other.getDestinationOptionsCase())) return false; + switch (destinationOptionsCase_) { + case 3: + if (!getStorageDestinationOptions().equals(other.getStorageDestinationOptions())) + 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(); + if (getMetadataFieldsCount() > 0) { + hash = (37 * hash) + METADATA_FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getMetadataFieldsList().hashCode(); + } + switch (filterCase_) { + case 2: + hash = (37 * hash) + STORAGE_FILTERS_FIELD_NUMBER; + hash = (53 * hash) + getStorageFilters().hashCode(); + break; + case 0: + default: + } + switch (destinationOptionsCase_) { + case 3: + hash = (37 * hash) + STORAGE_DESTINATION_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getStorageDestinationOptions().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions 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.storageinsights.v1.ObjectMetadataReportOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions 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.storageinsights.v1.ObjectMetadataReportOptions parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Report specification for exporting object metadata.
+   * Next ID: 4
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ObjectMetadataReportOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.ObjectMetadataReportOptions) + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ObjectMetadataReportOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ObjectMetadataReportOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.class, + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + metadataFields_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (storageFiltersBuilder_ != null) { + storageFiltersBuilder_.clear(); + } + if (storageDestinationOptionsBuilder_ != null) { + storageDestinationOptionsBuilder_.clear(); + } + filterCase_ = 0; + filter_ = null; + destinationOptionsCase_ = 0; + destinationOptions_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ObjectMetadataReportOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions + getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions build() { + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions buildPartial() { + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions result = + new com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions result) { + if (((bitField0_ & 0x00000001) != 0)) { + metadataFields_ = metadataFields_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.metadataFields_ = metadataFields_; + } + + private void buildPartial0( + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs( + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions result) { + result.filterCase_ = filterCase_; + result.filter_ = this.filter_; + if (filterCase_ == 2 && storageFiltersBuilder_ != null) { + result.filter_ = storageFiltersBuilder_.build(); + } + result.destinationOptionsCase_ = destinationOptionsCase_; + result.destinationOptions_ = this.destinationOptions_; + if (destinationOptionsCase_ == 3 && storageDestinationOptionsBuilder_ != null) { + result.destinationOptions_ = storageDestinationOptionsBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions) { + return mergeFrom((com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions other) { + if (other + == com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.getDefaultInstance()) + return this; + if (!other.metadataFields_.isEmpty()) { + if (metadataFields_.isEmpty()) { + metadataFields_ = other.metadataFields_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMetadataFieldsIsMutable(); + metadataFields_.addAll(other.metadataFields_); + } + onChanged(); + } + switch (other.getFilterCase()) { + case STORAGE_FILTERS: + { + mergeStorageFilters(other.getStorageFilters()); + break; + } + case FILTER_NOT_SET: + { + break; + } + } + switch (other.getDestinationOptionsCase()) { + case STORAGE_DESTINATION_OPTIONS: + { + mergeStorageDestinationOptions(other.getStorageDestinationOptions()); + break; + } + case DESTINATIONOPTIONS_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(); + ensureMetadataFieldsIsMutable(); + metadataFields_.add(s); + break; + } // case 10 + case 18: + { + input.readMessage(getStorageFiltersFieldBuilder().getBuilder(), extensionRegistry); + filterCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage( + getStorageDestinationOptionsFieldBuilder().getBuilder(), extensionRegistry); + destinationOptionsCase_ = 3; + 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 filterCase_ = 0; + private java.lang.Object filter_; + + public FilterCase getFilterCase() { + return FilterCase.forNumber(filterCase_); + } + + public Builder clearFilter() { + filterCase_ = 0; + filter_ = null; + onChanged(); + return this; + } + + private int destinationOptionsCase_ = 0; + private java.lang.Object destinationOptions_; + + public DestinationOptionsCase getDestinationOptionsCase() { + return DestinationOptionsCase.forNumber(destinationOptionsCase_); + } + + public Builder clearDestinationOptions() { + destinationOptionsCase_ = 0; + destinationOptions_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList metadataFields_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureMetadataFieldsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + metadataFields_ = new com.google.protobuf.LazyStringArrayList(metadataFields_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Metadata fields to be included in the report.
+     * 
+ * + * repeated string metadata_fields = 1; + * + * @return A list containing the metadataFields. + */ + public com.google.protobuf.ProtocolStringList getMetadataFieldsList() { + return metadataFields_.getUnmodifiableView(); + } + /** + * + * + *
+     * Metadata fields to be included in the report.
+     * 
+ * + * repeated string metadata_fields = 1; + * + * @return The count of metadataFields. + */ + public int getMetadataFieldsCount() { + return metadataFields_.size(); + } + /** + * + * + *
+     * Metadata fields to be included in the report.
+     * 
+ * + * repeated string metadata_fields = 1; + * + * @param index The index of the element to return. + * @return The metadataFields at the given index. + */ + public java.lang.String getMetadataFields(int index) { + return metadataFields_.get(index); + } + /** + * + * + *
+     * Metadata fields to be included in the report.
+     * 
+ * + * repeated string metadata_fields = 1; + * + * @param index The index of the value to return. + * @return The bytes of the metadataFields at the given index. + */ + public com.google.protobuf.ByteString getMetadataFieldsBytes(int index) { + return metadataFields_.getByteString(index); + } + /** + * + * + *
+     * Metadata fields to be included in the report.
+     * 
+ * + * repeated string metadata_fields = 1; + * + * @param index The index to set the value at. + * @param value The metadataFields to set. + * @return This builder for chaining. + */ + public Builder setMetadataFields(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetadataFieldsIsMutable(); + metadataFields_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Metadata fields to be included in the report.
+     * 
+ * + * repeated string metadata_fields = 1; + * + * @param value The metadataFields to add. + * @return This builder for chaining. + */ + public Builder addMetadataFields(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetadataFieldsIsMutable(); + metadataFields_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Metadata fields to be included in the report.
+     * 
+ * + * repeated string metadata_fields = 1; + * + * @param values The metadataFields to add. + * @return This builder for chaining. + */ + public Builder addAllMetadataFields(java.lang.Iterable values) { + ensureMetadataFieldsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, metadataFields_); + onChanged(); + return this; + } + /** + * + * + *
+     * Metadata fields to be included in the report.
+     * 
+ * + * repeated string metadata_fields = 1; + * + * @return This builder for chaining. + */ + public Builder clearMetadataFields() { + metadataFields_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Metadata fields to be included in the report.
+     * 
+ * + * repeated string metadata_fields = 1; + * + * @param value The bytes of the metadataFields to add. + * @return This builder for chaining. + */ + public Builder addMetadataFieldsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMetadataFieldsIsMutable(); + metadataFields_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.CloudStorageFilters, + com.google.cloud.storageinsights.v1.CloudStorageFilters.Builder, + com.google.cloud.storageinsights.v1.CloudStorageFiltersOrBuilder> + storageFiltersBuilder_; + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * .google.cloud.storageinsights.v1.CloudStorageFilters storage_filters = 2; + * + * @return Whether the storageFilters field is set. + */ + @java.lang.Override + public boolean hasStorageFilters() { + return filterCase_ == 2; + } + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * .google.cloud.storageinsights.v1.CloudStorageFilters storage_filters = 2; + * + * @return The storageFilters. + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.CloudStorageFilters getStorageFilters() { + if (storageFiltersBuilder_ == null) { + if (filterCase_ == 2) { + return (com.google.cloud.storageinsights.v1.CloudStorageFilters) filter_; + } + return com.google.cloud.storageinsights.v1.CloudStorageFilters.getDefaultInstance(); + } else { + if (filterCase_ == 2) { + return storageFiltersBuilder_.getMessage(); + } + return com.google.cloud.storageinsights.v1.CloudStorageFilters.getDefaultInstance(); + } + } + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * .google.cloud.storageinsights.v1.CloudStorageFilters storage_filters = 2; + */ + public Builder setStorageFilters( + com.google.cloud.storageinsights.v1.CloudStorageFilters value) { + if (storageFiltersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + onChanged(); + } else { + storageFiltersBuilder_.setMessage(value); + } + filterCase_ = 2; + return this; + } + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * .google.cloud.storageinsights.v1.CloudStorageFilters storage_filters = 2; + */ + public Builder setStorageFilters( + com.google.cloud.storageinsights.v1.CloudStorageFilters.Builder builderForValue) { + if (storageFiltersBuilder_ == null) { + filter_ = builderForValue.build(); + onChanged(); + } else { + storageFiltersBuilder_.setMessage(builderForValue.build()); + } + filterCase_ = 2; + return this; + } + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * .google.cloud.storageinsights.v1.CloudStorageFilters storage_filters = 2; + */ + public Builder mergeStorageFilters( + com.google.cloud.storageinsights.v1.CloudStorageFilters value) { + if (storageFiltersBuilder_ == null) { + if (filterCase_ == 2 + && filter_ + != com.google.cloud.storageinsights.v1.CloudStorageFilters.getDefaultInstance()) { + filter_ = + com.google.cloud.storageinsights.v1.CloudStorageFilters.newBuilder( + (com.google.cloud.storageinsights.v1.CloudStorageFilters) filter_) + .mergeFrom(value) + .buildPartial(); + } else { + filter_ = value; + } + onChanged(); + } else { + if (filterCase_ == 2) { + storageFiltersBuilder_.mergeFrom(value); + } else { + storageFiltersBuilder_.setMessage(value); + } + } + filterCase_ = 2; + return this; + } + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * .google.cloud.storageinsights.v1.CloudStorageFilters storage_filters = 2; + */ + public Builder clearStorageFilters() { + if (storageFiltersBuilder_ == null) { + if (filterCase_ == 2) { + filterCase_ = 0; + filter_ = null; + onChanged(); + } + } else { + if (filterCase_ == 2) { + filterCase_ = 0; + filter_ = null; + } + storageFiltersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * .google.cloud.storageinsights.v1.CloudStorageFilters storage_filters = 2; + */ + public com.google.cloud.storageinsights.v1.CloudStorageFilters.Builder + getStorageFiltersBuilder() { + return getStorageFiltersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * .google.cloud.storageinsights.v1.CloudStorageFilters storage_filters = 2; + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.CloudStorageFiltersOrBuilder + getStorageFiltersOrBuilder() { + if ((filterCase_ == 2) && (storageFiltersBuilder_ != null)) { + return storageFiltersBuilder_.getMessageOrBuilder(); + } else { + if (filterCase_ == 2) { + return (com.google.cloud.storageinsights.v1.CloudStorageFilters) filter_; + } + return com.google.cloud.storageinsights.v1.CloudStorageFilters.getDefaultInstance(); + } + } + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * .google.cloud.storageinsights.v1.CloudStorageFilters storage_filters = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.CloudStorageFilters, + com.google.cloud.storageinsights.v1.CloudStorageFilters.Builder, + com.google.cloud.storageinsights.v1.CloudStorageFiltersOrBuilder> + getStorageFiltersFieldBuilder() { + if (storageFiltersBuilder_ == null) { + if (!(filterCase_ == 2)) { + filter_ = com.google.cloud.storageinsights.v1.CloudStorageFilters.getDefaultInstance(); + } + storageFiltersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.CloudStorageFilters, + com.google.cloud.storageinsights.v1.CloudStorageFilters.Builder, + com.google.cloud.storageinsights.v1.CloudStorageFiltersOrBuilder>( + (com.google.cloud.storageinsights.v1.CloudStorageFilters) filter_, + getParentForChildren(), + isClean()); + filter_ = null; + } + filterCase_ = 2; + onChanged(); + return storageFiltersBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions, + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions.Builder, + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptionsOrBuilder> + storageDestinationOptionsBuilder_; + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.CloudStorageDestinationOptions storage_destination_options = 3; + * + * + * @return Whether the storageDestinationOptions field is set. + */ + @java.lang.Override + public boolean hasStorageDestinationOptions() { + return destinationOptionsCase_ == 3; + } + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.CloudStorageDestinationOptions storage_destination_options = 3; + * + * + * @return The storageDestinationOptions. + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions + getStorageDestinationOptions() { + if (storageDestinationOptionsBuilder_ == null) { + if (destinationOptionsCase_ == 3) { + return (com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions) + destinationOptions_; + } + return com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions + .getDefaultInstance(); + } else { + if (destinationOptionsCase_ == 3) { + return storageDestinationOptionsBuilder_.getMessage(); + } + return com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.CloudStorageDestinationOptions storage_destination_options = 3; + * + */ + public Builder setStorageDestinationOptions( + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions value) { + if (storageDestinationOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + destinationOptions_ = value; + onChanged(); + } else { + storageDestinationOptionsBuilder_.setMessage(value); + } + destinationOptionsCase_ = 3; + return this; + } + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.CloudStorageDestinationOptions storage_destination_options = 3; + * + */ + public Builder setStorageDestinationOptions( + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions.Builder + builderForValue) { + if (storageDestinationOptionsBuilder_ == null) { + destinationOptions_ = builderForValue.build(); + onChanged(); + } else { + storageDestinationOptionsBuilder_.setMessage(builderForValue.build()); + } + destinationOptionsCase_ = 3; + return this; + } + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.CloudStorageDestinationOptions storage_destination_options = 3; + * + */ + public Builder mergeStorageDestinationOptions( + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions value) { + if (storageDestinationOptionsBuilder_ == null) { + if (destinationOptionsCase_ == 3 + && destinationOptions_ + != com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions + .getDefaultInstance()) { + destinationOptions_ = + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions.newBuilder( + (com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions) + destinationOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + destinationOptions_ = value; + } + onChanged(); + } else { + if (destinationOptionsCase_ == 3) { + storageDestinationOptionsBuilder_.mergeFrom(value); + } else { + storageDestinationOptionsBuilder_.setMessage(value); + } + } + destinationOptionsCase_ = 3; + return this; + } + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.CloudStorageDestinationOptions storage_destination_options = 3; + * + */ + public Builder clearStorageDestinationOptions() { + if (storageDestinationOptionsBuilder_ == null) { + if (destinationOptionsCase_ == 3) { + destinationOptionsCase_ = 0; + destinationOptions_ = null; + onChanged(); + } + } else { + if (destinationOptionsCase_ == 3) { + destinationOptionsCase_ = 0; + destinationOptions_ = null; + } + storageDestinationOptionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.CloudStorageDestinationOptions storage_destination_options = 3; + * + */ + public com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions.Builder + getStorageDestinationOptionsBuilder() { + return getStorageDestinationOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.CloudStorageDestinationOptions storage_destination_options = 3; + * + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.CloudStorageDestinationOptionsOrBuilder + getStorageDestinationOptionsOrBuilder() { + if ((destinationOptionsCase_ == 3) && (storageDestinationOptionsBuilder_ != null)) { + return storageDestinationOptionsBuilder_.getMessageOrBuilder(); + } else { + if (destinationOptionsCase_ == 3) { + return (com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions) + destinationOptions_; + } + return com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Cloud Storage as the storage system.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.CloudStorageDestinationOptions storage_destination_options = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions, + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions.Builder, + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptionsOrBuilder> + getStorageDestinationOptionsFieldBuilder() { + if (storageDestinationOptionsBuilder_ == null) { + if (!(destinationOptionsCase_ == 3)) { + destinationOptions_ = + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions + .getDefaultInstance(); + } + storageDestinationOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions, + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions.Builder, + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptionsOrBuilder>( + (com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions) + destinationOptions_, + getParentForChildren(), + isClean()); + destinationOptions_ = null; + } + destinationOptionsCase_ = 3; + onChanged(); + return storageDestinationOptionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.ObjectMetadataReportOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.ObjectMetadataReportOptions) + private static final com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions(); + } + + public static com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ObjectMetadataReportOptions 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.storageinsights.v1.ObjectMetadataReportOptions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ObjectMetadataReportOptionsOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ObjectMetadataReportOptionsOrBuilder.java new file mode 100644 index 000000000000..34ab2dff0fd1 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ObjectMetadataReportOptionsOrBuilder.java @@ -0,0 +1,158 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface ObjectMetadataReportOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.ObjectMetadataReportOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Metadata fields to be included in the report.
+   * 
+ * + * repeated string metadata_fields = 1; + * + * @return A list containing the metadataFields. + */ + java.util.List getMetadataFieldsList(); + /** + * + * + *
+   * Metadata fields to be included in the report.
+   * 
+ * + * repeated string metadata_fields = 1; + * + * @return The count of metadataFields. + */ + int getMetadataFieldsCount(); + /** + * + * + *
+   * Metadata fields to be included in the report.
+   * 
+ * + * repeated string metadata_fields = 1; + * + * @param index The index of the element to return. + * @return The metadataFields at the given index. + */ + java.lang.String getMetadataFields(int index); + /** + * + * + *
+   * Metadata fields to be included in the report.
+   * 
+ * + * repeated string metadata_fields = 1; + * + * @param index The index of the value to return. + * @return The bytes of the metadataFields at the given index. + */ + com.google.protobuf.ByteString getMetadataFieldsBytes(int index); + + /** + * + * + *
+   * Cloud Storage as the storage system.
+   * 
+ * + * .google.cloud.storageinsights.v1.CloudStorageFilters storage_filters = 2; + * + * @return Whether the storageFilters field is set. + */ + boolean hasStorageFilters(); + /** + * + * + *
+   * Cloud Storage as the storage system.
+   * 
+ * + * .google.cloud.storageinsights.v1.CloudStorageFilters storage_filters = 2; + * + * @return The storageFilters. + */ + com.google.cloud.storageinsights.v1.CloudStorageFilters getStorageFilters(); + /** + * + * + *
+   * Cloud Storage as the storage system.
+   * 
+ * + * .google.cloud.storageinsights.v1.CloudStorageFilters storage_filters = 2; + */ + com.google.cloud.storageinsights.v1.CloudStorageFiltersOrBuilder getStorageFiltersOrBuilder(); + + /** + * + * + *
+   * Cloud Storage as the storage system.
+   * 
+ * + * + * .google.cloud.storageinsights.v1.CloudStorageDestinationOptions storage_destination_options = 3; + * + * + * @return Whether the storageDestinationOptions field is set. + */ + boolean hasStorageDestinationOptions(); + /** + * + * + *
+   * Cloud Storage as the storage system.
+   * 
+ * + * + * .google.cloud.storageinsights.v1.CloudStorageDestinationOptions storage_destination_options = 3; + * + * + * @return The storageDestinationOptions. + */ + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptions getStorageDestinationOptions(); + /** + * + * + *
+   * Cloud Storage as the storage system.
+   * 
+ * + * + * .google.cloud.storageinsights.v1.CloudStorageDestinationOptions storage_destination_options = 3; + * + */ + com.google.cloud.storageinsights.v1.CloudStorageDestinationOptionsOrBuilder + getStorageDestinationOptionsOrBuilder(); + + public com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.FilterCase getFilterCase(); + + public com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.DestinationOptionsCase + getDestinationOptionsCase(); +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/OperationMetadata.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/OperationMetadata.java new file mode 100644 index 000000000000..212122b00818 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/OperationMetadata.java @@ -0,0 +1,1834 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.OperationMetadata.class, + com.google.cloud.storageinsights.v1.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int TARGET_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object verb_ = ""; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object statusMessage_ = ""; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + 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(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_ = false; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have been cancelled successfully
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiVersion_ = ""; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + 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.storageinsights.v1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.OperationMetadata other = + (com.google.cloud.storageinsights.v1.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) 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 (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.storageinsights.v1.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.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.storageinsights.v1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.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.storageinsights.v1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.OperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.storageinsights.v1.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.OperationMetadata) + com.google.cloud.storageinsights.v1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.OperationMetadata.class, + com.google.cloud.storageinsights.v1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.OperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + requestedCancellation_ = false; + apiVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.OperationMetadata build() { + com.google.cloud.storageinsights.v1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.OperationMetadata buildPartial() { + com.google.cloud.storageinsights.v1.OperationMetadata result = + new com.google.cloud.storageinsights.v1.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.storageinsights.v1.OperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.target_ = target_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.verb_ = verb_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.statusMessage_ = statusMessage_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestedCancellation_ = requestedCancellation_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.apiVersion_ = apiVersion_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.OperationMetadata) { + return mergeFrom((com.google.cloud.storageinsights.v1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.OperationMetadata other) { + if (other == com.google.cloud.storageinsights.v1.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + bitField0_ |= 0x00000040; + 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: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + verb_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + statusMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + requestedCancellation_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + apiVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + 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 bitField0_; + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + target_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + verb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + verb_ = getDefaultInstance().getVerb(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + verb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + statusMessage_ = getDefaultInstance().getStatusMessage(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have been cancelled successfully
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have been cancelled successfully
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have been cancelled successfully
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + bitField0_ = (bitField0_ & ~0x00000020); + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiVersion_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + apiVersion_ = getDefaultInstance().getApiVersion(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiVersion_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.OperationMetadata) + private static final com.google.cloud.storageinsights.v1.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.OperationMetadata(); + } + + public static com.google.cloud.storageinsights.v1.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.storageinsights.v1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/OperationMetadataOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..16f7dad1a13f --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/OperationMetadataOrBuilder.java @@ -0,0 +1,218 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have been cancelled successfully
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ParquetOptions.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ParquetOptions.java new file mode 100644 index 000000000000..3b72b48b0712 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ParquetOptions.java @@ -0,0 +1,436 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Options to configure Parquet formatted reports.
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ParquetOptions} + */ +public final class ParquetOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.ParquetOptions) + ParquetOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ParquetOptions.newBuilder() to construct. + private ParquetOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ParquetOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ParquetOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ParquetOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ParquetOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ParquetOptions.class, + com.google.cloud.storageinsights.v1.ParquetOptions.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.storageinsights.v1.ParquetOptions)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.ParquetOptions other = + (com.google.cloud.storageinsights.v1.ParquetOptions) 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.storageinsights.v1.ParquetOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ParquetOptions 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.storageinsights.v1.ParquetOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ParquetOptions 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.storageinsights.v1.ParquetOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ParquetOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ParquetOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ParquetOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ParquetOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ParquetOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ParquetOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ParquetOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.storageinsights.v1.ParquetOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Options to configure Parquet formatted reports.
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ParquetOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.ParquetOptions) + com.google.cloud.storageinsights.v1.ParquetOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ParquetOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ParquetOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ParquetOptions.class, + com.google.cloud.storageinsights.v1.ParquetOptions.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.ParquetOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.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.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ParquetOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ParquetOptions getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.ParquetOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ParquetOptions build() { + com.google.cloud.storageinsights.v1.ParquetOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ParquetOptions buildPartial() { + com.google.cloud.storageinsights.v1.ParquetOptions result = + new com.google.cloud.storageinsights.v1.ParquetOptions(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.ParquetOptions) { + return mergeFrom((com.google.cloud.storageinsights.v1.ParquetOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.ParquetOptions other) { + if (other == com.google.cloud.storageinsights.v1.ParquetOptions.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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.ParquetOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.ParquetOptions) + private static final com.google.cloud.storageinsights.v1.ParquetOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.ParquetOptions(); + } + + public static com.google.cloud.storageinsights.v1.ParquetOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ParquetOptions 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.storageinsights.v1.ParquetOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ParquetOptionsOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ParquetOptionsOrBuilder.java new file mode 100644 index 000000000000..c1e604bdeb2c --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ParquetOptionsOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface ParquetOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.ParquetOptions) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportConfig.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportConfig.java new file mode 100644 index 000000000000..e403a9cff86e --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportConfig.java @@ -0,0 +1,3072 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Message describing ReportConfig object. ReportConfig is the configuration to
+ * generate reports.
+ * Next ID: 12
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ReportConfig} + */ +public final class ReportConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.ReportConfig) + ReportConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReportConfig.newBuilder() to construct. + private ReportConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReportConfig() { + name_ = ""; + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReportConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 10: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ReportConfig.class, + com.google.cloud.storageinsights.v1.ReportConfig.Builder.class); + } + + private int reportFormatCase_ = 0; + private java.lang.Object reportFormat_; + + public enum ReportFormatCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CSV_OPTIONS(6), + PARQUET_OPTIONS(7), + REPORTFORMAT_NOT_SET(0); + private final int value; + + private ReportFormatCase(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 ReportFormatCase valueOf(int value) { + return forNumber(value); + } + + public static ReportFormatCase forNumber(int value) { + switch (value) { + case 6: + return CSV_OPTIONS; + case 7: + return PARQUET_OPTIONS; + case 0: + return REPORTFORMAT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ReportFormatCase getReportFormatCase() { + return ReportFormatCase.forNumber(reportFormatCase_); + } + + private int reportKindCase_ = 0; + private java.lang.Object reportKind_; + + public enum ReportKindCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + OBJECT_METADATA_REPORT_OPTIONS(8), + REPORTKIND_NOT_SET(0); + private final int value; + + private ReportKindCase(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 ReportKindCase valueOf(int value) { + return forNumber(value); + } + + public static ReportKindCase forNumber(int value) { + switch (value) { + case 8: + return OBJECT_METADATA_REPORT_OPTIONS; + case 0: + return REPORTKIND_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ReportKindCase getReportKindCase() { + return ReportKindCase.forNumber(reportKindCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * name of resource. It will be of form
+   * projects/<project>/locations/<location>/reportConfigs/<report-config-id>.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * name of resource. It will be of form
+   * projects/<project>/locations/<location>/reportConfigs/<report-config-id>.
+   * 
+ * + * 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 CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. [Output only] Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. [Output only] Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. [Output only] Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. [Output only] Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. [Output only] Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. [Output only] Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int FREQUENCY_OPTIONS_FIELD_NUMBER = 5; + private com.google.cloud.storageinsights.v1.FrequencyOptions frequencyOptions_; + /** + * + * + *
+   * The frequency of report generation.
+   * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions frequency_options = 5; + * + * @return Whether the frequencyOptions field is set. + */ + @java.lang.Override + public boolean hasFrequencyOptions() { + return frequencyOptions_ != null; + } + /** + * + * + *
+   * The frequency of report generation.
+   * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions frequency_options = 5; + * + * @return The frequencyOptions. + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.FrequencyOptions getFrequencyOptions() { + return frequencyOptions_ == null + ? com.google.cloud.storageinsights.v1.FrequencyOptions.getDefaultInstance() + : frequencyOptions_; + } + /** + * + * + *
+   * The frequency of report generation.
+   * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions frequency_options = 5; + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.FrequencyOptionsOrBuilder + getFrequencyOptionsOrBuilder() { + return frequencyOptions_ == null + ? com.google.cloud.storageinsights.v1.FrequencyOptions.getDefaultInstance() + : frequencyOptions_; + } + + public static final int CSV_OPTIONS_FIELD_NUMBER = 6; + /** + * + * + *
+   * Options for CSV formatted reports.
+   * 
+ * + * .google.cloud.storageinsights.v1.CSVOptions csv_options = 6; + * + * @return Whether the csvOptions field is set. + */ + @java.lang.Override + public boolean hasCsvOptions() { + return reportFormatCase_ == 6; + } + /** + * + * + *
+   * Options for CSV formatted reports.
+   * 
+ * + * .google.cloud.storageinsights.v1.CSVOptions csv_options = 6; + * + * @return The csvOptions. + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.CSVOptions getCsvOptions() { + if (reportFormatCase_ == 6) { + return (com.google.cloud.storageinsights.v1.CSVOptions) reportFormat_; + } + return com.google.cloud.storageinsights.v1.CSVOptions.getDefaultInstance(); + } + /** + * + * + *
+   * Options for CSV formatted reports.
+   * 
+ * + * .google.cloud.storageinsights.v1.CSVOptions csv_options = 6; + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.CSVOptionsOrBuilder getCsvOptionsOrBuilder() { + if (reportFormatCase_ == 6) { + return (com.google.cloud.storageinsights.v1.CSVOptions) reportFormat_; + } + return com.google.cloud.storageinsights.v1.CSVOptions.getDefaultInstance(); + } + + public static final int PARQUET_OPTIONS_FIELD_NUMBER = 7; + /** + * + * + *
+   * Options for Parquet formatted reports.
+   * 
+ * + * .google.cloud.storageinsights.v1.ParquetOptions parquet_options = 7; + * + * @return Whether the parquetOptions field is set. + */ + @java.lang.Override + public boolean hasParquetOptions() { + return reportFormatCase_ == 7; + } + /** + * + * + *
+   * Options for Parquet formatted reports.
+   * 
+ * + * .google.cloud.storageinsights.v1.ParquetOptions parquet_options = 7; + * + * @return The parquetOptions. + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ParquetOptions getParquetOptions() { + if (reportFormatCase_ == 7) { + return (com.google.cloud.storageinsights.v1.ParquetOptions) reportFormat_; + } + return com.google.cloud.storageinsights.v1.ParquetOptions.getDefaultInstance(); + } + /** + * + * + *
+   * Options for Parquet formatted reports.
+   * 
+ * + * .google.cloud.storageinsights.v1.ParquetOptions parquet_options = 7; + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ParquetOptionsOrBuilder getParquetOptionsOrBuilder() { + if (reportFormatCase_ == 7) { + return (com.google.cloud.storageinsights.v1.ParquetOptions) reportFormat_; + } + return com.google.cloud.storageinsights.v1.ParquetOptions.getDefaultInstance(); + } + + public static final int OBJECT_METADATA_REPORT_OPTIONS_FIELD_NUMBER = 8; + /** + * + * + *
+   * Report for exporting object metadata.
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ObjectMetadataReportOptions object_metadata_report_options = 8; + * + * + * @return Whether the objectMetadataReportOptions field is set. + */ + @java.lang.Override + public boolean hasObjectMetadataReportOptions() { + return reportKindCase_ == 8; + } + /** + * + * + *
+   * Report for exporting object metadata.
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ObjectMetadataReportOptions object_metadata_report_options = 8; + * + * + * @return The objectMetadataReportOptions. + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions + getObjectMetadataReportOptions() { + if (reportKindCase_ == 8) { + return (com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions) reportKind_; + } + return com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.getDefaultInstance(); + } + /** + * + * + *
+   * Report for exporting object metadata.
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ObjectMetadataReportOptions object_metadata_report_options = 8; + * + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ObjectMetadataReportOptionsOrBuilder + getObjectMetadataReportOptionsOrBuilder() { + if (reportKindCase_ == 8) { + return (com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions) reportKind_; + } + return com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.getDefaultInstance(); + } + + public static final int LABELS_FIELD_NUMBER = 10; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportConfig_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 10; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 10; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 10; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 10; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * User provided display name which can be empty and limited to 256 characters
+   * that is editable.
+   * 
+ * + * string display_name = 11; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * User provided display name which can be empty and limited to 256 characters
+   * that is editable.
+   * 
+ * + * string display_name = 11; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = 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.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + if (frequencyOptions_ != null) { + output.writeMessage(5, getFrequencyOptions()); + } + if (reportFormatCase_ == 6) { + output.writeMessage(6, (com.google.cloud.storageinsights.v1.CSVOptions) reportFormat_); + } + if (reportFormatCase_ == 7) { + output.writeMessage(7, (com.google.cloud.storageinsights.v1.ParquetOptions) reportFormat_); + } + if (reportKindCase_ == 8) { + output.writeMessage( + 8, (com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions) reportKind_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 10); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, displayName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + if (frequencyOptions_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getFrequencyOptions()); + } + if (reportFormatCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.storageinsights.v1.CSVOptions) reportFormat_); + } + if (reportFormatCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.cloud.storageinsights.v1.ParquetOptions) reportFormat_); + } + if (reportKindCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions) reportKind_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, labels__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, displayName_); + } + 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.storageinsights.v1.ReportConfig)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.ReportConfig other = + (com.google.cloud.storageinsights.v1.ReportConfig) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasFrequencyOptions() != other.hasFrequencyOptions()) return false; + if (hasFrequencyOptions()) { + if (!getFrequencyOptions().equals(other.getFrequencyOptions())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getReportFormatCase().equals(other.getReportFormatCase())) return false; + switch (reportFormatCase_) { + case 6: + if (!getCsvOptions().equals(other.getCsvOptions())) return false; + break; + case 7: + if (!getParquetOptions().equals(other.getParquetOptions())) return false; + break; + case 0: + default: + } + if (!getReportKindCase().equals(other.getReportKindCase())) return false; + switch (reportKindCase_) { + case 8: + if (!getObjectMetadataReportOptions().equals(other.getObjectMetadataReportOptions())) + 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 (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasFrequencyOptions()) { + hash = (37 * hash) + FREQUENCY_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getFrequencyOptions().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + switch (reportFormatCase_) { + case 6: + hash = (37 * hash) + CSV_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getCsvOptions().hashCode(); + break; + case 7: + hash = (37 * hash) + PARQUET_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getParquetOptions().hashCode(); + break; + case 0: + default: + } + switch (reportKindCase_) { + case 8: + hash = (37 * hash) + OBJECT_METADATA_REPORT_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getObjectMetadataReportOptions().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.storageinsights.v1.ReportConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ReportConfig 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.storageinsights.v1.ReportConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ReportConfig 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.storageinsights.v1.ReportConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ReportConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ReportConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ReportConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ReportConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ReportConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ReportConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ReportConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.storageinsights.v1.ReportConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message describing ReportConfig object. ReportConfig is the configuration to
+   * generate reports.
+   * Next ID: 12
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ReportConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.ReportConfig) + com.google.cloud.storageinsights.v1.ReportConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 10: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 10: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ReportConfig.class, + com.google.cloud.storageinsights.v1.ReportConfig.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.ReportConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + frequencyOptions_ = null; + if (frequencyOptionsBuilder_ != null) { + frequencyOptionsBuilder_.dispose(); + frequencyOptionsBuilder_ = null; + } + if (csvOptionsBuilder_ != null) { + csvOptionsBuilder_.clear(); + } + if (parquetOptionsBuilder_ != null) { + parquetOptionsBuilder_.clear(); + } + if (objectMetadataReportOptionsBuilder_ != null) { + objectMetadataReportOptionsBuilder_.clear(); + } + internalGetMutableLabels().clear(); + displayName_ = ""; + reportFormatCase_ = 0; + reportFormat_ = null; + reportKindCase_ = 0; + reportKind_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportConfig getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.ReportConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportConfig build() { + com.google.cloud.storageinsights.v1.ReportConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportConfig buildPartial() { + com.google.cloud.storageinsights.v1.ReportConfig result = + new com.google.cloud.storageinsights.v1.ReportConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.storageinsights.v1.ReportConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.frequencyOptions_ = + frequencyOptionsBuilder_ == null ? frequencyOptions_ : frequencyOptionsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.displayName_ = displayName_; + } + } + + private void buildPartialOneofs(com.google.cloud.storageinsights.v1.ReportConfig result) { + result.reportFormatCase_ = reportFormatCase_; + result.reportFormat_ = this.reportFormat_; + if (reportFormatCase_ == 6 && csvOptionsBuilder_ != null) { + result.reportFormat_ = csvOptionsBuilder_.build(); + } + if (reportFormatCase_ == 7 && parquetOptionsBuilder_ != null) { + result.reportFormat_ = parquetOptionsBuilder_.build(); + } + result.reportKindCase_ = reportKindCase_; + result.reportKind_ = this.reportKind_; + if (reportKindCase_ == 8 && objectMetadataReportOptionsBuilder_ != null) { + result.reportKind_ = objectMetadataReportOptionsBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.ReportConfig) { + return mergeFrom((com.google.cloud.storageinsights.v1.ReportConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.ReportConfig other) { + if (other == com.google.cloud.storageinsights.v1.ReportConfig.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasFrequencyOptions()) { + mergeFrequencyOptions(other.getFrequencyOptions()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000080; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000100; + onChanged(); + } + switch (other.getReportFormatCase()) { + case CSV_OPTIONS: + { + mergeCsvOptions(other.getCsvOptions()); + break; + } + case PARQUET_OPTIONS: + { + mergeParquetOptions(other.getParquetOptions()); + break; + } + case REPORTFORMAT_NOT_SET: + { + break; + } + } + switch (other.getReportKindCase()) { + case OBJECT_METADATA_REPORT_OPTIONS: + { + mergeObjectMetadataReportOptions(other.getObjectMetadataReportOptions()); + break; + } + case REPORTKIND_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_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + input.readMessage( + getFrequencyOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 50: + { + input.readMessage(getCsvOptionsFieldBuilder().getBuilder(), extensionRegistry); + reportFormatCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage(getParquetOptionsFieldBuilder().getBuilder(), extensionRegistry); + reportFormatCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage( + getObjectMetadataReportOptionsFieldBuilder().getBuilder(), extensionRegistry); + reportKindCase_ = 8; + break; + } // case 66 + case 82: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000080; + break; + } // case 82 + case 90: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 90 + 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 reportFormatCase_ = 0; + private java.lang.Object reportFormat_; + + public ReportFormatCase getReportFormatCase() { + return ReportFormatCase.forNumber(reportFormatCase_); + } + + public Builder clearReportFormat() { + reportFormatCase_ = 0; + reportFormat_ = null; + onChanged(); + return this; + } + + private int reportKindCase_ = 0; + private java.lang.Object reportKind_; + + public ReportKindCase getReportKindCase() { + return ReportKindCase.forNumber(reportKindCase_); + } + + public Builder clearReportKind() { + reportKindCase_ = 0; + reportKind_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * name of resource. It will be of form
+     * projects/<project>/locations/<location>/reportConfigs/<report-config-id>.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * name of resource. It will be of form
+     * projects/<project>/locations/<location>/reportConfigs/<report-config-id>.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * name of resource. It will be of form
+     * projects/<project>/locations/<location>/reportConfigs/<report-config-id>.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * name of resource. It will be of form
+     * projects/<project>/locations/<location>/reportConfigs/<report-config-id>.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * name of resource. It will be of form
+     * projects/<project>/locations/<location>/reportConfigs/<report-config-id>.
+     * 
+ * + * 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 com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. [Output only] Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. [Output only] Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. [Output only] Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. [Output only] Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. [Output only] Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. [Output only] Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000002); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. [Output only] Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. [Output only] Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. [Output only] Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. [Output only] Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. [Output only] Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. [Output only] Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. [Output only] Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. [Output only] Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. [Output only] Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. [Output only] Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. [Output only] Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. [Output only] Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.cloud.storageinsights.v1.FrequencyOptions frequencyOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.FrequencyOptions, + com.google.cloud.storageinsights.v1.FrequencyOptions.Builder, + com.google.cloud.storageinsights.v1.FrequencyOptionsOrBuilder> + frequencyOptionsBuilder_; + /** + * + * + *
+     * The frequency of report generation.
+     * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions frequency_options = 5; + * + * @return Whether the frequencyOptions field is set. + */ + public boolean hasFrequencyOptions() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * The frequency of report generation.
+     * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions frequency_options = 5; + * + * @return The frequencyOptions. + */ + public com.google.cloud.storageinsights.v1.FrequencyOptions getFrequencyOptions() { + if (frequencyOptionsBuilder_ == null) { + return frequencyOptions_ == null + ? com.google.cloud.storageinsights.v1.FrequencyOptions.getDefaultInstance() + : frequencyOptions_; + } else { + return frequencyOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The frequency of report generation.
+     * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions frequency_options = 5; + */ + public Builder setFrequencyOptions(com.google.cloud.storageinsights.v1.FrequencyOptions value) { + if (frequencyOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + frequencyOptions_ = value; + } else { + frequencyOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The frequency of report generation.
+     * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions frequency_options = 5; + */ + public Builder setFrequencyOptions( + com.google.cloud.storageinsights.v1.FrequencyOptions.Builder builderForValue) { + if (frequencyOptionsBuilder_ == null) { + frequencyOptions_ = builderForValue.build(); + } else { + frequencyOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The frequency of report generation.
+     * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions frequency_options = 5; + */ + public Builder mergeFrequencyOptions( + com.google.cloud.storageinsights.v1.FrequencyOptions value) { + if (frequencyOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && frequencyOptions_ != null + && frequencyOptions_ + != com.google.cloud.storageinsights.v1.FrequencyOptions.getDefaultInstance()) { + getFrequencyOptionsBuilder().mergeFrom(value); + } else { + frequencyOptions_ = value; + } + } else { + frequencyOptionsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The frequency of report generation.
+     * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions frequency_options = 5; + */ + public Builder clearFrequencyOptions() { + bitField0_ = (bitField0_ & ~0x00000008); + frequencyOptions_ = null; + if (frequencyOptionsBuilder_ != null) { + frequencyOptionsBuilder_.dispose(); + frequencyOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The frequency of report generation.
+     * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions frequency_options = 5; + */ + public com.google.cloud.storageinsights.v1.FrequencyOptions.Builder + getFrequencyOptionsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getFrequencyOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The frequency of report generation.
+     * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions frequency_options = 5; + */ + public com.google.cloud.storageinsights.v1.FrequencyOptionsOrBuilder + getFrequencyOptionsOrBuilder() { + if (frequencyOptionsBuilder_ != null) { + return frequencyOptionsBuilder_.getMessageOrBuilder(); + } else { + return frequencyOptions_ == null + ? com.google.cloud.storageinsights.v1.FrequencyOptions.getDefaultInstance() + : frequencyOptions_; + } + } + /** + * + * + *
+     * The frequency of report generation.
+     * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions frequency_options = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.FrequencyOptions, + com.google.cloud.storageinsights.v1.FrequencyOptions.Builder, + com.google.cloud.storageinsights.v1.FrequencyOptionsOrBuilder> + getFrequencyOptionsFieldBuilder() { + if (frequencyOptionsBuilder_ == null) { + frequencyOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.FrequencyOptions, + com.google.cloud.storageinsights.v1.FrequencyOptions.Builder, + com.google.cloud.storageinsights.v1.FrequencyOptionsOrBuilder>( + getFrequencyOptions(), getParentForChildren(), isClean()); + frequencyOptions_ = null; + } + return frequencyOptionsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.CSVOptions, + com.google.cloud.storageinsights.v1.CSVOptions.Builder, + com.google.cloud.storageinsights.v1.CSVOptionsOrBuilder> + csvOptionsBuilder_; + /** + * + * + *
+     * Options for CSV formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.CSVOptions csv_options = 6; + * + * @return Whether the csvOptions field is set. + */ + @java.lang.Override + public boolean hasCsvOptions() { + return reportFormatCase_ == 6; + } + /** + * + * + *
+     * Options for CSV formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.CSVOptions csv_options = 6; + * + * @return The csvOptions. + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.CSVOptions getCsvOptions() { + if (csvOptionsBuilder_ == null) { + if (reportFormatCase_ == 6) { + return (com.google.cloud.storageinsights.v1.CSVOptions) reportFormat_; + } + return com.google.cloud.storageinsights.v1.CSVOptions.getDefaultInstance(); + } else { + if (reportFormatCase_ == 6) { + return csvOptionsBuilder_.getMessage(); + } + return com.google.cloud.storageinsights.v1.CSVOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Options for CSV formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.CSVOptions csv_options = 6; + */ + public Builder setCsvOptions(com.google.cloud.storageinsights.v1.CSVOptions value) { + if (csvOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + reportFormat_ = value; + onChanged(); + } else { + csvOptionsBuilder_.setMessage(value); + } + reportFormatCase_ = 6; + return this; + } + /** + * + * + *
+     * Options for CSV formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.CSVOptions csv_options = 6; + */ + public Builder setCsvOptions( + com.google.cloud.storageinsights.v1.CSVOptions.Builder builderForValue) { + if (csvOptionsBuilder_ == null) { + reportFormat_ = builderForValue.build(); + onChanged(); + } else { + csvOptionsBuilder_.setMessage(builderForValue.build()); + } + reportFormatCase_ = 6; + return this; + } + /** + * + * + *
+     * Options for CSV formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.CSVOptions csv_options = 6; + */ + public Builder mergeCsvOptions(com.google.cloud.storageinsights.v1.CSVOptions value) { + if (csvOptionsBuilder_ == null) { + if (reportFormatCase_ == 6 + && reportFormat_ + != com.google.cloud.storageinsights.v1.CSVOptions.getDefaultInstance()) { + reportFormat_ = + com.google.cloud.storageinsights.v1.CSVOptions.newBuilder( + (com.google.cloud.storageinsights.v1.CSVOptions) reportFormat_) + .mergeFrom(value) + .buildPartial(); + } else { + reportFormat_ = value; + } + onChanged(); + } else { + if (reportFormatCase_ == 6) { + csvOptionsBuilder_.mergeFrom(value); + } else { + csvOptionsBuilder_.setMessage(value); + } + } + reportFormatCase_ = 6; + return this; + } + /** + * + * + *
+     * Options for CSV formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.CSVOptions csv_options = 6; + */ + public Builder clearCsvOptions() { + if (csvOptionsBuilder_ == null) { + if (reportFormatCase_ == 6) { + reportFormatCase_ = 0; + reportFormat_ = null; + onChanged(); + } + } else { + if (reportFormatCase_ == 6) { + reportFormatCase_ = 0; + reportFormat_ = null; + } + csvOptionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Options for CSV formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.CSVOptions csv_options = 6; + */ + public com.google.cloud.storageinsights.v1.CSVOptions.Builder getCsvOptionsBuilder() { + return getCsvOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Options for CSV formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.CSVOptions csv_options = 6; + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.CSVOptionsOrBuilder getCsvOptionsOrBuilder() { + if ((reportFormatCase_ == 6) && (csvOptionsBuilder_ != null)) { + return csvOptionsBuilder_.getMessageOrBuilder(); + } else { + if (reportFormatCase_ == 6) { + return (com.google.cloud.storageinsights.v1.CSVOptions) reportFormat_; + } + return com.google.cloud.storageinsights.v1.CSVOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Options for CSV formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.CSVOptions csv_options = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.CSVOptions, + com.google.cloud.storageinsights.v1.CSVOptions.Builder, + com.google.cloud.storageinsights.v1.CSVOptionsOrBuilder> + getCsvOptionsFieldBuilder() { + if (csvOptionsBuilder_ == null) { + if (!(reportFormatCase_ == 6)) { + reportFormat_ = com.google.cloud.storageinsights.v1.CSVOptions.getDefaultInstance(); + } + csvOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.CSVOptions, + com.google.cloud.storageinsights.v1.CSVOptions.Builder, + com.google.cloud.storageinsights.v1.CSVOptionsOrBuilder>( + (com.google.cloud.storageinsights.v1.CSVOptions) reportFormat_, + getParentForChildren(), + isClean()); + reportFormat_ = null; + } + reportFormatCase_ = 6; + onChanged(); + return csvOptionsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.ParquetOptions, + com.google.cloud.storageinsights.v1.ParquetOptions.Builder, + com.google.cloud.storageinsights.v1.ParquetOptionsOrBuilder> + parquetOptionsBuilder_; + /** + * + * + *
+     * Options for Parquet formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.ParquetOptions parquet_options = 7; + * + * @return Whether the parquetOptions field is set. + */ + @java.lang.Override + public boolean hasParquetOptions() { + return reportFormatCase_ == 7; + } + /** + * + * + *
+     * Options for Parquet formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.ParquetOptions parquet_options = 7; + * + * @return The parquetOptions. + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ParquetOptions getParquetOptions() { + if (parquetOptionsBuilder_ == null) { + if (reportFormatCase_ == 7) { + return (com.google.cloud.storageinsights.v1.ParquetOptions) reportFormat_; + } + return com.google.cloud.storageinsights.v1.ParquetOptions.getDefaultInstance(); + } else { + if (reportFormatCase_ == 7) { + return parquetOptionsBuilder_.getMessage(); + } + return com.google.cloud.storageinsights.v1.ParquetOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Options for Parquet formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.ParquetOptions parquet_options = 7; + */ + public Builder setParquetOptions(com.google.cloud.storageinsights.v1.ParquetOptions value) { + if (parquetOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + reportFormat_ = value; + onChanged(); + } else { + parquetOptionsBuilder_.setMessage(value); + } + reportFormatCase_ = 7; + return this; + } + /** + * + * + *
+     * Options for Parquet formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.ParquetOptions parquet_options = 7; + */ + public Builder setParquetOptions( + com.google.cloud.storageinsights.v1.ParquetOptions.Builder builderForValue) { + if (parquetOptionsBuilder_ == null) { + reportFormat_ = builderForValue.build(); + onChanged(); + } else { + parquetOptionsBuilder_.setMessage(builderForValue.build()); + } + reportFormatCase_ = 7; + return this; + } + /** + * + * + *
+     * Options for Parquet formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.ParquetOptions parquet_options = 7; + */ + public Builder mergeParquetOptions(com.google.cloud.storageinsights.v1.ParquetOptions value) { + if (parquetOptionsBuilder_ == null) { + if (reportFormatCase_ == 7 + && reportFormat_ + != com.google.cloud.storageinsights.v1.ParquetOptions.getDefaultInstance()) { + reportFormat_ = + com.google.cloud.storageinsights.v1.ParquetOptions.newBuilder( + (com.google.cloud.storageinsights.v1.ParquetOptions) reportFormat_) + .mergeFrom(value) + .buildPartial(); + } else { + reportFormat_ = value; + } + onChanged(); + } else { + if (reportFormatCase_ == 7) { + parquetOptionsBuilder_.mergeFrom(value); + } else { + parquetOptionsBuilder_.setMessage(value); + } + } + reportFormatCase_ = 7; + return this; + } + /** + * + * + *
+     * Options for Parquet formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.ParquetOptions parquet_options = 7; + */ + public Builder clearParquetOptions() { + if (parquetOptionsBuilder_ == null) { + if (reportFormatCase_ == 7) { + reportFormatCase_ = 0; + reportFormat_ = null; + onChanged(); + } + } else { + if (reportFormatCase_ == 7) { + reportFormatCase_ = 0; + reportFormat_ = null; + } + parquetOptionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Options for Parquet formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.ParquetOptions parquet_options = 7; + */ + public com.google.cloud.storageinsights.v1.ParquetOptions.Builder getParquetOptionsBuilder() { + return getParquetOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Options for Parquet formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.ParquetOptions parquet_options = 7; + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ParquetOptionsOrBuilder + getParquetOptionsOrBuilder() { + if ((reportFormatCase_ == 7) && (parquetOptionsBuilder_ != null)) { + return parquetOptionsBuilder_.getMessageOrBuilder(); + } else { + if (reportFormatCase_ == 7) { + return (com.google.cloud.storageinsights.v1.ParquetOptions) reportFormat_; + } + return com.google.cloud.storageinsights.v1.ParquetOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Options for Parquet formatted reports.
+     * 
+ * + * .google.cloud.storageinsights.v1.ParquetOptions parquet_options = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.ParquetOptions, + com.google.cloud.storageinsights.v1.ParquetOptions.Builder, + com.google.cloud.storageinsights.v1.ParquetOptionsOrBuilder> + getParquetOptionsFieldBuilder() { + if (parquetOptionsBuilder_ == null) { + if (!(reportFormatCase_ == 7)) { + reportFormat_ = com.google.cloud.storageinsights.v1.ParquetOptions.getDefaultInstance(); + } + parquetOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.ParquetOptions, + com.google.cloud.storageinsights.v1.ParquetOptions.Builder, + com.google.cloud.storageinsights.v1.ParquetOptionsOrBuilder>( + (com.google.cloud.storageinsights.v1.ParquetOptions) reportFormat_, + getParentForChildren(), + isClean()); + reportFormat_ = null; + } + reportFormatCase_ = 7; + onChanged(); + return parquetOptionsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions, + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.Builder, + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptionsOrBuilder> + objectMetadataReportOptionsBuilder_; + /** + * + * + *
+     * Report for exporting object metadata.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ObjectMetadataReportOptions object_metadata_report_options = 8; + * + * + * @return Whether the objectMetadataReportOptions field is set. + */ + @java.lang.Override + public boolean hasObjectMetadataReportOptions() { + return reportKindCase_ == 8; + } + /** + * + * + *
+     * Report for exporting object metadata.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ObjectMetadataReportOptions object_metadata_report_options = 8; + * + * + * @return The objectMetadataReportOptions. + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions + getObjectMetadataReportOptions() { + if (objectMetadataReportOptionsBuilder_ == null) { + if (reportKindCase_ == 8) { + return (com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions) reportKind_; + } + return com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.getDefaultInstance(); + } else { + if (reportKindCase_ == 8) { + return objectMetadataReportOptionsBuilder_.getMessage(); + } + return com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Report for exporting object metadata.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ObjectMetadataReportOptions object_metadata_report_options = 8; + * + */ + public Builder setObjectMetadataReportOptions( + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions value) { + if (objectMetadataReportOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + reportKind_ = value; + onChanged(); + } else { + objectMetadataReportOptionsBuilder_.setMessage(value); + } + reportKindCase_ = 8; + return this; + } + /** + * + * + *
+     * Report for exporting object metadata.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ObjectMetadataReportOptions object_metadata_report_options = 8; + * + */ + public Builder setObjectMetadataReportOptions( + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.Builder builderForValue) { + if (objectMetadataReportOptionsBuilder_ == null) { + reportKind_ = builderForValue.build(); + onChanged(); + } else { + objectMetadataReportOptionsBuilder_.setMessage(builderForValue.build()); + } + reportKindCase_ = 8; + return this; + } + /** + * + * + *
+     * Report for exporting object metadata.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ObjectMetadataReportOptions object_metadata_report_options = 8; + * + */ + public Builder mergeObjectMetadataReportOptions( + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions value) { + if (objectMetadataReportOptionsBuilder_ == null) { + if (reportKindCase_ == 8 + && reportKind_ + != com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions + .getDefaultInstance()) { + reportKind_ = + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.newBuilder( + (com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions) reportKind_) + .mergeFrom(value) + .buildPartial(); + } else { + reportKind_ = value; + } + onChanged(); + } else { + if (reportKindCase_ == 8) { + objectMetadataReportOptionsBuilder_.mergeFrom(value); + } else { + objectMetadataReportOptionsBuilder_.setMessage(value); + } + } + reportKindCase_ = 8; + return this; + } + /** + * + * + *
+     * Report for exporting object metadata.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ObjectMetadataReportOptions object_metadata_report_options = 8; + * + */ + public Builder clearObjectMetadataReportOptions() { + if (objectMetadataReportOptionsBuilder_ == null) { + if (reportKindCase_ == 8) { + reportKindCase_ = 0; + reportKind_ = null; + onChanged(); + } + } else { + if (reportKindCase_ == 8) { + reportKindCase_ = 0; + reportKind_ = null; + } + objectMetadataReportOptionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Report for exporting object metadata.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ObjectMetadataReportOptions object_metadata_report_options = 8; + * + */ + public com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.Builder + getObjectMetadataReportOptionsBuilder() { + return getObjectMetadataReportOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Report for exporting object metadata.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ObjectMetadataReportOptions object_metadata_report_options = 8; + * + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ObjectMetadataReportOptionsOrBuilder + getObjectMetadataReportOptionsOrBuilder() { + if ((reportKindCase_ == 8) && (objectMetadataReportOptionsBuilder_ != null)) { + return objectMetadataReportOptionsBuilder_.getMessageOrBuilder(); + } else { + if (reportKindCase_ == 8) { + return (com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions) reportKind_; + } + return com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.getDefaultInstance(); + } + } + /** + * + * + *
+     * Report for exporting object metadata.
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ObjectMetadataReportOptions object_metadata_report_options = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions, + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.Builder, + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptionsOrBuilder> + getObjectMetadataReportOptionsFieldBuilder() { + if (objectMetadataReportOptionsBuilder_ == null) { + if (!(reportKindCase_ == 8)) { + reportKind_ = + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.getDefaultInstance(); + } + objectMetadataReportOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions, + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions.Builder, + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptionsOrBuilder>( + (com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions) reportKind_, + getParentForChildren(), + isClean()); + reportKind_ = null; + } + reportKindCase_ = 8; + onChanged(); + return objectMetadataReportOptionsBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000080; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 10; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 10; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 10; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 10; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000080); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 10; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000080; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 10; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000080; + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 10; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000080; + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * User provided display name which can be empty and limited to 256 characters
+     * that is editable.
+     * 
+ * + * string display_name = 11; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * User provided display name which can be empty and limited to 256 characters
+     * that is editable.
+     * 
+ * + * string display_name = 11; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * User provided display name which can be empty and limited to 256 characters
+     * that is editable.
+     * 
+ * + * string display_name = 11; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * User provided display name which can be empty and limited to 256 characters
+     * that is editable.
+     * 
+ * + * string display_name = 11; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+     * User provided display name which can be empty and limited to 256 characters
+     * that is editable.
+     * 
+ * + * string display_name = 11; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.ReportConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.ReportConfig) + private static final com.google.cloud.storageinsights.v1.ReportConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.ReportConfig(); + } + + public static com.google.cloud.storageinsights.v1.ReportConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReportConfig 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.storageinsights.v1.ReportConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportConfigName.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportConfigName.java new file mode 100644 index 000000000000..adac2e35a7cd --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportConfigName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2022 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.storageinsights.v1; + +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 ReportConfigName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_REPORT_CONFIG = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/reportConfigs/{report_config}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String reportConfig; + + @Deprecated + protected ReportConfigName() { + project = null; + location = null; + reportConfig = null; + } + + private ReportConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + reportConfig = Preconditions.checkNotNull(builder.getReportConfig()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getReportConfig() { + return reportConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ReportConfigName of(String project, String location, String reportConfig) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setReportConfig(reportConfig) + .build(); + } + + public static String format(String project, String location, String reportConfig) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setReportConfig(reportConfig) + .build() + .toString(); + } + + public static ReportConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_REPORT_CONFIG.validatedMatch( + formattedString, "ReportConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("report_config")); + } + + 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 (ReportConfigName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_REPORT_CONFIG.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 (reportConfig != null) { + fieldMapBuilder.put("report_config", reportConfig); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_REPORT_CONFIG.instantiate( + "project", project, "location", location, "report_config", reportConfig); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ReportConfigName that = ((ReportConfigName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.reportConfig, that.reportConfig); + } + 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(reportConfig); + return h; + } + + /** Builder for projects/{project}/locations/{location}/reportConfigs/{report_config}. */ + public static class Builder { + private String project; + private String location; + private String reportConfig; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getReportConfig() { + return reportConfig; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setReportConfig(String reportConfig) { + this.reportConfig = reportConfig; + return this; + } + + private Builder(ReportConfigName reportConfigName) { + this.project = reportConfigName.project; + this.location = reportConfigName.location; + this.reportConfig = reportConfigName.reportConfig; + } + + public ReportConfigName build() { + return new ReportConfigName(this); + } + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportConfigOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportConfigOrBuilder.java new file mode 100644 index 000000000000..00cd90542084 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportConfigOrBuilder.java @@ -0,0 +1,364 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface ReportConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.ReportConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * name of resource. It will be of form
+   * projects/<project>/locations/<location>/reportConfigs/<report-config-id>.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * name of resource. It will be of form
+   * projects/<project>/locations/<location>/reportConfigs/<report-config-id>.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. [Output only] Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. [Output only] Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. [Output only] Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. [Output only] Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. [Output only] Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. [Output only] Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * The frequency of report generation.
+   * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions frequency_options = 5; + * + * @return Whether the frequencyOptions field is set. + */ + boolean hasFrequencyOptions(); + /** + * + * + *
+   * The frequency of report generation.
+   * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions frequency_options = 5; + * + * @return The frequencyOptions. + */ + com.google.cloud.storageinsights.v1.FrequencyOptions getFrequencyOptions(); + /** + * + * + *
+   * The frequency of report generation.
+   * 
+ * + * .google.cloud.storageinsights.v1.FrequencyOptions frequency_options = 5; + */ + com.google.cloud.storageinsights.v1.FrequencyOptionsOrBuilder getFrequencyOptionsOrBuilder(); + + /** + * + * + *
+   * Options for CSV formatted reports.
+   * 
+ * + * .google.cloud.storageinsights.v1.CSVOptions csv_options = 6; + * + * @return Whether the csvOptions field is set. + */ + boolean hasCsvOptions(); + /** + * + * + *
+   * Options for CSV formatted reports.
+   * 
+ * + * .google.cloud.storageinsights.v1.CSVOptions csv_options = 6; + * + * @return The csvOptions. + */ + com.google.cloud.storageinsights.v1.CSVOptions getCsvOptions(); + /** + * + * + *
+   * Options for CSV formatted reports.
+   * 
+ * + * .google.cloud.storageinsights.v1.CSVOptions csv_options = 6; + */ + com.google.cloud.storageinsights.v1.CSVOptionsOrBuilder getCsvOptionsOrBuilder(); + + /** + * + * + *
+   * Options for Parquet formatted reports.
+   * 
+ * + * .google.cloud.storageinsights.v1.ParquetOptions parquet_options = 7; + * + * @return Whether the parquetOptions field is set. + */ + boolean hasParquetOptions(); + /** + * + * + *
+   * Options for Parquet formatted reports.
+   * 
+ * + * .google.cloud.storageinsights.v1.ParquetOptions parquet_options = 7; + * + * @return The parquetOptions. + */ + com.google.cloud.storageinsights.v1.ParquetOptions getParquetOptions(); + /** + * + * + *
+   * Options for Parquet formatted reports.
+   * 
+ * + * .google.cloud.storageinsights.v1.ParquetOptions parquet_options = 7; + */ + com.google.cloud.storageinsights.v1.ParquetOptionsOrBuilder getParquetOptionsOrBuilder(); + + /** + * + * + *
+   * Report for exporting object metadata.
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ObjectMetadataReportOptions object_metadata_report_options = 8; + * + * + * @return Whether the objectMetadataReportOptions field is set. + */ + boolean hasObjectMetadataReportOptions(); + /** + * + * + *
+   * Report for exporting object metadata.
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ObjectMetadataReportOptions object_metadata_report_options = 8; + * + * + * @return The objectMetadataReportOptions. + */ + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptions getObjectMetadataReportOptions(); + /** + * + * + *
+   * Report for exporting object metadata.
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ObjectMetadataReportOptions object_metadata_report_options = 8; + * + */ + com.google.cloud.storageinsights.v1.ObjectMetadataReportOptionsOrBuilder + getObjectMetadataReportOptionsOrBuilder(); + + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 10; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 10; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 10; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 10; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 10; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * User provided display name which can be empty and limited to 256 characters
+   * that is editable.
+   * 
+ * + * string display_name = 11; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * User provided display name which can be empty and limited to 256 characters
+   * that is editable.
+   * 
+ * + * string display_name = 11; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + public com.google.cloud.storageinsights.v1.ReportConfig.ReportFormatCase getReportFormatCase(); + + public com.google.cloud.storageinsights.v1.ReportConfig.ReportKindCase getReportKindCase(); +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportDetail.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportDetail.java new file mode 100644 index 000000000000..5de975085e97 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportDetail.java @@ -0,0 +1,2911 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Message describing ReportDetail object. ReportDetail represents metadata of
+ * generated reports for a ReportConfig.
+ * Next ID: 10
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ReportDetail} + */ +public final class ReportDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.ReportDetail) + ReportDetailOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReportDetail.newBuilder() to construct. + private ReportDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReportDetail() { + name_ = ""; + reportPathPrefix_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReportDetail(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportDetail_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ReportDetail.class, + com.google.cloud.storageinsights.v1.ReportDetail.Builder.class); + } + + public interface MetricsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.ReportDetail.Metrics) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Count of Cloud Storage objects which are part of the report.
+     * 
+ * + * int64 processed_records_count = 1; + * + * @return The processedRecordsCount. + */ + long getProcessedRecordsCount(); + } + /** + * + * + *
+   * Different metrics associated with the generated report.
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ReportDetail.Metrics} + */ + public static final class Metrics extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.ReportDetail.Metrics) + MetricsOrBuilder { + private static final long serialVersionUID = 0L; + // Use Metrics.newBuilder() to construct. + private Metrics(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Metrics() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Metrics(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportDetail_Metrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportDetail_Metrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ReportDetail.Metrics.class, + com.google.cloud.storageinsights.v1.ReportDetail.Metrics.Builder.class); + } + + public static final int PROCESSED_RECORDS_COUNT_FIELD_NUMBER = 1; + private long processedRecordsCount_ = 0L; + /** + * + * + *
+     * Count of Cloud Storage objects which are part of the report.
+     * 
+ * + * int64 processed_records_count = 1; + * + * @return The processedRecordsCount. + */ + @java.lang.Override + public long getProcessedRecordsCount() { + return processedRecordsCount_; + } + + 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 (processedRecordsCount_ != 0L) { + output.writeInt64(1, processedRecordsCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (processedRecordsCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, processedRecordsCount_); + } + 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.storageinsights.v1.ReportDetail.Metrics)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.ReportDetail.Metrics other = + (com.google.cloud.storageinsights.v1.ReportDetail.Metrics) obj; + + if (getProcessedRecordsCount() != other.getProcessedRecordsCount()) 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) + PROCESSED_RECORDS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getProcessedRecordsCount()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.storageinsights.v1.ReportDetail.Metrics parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail.Metrics 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.storageinsights.v1.ReportDetail.Metrics parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail.Metrics 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.storageinsights.v1.ReportDetail.Metrics parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail.Metrics parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail.Metrics parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail.Metrics parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail.Metrics parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail.Metrics parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail.Metrics parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail.Metrics parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.storageinsights.v1.ReportDetail.Metrics prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Different metrics associated with the generated report.
+     * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ReportDetail.Metrics} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.ReportDetail.Metrics) + com.google.cloud.storageinsights.v1.ReportDetail.MetricsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportDetail_Metrics_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportDetail_Metrics_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ReportDetail.Metrics.class, + com.google.cloud.storageinsights.v1.ReportDetail.Metrics.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.ReportDetail.Metrics.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + processedRecordsCount_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportDetail_Metrics_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportDetail.Metrics getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.ReportDetail.Metrics.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportDetail.Metrics build() { + com.google.cloud.storageinsights.v1.ReportDetail.Metrics result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportDetail.Metrics buildPartial() { + com.google.cloud.storageinsights.v1.ReportDetail.Metrics result = + new com.google.cloud.storageinsights.v1.ReportDetail.Metrics(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.storageinsights.v1.ReportDetail.Metrics result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.processedRecordsCount_ = processedRecordsCount_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.ReportDetail.Metrics) { + return mergeFrom((com.google.cloud.storageinsights.v1.ReportDetail.Metrics) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.ReportDetail.Metrics other) { + if (other == com.google.cloud.storageinsights.v1.ReportDetail.Metrics.getDefaultInstance()) + return this; + if (other.getProcessedRecordsCount() != 0L) { + setProcessedRecordsCount(other.getProcessedRecordsCount()); + } + 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 8: + { + processedRecordsCount_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + 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 long processedRecordsCount_; + /** + * + * + *
+       * Count of Cloud Storage objects which are part of the report.
+       * 
+ * + * int64 processed_records_count = 1; + * + * @return The processedRecordsCount. + */ + @java.lang.Override + public long getProcessedRecordsCount() { + return processedRecordsCount_; + } + /** + * + * + *
+       * Count of Cloud Storage objects which are part of the report.
+       * 
+ * + * int64 processed_records_count = 1; + * + * @param value The processedRecordsCount to set. + * @return This builder for chaining. + */ + public Builder setProcessedRecordsCount(long value) { + + processedRecordsCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Count of Cloud Storage objects which are part of the report.
+       * 
+ * + * int64 processed_records_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearProcessedRecordsCount() { + bitField0_ = (bitField0_ & ~0x00000001); + processedRecordsCount_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.ReportDetail.Metrics) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.ReportDetail.Metrics) + private static final com.google.cloud.storageinsights.v1.ReportDetail.Metrics DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.ReportDetail.Metrics(); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail.Metrics getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Metrics 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.storageinsights.v1.ReportDetail.Metrics getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Name of resource. It will be of form
+   * projects/<project>/locations/<location>/reportConfigs/<report-config-id>/reportDetails/<report-detail-id>.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * Name of resource. It will be of form
+   * projects/<project>/locations/<location>/reportConfigs/<report-config-id>/reportDetails/<report-detail-id>.
+   * 
+ * + * 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 SNAPSHOT_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp snapshotTime_; + /** + * + * + *
+   * The snapshot time.
+   * All the report data is referenced at this point of time.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 2; + * + * @return Whether the snapshotTime field is set. + */ + @java.lang.Override + public boolean hasSnapshotTime() { + return snapshotTime_ != null; + } + /** + * + * + *
+   * The snapshot time.
+   * All the report data is referenced at this point of time.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 2; + * + * @return The snapshotTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSnapshotTime() { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + /** + * + * + *
+   * The snapshot time.
+   * All the report data is referenced at this point of time.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder() { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + + public static final int REPORT_PATH_PREFIX_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object reportPathPrefix_ = ""; + /** + * + * + *
+   * Prefix of the object name of each report's shard. This will have full
+   * prefix except the "extension" and "shard_id".
+   * For example, if the `destination_path` is
+   * "{{report-config-id}}/dt={{datetime}}", the shard object name would be
+   * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_5.csv"
+   * and the value of `report_path_prefix` field would be
+   * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_".
+   * 
+ * + * string report_path_prefix = 8; + * + * @return The reportPathPrefix. + */ + @java.lang.Override + public java.lang.String getReportPathPrefix() { + java.lang.Object ref = reportPathPrefix_; + 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(); + reportPathPrefix_ = s; + return s; + } + } + /** + * + * + *
+   * Prefix of the object name of each report's shard. This will have full
+   * prefix except the "extension" and "shard_id".
+   * For example, if the `destination_path` is
+   * "{{report-config-id}}/dt={{datetime}}", the shard object name would be
+   * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_5.csv"
+   * and the value of `report_path_prefix` field would be
+   * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_".
+   * 
+ * + * string report_path_prefix = 8; + * + * @return The bytes for reportPathPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReportPathPrefixBytes() { + java.lang.Object ref = reportPathPrefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reportPathPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SHARDS_COUNT_FIELD_NUMBER = 9; + private long shardsCount_ = 0L; + /** + * + * + *
+   * Total shards generated for the report.
+   * 
+ * + * int64 shards_count = 9; + * + * @return The shardsCount. + */ + @java.lang.Override + public long getShardsCount() { + return shardsCount_; + } + + public static final int STATUS_FIELD_NUMBER = 4; + private com.google.rpc.Status status_; + /** + * + * + *
+   * Status of the ReportDetail.
+   * 
+ * + * .google.rpc.Status status = 4; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return status_ != null; + } + /** + * + * + *
+   * Status of the ReportDetail.
+   * 
+ * + * .google.rpc.Status status = 4; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + /** + * + * + *
+   * Status of the ReportDetail.
+   * 
+ * + * .google.rpc.Status status = 4; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + public static final int LABELS_FIELD_NUMBER = 5; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportDetail_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int TARGET_DATETIME_FIELD_NUMBER = 6; + private com.google.type.DateTime targetDatetime_; + /** + * + * + *
+   * The date for which report is generated. The time part of target_datetime
+   * will be zero till we support multiple reports per day.
+   * 
+ * + * .google.type.DateTime target_datetime = 6; + * + * @return Whether the targetDatetime field is set. + */ + @java.lang.Override + public boolean hasTargetDatetime() { + return targetDatetime_ != null; + } + /** + * + * + *
+   * The date for which report is generated. The time part of target_datetime
+   * will be zero till we support multiple reports per day.
+   * 
+ * + * .google.type.DateTime target_datetime = 6; + * + * @return The targetDatetime. + */ + @java.lang.Override + public com.google.type.DateTime getTargetDatetime() { + return targetDatetime_ == null + ? com.google.type.DateTime.getDefaultInstance() + : targetDatetime_; + } + /** + * + * + *
+   * The date for which report is generated. The time part of target_datetime
+   * will be zero till we support multiple reports per day.
+   * 
+ * + * .google.type.DateTime target_datetime = 6; + */ + @java.lang.Override + public com.google.type.DateTimeOrBuilder getTargetDatetimeOrBuilder() { + return targetDatetime_ == null + ? com.google.type.DateTime.getDefaultInstance() + : targetDatetime_; + } + + public static final int REPORT_METRICS_FIELD_NUMBER = 7; + private com.google.cloud.storageinsights.v1.ReportDetail.Metrics reportMetrics_; + /** + * + * + *
+   * Metrics of the report.
+   * 
+ * + * .google.cloud.storageinsights.v1.ReportDetail.Metrics report_metrics = 7; + * + * @return Whether the reportMetrics field is set. + */ + @java.lang.Override + public boolean hasReportMetrics() { + return reportMetrics_ != null; + } + /** + * + * + *
+   * Metrics of the report.
+   * 
+ * + * .google.cloud.storageinsights.v1.ReportDetail.Metrics report_metrics = 7; + * + * @return The reportMetrics. + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportDetail.Metrics getReportMetrics() { + return reportMetrics_ == null + ? com.google.cloud.storageinsights.v1.ReportDetail.Metrics.getDefaultInstance() + : reportMetrics_; + } + /** + * + * + *
+   * Metrics of the report.
+   * 
+ * + * .google.cloud.storageinsights.v1.ReportDetail.Metrics report_metrics = 7; + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportDetail.MetricsOrBuilder + getReportMetricsOrBuilder() { + return reportMetrics_ == null + ? com.google.cloud.storageinsights.v1.ReportDetail.Metrics.getDefaultInstance() + : reportMetrics_; + } + + 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.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (snapshotTime_ != null) { + output.writeMessage(2, getSnapshotTime()); + } + if (status_ != null) { + output.writeMessage(4, getStatus()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 5); + if (targetDatetime_ != null) { + output.writeMessage(6, getTargetDatetime()); + } + if (reportMetrics_ != null) { + output.writeMessage(7, getReportMetrics()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(reportPathPrefix_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, reportPathPrefix_); + } + if (shardsCount_ != 0L) { + output.writeInt64(9, shardsCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (snapshotTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSnapshotTime()); + } + if (status_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStatus()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, labels__); + } + if (targetDatetime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getTargetDatetime()); + } + if (reportMetrics_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getReportMetrics()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(reportPathPrefix_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, reportPathPrefix_); + } + if (shardsCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(9, shardsCount_); + } + 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.storageinsights.v1.ReportDetail)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.ReportDetail other = + (com.google.cloud.storageinsights.v1.ReportDetail) obj; + + if (!getName().equals(other.getName())) return false; + if (hasSnapshotTime() != other.hasSnapshotTime()) return false; + if (hasSnapshotTime()) { + if (!getSnapshotTime().equals(other.getSnapshotTime())) return false; + } + if (!getReportPathPrefix().equals(other.getReportPathPrefix())) return false; + if (getShardsCount() != other.getShardsCount()) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasTargetDatetime() != other.hasTargetDatetime()) return false; + if (hasTargetDatetime()) { + if (!getTargetDatetime().equals(other.getTargetDatetime())) return false; + } + if (hasReportMetrics() != other.hasReportMetrics()) return false; + if (hasReportMetrics()) { + if (!getReportMetrics().equals(other.getReportMetrics())) 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(); + if (hasSnapshotTime()) { + hash = (37 * hash) + SNAPSHOT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSnapshotTime().hashCode(); + } + hash = (37 * hash) + REPORT_PATH_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getReportPathPrefix().hashCode(); + hash = (37 * hash) + SHARDS_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getShardsCount()); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasTargetDatetime()) { + hash = (37 * hash) + TARGET_DATETIME_FIELD_NUMBER; + hash = (53 * hash) + getTargetDatetime().hashCode(); + } + if (hasReportMetrics()) { + hash = (37 * hash) + REPORT_METRICS_FIELD_NUMBER; + hash = (53 * hash) + getReportMetrics().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.storageinsights.v1.ReportDetail parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail 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.storageinsights.v1.ReportDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail 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.storageinsights.v1.ReportDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.storageinsights.v1.ReportDetail prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message describing ReportDetail object. ReportDetail represents metadata of
+   * generated reports for a ReportConfig.
+   * Next ID: 10
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.ReportDetail} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.ReportDetail) + com.google.cloud.storageinsights.v1.ReportDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportDetail_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 5: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.ReportDetail.class, + com.google.cloud.storageinsights.v1.ReportDetail.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.ReportDetail.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + snapshotTime_ = null; + if (snapshotTimeBuilder_ != null) { + snapshotTimeBuilder_.dispose(); + snapshotTimeBuilder_ = null; + } + reportPathPrefix_ = ""; + shardsCount_ = 0L; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + internalGetMutableLabels().clear(); + targetDatetime_ = null; + if (targetDatetimeBuilder_ != null) { + targetDatetimeBuilder_.dispose(); + targetDatetimeBuilder_ = null; + } + reportMetrics_ = null; + if (reportMetricsBuilder_ != null) { + reportMetricsBuilder_.dispose(); + reportMetricsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_ReportDetail_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportDetail getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.ReportDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportDetail build() { + com.google.cloud.storageinsights.v1.ReportDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportDetail buildPartial() { + com.google.cloud.storageinsights.v1.ReportDetail result = + new com.google.cloud.storageinsights.v1.ReportDetail(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.storageinsights.v1.ReportDetail result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.snapshotTime_ = + snapshotTimeBuilder_ == null ? snapshotTime_ : snapshotTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.reportPathPrefix_ = reportPathPrefix_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.shardsCount_ = shardsCount_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.targetDatetime_ = + targetDatetimeBuilder_ == null ? targetDatetime_ : targetDatetimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.reportMetrics_ = + reportMetricsBuilder_ == null ? reportMetrics_ : reportMetricsBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.ReportDetail) { + return mergeFrom((com.google.cloud.storageinsights.v1.ReportDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.ReportDetail other) { + if (other == com.google.cloud.storageinsights.v1.ReportDetail.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSnapshotTime()) { + mergeSnapshotTime(other.getSnapshotTime()); + } + if (!other.getReportPathPrefix().isEmpty()) { + reportPathPrefix_ = other.reportPathPrefix_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getShardsCount() != 0L) { + setShardsCount(other.getShardsCount()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000020; + if (other.hasTargetDatetime()) { + mergeTargetDatetime(other.getTargetDatetime()); + } + if (other.hasReportMetrics()) { + mergeReportMetrics(other.getReportMetrics()); + } + 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: + { + input.readMessage(getSnapshotTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + input.readMessage(getStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 50: + { + input.readMessage(getTargetDatetimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 58: + { + input.readMessage(getReportMetricsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + reportPathPrefix_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 66 + case 72: + { + shardsCount_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 72 + 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_ = ""; + /** + * + * + *
+     * Name of resource. It will be of form
+     * projects/<project>/locations/<location>/reportConfigs/<report-config-id>/reportDetails/<report-detail-id>.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Name of resource. It will be of form
+     * projects/<project>/locations/<location>/reportConfigs/<report-config-id>/reportDetails/<report-detail-id>.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Name of resource. It will be of form
+     * projects/<project>/locations/<location>/reportConfigs/<report-config-id>/reportDetails/<report-detail-id>.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Name of resource. It will be of form
+     * projects/<project>/locations/<location>/reportConfigs/<report-config-id>/reportDetails/<report-detail-id>.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of resource. It will be of form
+     * projects/<project>/locations/<location>/reportConfigs/<report-config-id>/reportDetails/<report-detail-id>.
+     * 
+ * + * 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 com.google.protobuf.Timestamp snapshotTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + snapshotTimeBuilder_; + /** + * + * + *
+     * The snapshot time.
+     * All the report data is referenced at this point of time.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 2; + * + * @return Whether the snapshotTime field is set. + */ + public boolean hasSnapshotTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The snapshot time.
+     * All the report data is referenced at this point of time.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 2; + * + * @return The snapshotTime. + */ + public com.google.protobuf.Timestamp getSnapshotTime() { + if (snapshotTimeBuilder_ == null) { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } else { + return snapshotTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The snapshot time.
+     * All the report data is referenced at this point of time.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 2; + */ + public Builder setSnapshotTime(com.google.protobuf.Timestamp value) { + if (snapshotTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + snapshotTime_ = value; + } else { + snapshotTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The snapshot time.
+     * All the report data is referenced at this point of time.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 2; + */ + public Builder setSnapshotTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (snapshotTimeBuilder_ == null) { + snapshotTime_ = builderForValue.build(); + } else { + snapshotTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The snapshot time.
+     * All the report data is referenced at this point of time.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 2; + */ + public Builder mergeSnapshotTime(com.google.protobuf.Timestamp value) { + if (snapshotTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && snapshotTime_ != null + && snapshotTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getSnapshotTimeBuilder().mergeFrom(value); + } else { + snapshotTime_ = value; + } + } else { + snapshotTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The snapshot time.
+     * All the report data is referenced at this point of time.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 2; + */ + public Builder clearSnapshotTime() { + bitField0_ = (bitField0_ & ~0x00000002); + snapshotTime_ = null; + if (snapshotTimeBuilder_ != null) { + snapshotTimeBuilder_.dispose(); + snapshotTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The snapshot time.
+     * All the report data is referenced at this point of time.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getSnapshotTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSnapshotTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The snapshot time.
+     * All the report data is referenced at this point of time.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder() { + if (snapshotTimeBuilder_ != null) { + return snapshotTimeBuilder_.getMessageOrBuilder(); + } else { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + } + /** + * + * + *
+     * The snapshot time.
+     * All the report data is referenced at this point of time.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getSnapshotTimeFieldBuilder() { + if (snapshotTimeBuilder_ == null) { + snapshotTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSnapshotTime(), getParentForChildren(), isClean()); + snapshotTime_ = null; + } + return snapshotTimeBuilder_; + } + + private java.lang.Object reportPathPrefix_ = ""; + /** + * + * + *
+     * Prefix of the object name of each report's shard. This will have full
+     * prefix except the "extension" and "shard_id".
+     * For example, if the `destination_path` is
+     * "{{report-config-id}}/dt={{datetime}}", the shard object name would be
+     * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_5.csv"
+     * and the value of `report_path_prefix` field would be
+     * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_".
+     * 
+ * + * string report_path_prefix = 8; + * + * @return The reportPathPrefix. + */ + public java.lang.String getReportPathPrefix() { + java.lang.Object ref = reportPathPrefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reportPathPrefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Prefix of the object name of each report's shard. This will have full
+     * prefix except the "extension" and "shard_id".
+     * For example, if the `destination_path` is
+     * "{{report-config-id}}/dt={{datetime}}", the shard object name would be
+     * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_5.csv"
+     * and the value of `report_path_prefix` field would be
+     * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_".
+     * 
+ * + * string report_path_prefix = 8; + * + * @return The bytes for reportPathPrefix. + */ + public com.google.protobuf.ByteString getReportPathPrefixBytes() { + java.lang.Object ref = reportPathPrefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reportPathPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Prefix of the object name of each report's shard. This will have full
+     * prefix except the "extension" and "shard_id".
+     * For example, if the `destination_path` is
+     * "{{report-config-id}}/dt={{datetime}}", the shard object name would be
+     * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_5.csv"
+     * and the value of `report_path_prefix` field would be
+     * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_".
+     * 
+ * + * string report_path_prefix = 8; + * + * @param value The reportPathPrefix to set. + * @return This builder for chaining. + */ + public Builder setReportPathPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + reportPathPrefix_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Prefix of the object name of each report's shard. This will have full
+     * prefix except the "extension" and "shard_id".
+     * For example, if the `destination_path` is
+     * "{{report-config-id}}/dt={{datetime}}", the shard object name would be
+     * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_5.csv"
+     * and the value of `report_path_prefix` field would be
+     * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_".
+     * 
+ * + * string report_path_prefix = 8; + * + * @return This builder for chaining. + */ + public Builder clearReportPathPrefix() { + reportPathPrefix_ = getDefaultInstance().getReportPathPrefix(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Prefix of the object name of each report's shard. This will have full
+     * prefix except the "extension" and "shard_id".
+     * For example, if the `destination_path` is
+     * "{{report-config-id}}/dt={{datetime}}", the shard object name would be
+     * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_5.csv"
+     * and the value of `report_path_prefix` field would be
+     * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_".
+     * 
+ * + * string report_path_prefix = 8; + * + * @param value The bytes for reportPathPrefix to set. + * @return This builder for chaining. + */ + public Builder setReportPathPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + reportPathPrefix_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private long shardsCount_; + /** + * + * + *
+     * Total shards generated for the report.
+     * 
+ * + * int64 shards_count = 9; + * + * @return The shardsCount. + */ + @java.lang.Override + public long getShardsCount() { + return shardsCount_; + } + /** + * + * + *
+     * Total shards generated for the report.
+     * 
+ * + * int64 shards_count = 9; + * + * @param value The shardsCount to set. + * @return This builder for chaining. + */ + public Builder setShardsCount(long value) { + + shardsCount_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Total shards generated for the report.
+     * 
+ * + * int64 shards_count = 9; + * + * @return This builder for chaining. + */ + public Builder clearShardsCount() { + bitField0_ = (bitField0_ & ~0x00000008); + shardsCount_ = 0L; + onChanged(); + return this; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + /** + * + * + *
+     * Status of the ReportDetail.
+     * 
+ * + * .google.rpc.Status status = 4; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Status of the ReportDetail.
+     * 
+ * + * .google.rpc.Status status = 4; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Status of the ReportDetail.
+     * 
+ * + * .google.rpc.Status status = 4; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Status of the ReportDetail.
+     * 
+ * + * .google.rpc.Status status = 4; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Status of the ReportDetail.
+     * 
+ * + * .google.rpc.Status status = 4; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Status of the ReportDetail.
+     * 
+ * + * .google.rpc.Status status = 4; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000010); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Status of the ReportDetail.
+     * 
+ * + * .google.rpc.Status status = 4; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Status of the ReportDetail.
+     * 
+ * + * .google.rpc.Status status = 4; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + /** + * + * + *
+     * Status of the ReportDetail.
+     * 
+ * + * .google.rpc.Status status = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 5; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 5; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000020; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 5; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000020; + return this; + } + /** + * + * + *
+     * Labels as key value pairs
+     * 
+ * + * map<string, string> labels = 5; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000020; + return this; + } + + private com.google.type.DateTime targetDatetime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.DateTime, + com.google.type.DateTime.Builder, + com.google.type.DateTimeOrBuilder> + targetDatetimeBuilder_; + /** + * + * + *
+     * The date for which report is generated. The time part of target_datetime
+     * will be zero till we support multiple reports per day.
+     * 
+ * + * .google.type.DateTime target_datetime = 6; + * + * @return Whether the targetDatetime field is set. + */ + public boolean hasTargetDatetime() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * The date for which report is generated. The time part of target_datetime
+     * will be zero till we support multiple reports per day.
+     * 
+ * + * .google.type.DateTime target_datetime = 6; + * + * @return The targetDatetime. + */ + public com.google.type.DateTime getTargetDatetime() { + if (targetDatetimeBuilder_ == null) { + return targetDatetime_ == null + ? com.google.type.DateTime.getDefaultInstance() + : targetDatetime_; + } else { + return targetDatetimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The date for which report is generated. The time part of target_datetime
+     * will be zero till we support multiple reports per day.
+     * 
+ * + * .google.type.DateTime target_datetime = 6; + */ + public Builder setTargetDatetime(com.google.type.DateTime value) { + if (targetDatetimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + targetDatetime_ = value; + } else { + targetDatetimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The date for which report is generated. The time part of target_datetime
+     * will be zero till we support multiple reports per day.
+     * 
+ * + * .google.type.DateTime target_datetime = 6; + */ + public Builder setTargetDatetime(com.google.type.DateTime.Builder builderForValue) { + if (targetDatetimeBuilder_ == null) { + targetDatetime_ = builderForValue.build(); + } else { + targetDatetimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The date for which report is generated. The time part of target_datetime
+     * will be zero till we support multiple reports per day.
+     * 
+ * + * .google.type.DateTime target_datetime = 6; + */ + public Builder mergeTargetDatetime(com.google.type.DateTime value) { + if (targetDatetimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && targetDatetime_ != null + && targetDatetime_ != com.google.type.DateTime.getDefaultInstance()) { + getTargetDatetimeBuilder().mergeFrom(value); + } else { + targetDatetime_ = value; + } + } else { + targetDatetimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The date for which report is generated. The time part of target_datetime
+     * will be zero till we support multiple reports per day.
+     * 
+ * + * .google.type.DateTime target_datetime = 6; + */ + public Builder clearTargetDatetime() { + bitField0_ = (bitField0_ & ~0x00000040); + targetDatetime_ = null; + if (targetDatetimeBuilder_ != null) { + targetDatetimeBuilder_.dispose(); + targetDatetimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The date for which report is generated. The time part of target_datetime
+     * will be zero till we support multiple reports per day.
+     * 
+ * + * .google.type.DateTime target_datetime = 6; + */ + public com.google.type.DateTime.Builder getTargetDatetimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getTargetDatetimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The date for which report is generated. The time part of target_datetime
+     * will be zero till we support multiple reports per day.
+     * 
+ * + * .google.type.DateTime target_datetime = 6; + */ + public com.google.type.DateTimeOrBuilder getTargetDatetimeOrBuilder() { + if (targetDatetimeBuilder_ != null) { + return targetDatetimeBuilder_.getMessageOrBuilder(); + } else { + return targetDatetime_ == null + ? com.google.type.DateTime.getDefaultInstance() + : targetDatetime_; + } + } + /** + * + * + *
+     * The date for which report is generated. The time part of target_datetime
+     * will be zero till we support multiple reports per day.
+     * 
+ * + * .google.type.DateTime target_datetime = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.DateTime, + com.google.type.DateTime.Builder, + com.google.type.DateTimeOrBuilder> + getTargetDatetimeFieldBuilder() { + if (targetDatetimeBuilder_ == null) { + targetDatetimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.DateTime, + com.google.type.DateTime.Builder, + com.google.type.DateTimeOrBuilder>( + getTargetDatetime(), getParentForChildren(), isClean()); + targetDatetime_ = null; + } + return targetDatetimeBuilder_; + } + + private com.google.cloud.storageinsights.v1.ReportDetail.Metrics reportMetrics_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.ReportDetail.Metrics, + com.google.cloud.storageinsights.v1.ReportDetail.Metrics.Builder, + com.google.cloud.storageinsights.v1.ReportDetail.MetricsOrBuilder> + reportMetricsBuilder_; + /** + * + * + *
+     * Metrics of the report.
+     * 
+ * + * .google.cloud.storageinsights.v1.ReportDetail.Metrics report_metrics = 7; + * + * @return Whether the reportMetrics field is set. + */ + public boolean hasReportMetrics() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Metrics of the report.
+     * 
+ * + * .google.cloud.storageinsights.v1.ReportDetail.Metrics report_metrics = 7; + * + * @return The reportMetrics. + */ + public com.google.cloud.storageinsights.v1.ReportDetail.Metrics getReportMetrics() { + if (reportMetricsBuilder_ == null) { + return reportMetrics_ == null + ? com.google.cloud.storageinsights.v1.ReportDetail.Metrics.getDefaultInstance() + : reportMetrics_; + } else { + return reportMetricsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Metrics of the report.
+     * 
+ * + * .google.cloud.storageinsights.v1.ReportDetail.Metrics report_metrics = 7; + */ + public Builder setReportMetrics( + com.google.cloud.storageinsights.v1.ReportDetail.Metrics value) { + if (reportMetricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + reportMetrics_ = value; + } else { + reportMetricsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Metrics of the report.
+     * 
+ * + * .google.cloud.storageinsights.v1.ReportDetail.Metrics report_metrics = 7; + */ + public Builder setReportMetrics( + com.google.cloud.storageinsights.v1.ReportDetail.Metrics.Builder builderForValue) { + if (reportMetricsBuilder_ == null) { + reportMetrics_ = builderForValue.build(); + } else { + reportMetricsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Metrics of the report.
+     * 
+ * + * .google.cloud.storageinsights.v1.ReportDetail.Metrics report_metrics = 7; + */ + public Builder mergeReportMetrics( + com.google.cloud.storageinsights.v1.ReportDetail.Metrics value) { + if (reportMetricsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && reportMetrics_ != null + && reportMetrics_ + != com.google.cloud.storageinsights.v1.ReportDetail.Metrics.getDefaultInstance()) { + getReportMetricsBuilder().mergeFrom(value); + } else { + reportMetrics_ = value; + } + } else { + reportMetricsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Metrics of the report.
+     * 
+ * + * .google.cloud.storageinsights.v1.ReportDetail.Metrics report_metrics = 7; + */ + public Builder clearReportMetrics() { + bitField0_ = (bitField0_ & ~0x00000080); + reportMetrics_ = null; + if (reportMetricsBuilder_ != null) { + reportMetricsBuilder_.dispose(); + reportMetricsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Metrics of the report.
+     * 
+ * + * .google.cloud.storageinsights.v1.ReportDetail.Metrics report_metrics = 7; + */ + public com.google.cloud.storageinsights.v1.ReportDetail.Metrics.Builder + getReportMetricsBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getReportMetricsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metrics of the report.
+     * 
+ * + * .google.cloud.storageinsights.v1.ReportDetail.Metrics report_metrics = 7; + */ + public com.google.cloud.storageinsights.v1.ReportDetail.MetricsOrBuilder + getReportMetricsOrBuilder() { + if (reportMetricsBuilder_ != null) { + return reportMetricsBuilder_.getMessageOrBuilder(); + } else { + return reportMetrics_ == null + ? com.google.cloud.storageinsights.v1.ReportDetail.Metrics.getDefaultInstance() + : reportMetrics_; + } + } + /** + * + * + *
+     * Metrics of the report.
+     * 
+ * + * .google.cloud.storageinsights.v1.ReportDetail.Metrics report_metrics = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.ReportDetail.Metrics, + com.google.cloud.storageinsights.v1.ReportDetail.Metrics.Builder, + com.google.cloud.storageinsights.v1.ReportDetail.MetricsOrBuilder> + getReportMetricsFieldBuilder() { + if (reportMetricsBuilder_ == null) { + reportMetricsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.ReportDetail.Metrics, + com.google.cloud.storageinsights.v1.ReportDetail.Metrics.Builder, + com.google.cloud.storageinsights.v1.ReportDetail.MetricsOrBuilder>( + getReportMetrics(), getParentForChildren(), isClean()); + reportMetrics_ = null; + } + return reportMetricsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.ReportDetail) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.ReportDetail) + private static final com.google.cloud.storageinsights.v1.ReportDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.ReportDetail(); + } + + public static com.google.cloud.storageinsights.v1.ReportDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReportDetail 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.storageinsights.v1.ReportDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportDetailName.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportDetailName.java new file mode 100644 index 000000000000..d6f87026c8f0 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportDetailName.java @@ -0,0 +1,269 @@ +/* + * Copyright 2022 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.storageinsights.v1; + +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 ReportDetailName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_REPORT_CONFIG_REPORT_DETAIL = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/reportConfigs/{report_config}/reportDetails/{report_detail}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String reportConfig; + private final String reportDetail; + + @Deprecated + protected ReportDetailName() { + project = null; + location = null; + reportConfig = null; + reportDetail = null; + } + + private ReportDetailName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + reportConfig = Preconditions.checkNotNull(builder.getReportConfig()); + reportDetail = Preconditions.checkNotNull(builder.getReportDetail()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getReportConfig() { + return reportConfig; + } + + public String getReportDetail() { + return reportDetail; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ReportDetailName of( + String project, String location, String reportConfig, String reportDetail) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setReportConfig(reportConfig) + .setReportDetail(reportDetail) + .build(); + } + + public static String format( + String project, String location, String reportConfig, String reportDetail) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setReportConfig(reportConfig) + .setReportDetail(reportDetail) + .build() + .toString(); + } + + public static ReportDetailName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_REPORT_CONFIG_REPORT_DETAIL.validatedMatch( + formattedString, "ReportDetailName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("report_config"), + matchMap.get("report_detail")); + } + + 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 (ReportDetailName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_REPORT_CONFIG_REPORT_DETAIL.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 (reportConfig != null) { + fieldMapBuilder.put("report_config", reportConfig); + } + if (reportDetail != null) { + fieldMapBuilder.put("report_detail", reportDetail); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_REPORT_CONFIG_REPORT_DETAIL.instantiate( + "project", + project, + "location", + location, + "report_config", + reportConfig, + "report_detail", + reportDetail); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ReportDetailName that = ((ReportDetailName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.reportConfig, that.reportConfig) + && Objects.equals(this.reportDetail, that.reportDetail); + } + 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(reportConfig); + h *= 1000003; + h ^= Objects.hashCode(reportDetail); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/reportConfigs/{report_config}/reportDetails/{report_detail}. + */ + public static class Builder { + private String project; + private String location; + private String reportConfig; + private String reportDetail; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getReportConfig() { + return reportConfig; + } + + public String getReportDetail() { + return reportDetail; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setReportConfig(String reportConfig) { + this.reportConfig = reportConfig; + return this; + } + + public Builder setReportDetail(String reportDetail) { + this.reportDetail = reportDetail; + return this; + } + + private Builder(ReportDetailName reportDetailName) { + this.project = reportDetailName.project; + this.location = reportDetailName.location; + this.reportConfig = reportDetailName.reportConfig; + this.reportDetail = reportDetailName.reportDetail; + } + + public ReportDetailName build() { + return new ReportDetailName(this); + } + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportDetailOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportDetailOrBuilder.java new file mode 100644 index 000000000000..e390b52c18ec --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/ReportDetailOrBuilder.java @@ -0,0 +1,306 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface ReportDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.ReportDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of resource. It will be of form
+   * projects/<project>/locations/<location>/reportConfigs/<report-config-id>/reportDetails/<report-detail-id>.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of resource. It will be of form
+   * projects/<project>/locations/<location>/reportConfigs/<report-config-id>/reportDetails/<report-detail-id>.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The snapshot time.
+   * All the report data is referenced at this point of time.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 2; + * + * @return Whether the snapshotTime field is set. + */ + boolean hasSnapshotTime(); + /** + * + * + *
+   * The snapshot time.
+   * All the report data is referenced at this point of time.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 2; + * + * @return The snapshotTime. + */ + com.google.protobuf.Timestamp getSnapshotTime(); + /** + * + * + *
+   * The snapshot time.
+   * All the report data is referenced at this point of time.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder(); + + /** + * + * + *
+   * Prefix of the object name of each report's shard. This will have full
+   * prefix except the "extension" and "shard_id".
+   * For example, if the `destination_path` is
+   * "{{report-config-id}}/dt={{datetime}}", the shard object name would be
+   * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_5.csv"
+   * and the value of `report_path_prefix` field would be
+   * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_".
+   * 
+ * + * string report_path_prefix = 8; + * + * @return The reportPathPrefix. + */ + java.lang.String getReportPathPrefix(); + /** + * + * + *
+   * Prefix of the object name of each report's shard. This will have full
+   * prefix except the "extension" and "shard_id".
+   * For example, if the `destination_path` is
+   * "{{report-config-id}}/dt={{datetime}}", the shard object name would be
+   * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_5.csv"
+   * and the value of `report_path_prefix` field would be
+   * "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_".
+   * 
+ * + * string report_path_prefix = 8; + * + * @return The bytes for reportPathPrefix. + */ + com.google.protobuf.ByteString getReportPathPrefixBytes(); + + /** + * + * + *
+   * Total shards generated for the report.
+   * 
+ * + * int64 shards_count = 9; + * + * @return The shardsCount. + */ + long getShardsCount(); + + /** + * + * + *
+   * Status of the ReportDetail.
+   * 
+ * + * .google.rpc.Status status = 4; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + /** + * + * + *
+   * Status of the ReportDetail.
+   * 
+ * + * .google.rpc.Status status = 4; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + /** + * + * + *
+   * Status of the ReportDetail.
+   * 
+ * + * .google.rpc.Status status = 4; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 5; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 5; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 5; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 5; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels as key value pairs
+   * 
+ * + * map<string, string> labels = 5; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * The date for which report is generated. The time part of target_datetime
+   * will be zero till we support multiple reports per day.
+   * 
+ * + * .google.type.DateTime target_datetime = 6; + * + * @return Whether the targetDatetime field is set. + */ + boolean hasTargetDatetime(); + /** + * + * + *
+   * The date for which report is generated. The time part of target_datetime
+   * will be zero till we support multiple reports per day.
+   * 
+ * + * .google.type.DateTime target_datetime = 6; + * + * @return The targetDatetime. + */ + com.google.type.DateTime getTargetDatetime(); + /** + * + * + *
+   * The date for which report is generated. The time part of target_datetime
+   * will be zero till we support multiple reports per day.
+   * 
+ * + * .google.type.DateTime target_datetime = 6; + */ + com.google.type.DateTimeOrBuilder getTargetDatetimeOrBuilder(); + + /** + * + * + *
+   * Metrics of the report.
+   * 
+ * + * .google.cloud.storageinsights.v1.ReportDetail.Metrics report_metrics = 7; + * + * @return Whether the reportMetrics field is set. + */ + boolean hasReportMetrics(); + /** + * + * + *
+   * Metrics of the report.
+   * 
+ * + * .google.cloud.storageinsights.v1.ReportDetail.Metrics report_metrics = 7; + * + * @return The reportMetrics. + */ + com.google.cloud.storageinsights.v1.ReportDetail.Metrics getReportMetrics(); + /** + * + * + *
+   * Metrics of the report.
+   * 
+ * + * .google.cloud.storageinsights.v1.ReportDetail.Metrics report_metrics = 7; + */ + com.google.cloud.storageinsights.v1.ReportDetail.MetricsOrBuilder getReportMetricsOrBuilder(); +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/UpdateReportConfigRequest.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/UpdateReportConfigRequest.java new file mode 100644 index 000000000000..ca663b37b4a0 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/UpdateReportConfigRequest.java @@ -0,0 +1,1315 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +/** + * + * + *
+ * Message for updating a ReportConfig
+ * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.UpdateReportConfigRequest} + */ +public final class UpdateReportConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.storageinsights.v1.UpdateReportConfigRequest) + UpdateReportConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateReportConfigRequest.newBuilder() to construct. + private UpdateReportConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateReportConfigRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateReportConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_UpdateReportConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_UpdateReportConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest.class, + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * ReportConfig resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * ReportConfig resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * ReportConfig resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int REPORT_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.storageinsights.v1.ReportConfig reportConfig_; + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the reportConfig field is set. + */ + @java.lang.Override + public boolean hasReportConfig() { + return reportConfig_ != null; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The reportConfig. + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportConfig getReportConfig() { + return reportConfig_ == null + ? com.google.cloud.storageinsights.v1.ReportConfig.getDefaultInstance() + : reportConfig_; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.storageinsights.v1.ReportConfigOrBuilder getReportConfigOrBuilder() { + return reportConfig_ == null + ? com.google.cloud.storageinsights.v1.ReportConfig.getDefaultInstance() + : reportConfig_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = 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 (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (reportConfig_ != null) { + output.writeMessage(2, getReportConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (reportConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getReportConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + 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.storageinsights.v1.UpdateReportConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest other = + (com.google.cloud.storageinsights.v1.UpdateReportConfigRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasReportConfig() != other.hasReportConfig()) return false; + if (hasReportConfig()) { + if (!getReportConfig().equals(other.getReportConfig())) return false; + } + if (!getRequestId().equals(other.getRequestId())) 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 (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasReportConfig()) { + hash = (37 * hash) + REPORT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getReportConfig().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.storageinsights.v1.UpdateReportConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.UpdateReportConfigRequest 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.storageinsights.v1.UpdateReportConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.UpdateReportConfigRequest 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.storageinsights.v1.UpdateReportConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.storageinsights.v1.UpdateReportConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.UpdateReportConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.UpdateReportConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.UpdateReportConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.UpdateReportConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.storageinsights.v1.UpdateReportConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.storageinsights.v1.UpdateReportConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for updating a ReportConfig
+   * 
+ * + * Protobuf type {@code google.cloud.storageinsights.v1.UpdateReportConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.storageinsights.v1.UpdateReportConfigRequest) + com.google.cloud.storageinsights.v1.UpdateReportConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_UpdateReportConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_UpdateReportConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest.class, + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.storageinsights.v1.UpdateReportConfigRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + reportConfig_ = null; + if (reportConfigBuilder_ != null) { + reportConfigBuilder_.dispose(); + reportConfigBuilder_ = null; + } + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.storageinsights.v1.V1Proto + .internal_static_google_cloud_storageinsights_v1_UpdateReportConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.UpdateReportConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.storageinsights.v1.UpdateReportConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.UpdateReportConfigRequest build() { + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.storageinsights.v1.UpdateReportConfigRequest buildPartial() { + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest result = + new com.google.cloud.storageinsights.v1.UpdateReportConfigRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.storageinsights.v1.UpdateReportConfigRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.reportConfig_ = + reportConfigBuilder_ == null ? reportConfig_ : reportConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.storageinsights.v1.UpdateReportConfigRequest) { + return mergeFrom((com.google.cloud.storageinsights.v1.UpdateReportConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.storageinsights.v1.UpdateReportConfigRequest other) { + if (other + == com.google.cloud.storageinsights.v1.UpdateReportConfigRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasReportConfig()) { + mergeReportConfig(other.getReportConfig()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + 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: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getReportConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = 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 com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * ReportConfig resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * ReportConfig resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * ReportConfig resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * ReportConfig resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * ReportConfig resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * ReportConfig resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * ReportConfig resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * ReportConfig resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * ReportConfig resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.storageinsights.v1.ReportConfig reportConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.ReportConfig, + com.google.cloud.storageinsights.v1.ReportConfig.Builder, + com.google.cloud.storageinsights.v1.ReportConfigOrBuilder> + reportConfigBuilder_; + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the reportConfig field is set. + */ + public boolean hasReportConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The reportConfig. + */ + public com.google.cloud.storageinsights.v1.ReportConfig getReportConfig() { + if (reportConfigBuilder_ == null) { + return reportConfig_ == null + ? com.google.cloud.storageinsights.v1.ReportConfig.getDefaultInstance() + : reportConfig_; + } else { + return reportConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setReportConfig(com.google.cloud.storageinsights.v1.ReportConfig value) { + if (reportConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + reportConfig_ = value; + } else { + reportConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setReportConfig( + com.google.cloud.storageinsights.v1.ReportConfig.Builder builderForValue) { + if (reportConfigBuilder_ == null) { + reportConfig_ = builderForValue.build(); + } else { + reportConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeReportConfig(com.google.cloud.storageinsights.v1.ReportConfig value) { + if (reportConfigBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && reportConfig_ != null + && reportConfig_ + != com.google.cloud.storageinsights.v1.ReportConfig.getDefaultInstance()) { + getReportConfigBuilder().mergeFrom(value); + } else { + reportConfig_ = value; + } + } else { + reportConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearReportConfig() { + bitField0_ = (bitField0_ & ~0x00000002); + reportConfig_ = null; + if (reportConfigBuilder_ != null) { + reportConfigBuilder_.dispose(); + reportConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.storageinsights.v1.ReportConfig.Builder getReportConfigBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getReportConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.storageinsights.v1.ReportConfigOrBuilder getReportConfigOrBuilder() { + if (reportConfigBuilder_ != null) { + return reportConfigBuilder_.getMessageOrBuilder(); + } else { + return reportConfig_ == null + ? com.google.cloud.storageinsights.v1.ReportConfig.getDefaultInstance() + : reportConfig_; + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.ReportConfig, + com.google.cloud.storageinsights.v1.ReportConfig.Builder, + com.google.cloud.storageinsights.v1.ReportConfigOrBuilder> + getReportConfigFieldBuilder() { + if (reportConfigBuilder_ == null) { + reportConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.storageinsights.v1.ReportConfig, + com.google.cloud.storageinsights.v1.ReportConfig.Builder, + com.google.cloud.storageinsights.v1.ReportConfigOrBuilder>( + getReportConfig(), getParentForChildren(), isClean()); + reportConfig_ = null; + } + return reportConfigBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.storageinsights.v1.UpdateReportConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.storageinsights.v1.UpdateReportConfigRequest) + private static final com.google.cloud.storageinsights.v1.UpdateReportConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.storageinsights.v1.UpdateReportConfigRequest(); + } + + public static com.google.cloud.storageinsights.v1.UpdateReportConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateReportConfigRequest 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.storageinsights.v1.UpdateReportConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/UpdateReportConfigRequestOrBuilder.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/UpdateReportConfigRequestOrBuilder.java new file mode 100644 index 000000000000..c59ed51e7455 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/UpdateReportConfigRequestOrBuilder.java @@ -0,0 +1,161 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public interface UpdateReportConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.storageinsights.v1.UpdateReportConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * ReportConfig resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * ReportConfig resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * ReportConfig resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the reportConfig field is set. + */ + boolean hasReportConfig(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The reportConfig. + */ + com.google.cloud.storageinsights.v1.ReportConfig getReportConfig(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.cloud.storageinsights.v1.ReportConfig report_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.storageinsights.v1.ReportConfigOrBuilder getReportConfigOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/V1Proto.java b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/V1Proto.java new file mode 100644 index 000000000000..a28dd7e43ba3 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/java/com/google/cloud/storageinsights/v1/V1Proto.java @@ -0,0 +1,510 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/storageinsights/v1/storageinsights.proto + +package com.google.cloud.storageinsights.v1; + +public final class V1Proto { + private V1Proto() {} + + 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_storageinsights_v1_ListReportConfigsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_ListReportConfigsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_ListReportConfigsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_ListReportConfigsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_GetReportConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_GetReportConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_CreateReportConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_CreateReportConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_UpdateReportConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_UpdateReportConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_DeleteReportConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_DeleteReportConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_ReportDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_ReportDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_ReportDetail_Metrics_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_ReportDetail_Metrics_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_ReportDetail_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_ReportDetail_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_ListReportDetailsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_ListReportDetailsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_ListReportDetailsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_ListReportDetailsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_GetReportDetailRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_GetReportDetailRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_FrequencyOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_FrequencyOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_CSVOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_CSVOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_ParquetOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_ParquetOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_CloudStorageFilters_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_CloudStorageFilters_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_CloudStorageDestinationOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_CloudStorageDestinationOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_ObjectMetadataReportOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_ObjectMetadataReportOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_ReportConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_ReportConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_storageinsights_v1_ReportConfig_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_storageinsights_v1_ReportConfig_LabelsEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n5google/cloud/storageinsights/v1/storag" + + "einsights.proto\022\037google.cloud.storageins" + + "ights.v1\032\034google/api/annotations.proto\032\027" + + "google/api/client.proto\032\037google/api/fiel" + + "d_behavior.proto\032\031google/api/resource.pr" + + "oto\032\033google/protobuf/empty.proto\032 google" + + "/protobuf/field_mask.proto\032\037google/proto" + + "buf/timestamp.proto\032\027google/rpc/status.p" + + "roto\032\026google/type/date.proto\032\032google/typ" + + "e/datetime.proto\"\250\001\n\030ListReportConfigsRe" + + "quest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\022+storagein" + + "sights.googleapis.com/ReportConfig\022\021\n\tpa" + + "ge_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006fil" + + "ter\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"\220\001\n\031ListRepo" + + "rtConfigsResponse\022E\n\016report_configs\030\001 \003(" + + "\0132-.google.cloud.storageinsights.v1.Repo" + + "rtConfig\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unr" + + "eachable\030\003 \003(\t\"[\n\026GetReportConfigRequest" + + "\022A\n\004name\030\001 \001(\tB3\340A\002\372A-\n+storageinsights." + + "googleapis.com/ReportConfig\"\304\001\n\031CreateRe" + + "portConfigRequest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A" + + "-\022+storageinsights.googleapis.com/Report" + + "Config\022I\n\rreport_config\030\003 \001(\0132-.google.c" + + "loud.storageinsights.v1.ReportConfigB\003\340A" + + "\002\022\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\"\265\001\n\031UpdateRep" + + "ortConfigRequest\0224\n\013update_mask\030\001 \001(\0132\032." + + "google.protobuf.FieldMaskB\003\340A\002\022I\n\rreport" + + "_config\030\002 \001(\0132-.google.cloud.storageinsi" + + "ghts.v1.ReportConfigB\003\340A\002\022\027\n\nrequest_id\030" + + "\003 \001(\tB\003\340A\001\"\213\001\n\031DeleteReportConfigRequest" + + "\022A\n\004name\030\001 \001(\tB3\340A\002\372A-\n+storageinsights." + + "googleapis.com/ReportConfig\022\022\n\005force\030\002 \001" + + "(\010B\003\340A\001\022\027\n\nrequest_id\030\003 \001(\tB\003\340A\001\"\343\004\n\014Rep" + + "ortDetail\022\014\n\004name\030\001 \001(\t\0221\n\rsnapshot_time" + + "\030\002 \001(\0132\032.google.protobuf.Timestamp\022\032\n\022re" + + "port_path_prefix\030\010 \001(\t\022\024\n\014shards_count\030\t" + + " \001(\003\022\"\n\006status\030\004 \001(\0132\022.google.rpc.Status" + + "\022I\n\006labels\030\005 \003(\01329.google.cloud.storagei" + + "nsights.v1.ReportDetail.LabelsEntry\022.\n\017t" + + "arget_datetime\030\006 \001(\0132\025.google.type.DateT" + + "ime\022M\n\016report_metrics\030\007 \001(\01325.google.clo" + + "ud.storageinsights.v1.ReportDetail.Metri" + + "cs\032*\n\007Metrics\022\037\n\027processed_records_count" + + "\030\001 \001(\003\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" + + "lue\030\002 \001(\t:\0028\001:\226\001\352A\222\001\n+storageinsights.go" + + "ogleapis.com/ReportDetail\022cprojects/{pro" + + "ject}/locations/{location}/reportConfigs" + + "/{report_config}/reportDetails/{report_d" + + "etail}\"\250\001\n\030ListReportDetailsRequest\022C\n\006p" + + "arent\030\001 \001(\tB3\340A\002\372A-\022+storageinsights.goo" + + "gleapis.com/ReportDetail\022\021\n\tpage_size\030\002 " + + "\001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(\t\022" + + "\020\n\010order_by\030\005 \001(\t\"\220\001\n\031ListReportDetailsR" + + "esponse\022E\n\016report_details\030\001 \003(\0132-.google" + + ".cloud.storageinsights.v1.ReportDetail\022\027" + + "\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003" + + " \003(\t\"[\n\026GetReportDetailRequest\022A\n\004name\030\001" + + " \001(\tB3\340A\002\372A-\n+storageinsights.googleapis" + + ".com/ReportDetail\"\200\002\n\021OperationMetadata\022" + + "4\n\013create_time\030\001 \001(\0132\032.google.protobuf.T" + + "imestampB\003\340A\003\0221\n\010end_time\030\002 \001(\0132\032.google" + + ".protobuf.TimestampB\003\340A\003\022\023\n\006target\030\003 \001(\t" + + "B\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\033\n\016status_messa" + + "ge\030\005 \001(\tB\003\340A\003\022#\n\026requested_cancellation\030" + + "\006 \001(\010B\003\340A\003\022\030\n\013api_version\030\007 \001(\tB\003\340A\003\"\355\001\n" + + "\020FrequencyOptions\022N\n\tfrequency\030\001 \001(\0162;.g" + + "oogle.cloud.storageinsights.v1.Frequency" + + "Options.Frequency\022%\n\nstart_date\030\002 \001(\0132\021." + + "google.type.Date\022#\n\010end_date\030\003 \001(\0132\021.goo" + + "gle.type.Date\"=\n\tFrequency\022\031\n\025FREQUENCY_" + + "UNSPECIFIED\020\000\022\t\n\005DAILY\020\001\022\n\n\006WEEKLY\020\002\"R\n\n" + + "CSVOptions\022\030\n\020record_separator\030\001 \001(\t\022\021\n\t" + + "delimiter\030\002 \001(\t\022\027\n\017header_required\030\003 \001(\010" + + "\"\020\n\016ParquetOptions\"%\n\023CloudStorageFilter" + + "s\022\016\n\006bucket\030\001 \001(\t\"J\n\036CloudStorageDestina" + + "tionOptions\022\016\n\006bucket\030\001 \001(\t\022\030\n\020destinati" + + "on_path\030\002 \001(\t\"\220\002\n\033ObjectMetadataReportOp" + + "tions\022\027\n\017metadata_fields\030\001 \003(\t\022O\n\017storag" + + "e_filters\030\002 \001(\01324.google.cloud.storagein" + + "sights.v1.CloudStorageFiltersH\000\022f\n\033stora" + + "ge_destination_options\030\003 \001(\0132?.google.cl" + + "oud.storageinsights.v1.CloudStorageDesti" + + "nationOptionsH\001B\010\n\006filterB\025\n\023destination" + + "_options\"\367\005\n\014ReportConfig\022\014\n\004name\030\001 \001(\t\022" + + "4\n\013create_time\030\002 \001(\0132\032.google.protobuf.T" + + "imestampB\003\340A\003\0224\n\013update_time\030\003 \001(\0132\032.goo" + + "gle.protobuf.TimestampB\003\340A\003\022L\n\021frequency" + + "_options\030\005 \001(\01321.google.cloud.storageins" + + "ights.v1.FrequencyOptions\022B\n\013csv_options" + + "\030\006 \001(\0132+.google.cloud.storageinsights.v1" + + ".CSVOptionsH\000\022J\n\017parquet_options\030\007 \001(\0132/" + + ".google.cloud.storageinsights.v1.Parquet" + + "OptionsH\000\022f\n\036object_metadata_report_opti" + + "ons\030\010 \001(\0132<.google.cloud.storageinsights" + + ".v1.ObjectMetadataReportOptionsH\001\022I\n\006lab" + + "els\030\n \003(\01329.google.cloud.storageinsights" + + ".v1.ReportConfig.LabelsEntry\022\024\n\014display_" + + "name\030\013 \001(\t\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r" + + "\n\005value\030\002 \001(\t:\0028\001:w\352At\n+storageinsights." + + "googleapis.com/ReportConfig\022Eprojects/{p" + + "roject}/locations/{location}/reportConfi" + + "gs/{report_config}B\017\n\rreport_formatB\r\n\013r" + + "eport_kind2\251\014\n\017StorageInsights\022\316\001\n\021ListR" + + "eportConfigs\0229.google.cloud.storageinsig" + + "hts.v1.ListReportConfigsRequest\032:.google" + + ".cloud.storageinsights.v1.ListReportConf" + + "igsResponse\"B\202\323\344\223\0023\0221/v1/{parent=project" + + "s/*/locations/*}/reportConfigs\332A\006parent\022" + + "\273\001\n\017GetReportConfig\0227.google.cloud.stora" + + "geinsights.v1.GetReportConfigRequest\032-.g" + + "oogle.cloud.storageinsights.v1.ReportCon" + + "fig\"@\202\323\344\223\0023\0221/v1/{name=projects/*/locati" + + "ons/*/reportConfigs/*}\332A\004name\022\340\001\n\022Create" + + "ReportConfig\022:.google.cloud.storageinsig" + + "hts.v1.CreateReportConfigRequest\032-.googl" + + "e.cloud.storageinsights.v1.ReportConfig\"" + + "_\202\323\344\223\002B\"1/v1/{parent=projects/*/location" + + "s/*}/reportConfigs:\rreport_config\332A\024pare" + + "nt,report_config\022\363\001\n\022UpdateReportConfig\022" + + ":.google.cloud.storageinsights.v1.Update" + + "ReportConfigRequest\032-.google.cloud.stora" + + "geinsights.v1.ReportConfig\"r\202\323\344\223\002P2?/v1/" + + "{report_config.name=projects/*/locations" + + "/*/reportConfigs/*}:\rreport_config\332A\031rep" + + "ort_config,update_mask\022\252\001\n\022DeleteReportC" + + "onfig\022:.google.cloud.storageinsights.v1." + + "DeleteReportConfigRequest\032\026.google.proto" + + "buf.Empty\"@\202\323\344\223\0023*1/v1/{name=projects/*/" + + "locations/*/reportConfigs/*}\332A\004name\022\336\001\n\021" + + "ListReportDetails\0229.google.cloud.storage" + + "insights.v1.ListReportDetailsRequest\032:.g" + + "oogle.cloud.storageinsights.v1.ListRepor" + + "tDetailsResponse\"R\202\323\344\223\002C\022A/v1/{parent=pr" + + "ojects/*/locations/*/reportConfigs/*}/re" + + "portDetails\332A\006parent\022\313\001\n\017GetReportDetail" + + "\0227.google.cloud.storageinsights.v1.GetRe" + + "portDetailRequest\032-.google.cloud.storage" + + "insights.v1.ReportDetail\"P\202\323\344\223\002C\022A/v1/{n" + + "ame=projects/*/locations/*/reportConfigs" + + "/*/reportDetails/*}\332A\004name\032R\312A\036storagein" + + "sights.googleapis.com\322A.https://www.goog" + + "leapis.com/auth/cloud-platformB\350\001\n#com.g" + + "oogle.cloud.storageinsights.v1B\007V1ProtoP" + + "\001ZMcloud.google.com/go/storageinsights/a" + + "piv1/storageinsightspb;storageinsightspb" + + "\252\002\037Google.Cloud.StorageInsights.V1\312\002\037Goo" + + "gle\\Cloud\\StorageInsights\\V1\352\002\"Google::C" + + "loud::StorageInsights::V1b\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.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + com.google.type.DateProto.getDescriptor(), + com.google.type.DateTimeProto.getDescriptor(), + }); + internal_static_google_cloud_storageinsights_v1_ListReportConfigsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_storageinsights_v1_ListReportConfigsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_ListReportConfigsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_storageinsights_v1_ListReportConfigsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_storageinsights_v1_ListReportConfigsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_ListReportConfigsResponse_descriptor, + new java.lang.String[] { + "ReportConfigs", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_storageinsights_v1_GetReportConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_storageinsights_v1_GetReportConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_GetReportConfigRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_storageinsights_v1_CreateReportConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_storageinsights_v1_CreateReportConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_CreateReportConfigRequest_descriptor, + new java.lang.String[] { + "Parent", "ReportConfig", "RequestId", + }); + internal_static_google_cloud_storageinsights_v1_UpdateReportConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_storageinsights_v1_UpdateReportConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_UpdateReportConfigRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "ReportConfig", "RequestId", + }); + internal_static_google_cloud_storageinsights_v1_DeleteReportConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_storageinsights_v1_DeleteReportConfigRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_DeleteReportConfigRequest_descriptor, + new java.lang.String[] { + "Name", "Force", "RequestId", + }); + internal_static_google_cloud_storageinsights_v1_ReportDetail_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_storageinsights_v1_ReportDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_ReportDetail_descriptor, + new java.lang.String[] { + "Name", + "SnapshotTime", + "ReportPathPrefix", + "ShardsCount", + "Status", + "Labels", + "TargetDatetime", + "ReportMetrics", + }); + internal_static_google_cloud_storageinsights_v1_ReportDetail_Metrics_descriptor = + internal_static_google_cloud_storageinsights_v1_ReportDetail_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_storageinsights_v1_ReportDetail_Metrics_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_ReportDetail_Metrics_descriptor, + new java.lang.String[] { + "ProcessedRecordsCount", + }); + internal_static_google_cloud_storageinsights_v1_ReportDetail_LabelsEntry_descriptor = + internal_static_google_cloud_storageinsights_v1_ReportDetail_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_storageinsights_v1_ReportDetail_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_ReportDetail_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_storageinsights_v1_ListReportDetailsRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_storageinsights_v1_ListReportDetailsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_ListReportDetailsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_storageinsights_v1_ListReportDetailsResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_storageinsights_v1_ListReportDetailsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_ListReportDetailsResponse_descriptor, + new java.lang.String[] { + "ReportDetails", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_storageinsights_v1_GetReportDetailRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_storageinsights_v1_GetReportDetailRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_GetReportDetailRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_storageinsights_v1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_storageinsights_v1_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + }); + internal_static_google_cloud_storageinsights_v1_FrequencyOptions_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_storageinsights_v1_FrequencyOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_FrequencyOptions_descriptor, + new java.lang.String[] { + "Frequency", "StartDate", "EndDate", + }); + internal_static_google_cloud_storageinsights_v1_CSVOptions_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_storageinsights_v1_CSVOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_CSVOptions_descriptor, + new java.lang.String[] { + "RecordSeparator", "Delimiter", "HeaderRequired", + }); + internal_static_google_cloud_storageinsights_v1_ParquetOptions_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_storageinsights_v1_ParquetOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_ParquetOptions_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_storageinsights_v1_CloudStorageFilters_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_storageinsights_v1_CloudStorageFilters_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_CloudStorageFilters_descriptor, + new java.lang.String[] { + "Bucket", + }); + internal_static_google_cloud_storageinsights_v1_CloudStorageDestinationOptions_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_storageinsights_v1_CloudStorageDestinationOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_CloudStorageDestinationOptions_descriptor, + new java.lang.String[] { + "Bucket", "DestinationPath", + }); + internal_static_google_cloud_storageinsights_v1_ObjectMetadataReportOptions_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_storageinsights_v1_ObjectMetadataReportOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_ObjectMetadataReportOptions_descriptor, + new java.lang.String[] { + "MetadataFields", + "StorageFilters", + "StorageDestinationOptions", + "Filter", + "DestinationOptions", + }); + internal_static_google_cloud_storageinsights_v1_ReportConfig_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_storageinsights_v1_ReportConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_ReportConfig_descriptor, + new java.lang.String[] { + "Name", + "CreateTime", + "UpdateTime", + "FrequencyOptions", + "CsvOptions", + "ParquetOptions", + "ObjectMetadataReportOptions", + "Labels", + "DisplayName", + "ReportFormat", + "ReportKind", + }); + internal_static_google_cloud_storageinsights_v1_ReportConfig_LabelsEntry_descriptor = + internal_static_google_cloud_storageinsights_v1_ReportConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_storageinsights_v1_ReportConfig_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_storageinsights_v1_ReportConfig_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + 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.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + com.google.type.DateProto.getDescriptor(); + com.google.type.DateTimeProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/proto/google/cloud/storageinsights/v1/storageinsights.proto b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/proto/google/cloud/storageinsights/v1/storageinsights.proto new file mode 100644 index 000000000000..0f76cc88e8b0 --- /dev/null +++ b/java-storageinsights/proto-google-cloud-storageinsights-v1/src/main/proto/google/cloud/storageinsights/v1/storageinsights.proto @@ -0,0 +1,491 @@ +// Copyright 2023 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.storageinsights.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/type/date.proto"; +import "google/type/datetime.proto"; + +option csharp_namespace = "Google.Cloud.StorageInsights.V1"; +option go_package = "cloud.google.com/go/storageinsights/apiv1/storageinsightspb;storageinsightspb"; +option java_multiple_files = true; +option java_outer_classname = "V1Proto"; +option java_package = "com.google.cloud.storageinsights.v1"; +option php_namespace = "Google\\Cloud\\StorageInsights\\V1"; +option ruby_package = "Google::Cloud::StorageInsights::V1"; + +// Service describing handlers for resources +service StorageInsights { + option (google.api.default_host) = "storageinsights.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists ReportConfigs in a given project and location. + rpc ListReportConfigs(ListReportConfigsRequest) + returns (ListReportConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/reportConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single ReportConfig. + rpc GetReportConfig(GetReportConfigRequest) returns (ReportConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/reportConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new ReportConfig in a given project and location. + rpc CreateReportConfig(CreateReportConfigRequest) returns (ReportConfig) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/reportConfigs" + body: "report_config" + }; + option (google.api.method_signature) = "parent,report_config"; + } + + // Updates the parameters of a single ReportConfig. + rpc UpdateReportConfig(UpdateReportConfigRequest) returns (ReportConfig) { + option (google.api.http) = { + patch: "/v1/{report_config.name=projects/*/locations/*/reportConfigs/*}" + body: "report_config" + }; + option (google.api.method_signature) = "report_config,update_mask"; + } + + // Deletes a single ReportConfig. + rpc DeleteReportConfig(DeleteReportConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/reportConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists ReportDetails in a given project and location. + rpc ListReportDetails(ListReportDetailsRequest) + returns (ListReportDetailsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/reportConfigs/*}/reportDetails" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single ReportDetail. + rpc GetReportDetail(GetReportDetailRequest) returns (ReportDetail) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/reportConfigs/*/reportDetails/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Message for requesting list of ReportConfigs +message ListReportConfigsRequest { + // Required. Parent value for ListReportConfigsRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "storageinsights.googleapis.com/ReportConfig" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results + string filter = 4; + + // Hint for how to order the results + string order_by = 5; +} + +// Message for response to listing ReportConfigs +message ListReportConfigsResponse { + // The list of ReportConfig + repeated ReportConfig report_configs = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a ReportConfig +message GetReportConfigRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "storageinsights.googleapis.com/ReportConfig" + } + ]; +} + +// Message for creating a ReportConfig +message CreateReportConfigRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "storageinsights.googleapis.com/ReportConfig" + } + ]; + + // Required. The resource being created + ReportConfig report_config = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a ReportConfig +message UpdateReportConfigRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // ReportConfig resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated + ReportConfig report_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a ReportConfig +message DeleteReportConfigRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "storageinsights.googleapis.com/ReportConfig" + } + ]; + + // Optional. If set, all ReportDetails for this ReportConfig will be deleted. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message describing ReportDetail object. ReportDetail represents metadata of +// generated reports for a ReportConfig. +// Next ID: 10 +message ReportDetail { + option (google.api.resource) = { + type: "storageinsights.googleapis.com/ReportDetail" + pattern: "projects/{project}/locations/{location}/reportConfigs/{report_config}/reportDetails/{report_detail}" + }; + + // Different metrics associated with the generated report. + message Metrics { + // Count of Cloud Storage objects which are part of the report. + int64 processed_records_count = 1; + } + + // Name of resource. It will be of form + // projects//locations//reportConfigs//reportDetails/. + string name = 1; + + // The snapshot time. + // All the report data is referenced at this point of time. + google.protobuf.Timestamp snapshot_time = 2; + + // Prefix of the object name of each report's shard. This will have full + // prefix except the "extension" and "shard_id". + // For example, if the `destination_path` is + // "{{report-config-id}}/dt={{datetime}}", the shard object name would be + // "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_5.csv" + // and the value of `report_path_prefix` field would be + // "gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_". + string report_path_prefix = 8; + + // Total shards generated for the report. + int64 shards_count = 9; + + // Status of the ReportDetail. + google.rpc.Status status = 4; + + // Labels as key value pairs + map labels = 5; + + // The date for which report is generated. The time part of target_datetime + // will be zero till we support multiple reports per day. + google.type.DateTime target_datetime = 6; + + // Metrics of the report. + Metrics report_metrics = 7; +} + +// Message for requesting list of ReportDetails +message ListReportDetailsRequest { + // Required. Parent value for ListReportDetailsRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "storageinsights.googleapis.com/ReportDetail" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results + string filter = 4; + + // Hint for how to order the results + string order_by = 5; +} + +// Message for response to listing ReportDetails +message ListReportDetailsResponse { + // The list of ReportDetail + repeated ReportDetail report_details = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a ReportDetail +message GetReportDetailRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "storageinsights.googleapis.com/ReportDetail" + } + ]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have been cancelled successfully + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ReportConfig Resource: +// +// Options to setup frequency of report generation. +message FrequencyOptions { + // This ENUM specifies possible frequencies of report generation. + enum Frequency { + // Unspecified. + FREQUENCY_UNSPECIFIED = 0; + + // Report will be generated daily. + DAILY = 1; + + // Report will be generated weekly. + WEEKLY = 2; + } + + // Frequency of report generation. + Frequency frequency = 1; + + // The date from which report generation should start. + // UTC time zone. + google.type.Date start_date = 2; + + // The date on which report generation should stop (Inclusive). + // UTC time zone. + google.type.Date end_date = 3; +} + +// Options to configure CSV formatted reports. +message CSVOptions { + // Record separator characters in CSV. + string record_separator = 1; + + // Delimiter characters in CSV. + string delimiter = 2; + + // If set, will include a header row in the CSV report. + bool header_required = 3; +} + +// Options to configure Parquet formatted reports. +message ParquetOptions {} + +// Options to filter data on storage systems. +// Next ID: 2 +message CloudStorageFilters { + // Bucket for which the report will be generated. + string bucket = 1; +} + +// Options to store reports in storage systems. +// Next ID: 3 +message CloudStorageDestinationOptions { + // Destination bucket. + string bucket = 1; + + // Destination path is the path in the bucket where the report should be + // generated. + string destination_path = 2; +} + +// Report specification for exporting object metadata. +// Next ID: 4 +message ObjectMetadataReportOptions { + // Metadata fields to be included in the report. + repeated string metadata_fields = 1; + + // Filter options for storage systems. + oneof filter { + // Cloud Storage as the storage system. + CloudStorageFilters storage_filters = 2; + } + + // Options on destination for storage systems. + oneof destination_options { + // Cloud Storage as the storage system. + CloudStorageDestinationOptions storage_destination_options = 3; + } +} + +// Message describing ReportConfig object. ReportConfig is the configuration to +// generate reports. +// Next ID: 12 +message ReportConfig { + option (google.api.resource) = { + type: "storageinsights.googleapis.com/ReportConfig" + pattern: "projects/{project}/locations/{location}/reportConfigs/{report_config}" + }; + + // name of resource. It will be of form + // projects//locations//reportConfigs/. + string name = 1; + + // Output only. [Output only] Create time stamp + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output only] Update time stamp + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The frequency of report generation. + FrequencyOptions frequency_options = 5; + + // Format in which report will be published. + oneof report_format { + // Options for CSV formatted reports. + CSVOptions csv_options = 6; + + // Options for Parquet formatted reports. + ParquetOptions parquet_options = 7; + } + + // Configuration options for report contents. + oneof report_kind { + // Report for exporting object metadata. + ObjectMetadataReportOptions object_metadata_report_options = 8; + } + + // Labels as key value pairs + map labels = 10; + + // User provided display name which can be empty and limited to 256 characters + // that is editable. + string display_name = 11; +} diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/create/SyncCreateSetCredentialsProvider.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..7fe819316a01 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; +import com.google.cloud.storageinsights.v1.StorageInsightsSettings; +import com.google.cloud.storageinsights.v1.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 + StorageInsightsSettings storageInsightsSettings = + StorageInsightsSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + StorageInsightsClient storageInsightsClient = + StorageInsightsClient.create(storageInsightsSettings); + } +} +// [END storageinsights_v1_generated_StorageInsights_Create_SetCredentialsProvider_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/create/SyncCreateSetCredentialsProvider1.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..0f4ff575b676 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_Create_SetCredentialsProvider1_sync] +import com.google.cloud.storageinsights.v1.StorageInsightsClient; +import com.google.cloud.storageinsights.v1.StorageInsightsSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() 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 + StorageInsightsSettings storageInsightsSettings = + StorageInsightsSettings.newHttpJsonBuilder().build(); + StorageInsightsClient storageInsightsClient = + StorageInsightsClient.create(storageInsightsSettings); + } +} +// [END storageinsights_v1_generated_StorageInsights_Create_SetCredentialsProvider1_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/create/SyncCreateSetEndpoint.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..2e6b56a15a80 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_Create_SetEndpoint_sync] +import com.google.cloud.storageinsights.v1.StorageInsightsClient; +import com.google.cloud.storageinsights.v1.StorageInsightsSettings; +import com.google.cloud.storageinsights.v1.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 + StorageInsightsSettings storageInsightsSettings = + StorageInsightsSettings.newBuilder().setEndpoint(myEndpoint).build(); + StorageInsightsClient storageInsightsClient = + StorageInsightsClient.create(storageInsightsSettings); + } +} +// [END storageinsights_v1_generated_StorageInsights_Create_SetEndpoint_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/createreportconfig/AsyncCreateReportConfig.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/createreportconfig/AsyncCreateReportConfig.java new file mode 100644 index 000000000000..f6b9512296fa --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/createreportconfig/AsyncCreateReportConfig.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_CreateReportConfig_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.storageinsights.v1.CreateReportConfigRequest; +import com.google.cloud.storageinsights.v1.LocationName; +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class AsyncCreateReportConfig { + + public static void main(String[] args) throws Exception { + asyncCreateReportConfig(); + } + + public static void asyncCreateReportConfig() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + CreateReportConfigRequest request = + CreateReportConfigRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setReportConfig(ReportConfig.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + storageInsightsClient.createReportConfigCallable().futureCall(request); + // Do something. + ReportConfig response = future.get(); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_CreateReportConfig_async] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/createreportconfig/SyncCreateReportConfig.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/createreportconfig/SyncCreateReportConfig.java new file mode 100644 index 000000000000..190e6cb42f9c --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/createreportconfig/SyncCreateReportConfig.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_CreateReportConfig_sync] +import com.google.cloud.storageinsights.v1.CreateReportConfigRequest; +import com.google.cloud.storageinsights.v1.LocationName; +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class SyncCreateReportConfig { + + public static void main(String[] args) throws Exception { + syncCreateReportConfig(); + } + + public static void syncCreateReportConfig() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + CreateReportConfigRequest request = + CreateReportConfigRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setReportConfig(ReportConfig.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ReportConfig response = storageInsightsClient.createReportConfig(request); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_CreateReportConfig_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/createreportconfig/SyncCreateReportConfigLocationnameReportconfig.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/createreportconfig/SyncCreateReportConfigLocationnameReportconfig.java new file mode 100644 index 000000000000..91357c57469e --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/createreportconfig/SyncCreateReportConfigLocationnameReportconfig.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_CreateReportConfig_LocationnameReportconfig_sync] +import com.google.cloud.storageinsights.v1.LocationName; +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class SyncCreateReportConfigLocationnameReportconfig { + + public static void main(String[] args) throws Exception { + syncCreateReportConfigLocationnameReportconfig(); + } + + public static void syncCreateReportConfigLocationnameReportconfig() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ReportConfig reportConfig = ReportConfig.newBuilder().build(); + ReportConfig response = storageInsightsClient.createReportConfig(parent, reportConfig); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_CreateReportConfig_LocationnameReportconfig_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/createreportconfig/SyncCreateReportConfigStringReportconfig.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/createreportconfig/SyncCreateReportConfigStringReportconfig.java new file mode 100644 index 000000000000..532fa1eecff9 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/createreportconfig/SyncCreateReportConfigStringReportconfig.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_CreateReportConfig_StringReportconfig_sync] +import com.google.cloud.storageinsights.v1.LocationName; +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class SyncCreateReportConfigStringReportconfig { + + public static void main(String[] args) throws Exception { + syncCreateReportConfigStringReportconfig(); + } + + public static void syncCreateReportConfigStringReportconfig() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + ReportConfig reportConfig = ReportConfig.newBuilder().build(); + ReportConfig response = storageInsightsClient.createReportConfig(parent, reportConfig); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_CreateReportConfig_StringReportconfig_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/deletereportconfig/AsyncDeleteReportConfig.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/deletereportconfig/AsyncDeleteReportConfig.java new file mode 100644 index 000000000000..919b3e91ff15 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/deletereportconfig/AsyncDeleteReportConfig.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_DeleteReportConfig_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.storageinsights.v1.DeleteReportConfigRequest; +import com.google.cloud.storageinsights.v1.ReportConfigName; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; +import com.google.protobuf.Empty; + +public class AsyncDeleteReportConfig { + + public static void main(String[] args) throws Exception { + asyncDeleteReportConfig(); + } + + public static void asyncDeleteReportConfig() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + DeleteReportConfigRequest request = + DeleteReportConfigRequest.newBuilder() + .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setForce(true) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + storageInsightsClient.deleteReportConfigCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_DeleteReportConfig_async] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/deletereportconfig/SyncDeleteReportConfig.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/deletereportconfig/SyncDeleteReportConfig.java new file mode 100644 index 000000000000..2b2baaa14013 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/deletereportconfig/SyncDeleteReportConfig.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_DeleteReportConfig_sync] +import com.google.cloud.storageinsights.v1.DeleteReportConfigRequest; +import com.google.cloud.storageinsights.v1.ReportConfigName; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; +import com.google.protobuf.Empty; + +public class SyncDeleteReportConfig { + + public static void main(String[] args) throws Exception { + syncDeleteReportConfig(); + } + + public static void syncDeleteReportConfig() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + DeleteReportConfigRequest request = + DeleteReportConfigRequest.newBuilder() + .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setForce(true) + .setRequestId("requestId693933066") + .build(); + storageInsightsClient.deleteReportConfig(request); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_DeleteReportConfig_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/deletereportconfig/SyncDeleteReportConfigReportconfigname.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/deletereportconfig/SyncDeleteReportConfigReportconfigname.java new file mode 100644 index 000000000000..288822b7af34 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/deletereportconfig/SyncDeleteReportConfigReportconfigname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_DeleteReportConfig_Reportconfigname_sync] +import com.google.cloud.storageinsights.v1.ReportConfigName; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; +import com.google.protobuf.Empty; + +public class SyncDeleteReportConfigReportconfigname { + + public static void main(String[] args) throws Exception { + syncDeleteReportConfigReportconfigname(); + } + + public static void syncDeleteReportConfigReportconfigname() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + ReportConfigName name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]"); + storageInsightsClient.deleteReportConfig(name); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_DeleteReportConfig_Reportconfigname_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/deletereportconfig/SyncDeleteReportConfigString.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/deletereportconfig/SyncDeleteReportConfigString.java new file mode 100644 index 000000000000..58bcc2b631c9 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/deletereportconfig/SyncDeleteReportConfigString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_DeleteReportConfig_String_sync] +import com.google.cloud.storageinsights.v1.ReportConfigName; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; +import com.google.protobuf.Empty; + +public class SyncDeleteReportConfigString { + + public static void main(String[] args) throws Exception { + syncDeleteReportConfigString(); + } + + public static void syncDeleteReportConfigString() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + String name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString(); + storageInsightsClient.deleteReportConfig(name); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_DeleteReportConfig_String_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getlocation/AsyncGetLocation.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..72d6b5a34bca --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = storageInsightsClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_GetLocation_async] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getlocation/SyncGetLocation.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..9d59c0ef3ff3 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = storageInsightsClient.getLocation(request); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_GetLocation_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportconfig/AsyncGetReportConfig.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportconfig/AsyncGetReportConfig.java new file mode 100644 index 000000000000..160e20470a2d --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportconfig/AsyncGetReportConfig.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_GetReportConfig_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.storageinsights.v1.GetReportConfigRequest; +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.ReportConfigName; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class AsyncGetReportConfig { + + public static void main(String[] args) throws Exception { + asyncGetReportConfig(); + } + + public static void asyncGetReportConfig() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + GetReportConfigRequest request = + GetReportConfigRequest.newBuilder() + .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .build(); + ApiFuture future = + storageInsightsClient.getReportConfigCallable().futureCall(request); + // Do something. + ReportConfig response = future.get(); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_GetReportConfig_async] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportconfig/SyncGetReportConfig.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportconfig/SyncGetReportConfig.java new file mode 100644 index 000000000000..441052916307 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportconfig/SyncGetReportConfig.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_GetReportConfig_sync] +import com.google.cloud.storageinsights.v1.GetReportConfigRequest; +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.ReportConfigName; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class SyncGetReportConfig { + + public static void main(String[] args) throws Exception { + syncGetReportConfig(); + } + + public static void syncGetReportConfig() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + GetReportConfigRequest request = + GetReportConfigRequest.newBuilder() + .setName(ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .build(); + ReportConfig response = storageInsightsClient.getReportConfig(request); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_GetReportConfig_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportconfig/SyncGetReportConfigReportconfigname.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportconfig/SyncGetReportConfigReportconfigname.java new file mode 100644 index 000000000000..cfba0a4f1eaa --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportconfig/SyncGetReportConfigReportconfigname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_GetReportConfig_Reportconfigname_sync] +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.ReportConfigName; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class SyncGetReportConfigReportconfigname { + + public static void main(String[] args) throws Exception { + syncGetReportConfigReportconfigname(); + } + + public static void syncGetReportConfigReportconfigname() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + ReportConfigName name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]"); + ReportConfig response = storageInsightsClient.getReportConfig(name); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_GetReportConfig_Reportconfigname_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportconfig/SyncGetReportConfigString.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportconfig/SyncGetReportConfigString.java new file mode 100644 index 000000000000..d302c470c748 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportconfig/SyncGetReportConfigString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_GetReportConfig_String_sync] +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.ReportConfigName; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class SyncGetReportConfigString { + + public static void main(String[] args) throws Exception { + syncGetReportConfigString(); + } + + public static void syncGetReportConfigString() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + String name = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString(); + ReportConfig response = storageInsightsClient.getReportConfig(name); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_GetReportConfig_String_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportdetail/AsyncGetReportDetail.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportdetail/AsyncGetReportDetail.java new file mode 100644 index 000000000000..59ae6c86e0cf --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportdetail/AsyncGetReportDetail.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_GetReportDetail_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.storageinsights.v1.GetReportDetailRequest; +import com.google.cloud.storageinsights.v1.ReportDetail; +import com.google.cloud.storageinsights.v1.ReportDetailName; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class AsyncGetReportDetail { + + public static void main(String[] args) throws Exception { + asyncGetReportDetail(); + } + + public static void asyncGetReportDetail() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + GetReportDetailRequest request = + GetReportDetailRequest.newBuilder() + .setName( + ReportDetailName.of( + "[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]", "[REPORT_DETAIL]") + .toString()) + .build(); + ApiFuture future = + storageInsightsClient.getReportDetailCallable().futureCall(request); + // Do something. + ReportDetail response = future.get(); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_GetReportDetail_async] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportdetail/SyncGetReportDetail.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportdetail/SyncGetReportDetail.java new file mode 100644 index 000000000000..6c263b98611b --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportdetail/SyncGetReportDetail.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_GetReportDetail_sync] +import com.google.cloud.storageinsights.v1.GetReportDetailRequest; +import com.google.cloud.storageinsights.v1.ReportDetail; +import com.google.cloud.storageinsights.v1.ReportDetailName; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class SyncGetReportDetail { + + public static void main(String[] args) throws Exception { + syncGetReportDetail(); + } + + public static void syncGetReportDetail() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + GetReportDetailRequest request = + GetReportDetailRequest.newBuilder() + .setName( + ReportDetailName.of( + "[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]", "[REPORT_DETAIL]") + .toString()) + .build(); + ReportDetail response = storageInsightsClient.getReportDetail(request); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_GetReportDetail_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportdetail/SyncGetReportDetailReportdetailname.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportdetail/SyncGetReportDetailReportdetailname.java new file mode 100644 index 000000000000..99b88f576b0c --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportdetail/SyncGetReportDetailReportdetailname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_GetReportDetail_Reportdetailname_sync] +import com.google.cloud.storageinsights.v1.ReportDetail; +import com.google.cloud.storageinsights.v1.ReportDetailName; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class SyncGetReportDetailReportdetailname { + + public static void main(String[] args) throws Exception { + syncGetReportDetailReportdetailname(); + } + + public static void syncGetReportDetailReportdetailname() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + ReportDetailName name = + ReportDetailName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]", "[REPORT_DETAIL]"); + ReportDetail response = storageInsightsClient.getReportDetail(name); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_GetReportDetail_Reportdetailname_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportdetail/SyncGetReportDetailString.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportdetail/SyncGetReportDetailString.java new file mode 100644 index 000000000000..a2f165b0e403 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/getreportdetail/SyncGetReportDetailString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_GetReportDetail_String_sync] +import com.google.cloud.storageinsights.v1.ReportDetail; +import com.google.cloud.storageinsights.v1.ReportDetailName; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class SyncGetReportDetailString { + + public static void main(String[] args) throws Exception { + syncGetReportDetailString(); + } + + public static void syncGetReportDetailString() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + String name = + ReportDetailName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]", "[REPORT_DETAIL]") + .toString(); + ReportDetail response = storageInsightsClient.getReportDetail(name); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_GetReportDetail_String_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listlocations/AsyncListLocations.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..e5c4f4a9e482 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + storageInsightsClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storageinsights_v1_generated_StorageInsights_ListLocations_async] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listlocations/AsyncListLocationsPaged.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..e21d225e29ca --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; +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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + storageInsightsClient.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 storageinsights_v1_generated_StorageInsights_ListLocations_Paged_async] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listlocations/SyncListLocations.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..11951466dc9c --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : storageInsightsClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storageinsights_v1_generated_StorageInsights_ListLocations_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportconfigs/AsyncListReportConfigs.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportconfigs/AsyncListReportConfigs.java new file mode 100644 index 000000000000..9a98818cc6ea --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportconfigs/AsyncListReportConfigs.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_ListReportConfigs_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.storageinsights.v1.ListReportConfigsRequest; +import com.google.cloud.storageinsights.v1.LocationName; +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class AsyncListReportConfigs { + + public static void main(String[] args) throws Exception { + asyncListReportConfigs(); + } + + public static void asyncListReportConfigs() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + ListReportConfigsRequest request = + ListReportConfigsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + storageInsightsClient.listReportConfigsPagedCallable().futureCall(request); + // Do something. + for (ReportConfig element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storageinsights_v1_generated_StorageInsights_ListReportConfigs_async] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportconfigs/AsyncListReportConfigsPaged.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportconfigs/AsyncListReportConfigsPaged.java new file mode 100644 index 000000000000..b434bf4eb987 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportconfigs/AsyncListReportConfigsPaged.java @@ -0,0 +1,64 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_ListReportConfigs_Paged_async] +import com.google.cloud.storageinsights.v1.ListReportConfigsRequest; +import com.google.cloud.storageinsights.v1.ListReportConfigsResponse; +import com.google.cloud.storageinsights.v1.LocationName; +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; +import com.google.common.base.Strings; + +public class AsyncListReportConfigsPaged { + + public static void main(String[] args) throws Exception { + asyncListReportConfigsPaged(); + } + + public static void asyncListReportConfigsPaged() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + ListReportConfigsRequest request = + ListReportConfigsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListReportConfigsResponse response = + storageInsightsClient.listReportConfigsCallable().call(request); + for (ReportConfig element : response.getReportConfigsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END storageinsights_v1_generated_StorageInsights_ListReportConfigs_Paged_async] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportconfigs/SyncListReportConfigs.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportconfigs/SyncListReportConfigs.java new file mode 100644 index 000000000000..f07bf5f51068 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportconfigs/SyncListReportConfigs.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_ListReportConfigs_sync] +import com.google.cloud.storageinsights.v1.ListReportConfigsRequest; +import com.google.cloud.storageinsights.v1.LocationName; +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class SyncListReportConfigs { + + public static void main(String[] args) throws Exception { + syncListReportConfigs(); + } + + public static void syncListReportConfigs() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + ListReportConfigsRequest request = + ListReportConfigsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (ReportConfig element : storageInsightsClient.listReportConfigs(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storageinsights_v1_generated_StorageInsights_ListReportConfigs_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportconfigs/SyncListReportConfigsLocationname.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportconfigs/SyncListReportConfigsLocationname.java new file mode 100644 index 000000000000..99c6773c9355 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportconfigs/SyncListReportConfigsLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_ListReportConfigs_Locationname_sync] +import com.google.cloud.storageinsights.v1.LocationName; +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class SyncListReportConfigsLocationname { + + public static void main(String[] args) throws Exception { + syncListReportConfigsLocationname(); + } + + public static void syncListReportConfigsLocationname() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (ReportConfig element : storageInsightsClient.listReportConfigs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storageinsights_v1_generated_StorageInsights_ListReportConfigs_Locationname_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportconfigs/SyncListReportConfigsString.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportconfigs/SyncListReportConfigsString.java new file mode 100644 index 000000000000..86a86883cc3c --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportconfigs/SyncListReportConfigsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_ListReportConfigs_String_sync] +import com.google.cloud.storageinsights.v1.LocationName; +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class SyncListReportConfigsString { + + public static void main(String[] args) throws Exception { + syncListReportConfigsString(); + } + + public static void syncListReportConfigsString() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (ReportConfig element : storageInsightsClient.listReportConfigs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storageinsights_v1_generated_StorageInsights_ListReportConfigs_String_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportdetails/AsyncListReportDetails.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportdetails/AsyncListReportDetails.java new file mode 100644 index 000000000000..64b40055552c --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportdetails/AsyncListReportDetails.java @@ -0,0 +1,57 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_ListReportDetails_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.storageinsights.v1.ListReportDetailsRequest; +import com.google.cloud.storageinsights.v1.ReportConfigName; +import com.google.cloud.storageinsights.v1.ReportDetail; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class AsyncListReportDetails { + + public static void main(String[] args) throws Exception { + asyncListReportDetails(); + } + + public static void asyncListReportDetails() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + ListReportDetailsRequest request = + ListReportDetailsRequest.newBuilder() + .setParent( + ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + storageInsightsClient.listReportDetailsPagedCallable().futureCall(request); + // Do something. + for (ReportDetail element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storageinsights_v1_generated_StorageInsights_ListReportDetails_async] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportdetails/AsyncListReportDetailsPaged.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportdetails/AsyncListReportDetailsPaged.java new file mode 100644 index 000000000000..ba901f36f164 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportdetails/AsyncListReportDetailsPaged.java @@ -0,0 +1,65 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_ListReportDetails_Paged_async] +import com.google.cloud.storageinsights.v1.ListReportDetailsRequest; +import com.google.cloud.storageinsights.v1.ListReportDetailsResponse; +import com.google.cloud.storageinsights.v1.ReportConfigName; +import com.google.cloud.storageinsights.v1.ReportDetail; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; +import com.google.common.base.Strings; + +public class AsyncListReportDetailsPaged { + + public static void main(String[] args) throws Exception { + asyncListReportDetailsPaged(); + } + + public static void asyncListReportDetailsPaged() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + ListReportDetailsRequest request = + ListReportDetailsRequest.newBuilder() + .setParent( + ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListReportDetailsResponse response = + storageInsightsClient.listReportDetailsCallable().call(request); + for (ReportDetail element : response.getReportDetailsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END storageinsights_v1_generated_StorageInsights_ListReportDetails_Paged_async] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportdetails/SyncListReportDetails.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportdetails/SyncListReportDetails.java new file mode 100644 index 000000000000..b40554cf78b1 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportdetails/SyncListReportDetails.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_ListReportDetails_sync] +import com.google.cloud.storageinsights.v1.ListReportDetailsRequest; +import com.google.cloud.storageinsights.v1.ReportConfigName; +import com.google.cloud.storageinsights.v1.ReportDetail; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class SyncListReportDetails { + + public static void main(String[] args) throws Exception { + syncListReportDetails(); + } + + public static void syncListReportDetails() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + ListReportDetailsRequest request = + ListReportDetailsRequest.newBuilder() + .setParent( + ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (ReportDetail element : storageInsightsClient.listReportDetails(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storageinsights_v1_generated_StorageInsights_ListReportDetails_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportdetails/SyncListReportDetailsReportconfigname.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportdetails/SyncListReportDetailsReportconfigname.java new file mode 100644 index 000000000000..28824dd345f6 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportdetails/SyncListReportDetailsReportconfigname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_ListReportDetails_Reportconfigname_sync] +import com.google.cloud.storageinsights.v1.ReportConfigName; +import com.google.cloud.storageinsights.v1.ReportDetail; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class SyncListReportDetailsReportconfigname { + + public static void main(String[] args) throws Exception { + syncListReportDetailsReportconfigname(); + } + + public static void syncListReportDetailsReportconfigname() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + ReportConfigName parent = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]"); + for (ReportDetail element : storageInsightsClient.listReportDetails(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storageinsights_v1_generated_StorageInsights_ListReportDetails_Reportconfigname_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportdetails/SyncListReportDetailsString.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportdetails/SyncListReportDetailsString.java new file mode 100644 index 000000000000..3a7a960c0a3f --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/listreportdetails/SyncListReportDetailsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_ListReportDetails_String_sync] +import com.google.cloud.storageinsights.v1.ReportConfigName; +import com.google.cloud.storageinsights.v1.ReportDetail; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; + +public class SyncListReportDetailsString { + + public static void main(String[] args) throws Exception { + syncListReportDetailsString(); + } + + public static void syncListReportDetailsString() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + String parent = ReportConfigName.of("[PROJECT]", "[LOCATION]", "[REPORT_CONFIG]").toString(); + for (ReportDetail element : storageInsightsClient.listReportDetails(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storageinsights_v1_generated_StorageInsights_ListReportDetails_String_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/updatereportconfig/AsyncUpdateReportConfig.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/updatereportconfig/AsyncUpdateReportConfig.java new file mode 100644 index 000000000000..158af82e601e --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/updatereportconfig/AsyncUpdateReportConfig.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_UpdateReportConfig_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; +import com.google.cloud.storageinsights.v1.UpdateReportConfigRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateReportConfig { + + public static void main(String[] args) throws Exception { + asyncUpdateReportConfig(); + } + + public static void asyncUpdateReportConfig() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + UpdateReportConfigRequest request = + UpdateReportConfigRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setReportConfig(ReportConfig.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + storageInsightsClient.updateReportConfigCallable().futureCall(request); + // Do something. + ReportConfig response = future.get(); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_UpdateReportConfig_async] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/updatereportconfig/SyncUpdateReportConfig.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/updatereportconfig/SyncUpdateReportConfig.java new file mode 100644 index 000000000000..56bba704c5b2 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/updatereportconfig/SyncUpdateReportConfig.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_UpdateReportConfig_sync] +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; +import com.google.cloud.storageinsights.v1.UpdateReportConfigRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateReportConfig { + + public static void main(String[] args) throws Exception { + syncUpdateReportConfig(); + } + + public static void syncUpdateReportConfig() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + UpdateReportConfigRequest request = + UpdateReportConfigRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setReportConfig(ReportConfig.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ReportConfig response = storageInsightsClient.updateReportConfig(request); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_UpdateReportConfig_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/updatereportconfig/SyncUpdateReportConfigReportconfigFieldmask.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/updatereportconfig/SyncUpdateReportConfigReportconfigFieldmask.java new file mode 100644 index 000000000000..45a48339d8ba --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsights/updatereportconfig/SyncUpdateReportConfigReportconfigFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsights_UpdateReportConfig_ReportconfigFieldmask_sync] +import com.google.cloud.storageinsights.v1.ReportConfig; +import com.google.cloud.storageinsights.v1.StorageInsightsClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateReportConfigReportconfigFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateReportConfigReportconfigFieldmask(); + } + + public static void syncUpdateReportConfigReportconfigFieldmask() 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 (StorageInsightsClient storageInsightsClient = StorageInsightsClient.create()) { + ReportConfig reportConfig = ReportConfig.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + ReportConfig response = storageInsightsClient.updateReportConfig(reportConfig, updateMask); + } + } +} +// [END storageinsights_v1_generated_StorageInsights_UpdateReportConfig_ReportconfigFieldmask_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsightssettings/getreportconfig/SyncGetReportConfig.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsightssettings/getreportconfig/SyncGetReportConfig.java new file mode 100644 index 000000000000..8e31cb0f0c20 --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/storageinsightssettings/getreportconfig/SyncGetReportConfig.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.storageinsights.v1.samples; + +// [START storageinsights_v1_generated_StorageInsightsSettings_GetReportConfig_sync] +import com.google.cloud.storageinsights.v1.StorageInsightsSettings; +import java.time.Duration; + +public class SyncGetReportConfig { + + public static void main(String[] args) throws Exception { + syncGetReportConfig(); + } + + public static void syncGetReportConfig() 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 + StorageInsightsSettings.Builder storageInsightsSettingsBuilder = + StorageInsightsSettings.newBuilder(); + storageInsightsSettingsBuilder + .getReportConfigSettings() + .setRetrySettings( + storageInsightsSettingsBuilder + .getReportConfigSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + StorageInsightsSettings storageInsightsSettings = storageInsightsSettingsBuilder.build(); + } +} +// [END storageinsights_v1_generated_StorageInsightsSettings_GetReportConfig_sync] diff --git a/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/stub/storageinsightsstubsettings/getreportconfig/SyncGetReportConfig.java b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/stub/storageinsightsstubsettings/getreportconfig/SyncGetReportConfig.java new file mode 100644 index 000000000000..a6e63d2e4e9a --- /dev/null +++ b/java-storageinsights/samples/snippets/generated/com/google/cloud/storageinsights/v1/stub/storageinsightsstubsettings/getreportconfig/SyncGetReportConfig.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.storageinsights.v1.stub.samples; + +// [START storageinsights_v1_generated_StorageInsightsStubSettings_GetReportConfig_sync] +import com.google.cloud.storageinsights.v1.stub.StorageInsightsStubSettings; +import java.time.Duration; + +public class SyncGetReportConfig { + + public static void main(String[] args) throws Exception { + syncGetReportConfig(); + } + + public static void syncGetReportConfig() 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 + StorageInsightsStubSettings.Builder storageInsightsSettingsBuilder = + StorageInsightsStubSettings.newBuilder(); + storageInsightsSettingsBuilder + .getReportConfigSettings() + .setRetrySettings( + storageInsightsSettingsBuilder + .getReportConfigSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + StorageInsightsStubSettings storageInsightsSettings = storageInsightsSettingsBuilder.build(); + } +} +// [END storageinsights_v1_generated_StorageInsightsStubSettings_GetReportConfig_sync] diff --git a/pom.xml b/pom.xml index 28e9012560c8..aae5b3f86e52 100644 --- a/pom.xml +++ b/pom.xml @@ -146,6 +146,7 @@ java-service-usage java-shell java-speech + java-storageinsights java-storage-transfer java-talent java-tasks diff --git a/versions.txt b/versions.txt index 749ffdd4e8af..2aabede6f8f7 100644 --- a/versions.txt +++ b/versions.txt @@ -637,3 +637,6 @@ proto-google-cloud-workstations-v1:0.3.0:0.4.0-SNAPSHOT grpc-google-cloud-workstations-v1:0.3.0:0.4.0-SNAPSHOT proto-google-cloud-biglake-v1:0.3.0:0.4.0-SNAPSHOT grpc-google-cloud-biglake-v1:0.3.0:0.4.0-SNAPSHOT +google-cloud-storageinsights:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-storageinsights-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-storageinsights-v1:0.0.0:0.0.1-SNAPSHOT