diff --git a/java-maps-mapsplatformdatasets/.OwlBot.yaml b/java-maps-mapsplatformdatasets/.OwlBot.yaml new file mode 100644 index 000000000000..6bee7d9b0bba --- /dev/null +++ b/java-maps-mapsplatformdatasets/.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-maps-mapsplatformdatasets/grpc-google-.*/src" +- "/java-maps-mapsplatformdatasets/proto-google-.*/src" +- "/java-maps-mapsplatformdatasets/google-.*/src" +- "/java-maps-mapsplatformdatasets/samples/snippets/generated" + +deep-preserve-regex: +- "/java-maps-mapsplatformdatasets/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/maps/mapsplatformdatasets/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-maps-mapsplatformdatasets/$1/proto-google-maps-mapsplatformdatasets-$1/src" +- source: "/google/maps/mapsplatformdatasets/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-maps-mapsplatformdatasets/$1/grpc-google-maps-mapsplatformdatasets-$1/src" +- source: "/google/maps/mapsplatformdatasets/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-maps-mapsplatformdatasets/$1/google-maps-mapsplatformdatasets/src" +- source: "/google/maps/mapsplatformdatasets/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-maps-mapsplatformdatasets/$1/samples/snippets/generated" + + +api-name: maps-mapsplatformdatasets \ No newline at end of file diff --git a/java-maps-mapsplatformdatasets/.repo-metadata.json b/java-maps-mapsplatformdatasets/.repo-metadata.json new file mode 100644 index 000000000000..1f8132184201 --- /dev/null +++ b/java-maps-mapsplatformdatasets/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "maps-mapsplatformdatasets", + "name_pretty": "Maps Platform Datasets API", + "product_documentation": "https://developers.google.com/maps/documentation", + "api_description": "The Maps Platform Datasets API enables developers to ingest geospatially-tied datasets\n that they can use to enrich their experience of Maps Platform solutions (e.g. styling, routing).", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-maps-mapsplatformdatasets/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-maps-mapsplatformdatasets", + "repo_short": "java-maps-mapsplatformdatasets", + "distribution_name": "com.google.maps:google-maps-mapsplatformdatasets", + "api_id": "mapsplatformdatasets.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-maps-mapsplatformdatasets/README.md b/java-maps-mapsplatformdatasets/README.md new file mode 100644 index 000000000000..e12b92bb954b --- /dev/null +++ b/java-maps-mapsplatformdatasets/README.md @@ -0,0 +1,202 @@ +# Google Maps Platform Datasets API Client for Java + +Java idiomatic client for [Maps Platform Datasets 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, add this to your pom.xml file: + + +```xml + + com.google.maps + google-maps-mapsplatformdatasets + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.maps:google-maps-mapsplatformdatasets:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.maps" % "google-maps-mapsplatformdatasets" % "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 Maps Platform Datasets API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Maps Platform Datasets API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Maps Platform Datasets API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Maps Platform Datasets 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 SDK][cloud-sdk] 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-maps-mapsplatformdatasets` library. See the [Quickstart](#quickstart) section +to add `google-maps-mapsplatformdatasets` as a dependency in your code. + +## About Maps Platform Datasets API + + +[Maps Platform Datasets API][product-docs] The Maps Platform Datasets API enables developers to ingest geospatially-tied datasets + that they can use to enrich their experience of Maps Platform solutions (e.g. styling, routing). + +See the [Maps Platform Datasets API client library docs][javadocs] to learn how to +use this Maps Platform Datasets API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Maps Platform Datasets 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://developers.google.com/maps/documentation +[javadocs]: https://cloud.google.com/java/docs/reference/google-maps-mapsplatformdatasets/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-mapsplatformdatasets/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-mapsplatformdatasets/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-mapsplatformdatasets/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-mapsplatformdatasets/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-mapsplatformdatasets/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-mapsplatformdatasets/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-mapsplatformdatasets/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-mapsplatformdatasets/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-mapsplatformdatasets/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-maps-mapsplatformdatasets/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.maps/google-maps-mapsplatformdatasets.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.maps%20AND%20a:google-maps-mapsplatformdatasets&core=gav +[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-sdk]: https://cloud.google.com/sdk/ +[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting +[contributing]: https://github.com/googleapis/java-maps-mapsplatformdatasets/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-maps-mapsplatformdatasets/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-maps-mapsplatformdatasets/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=maps-mapsplatformdatasets.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-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets-bom/pom.xml b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets-bom/pom.xml new file mode 100644 index 000000000000..b15cf9b6f3e4 --- /dev/null +++ b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets-bom/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + com.google.maps + google-maps-mapsplatformdatasets-bom + 0.0.1-SNAPSHOT + pom + + + com.google.cloud + google-cloud-pom-parent + 1.6.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Maps Platform Datasets API BOM + + BOM for Maps Platform Datasets API + + + + true + + + + + + com.google.maps + google-maps-mapsplatformdatasets + 0.0.1-SNAPSHOT + + + com.google.maps.api.grpc + grpc-google-maps-mapsplatformdatasets-v1alpha + 0.0.1-SNAPSHOT + + + com.google.maps.api.grpc + proto-google-maps-mapsplatformdatasets-v1alpha + 0.0.1-SNAPSHOT + + + + diff --git a/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/pom.xml b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/pom.xml new file mode 100644 index 000000000000..86fce47f50a6 --- /dev/null +++ b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/pom.xml @@ -0,0 +1,114 @@ + + + 4.0.0 + com.google.maps + google-maps-mapsplatformdatasets + 0.0.1-SNAPSHOT + jar + Google Maps Platform Datasets API + Maps Platform Datasets API The Maps Platform Datasets API enables developers to ingest geospatially-tied datasets + that they can use to enrich their experience of Maps Platform solutions (e.g. styling, routing). + + com.google.maps + google-maps-mapsplatformdatasets-parent + 0.0.1-SNAPSHOT + + + google-maps-mapsplatformdatasets + + + + 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.maps.api.grpc + proto-google-maps-mapsplatformdatasets-v1alpha + + + 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.maps.api.grpc + grpc-google-maps-mapsplatformdatasets-v1alpha + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + \ No newline at end of file diff --git a/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaClient.java b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaClient.java new file mode 100644 index 000000000000..3151bb5625eb --- /dev/null +++ b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaClient.java @@ -0,0 +1,1289 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.maps.mapsplatformdatasets.v1alpha.stub.MapsPlatformDatasetsV1AlphaStub; +import com.google.maps.mapsplatformdatasets.v1alpha.stub.MapsPlatformDatasetsV1AlphaStubSettings; +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 definition for the Maps Platform Datasets API. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+ *     MapsPlatformDatasetsV1AlphaClient.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   Dataset dataset = Dataset.newBuilder().build();
+ *   Dataset response = mapsPlatformDatasetsV1AlphaClient.createDataset(parent, dataset);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the MapsPlatformDatasetsV1AlphaClient 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 + * MapsPlatformDatasetsV1AlphaSettings 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
+ * MapsPlatformDatasetsV1AlphaSettings mapsPlatformDatasetsV1AlphaSettings =
+ *     MapsPlatformDatasetsV1AlphaSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+ *     MapsPlatformDatasetsV1AlphaClient.create(mapsPlatformDatasetsV1AlphaSettings);
+ * }
+ * + *

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
+ * MapsPlatformDatasetsV1AlphaSettings mapsPlatformDatasetsV1AlphaSettings =
+ *     MapsPlatformDatasetsV1AlphaSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+ *     MapsPlatformDatasetsV1AlphaClient.create(mapsPlatformDatasetsV1AlphaSettings);
+ * }
+ * + *

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
+ * MapsPlatformDatasetsV1AlphaSettings mapsPlatformDatasetsV1AlphaSettings =
+ *     MapsPlatformDatasetsV1AlphaSettings.newHttpJsonBuilder().build();
+ * MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+ *     MapsPlatformDatasetsV1AlphaClient.create(mapsPlatformDatasetsV1AlphaSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class MapsPlatformDatasetsV1AlphaClient implements BackgroundResource { + private final MapsPlatformDatasetsV1AlphaSettings settings; + private final MapsPlatformDatasetsV1AlphaStub stub; + + /** Constructs an instance of MapsPlatformDatasetsV1AlphaClient with default settings. */ + public static final MapsPlatformDatasetsV1AlphaClient create() throws IOException { + return create(MapsPlatformDatasetsV1AlphaSettings.newBuilder().build()); + } + + /** + * Constructs an instance of MapsPlatformDatasetsV1AlphaClient, 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 MapsPlatformDatasetsV1AlphaClient create( + MapsPlatformDatasetsV1AlphaSettings settings) throws IOException { + return new MapsPlatformDatasetsV1AlphaClient(settings); + } + + /** + * Constructs an instance of MapsPlatformDatasetsV1AlphaClient, using the given stub for making + * calls. This is for advanced usage - prefer using create(MapsPlatformDatasetsV1AlphaSettings). + */ + public static final MapsPlatformDatasetsV1AlphaClient create( + MapsPlatformDatasetsV1AlphaStub stub) { + return new MapsPlatformDatasetsV1AlphaClient(stub); + } + + /** + * Constructs an instance of MapsPlatformDatasetsV1AlphaClient, 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 MapsPlatformDatasetsV1AlphaClient(MapsPlatformDatasetsV1AlphaSettings settings) + throws IOException { + this.settings = settings; + this.stub = ((MapsPlatformDatasetsV1AlphaStubSettings) settings.getStubSettings()).createStub(); + } + + protected MapsPlatformDatasetsV1AlphaClient(MapsPlatformDatasetsV1AlphaStub stub) { + this.settings = null; + this.stub = stub; + } + + public final MapsPlatformDatasetsV1AlphaSettings getSettings() { + return settings; + } + + public MapsPlatformDatasetsV1AlphaStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a new dataset for the specified project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   Dataset response = mapsPlatformDatasetsV1AlphaClient.createDataset(parent, dataset);
+   * }
+   * }
+ * + * @param parent Required. Parent project that will own the dataset. Format: + * projects/{$project_number} + * @param dataset Required. The dataset version to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dataset createDataset(ProjectName parent, Dataset dataset) { + CreateDatasetRequest request = + CreateDatasetRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDataset(dataset) + .build(); + return createDataset(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a new dataset for the specified project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   Dataset response = mapsPlatformDatasetsV1AlphaClient.createDataset(parent, dataset);
+   * }
+   * }
+ * + * @param parent Required. Parent project that will own the dataset. Format: + * projects/{$project_number} + * @param dataset Required. The dataset version to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dataset createDataset(String parent, Dataset dataset) { + CreateDatasetRequest request = + CreateDatasetRequest.newBuilder().setParent(parent).setDataset(dataset).build(); + return createDataset(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a new dataset for the specified project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   CreateDatasetRequest request =
+   *       CreateDatasetRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setDataset(Dataset.newBuilder().build())
+   *           .build();
+   *   Dataset response = mapsPlatformDatasetsV1AlphaClient.createDataset(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 Dataset createDataset(CreateDatasetRequest request) { + return createDatasetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a new dataset for the specified project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   CreateDatasetRequest request =
+   *       CreateDatasetRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setDataset(Dataset.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       mapsPlatformDatasetsV1AlphaClient.createDatasetCallable().futureCall(request);
+   *   // Do something.
+   *   Dataset response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createDatasetCallable() { + return stub.createDatasetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update the metadata for the dataset. To update the data use: UploadDataset. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Dataset response =
+   *       mapsPlatformDatasetsV1AlphaClient.updateDatasetMetadata(dataset, updateMask);
+   * }
+   * }
+ * + * @param dataset Required. The dataset to update. The dataset's name is used to identify the + * dataset to be updated. The name has the format: projects/{project}/datasets/{dataset_id} + * @param updateMask The list of fields to be updated. Support the value "*" for full + * replacement. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dataset updateDatasetMetadata(Dataset dataset, FieldMask updateMask) { + UpdateDatasetMetadataRequest request = + UpdateDatasetMetadataRequest.newBuilder() + .setDataset(dataset) + .setUpdateMask(updateMask) + .build(); + return updateDatasetMetadata(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update the metadata for the dataset. To update the data use: UploadDataset. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   UpdateDatasetMetadataRequest request =
+   *       UpdateDatasetMetadataRequest.newBuilder()
+   *           .setDataset(Dataset.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Dataset response = mapsPlatformDatasetsV1AlphaClient.updateDatasetMetadata(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 Dataset updateDatasetMetadata(UpdateDatasetMetadataRequest request) { + return updateDatasetMetadataCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update the metadata for the dataset. To update the data use: UploadDataset. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   UpdateDatasetMetadataRequest request =
+   *       UpdateDatasetMetadataRequest.newBuilder()
+   *           .setDataset(Dataset.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       mapsPlatformDatasetsV1AlphaClient.updateDatasetMetadataCallable().futureCall(request);
+   *   // Do something.
+   *   Dataset response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateDatasetMetadataCallable() { + return stub.updateDatasetMetadataCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get the published or latest version of the dataset. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
+   *   Dataset response = mapsPlatformDatasetsV1AlphaClient.getDataset(name);
+   * }
+   * }
+ * + * @param name Required. Resource name. Can also fetch a specified version + * projects/{project}/datasets/{dataset_id} + * projects/{project}/datasets/{dataset_id}{@literal @}{version-id} + *

In order to retrieve a previous version of the dataset, also provide the version ID. + * Example: projects/123/datasets/assisted-driving-preferences{@literal @}c7cfa2a8 + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dataset getDataset(DatasetName name) { + GetDatasetRequest request = + GetDatasetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getDataset(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get the published or latest version of the dataset. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
+   *   Dataset response = mapsPlatformDatasetsV1AlphaClient.getDataset(name);
+   * }
+   * }
+ * + * @param name Required. Resource name. Can also fetch a specified version + * projects/{project}/datasets/{dataset_id} + * projects/{project}/datasets/{dataset_id}{@literal @}{version-id} + *

In order to retrieve a previous version of the dataset, also provide the version ID. + * Example: projects/123/datasets/assisted-driving-preferences{@literal @}c7cfa2a8 + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Dataset getDataset(String name) { + GetDatasetRequest request = GetDatasetRequest.newBuilder().setName(name).build(); + return getDataset(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get the published or latest version of the dataset. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   GetDatasetRequest request =
+   *       GetDatasetRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setPublishedUsage(Usage.forNumber(0))
+   *           .build();
+   *   Dataset response = mapsPlatformDatasetsV1AlphaClient.getDataset(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 Dataset getDataset(GetDatasetRequest request) { + return getDatasetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get the published or latest version of the dataset. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   GetDatasetRequest request =
+   *       GetDatasetRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setPublishedUsage(Usage.forNumber(0))
+   *           .build();
+   *   ApiFuture future =
+   *       mapsPlatformDatasetsV1AlphaClient.getDatasetCallable().futureCall(request);
+   *   // Do something.
+   *   Dataset response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getDatasetCallable() { + return stub.getDatasetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all the versions of a dataset. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
+   *   for (Dataset element :
+   *       mapsPlatformDatasetsV1AlphaClient.listDatasetVersions(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param name Required. The name of the dataset to list all the versions for. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDatasetVersionsPagedResponse listDatasetVersions(DatasetName name) { + ListDatasetVersionsRequest request = + ListDatasetVersionsRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return listDatasetVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all the versions of a dataset. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
+   *   for (Dataset element :
+   *       mapsPlatformDatasetsV1AlphaClient.listDatasetVersions(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param name Required. The name of the dataset to list all the versions for. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDatasetVersionsPagedResponse listDatasetVersions(String name) { + ListDatasetVersionsRequest request = + ListDatasetVersionsRequest.newBuilder().setName(name).build(); + return listDatasetVersions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all the versions of a dataset. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   ListDatasetVersionsRequest request =
+   *       ListDatasetVersionsRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Dataset element :
+   *       mapsPlatformDatasetsV1AlphaClient.listDatasetVersions(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 ListDatasetVersionsPagedResponse listDatasetVersions( + ListDatasetVersionsRequest request) { + return listDatasetVersionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all the versions of a dataset. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   ListDatasetVersionsRequest request =
+   *       ListDatasetVersionsRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       mapsPlatformDatasetsV1AlphaClient.listDatasetVersionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Dataset element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listDatasetVersionsPagedCallable() { + return stub.listDatasetVersionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all the versions of a dataset. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   ListDatasetVersionsRequest request =
+   *       ListDatasetVersionsRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListDatasetVersionsResponse response =
+   *         mapsPlatformDatasetsV1AlphaClient.listDatasetVersionsCallable().call(request);
+   *     for (Dataset element : response.getDatasetsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listDatasetVersionsCallable() { + return stub.listDatasetVersionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all the datasets for the specified project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (Dataset element : mapsPlatformDatasetsV1AlphaClient.listDatasets(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the project to list all the datasets for. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDatasetsPagedResponse listDatasets(ProjectName parent) { + ListDatasetsRequest request = + ListDatasetsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listDatasets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all the datasets for the specified project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   for (Dataset element : mapsPlatformDatasetsV1AlphaClient.listDatasets(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the project to list all the datasets for. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDatasetsPagedResponse listDatasets(String parent) { + ListDatasetsRequest request = ListDatasetsRequest.newBuilder().setParent(parent).build(); + return listDatasets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all the datasets for the specified project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   ListDatasetsRequest request =
+   *       ListDatasetsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Dataset element : mapsPlatformDatasetsV1AlphaClient.listDatasets(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 ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request) { + return listDatasetsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all the datasets for the specified project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   ListDatasetsRequest request =
+   *       ListDatasetsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       mapsPlatformDatasetsV1AlphaClient.listDatasetsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Dataset element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listDatasetsPagedCallable() { + return stub.listDatasetsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List all the datasets for the specified project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   ListDatasetsRequest request =
+   *       ListDatasetsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListDatasetsResponse response =
+   *         mapsPlatformDatasetsV1AlphaClient.listDatasetsCallable().call(request);
+   *     for (Dataset element : response.getDatasetsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listDatasetsCallable() { + return stub.listDatasetsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete the specified dataset and optionally all its corresponding versions. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
+   *   mapsPlatformDatasetsV1AlphaClient.deleteDataset(name);
+   * }
+   * }
+ * + * @param name Required. Format: projects/${project}/datasets/{dataset_id} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDataset(DatasetName name) { + DeleteDatasetRequest request = + DeleteDatasetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteDataset(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete the specified dataset and optionally all its corresponding versions. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
+   *   mapsPlatformDatasetsV1AlphaClient.deleteDataset(name);
+   * }
+   * }
+ * + * @param name Required. Format: projects/${project}/datasets/{dataset_id} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDataset(String name) { + DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder().setName(name).build(); + deleteDataset(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete the specified dataset and optionally all its corresponding versions. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   DeleteDatasetRequest request =
+   *       DeleteDatasetRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setForce(true)
+   *           .build();
+   *   mapsPlatformDatasetsV1AlphaClient.deleteDataset(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 deleteDataset(DeleteDatasetRequest request) { + deleteDatasetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete the specified dataset and optionally all its corresponding versions. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   DeleteDatasetRequest request =
+   *       DeleteDatasetRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setForce(true)
+   *           .build();
+   *   ApiFuture future =
+   *       mapsPlatformDatasetsV1AlphaClient.deleteDatasetCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteDatasetCallable() { + return stub.deleteDatasetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a specific version of the dataset. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
+   *   mapsPlatformDatasetsV1AlphaClient.deleteDatasetVersion(name);
+   * }
+   * }
+ * + * @param name Required. Format: projects/${project}/datasets/{dataset_id}{@literal @}{version-id} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDatasetVersion(DatasetName name) { + DeleteDatasetVersionRequest request = + DeleteDatasetVersionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteDatasetVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a specific version of the dataset. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
+   *   mapsPlatformDatasetsV1AlphaClient.deleteDatasetVersion(name);
+   * }
+   * }
+ * + * @param name Required. Format: projects/${project}/datasets/{dataset_id}{@literal @}{version-id} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDatasetVersion(String name) { + DeleteDatasetVersionRequest request = + DeleteDatasetVersionRequest.newBuilder().setName(name).build(); + deleteDatasetVersion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a specific version of the dataset. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   DeleteDatasetVersionRequest request =
+   *       DeleteDatasetVersionRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .build();
+   *   mapsPlatformDatasetsV1AlphaClient.deleteDatasetVersion(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 deleteDatasetVersion(DeleteDatasetVersionRequest request) { + deleteDatasetVersionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a specific version of the dataset. + * + *

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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+   *     MapsPlatformDatasetsV1AlphaClient.create()) {
+   *   DeleteDatasetVersionRequest request =
+   *       DeleteDatasetVersionRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       mapsPlatformDatasetsV1AlphaClient.deleteDatasetVersionCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteDatasetVersionCallable() { + return stub.deleteDatasetVersionCallable(); + } + + @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 ListDatasetVersionsPagedResponse + extends AbstractPagedListResponse< + ListDatasetVersionsRequest, + ListDatasetVersionsResponse, + Dataset, + ListDatasetVersionsPage, + ListDatasetVersionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDatasetVersionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListDatasetVersionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListDatasetVersionsPagedResponse(ListDatasetVersionsPage page) { + super(page, ListDatasetVersionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListDatasetVersionsPage + extends AbstractPage< + ListDatasetVersionsRequest, + ListDatasetVersionsResponse, + Dataset, + ListDatasetVersionsPage> { + + private ListDatasetVersionsPage( + PageContext context, + ListDatasetVersionsResponse response) { + super(context, response); + } + + private static ListDatasetVersionsPage createEmptyPage() { + return new ListDatasetVersionsPage(null, null); + } + + @Override + protected ListDatasetVersionsPage createPage( + PageContext context, + ListDatasetVersionsResponse response) { + return new ListDatasetVersionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListDatasetVersionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListDatasetVersionsRequest, + ListDatasetVersionsResponse, + Dataset, + ListDatasetVersionsPage, + ListDatasetVersionsFixedSizeCollection> { + + private ListDatasetVersionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListDatasetVersionsFixedSizeCollection createEmptyCollection() { + return new ListDatasetVersionsFixedSizeCollection(null, 0); + } + + @Override + protected ListDatasetVersionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListDatasetVersionsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListDatasetsPagedResponse + extends AbstractPagedListResponse< + ListDatasetsRequest, + ListDatasetsResponse, + Dataset, + ListDatasetsPage, + ListDatasetsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDatasetsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListDatasetsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListDatasetsPagedResponse(ListDatasetsPage page) { + super(page, ListDatasetsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListDatasetsPage + extends AbstractPage { + + private ListDatasetsPage( + PageContext context, + ListDatasetsResponse response) { + super(context, response); + } + + private static ListDatasetsPage createEmptyPage() { + return new ListDatasetsPage(null, null); + } + + @Override + protected ListDatasetsPage createPage( + PageContext context, + ListDatasetsResponse response) { + return new ListDatasetsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListDatasetsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListDatasetsRequest, + ListDatasetsResponse, + Dataset, + ListDatasetsPage, + ListDatasetsFixedSizeCollection> { + + private ListDatasetsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListDatasetsFixedSizeCollection createEmptyCollection() { + return new ListDatasetsFixedSizeCollection(null, 0); + } + + @Override + protected ListDatasetsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListDatasetsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaSettings.java b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaSettings.java new file mode 100644 index 000000000000..1c3af381363e --- /dev/null +++ b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaSettings.java @@ -0,0 +1,289 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha; + +import static com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient.ListDatasetVersionsPagedResponse; +import static com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient.ListDatasetsPagedResponse; + +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.maps.mapsplatformdatasets.v1alpha.stub.MapsPlatformDatasetsV1AlphaStubSettings; +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 MapsPlatformDatasetsV1AlphaClient}. + * + *

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

    + *
  • The default service address (mapsplatformdatasets.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 createDataset 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
+ * MapsPlatformDatasetsV1AlphaSettings.Builder mapsPlatformDatasetsV1AlphaSettingsBuilder =
+ *     MapsPlatformDatasetsV1AlphaSettings.newBuilder();
+ * mapsPlatformDatasetsV1AlphaSettingsBuilder
+ *     .createDatasetSettings()
+ *     .setRetrySettings(
+ *         mapsPlatformDatasetsV1AlphaSettingsBuilder
+ *             .createDatasetSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * MapsPlatformDatasetsV1AlphaSettings mapsPlatformDatasetsV1AlphaSettings =
+ *     mapsPlatformDatasetsV1AlphaSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class MapsPlatformDatasetsV1AlphaSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to createDataset. */ + public UnaryCallSettings createDatasetSettings() { + return ((MapsPlatformDatasetsV1AlphaStubSettings) getStubSettings()).createDatasetSettings(); + } + + /** Returns the object with the settings used for calls to updateDatasetMetadata. */ + public UnaryCallSettings updateDatasetMetadataSettings() { + return ((MapsPlatformDatasetsV1AlphaStubSettings) getStubSettings()) + .updateDatasetMetadataSettings(); + } + + /** Returns the object with the settings used for calls to getDataset. */ + public UnaryCallSettings getDatasetSettings() { + return ((MapsPlatformDatasetsV1AlphaStubSettings) getStubSettings()).getDatasetSettings(); + } + + /** Returns the object with the settings used for calls to listDatasetVersions. */ + public PagedCallSettings< + ListDatasetVersionsRequest, ListDatasetVersionsResponse, ListDatasetVersionsPagedResponse> + listDatasetVersionsSettings() { + return ((MapsPlatformDatasetsV1AlphaStubSettings) getStubSettings()) + .listDatasetVersionsSettings(); + } + + /** Returns the object with the settings used for calls to listDatasets. */ + public PagedCallSettings + listDatasetsSettings() { + return ((MapsPlatformDatasetsV1AlphaStubSettings) getStubSettings()).listDatasetsSettings(); + } + + /** Returns the object with the settings used for calls to deleteDataset. */ + public UnaryCallSettings deleteDatasetSettings() { + return ((MapsPlatformDatasetsV1AlphaStubSettings) getStubSettings()).deleteDatasetSettings(); + } + + /** Returns the object with the settings used for calls to deleteDatasetVersion. */ + public UnaryCallSettings deleteDatasetVersionSettings() { + return ((MapsPlatformDatasetsV1AlphaStubSettings) getStubSettings()) + .deleteDatasetVersionSettings(); + } + + public static final MapsPlatformDatasetsV1AlphaSettings create( + MapsPlatformDatasetsV1AlphaStubSettings stub) throws IOException { + return new MapsPlatformDatasetsV1AlphaSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return MapsPlatformDatasetsV1AlphaStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return MapsPlatformDatasetsV1AlphaStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return MapsPlatformDatasetsV1AlphaStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return MapsPlatformDatasetsV1AlphaStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return MapsPlatformDatasetsV1AlphaStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return MapsPlatformDatasetsV1AlphaStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return MapsPlatformDatasetsV1AlphaStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MapsPlatformDatasetsV1AlphaStubSettings.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 MapsPlatformDatasetsV1AlphaSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for MapsPlatformDatasetsV1AlphaSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(MapsPlatformDatasetsV1AlphaStubSettings.newBuilder(clientContext)); + } + + protected Builder(MapsPlatformDatasetsV1AlphaSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(MapsPlatformDatasetsV1AlphaStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(MapsPlatformDatasetsV1AlphaStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(MapsPlatformDatasetsV1AlphaStubSettings.newHttpJsonBuilder()); + } + + public MapsPlatformDatasetsV1AlphaStubSettings.Builder getStubSettingsBuilder() { + return ((MapsPlatformDatasetsV1AlphaStubSettings.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 createDataset. */ + public UnaryCallSettings.Builder createDatasetSettings() { + return getStubSettingsBuilder().createDatasetSettings(); + } + + /** Returns the builder for the settings used for calls to updateDatasetMetadata. */ + public UnaryCallSettings.Builder + updateDatasetMetadataSettings() { + return getStubSettingsBuilder().updateDatasetMetadataSettings(); + } + + /** Returns the builder for the settings used for calls to getDataset. */ + public UnaryCallSettings.Builder getDatasetSettings() { + return getStubSettingsBuilder().getDatasetSettings(); + } + + /** Returns the builder for the settings used for calls to listDatasetVersions. */ + public PagedCallSettings.Builder< + ListDatasetVersionsRequest, + ListDatasetVersionsResponse, + ListDatasetVersionsPagedResponse> + listDatasetVersionsSettings() { + return getStubSettingsBuilder().listDatasetVersionsSettings(); + } + + /** Returns the builder for the settings used for calls to listDatasets. */ + public PagedCallSettings.Builder< + ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> + listDatasetsSettings() { + return getStubSettingsBuilder().listDatasetsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteDataset. */ + public UnaryCallSettings.Builder deleteDatasetSettings() { + return getStubSettingsBuilder().deleteDatasetSettings(); + } + + /** Returns the builder for the settings used for calls to deleteDatasetVersion. */ + public UnaryCallSettings.Builder + deleteDatasetVersionSettings() { + return getStubSettingsBuilder().deleteDatasetVersionSettings(); + } + + @Override + public MapsPlatformDatasetsV1AlphaSettings build() throws IOException { + return new MapsPlatformDatasetsV1AlphaSettings(this); + } + } +} diff --git a/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/gapic_metadata.json b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/gapic_metadata.json new file mode 100644 index 000000000000..53a0b52b979e --- /dev/null +++ b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/gapic_metadata.json @@ -0,0 +1,39 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.maps.mapsplatformdatasets.v1alpha", + "libraryPackage": "com.google.maps.mapsplatformdatasets.v1alpha", + "services": { + "MapsPlatformDatasetsV1Alpha": { + "clients": { + "grpc": { + "libraryClient": "MapsPlatformDatasetsV1AlphaClient", + "rpcs": { + "CreateDataset": { + "methods": ["createDataset", "createDataset", "createDataset", "createDatasetCallable"] + }, + "DeleteDataset": { + "methods": ["deleteDataset", "deleteDataset", "deleteDataset", "deleteDatasetCallable"] + }, + "DeleteDatasetVersion": { + "methods": ["deleteDatasetVersion", "deleteDatasetVersion", "deleteDatasetVersion", "deleteDatasetVersionCallable"] + }, + "GetDataset": { + "methods": ["getDataset", "getDataset", "getDataset", "getDatasetCallable"] + }, + "ListDatasetVersions": { + "methods": ["listDatasetVersions", "listDatasetVersions", "listDatasetVersions", "listDatasetVersionsPagedCallable", "listDatasetVersionsCallable"] + }, + "ListDatasets": { + "methods": ["listDatasets", "listDatasets", "listDatasets", "listDatasetsPagedCallable", "listDatasetsCallable"] + }, + "UpdateDatasetMetadata": { + "methods": ["updateDatasetMetadata", "updateDatasetMetadata", "updateDatasetMetadataCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/package-info.java b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/package-info.java new file mode 100644 index 000000000000..d03b280b3be3 --- /dev/null +++ b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/package-info.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. + */ + +/** + * A client to Maps Platform Datasets API + * + *

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

======================= MapsPlatformDatasetsV1AlphaClient ======================= + * + *

Service Description: Service definition for the Maps Platform Datasets API. + * + *

Sample for MapsPlatformDatasetsV1AlphaClient: + * + *

{@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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient =
+ *     MapsPlatformDatasetsV1AlphaClient.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   Dataset dataset = Dataset.newBuilder().build();
+ *   Dataset response = mapsPlatformDatasetsV1AlphaClient.createDataset(parent, dataset);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.maps.mapsplatformdatasets.v1alpha; + +import javax.annotation.Generated; diff --git a/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/GrpcMapsPlatformDatasetsV1AlphaCallableFactory.java b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/GrpcMapsPlatformDatasetsV1AlphaCallableFactory.java new file mode 100644 index 000000000000..89317c1e39bf --- /dev/null +++ b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/GrpcMapsPlatformDatasetsV1AlphaCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the MapsPlatformDatasetsV1Alpha service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcMapsPlatformDatasetsV1AlphaCallableFactory 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-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/GrpcMapsPlatformDatasetsV1AlphaStub.java b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/GrpcMapsPlatformDatasetsV1AlphaStub.java new file mode 100644 index 000000000000..d26ab3a6f1cb --- /dev/null +++ b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/GrpcMapsPlatformDatasetsV1AlphaStub.java @@ -0,0 +1,389 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha.stub; + +import static com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient.ListDatasetVersionsPagedResponse; +import static com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient.ListDatasetsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse; +import com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest; +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 MapsPlatformDatasetsV1Alpha service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcMapsPlatformDatasetsV1AlphaStub extends MapsPlatformDatasetsV1AlphaStub { + private static final MethodDescriptor + createDatasetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha/CreateDataset") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateDatasetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Dataset.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateDatasetMetadataMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha/UpdateDatasetMetadata") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateDatasetMetadataRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Dataset.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getDatasetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha/GetDataset") + .setRequestMarshaller(ProtoUtils.marshaller(GetDatasetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Dataset.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listDatasetVersionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha/ListDatasetVersions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListDatasetVersionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListDatasetVersionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listDatasetsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha/ListDatasets") + .setRequestMarshaller(ProtoUtils.marshaller(ListDatasetsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListDatasetsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteDatasetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha/DeleteDataset") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteDatasetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteDatasetVersionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha/DeleteDatasetVersion") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteDatasetVersionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final UnaryCallable createDatasetCallable; + private final UnaryCallable updateDatasetMetadataCallable; + private final UnaryCallable getDatasetCallable; + private final UnaryCallable + listDatasetVersionsCallable; + private final UnaryCallable + listDatasetVersionsPagedCallable; + private final UnaryCallable listDatasetsCallable; + private final UnaryCallable + listDatasetsPagedCallable; + private final UnaryCallable deleteDatasetCallable; + private final UnaryCallable deleteDatasetVersionCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcMapsPlatformDatasetsV1AlphaStub create( + MapsPlatformDatasetsV1AlphaStubSettings settings) throws IOException { + return new GrpcMapsPlatformDatasetsV1AlphaStub(settings, ClientContext.create(settings)); + } + + public static final GrpcMapsPlatformDatasetsV1AlphaStub create(ClientContext clientContext) + throws IOException { + return new GrpcMapsPlatformDatasetsV1AlphaStub( + MapsPlatformDatasetsV1AlphaStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcMapsPlatformDatasetsV1AlphaStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcMapsPlatformDatasetsV1AlphaStub( + MapsPlatformDatasetsV1AlphaStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of GrpcMapsPlatformDatasetsV1AlphaStub, 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 GrpcMapsPlatformDatasetsV1AlphaStub( + MapsPlatformDatasetsV1AlphaStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcMapsPlatformDatasetsV1AlphaCallableFactory()); + } + + /** + * Constructs an instance of GrpcMapsPlatformDatasetsV1AlphaStub, 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 GrpcMapsPlatformDatasetsV1AlphaStub( + MapsPlatformDatasetsV1AlphaStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createDatasetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createDatasetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateDatasetMetadataTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateDatasetMetadataMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("dataset.name", String.valueOf(request.getDataset().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings getDatasetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDatasetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listDatasetVersionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listDatasetVersionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listDatasetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listDatasetsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteDatasetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteDatasetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteDatasetVersionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteDatasetVersionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + + this.createDatasetCallable = + callableFactory.createUnaryCallable( + createDatasetTransportSettings, settings.createDatasetSettings(), clientContext); + this.updateDatasetMetadataCallable = + callableFactory.createUnaryCallable( + updateDatasetMetadataTransportSettings, + settings.updateDatasetMetadataSettings(), + clientContext); + this.getDatasetCallable = + callableFactory.createUnaryCallable( + getDatasetTransportSettings, settings.getDatasetSettings(), clientContext); + this.listDatasetVersionsCallable = + callableFactory.createUnaryCallable( + listDatasetVersionsTransportSettings, + settings.listDatasetVersionsSettings(), + clientContext); + this.listDatasetVersionsPagedCallable = + callableFactory.createPagedCallable( + listDatasetVersionsTransportSettings, + settings.listDatasetVersionsSettings(), + clientContext); + this.listDatasetsCallable = + callableFactory.createUnaryCallable( + listDatasetsTransportSettings, settings.listDatasetsSettings(), clientContext); + this.listDatasetsPagedCallable = + callableFactory.createPagedCallable( + listDatasetsTransportSettings, settings.listDatasetsSettings(), clientContext); + this.deleteDatasetCallable = + callableFactory.createUnaryCallable( + deleteDatasetTransportSettings, settings.deleteDatasetSettings(), clientContext); + this.deleteDatasetVersionCallable = + callableFactory.createUnaryCallable( + deleteDatasetVersionTransportSettings, + settings.deleteDatasetVersionSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createDatasetCallable() { + return createDatasetCallable; + } + + @Override + public UnaryCallable updateDatasetMetadataCallable() { + return updateDatasetMetadataCallable; + } + + @Override + public UnaryCallable getDatasetCallable() { + return getDatasetCallable; + } + + @Override + public UnaryCallable + listDatasetVersionsCallable() { + return listDatasetVersionsCallable; + } + + @Override + public UnaryCallable + listDatasetVersionsPagedCallable() { + return listDatasetVersionsPagedCallable; + } + + @Override + public UnaryCallable listDatasetsCallable() { + return listDatasetsCallable; + } + + @Override + public UnaryCallable listDatasetsPagedCallable() { + return listDatasetsPagedCallable; + } + + @Override + public UnaryCallable deleteDatasetCallable() { + return deleteDatasetCallable; + } + + @Override + public UnaryCallable deleteDatasetVersionCallable() { + return deleteDatasetVersionCallable; + } + + @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-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/HttpJsonMapsPlatformDatasetsV1AlphaCallableFactory.java b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/HttpJsonMapsPlatformDatasetsV1AlphaCallableFactory.java new file mode 100644 index 000000000000..fedd6cbc7bc8 --- /dev/null +++ b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/HttpJsonMapsPlatformDatasetsV1AlphaCallableFactory.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.maps.mapsplatformdatasets.v1alpha.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 MapsPlatformDatasetsV1Alpha service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonMapsPlatformDatasetsV1AlphaCallableFactory + 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-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/HttpJsonMapsPlatformDatasetsV1AlphaStub.java b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/HttpJsonMapsPlatformDatasetsV1AlphaStub.java new file mode 100644 index 000000000000..6337dd14edf0 --- /dev/null +++ b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/HttpJsonMapsPlatformDatasetsV1AlphaStub.java @@ -0,0 +1,556 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha.stub; + +import static com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient.ListDatasetVersionsPagedResponse; +import static com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient.ListDatasetsPagedResponse; + +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.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse; +import com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest; +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 MapsPlatformDatasetsV1Alpha service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonMapsPlatformDatasetsV1AlphaStub extends MapsPlatformDatasetsV1AlphaStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createDatasetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha/CreateDataset") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*}/datasets", + 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, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("dataset", request.getDataset(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Dataset.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateDatasetMetadataMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha/UpdateDatasetMetadata") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{dataset.name=projects/*/datasets/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "dataset.name", request.getDataset().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("dataset", request.getDataset(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Dataset.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getDatasetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha/GetDataset") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/datasets/*}", + 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, "publishedUsage", request.getPublishedUsageValue()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Dataset.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listDatasetVersionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha/ListDatasetVersions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/datasets/*}:listVersions", + 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, "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(ListDatasetVersionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listDatasetsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha/ListDatasets") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=projects/*}/datasets", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListDatasetsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteDatasetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha/DeleteDataset") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/datasets/*}", + 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, "$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 + deleteDatasetVersionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha/DeleteDatasetVersion") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=projects/*/datasets/*}:deleteVersion", + 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(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createDatasetCallable; + private final UnaryCallable updateDatasetMetadataCallable; + private final UnaryCallable getDatasetCallable; + private final UnaryCallable + listDatasetVersionsCallable; + private final UnaryCallable + listDatasetVersionsPagedCallable; + private final UnaryCallable listDatasetsCallable; + private final UnaryCallable + listDatasetsPagedCallable; + private final UnaryCallable deleteDatasetCallable; + private final UnaryCallable deleteDatasetVersionCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonMapsPlatformDatasetsV1AlphaStub create( + MapsPlatformDatasetsV1AlphaStubSettings settings) throws IOException { + return new HttpJsonMapsPlatformDatasetsV1AlphaStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonMapsPlatformDatasetsV1AlphaStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonMapsPlatformDatasetsV1AlphaStub( + MapsPlatformDatasetsV1AlphaStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonMapsPlatformDatasetsV1AlphaStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonMapsPlatformDatasetsV1AlphaStub( + MapsPlatformDatasetsV1AlphaStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonMapsPlatformDatasetsV1AlphaStub, 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 HttpJsonMapsPlatformDatasetsV1AlphaStub( + MapsPlatformDatasetsV1AlphaStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonMapsPlatformDatasetsV1AlphaCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonMapsPlatformDatasetsV1AlphaStub, 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 HttpJsonMapsPlatformDatasetsV1AlphaStub( + MapsPlatformDatasetsV1AlphaStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createDatasetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createDatasetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + updateDatasetMetadataTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateDatasetMetadataMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getDatasetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getDatasetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listDatasetVersionsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listDatasetVersionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listDatasetsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listDatasetsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteDatasetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteDatasetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteDatasetVersionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteDatasetVersionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createDatasetCallable = + callableFactory.createUnaryCallable( + createDatasetTransportSettings, settings.createDatasetSettings(), clientContext); + this.updateDatasetMetadataCallable = + callableFactory.createUnaryCallable( + updateDatasetMetadataTransportSettings, + settings.updateDatasetMetadataSettings(), + clientContext); + this.getDatasetCallable = + callableFactory.createUnaryCallable( + getDatasetTransportSettings, settings.getDatasetSettings(), clientContext); + this.listDatasetVersionsCallable = + callableFactory.createUnaryCallable( + listDatasetVersionsTransportSettings, + settings.listDatasetVersionsSettings(), + clientContext); + this.listDatasetVersionsPagedCallable = + callableFactory.createPagedCallable( + listDatasetVersionsTransportSettings, + settings.listDatasetVersionsSettings(), + clientContext); + this.listDatasetsCallable = + callableFactory.createUnaryCallable( + listDatasetsTransportSettings, settings.listDatasetsSettings(), clientContext); + this.listDatasetsPagedCallable = + callableFactory.createPagedCallable( + listDatasetsTransportSettings, settings.listDatasetsSettings(), clientContext); + this.deleteDatasetCallable = + callableFactory.createUnaryCallable( + deleteDatasetTransportSettings, settings.deleteDatasetSettings(), clientContext); + this.deleteDatasetVersionCallable = + callableFactory.createUnaryCallable( + deleteDatasetVersionTransportSettings, + settings.deleteDatasetVersionSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createDatasetMethodDescriptor); + methodDescriptors.add(updateDatasetMetadataMethodDescriptor); + methodDescriptors.add(getDatasetMethodDescriptor); + methodDescriptors.add(listDatasetVersionsMethodDescriptor); + methodDescriptors.add(listDatasetsMethodDescriptor); + methodDescriptors.add(deleteDatasetMethodDescriptor); + methodDescriptors.add(deleteDatasetVersionMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createDatasetCallable() { + return createDatasetCallable; + } + + @Override + public UnaryCallable updateDatasetMetadataCallable() { + return updateDatasetMetadataCallable; + } + + @Override + public UnaryCallable getDatasetCallable() { + return getDatasetCallable; + } + + @Override + public UnaryCallable + listDatasetVersionsCallable() { + return listDatasetVersionsCallable; + } + + @Override + public UnaryCallable + listDatasetVersionsPagedCallable() { + return listDatasetVersionsPagedCallable; + } + + @Override + public UnaryCallable listDatasetsCallable() { + return listDatasetsCallable; + } + + @Override + public UnaryCallable listDatasetsPagedCallable() { + return listDatasetsPagedCallable; + } + + @Override + public UnaryCallable deleteDatasetCallable() { + return deleteDatasetCallable; + } + + @Override + public UnaryCallable deleteDatasetVersionCallable() { + return deleteDatasetVersionCallable; + } + + @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-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/MapsPlatformDatasetsV1AlphaStub.java b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/MapsPlatformDatasetsV1AlphaStub.java new file mode 100644 index 000000000000..be53e67042fb --- /dev/null +++ b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/MapsPlatformDatasetsV1AlphaStub.java @@ -0,0 +1,88 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha.stub; + +import static com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient.ListDatasetVersionsPagedResponse; +import static com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient.ListDatasetsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse; +import com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the MapsPlatformDatasetsV1Alpha service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class MapsPlatformDatasetsV1AlphaStub implements BackgroundResource { + + public UnaryCallable createDatasetCallable() { + throw new UnsupportedOperationException("Not implemented: createDatasetCallable()"); + } + + public UnaryCallable updateDatasetMetadataCallable() { + throw new UnsupportedOperationException("Not implemented: updateDatasetMetadataCallable()"); + } + + public UnaryCallable getDatasetCallable() { + throw new UnsupportedOperationException("Not implemented: getDatasetCallable()"); + } + + public UnaryCallable + listDatasetVersionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listDatasetVersionsPagedCallable()"); + } + + public UnaryCallable + listDatasetVersionsCallable() { + throw new UnsupportedOperationException("Not implemented: listDatasetVersionsCallable()"); + } + + public UnaryCallable listDatasetsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listDatasetsPagedCallable()"); + } + + public UnaryCallable listDatasetsCallable() { + throw new UnsupportedOperationException("Not implemented: listDatasetsCallable()"); + } + + public UnaryCallable deleteDatasetCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDatasetCallable()"); + } + + public UnaryCallable deleteDatasetVersionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDatasetVersionCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/MapsPlatformDatasetsV1AlphaStubSettings.java b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/MapsPlatformDatasetsV1AlphaStubSettings.java new file mode 100644 index 000000000000..01c0dcce1e4a --- /dev/null +++ b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/stub/MapsPlatformDatasetsV1AlphaStubSettings.java @@ -0,0 +1,635 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha.stub; + +import static com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient.ListDatasetVersionsPagedResponse; +import static com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient.ListDatasetsPagedResponse; + +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.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse; +import com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest; +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 MapsPlatformDatasetsV1AlphaStub}. + * + *

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

    + *
  • The default service address (mapsplatformdatasets.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 createDataset 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
+ * MapsPlatformDatasetsV1AlphaStubSettings.Builder mapsPlatformDatasetsV1AlphaSettingsBuilder =
+ *     MapsPlatformDatasetsV1AlphaStubSettings.newBuilder();
+ * mapsPlatformDatasetsV1AlphaSettingsBuilder
+ *     .createDatasetSettings()
+ *     .setRetrySettings(
+ *         mapsPlatformDatasetsV1AlphaSettingsBuilder
+ *             .createDatasetSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * MapsPlatformDatasetsV1AlphaStubSettings mapsPlatformDatasetsV1AlphaSettings =
+ *     mapsPlatformDatasetsV1AlphaSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class MapsPlatformDatasetsV1AlphaStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createDatasetSettings; + private final UnaryCallSettings + updateDatasetMetadataSettings; + private final UnaryCallSettings getDatasetSettings; + private final PagedCallSettings< + ListDatasetVersionsRequest, ListDatasetVersionsResponse, ListDatasetVersionsPagedResponse> + listDatasetVersionsSettings; + private final PagedCallSettings< + ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> + listDatasetsSettings; + private final UnaryCallSettings deleteDatasetSettings; + private final UnaryCallSettings deleteDatasetVersionSettings; + + private static final PagedListDescriptor< + ListDatasetVersionsRequest, ListDatasetVersionsResponse, Dataset> + LIST_DATASET_VERSIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListDatasetVersionsRequest, ListDatasetVersionsResponse, Dataset>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListDatasetVersionsRequest injectToken( + ListDatasetVersionsRequest payload, String token) { + return ListDatasetVersionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListDatasetVersionsRequest injectPageSize( + ListDatasetVersionsRequest payload, int pageSize) { + return ListDatasetVersionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListDatasetVersionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListDatasetVersionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListDatasetVersionsResponse payload) { + return payload.getDatasetsList() == null + ? ImmutableList.of() + : payload.getDatasetsList(); + } + }; + + private static final PagedListDescriptor + LIST_DATASETS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListDatasetsRequest injectToken(ListDatasetsRequest payload, String token) { + return ListDatasetsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListDatasetsRequest injectPageSize(ListDatasetsRequest payload, int pageSize) { + return ListDatasetsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListDatasetsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListDatasetsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListDatasetsResponse payload) { + return payload.getDatasetsList() == null + ? ImmutableList.of() + : payload.getDatasetsList(); + } + }; + + private static final PagedListResponseFactory< + ListDatasetVersionsRequest, ListDatasetVersionsResponse, ListDatasetVersionsPagedResponse> + LIST_DATASET_VERSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListDatasetVersionsRequest, + ListDatasetVersionsResponse, + ListDatasetVersionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListDatasetVersionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_DATASET_VERSIONS_PAGE_STR_DESC, request, context); + return ListDatasetVersionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> + LIST_DATASETS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListDatasetsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_DATASETS_PAGE_STR_DESC, request, context); + return ListDatasetsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createDataset. */ + public UnaryCallSettings createDatasetSettings() { + return createDatasetSettings; + } + + /** Returns the object with the settings used for calls to updateDatasetMetadata. */ + public UnaryCallSettings updateDatasetMetadataSettings() { + return updateDatasetMetadataSettings; + } + + /** Returns the object with the settings used for calls to getDataset. */ + public UnaryCallSettings getDatasetSettings() { + return getDatasetSettings; + } + + /** Returns the object with the settings used for calls to listDatasetVersions. */ + public PagedCallSettings< + ListDatasetVersionsRequest, ListDatasetVersionsResponse, ListDatasetVersionsPagedResponse> + listDatasetVersionsSettings() { + return listDatasetVersionsSettings; + } + + /** Returns the object with the settings used for calls to listDatasets. */ + public PagedCallSettings + listDatasetsSettings() { + return listDatasetsSettings; + } + + /** Returns the object with the settings used for calls to deleteDataset. */ + public UnaryCallSettings deleteDatasetSettings() { + return deleteDatasetSettings; + } + + /** Returns the object with the settings used for calls to deleteDatasetVersion. */ + public UnaryCallSettings deleteDatasetVersionSettings() { + return deleteDatasetVersionSettings; + } + + public MapsPlatformDatasetsV1AlphaStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcMapsPlatformDatasetsV1AlphaStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonMapsPlatformDatasetsV1AlphaStub.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 "mapsplatformdatasets.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "mapsplatformdatasets.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(MapsPlatformDatasetsV1AlphaStubSettings.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(MapsPlatformDatasetsV1AlphaStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MapsPlatformDatasetsV1AlphaStubSettings.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 MapsPlatformDatasetsV1AlphaStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createDatasetSettings = settingsBuilder.createDatasetSettings().build(); + updateDatasetMetadataSettings = settingsBuilder.updateDatasetMetadataSettings().build(); + getDatasetSettings = settingsBuilder.getDatasetSettings().build(); + listDatasetVersionsSettings = settingsBuilder.listDatasetVersionsSettings().build(); + listDatasetsSettings = settingsBuilder.listDatasetsSettings().build(); + deleteDatasetSettings = settingsBuilder.deleteDatasetSettings().build(); + deleteDatasetVersionSettings = settingsBuilder.deleteDatasetVersionSettings().build(); + } + + /** Builder for MapsPlatformDatasetsV1AlphaStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createDatasetSettings; + private final UnaryCallSettings.Builder + updateDatasetMetadataSettings; + private final UnaryCallSettings.Builder getDatasetSettings; + private final PagedCallSettings.Builder< + ListDatasetVersionsRequest, + ListDatasetVersionsResponse, + ListDatasetVersionsPagedResponse> + listDatasetVersionsSettings; + private final PagedCallSettings.Builder< + ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> + listDatasetsSettings; + private final UnaryCallSettings.Builder deleteDatasetSettings; + private final UnaryCallSettings.Builder + deleteDatasetVersionSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createDatasetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateDatasetMetadataSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getDatasetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listDatasetVersionsSettings = + PagedCallSettings.newBuilder(LIST_DATASET_VERSIONS_PAGE_STR_FACT); + listDatasetsSettings = PagedCallSettings.newBuilder(LIST_DATASETS_PAGE_STR_FACT); + deleteDatasetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteDatasetVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createDatasetSettings, + updateDatasetMetadataSettings, + getDatasetSettings, + listDatasetVersionsSettings, + listDatasetsSettings, + deleteDatasetSettings, + deleteDatasetVersionSettings); + initDefaults(this); + } + + protected Builder(MapsPlatformDatasetsV1AlphaStubSettings settings) { + super(settings); + + createDatasetSettings = settings.createDatasetSettings.toBuilder(); + updateDatasetMetadataSettings = settings.updateDatasetMetadataSettings.toBuilder(); + getDatasetSettings = settings.getDatasetSettings.toBuilder(); + listDatasetVersionsSettings = settings.listDatasetVersionsSettings.toBuilder(); + listDatasetsSettings = settings.listDatasetsSettings.toBuilder(); + deleteDatasetSettings = settings.deleteDatasetSettings.toBuilder(); + deleteDatasetVersionSettings = settings.deleteDatasetVersionSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createDatasetSettings, + updateDatasetMetadataSettings, + getDatasetSettings, + listDatasetVersionsSettings, + listDatasetsSettings, + deleteDatasetSettings, + deleteDatasetVersionSettings); + } + + 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 + .createDatasetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .updateDatasetMetadataSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getDatasetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listDatasetVersionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listDatasetsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteDatasetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteDatasetVersionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 createDataset. */ + public UnaryCallSettings.Builder createDatasetSettings() { + return createDatasetSettings; + } + + /** Returns the builder for the settings used for calls to updateDatasetMetadata. */ + public UnaryCallSettings.Builder + updateDatasetMetadataSettings() { + return updateDatasetMetadataSettings; + } + + /** Returns the builder for the settings used for calls to getDataset. */ + public UnaryCallSettings.Builder getDatasetSettings() { + return getDatasetSettings; + } + + /** Returns the builder for the settings used for calls to listDatasetVersions. */ + public PagedCallSettings.Builder< + ListDatasetVersionsRequest, + ListDatasetVersionsResponse, + ListDatasetVersionsPagedResponse> + listDatasetVersionsSettings() { + return listDatasetVersionsSettings; + } + + /** Returns the builder for the settings used for calls to listDatasets. */ + public PagedCallSettings.Builder< + ListDatasetsRequest, ListDatasetsResponse, ListDatasetsPagedResponse> + listDatasetsSettings() { + return listDatasetsSettings; + } + + /** Returns the builder for the settings used for calls to deleteDataset. */ + public UnaryCallSettings.Builder deleteDatasetSettings() { + return deleteDatasetSettings; + } + + /** Returns the builder for the settings used for calls to deleteDatasetVersion. */ + public UnaryCallSettings.Builder + deleteDatasetVersionSettings() { + return deleteDatasetVersionSettings; + } + + @Override + public MapsPlatformDatasetsV1AlphaStubSettings build() throws IOException { + return new MapsPlatformDatasetsV1AlphaStubSettings(this); + } + } +} diff --git a/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/test/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaClientHttpJsonTest.java b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/test/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaClientHttpJsonTest.java new file mode 100644 index 000000000000..0b6ed3e30683 --- /dev/null +++ b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/test/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaClientHttpJsonTest.java @@ -0,0 +1,737 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha; + +import static com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient.ListDatasetVersionsPagedResponse; +import static com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient.ListDatasetsPagedResponse; + +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.common.collect.Lists; +import com.google.maps.mapsplatformdatasets.v1alpha.stub.HttpJsonMapsPlatformDatasetsV1AlphaStub; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +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 MapsPlatformDatasetsV1AlphaClientHttpJsonTest { + private static MockHttpService mockService; + private static MapsPlatformDatasetsV1AlphaClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonMapsPlatformDatasetsV1AlphaStub.getMethodDescriptors(), + MapsPlatformDatasetsV1AlphaSettings.getDefaultEndpoint()); + MapsPlatformDatasetsV1AlphaSettings settings = + MapsPlatformDatasetsV1AlphaSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + MapsPlatformDatasetsV1AlphaSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MapsPlatformDatasetsV1AlphaClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createDatasetTest() throws Exception { + Dataset expectedResponse = + Dataset.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setVersionId("versionId-1407102957") + .addAllUsage(new ArrayList()) + .setStatus(State.forNumber(0)) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionCreateTime(Timestamp.newBuilder().build()) + .setVersionDescription("versionDescription-1736173564") + .build(); + mockService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + Dataset dataset = Dataset.newBuilder().build(); + + Dataset actualResponse = client.createDataset(parent, dataset); + 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 createDatasetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + Dataset dataset = Dataset.newBuilder().build(); + client.createDataset(parent, dataset); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDatasetTest2() throws Exception { + Dataset expectedResponse = + Dataset.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setVersionId("versionId-1407102957") + .addAllUsage(new ArrayList()) + .setStatus(State.forNumber(0)) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionCreateTime(Timestamp.newBuilder().build()) + .setVersionDescription("versionDescription-1736173564") + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-2353"; + Dataset dataset = Dataset.newBuilder().build(); + + Dataset actualResponse = client.createDataset(parent, dataset); + 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 createDatasetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-2353"; + Dataset dataset = Dataset.newBuilder().build(); + client.createDataset(parent, dataset); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDatasetMetadataTest() throws Exception { + Dataset expectedResponse = + Dataset.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setVersionId("versionId-1407102957") + .addAllUsage(new ArrayList()) + .setStatus(State.forNumber(0)) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionCreateTime(Timestamp.newBuilder().build()) + .setVersionDescription("versionDescription-1736173564") + .build(); + mockService.addResponse(expectedResponse); + + Dataset dataset = + Dataset.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setVersionId("versionId-1407102957") + .addAllUsage(new ArrayList()) + .setStatus(State.forNumber(0)) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionCreateTime(Timestamp.newBuilder().build()) + .setVersionDescription("versionDescription-1736173564") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Dataset actualResponse = client.updateDatasetMetadata(dataset, 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 updateDatasetMetadataExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Dataset dataset = + Dataset.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setVersionId("versionId-1407102957") + .addAllUsage(new ArrayList()) + .setStatus(State.forNumber(0)) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionCreateTime(Timestamp.newBuilder().build()) + .setVersionDescription("versionDescription-1736173564") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateDatasetMetadata(dataset, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDatasetTest() throws Exception { + Dataset expectedResponse = + Dataset.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setVersionId("versionId-1407102957") + .addAllUsage(new ArrayList()) + .setStatus(State.forNumber(0)) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionCreateTime(Timestamp.newBuilder().build()) + .setVersionDescription("versionDescription-1736173564") + .build(); + mockService.addResponse(expectedResponse); + + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + + Dataset actualResponse = client.getDataset(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 getDatasetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + client.getDataset(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDatasetTest2() throws Exception { + Dataset expectedResponse = + Dataset.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setVersionId("versionId-1407102957") + .addAllUsage(new ArrayList()) + .setStatus(State.forNumber(0)) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionCreateTime(Timestamp.newBuilder().build()) + .setVersionDescription("versionDescription-1736173564") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-2277/datasets/dataset-2277"; + + Dataset actualResponse = client.getDataset(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 getDatasetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2277/datasets/dataset-2277"; + client.getDataset(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDatasetVersionsTest() throws Exception { + Dataset responsesElement = Dataset.newBuilder().build(); + ListDatasetVersionsResponse expectedResponse = + ListDatasetVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllDatasets(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + + ListDatasetVersionsPagedResponse pagedListResponse = client.listDatasetVersions(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDatasetsList().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 listDatasetVersionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + client.listDatasetVersions(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDatasetVersionsTest2() throws Exception { + Dataset responsesElement = Dataset.newBuilder().build(); + ListDatasetVersionsResponse expectedResponse = + ListDatasetVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllDatasets(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-2277/datasets/dataset-2277"; + + ListDatasetVersionsPagedResponse pagedListResponse = client.listDatasetVersions(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDatasetsList().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 listDatasetVersionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2277/datasets/dataset-2277"; + client.listDatasetVersions(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDatasetsTest() throws Exception { + Dataset responsesElement = Dataset.newBuilder().build(); + ListDatasetsResponse expectedResponse = + ListDatasetsResponse.newBuilder() + .setNextPageToken("") + .addAllDatasets(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListDatasetsPagedResponse pagedListResponse = client.listDatasets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDatasetsList().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 listDatasetsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + client.listDatasets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDatasetsTest2() throws Exception { + Dataset responsesElement = Dataset.newBuilder().build(); + ListDatasetsResponse expectedResponse = + ListDatasetsResponse.newBuilder() + .setNextPageToken("") + .addAllDatasets(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-2353"; + + ListDatasetsPagedResponse pagedListResponse = client.listDatasets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDatasetsList().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 listDatasetsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-2353"; + client.listDatasets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDatasetTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + + client.deleteDataset(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 deleteDatasetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + client.deleteDataset(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDatasetTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-2277/datasets/dataset-2277"; + + client.deleteDataset(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 deleteDatasetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2277/datasets/dataset-2277"; + client.deleteDataset(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDatasetVersionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + + client.deleteDatasetVersion(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 deleteDatasetVersionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + client.deleteDatasetVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDatasetVersionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-2277/datasets/dataset-2277"; + + client.deleteDatasetVersion(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 deleteDatasetVersionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2277/datasets/dataset-2277"; + client.deleteDatasetVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/test/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaClientTest.java b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/test/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaClientTest.java new file mode 100644 index 000000000000..cff441648fc6 --- /dev/null +++ b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/test/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaClientTest.java @@ -0,0 +1,645 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha; + +import static com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient.ListDatasetVersionsPagedResponse; +import static com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient.ListDatasetsPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +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 MapsPlatformDatasetsV1AlphaClientTest { + private static MockMapsPlatformDatasetsV1Alpha mockMapsPlatformDatasetsV1Alpha; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private MapsPlatformDatasetsV1AlphaClient client; + + @BeforeClass + public static void startStaticServer() { + mockMapsPlatformDatasetsV1Alpha = new MockMapsPlatformDatasetsV1Alpha(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockMapsPlatformDatasetsV1Alpha)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + MapsPlatformDatasetsV1AlphaSettings settings = + MapsPlatformDatasetsV1AlphaSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MapsPlatformDatasetsV1AlphaClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createDatasetTest() throws Exception { + Dataset expectedResponse = + Dataset.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setVersionId("versionId-1407102957") + .addAllUsage(new ArrayList()) + .setStatus(State.forNumber(0)) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionCreateTime(Timestamp.newBuilder().build()) + .setVersionDescription("versionDescription-1736173564") + .build(); + mockMapsPlatformDatasetsV1Alpha.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + Dataset dataset = Dataset.newBuilder().build(); + + Dataset actualResponse = client.createDataset(parent, dataset); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMapsPlatformDatasetsV1Alpha.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDatasetRequest actualRequest = ((CreateDatasetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(dataset, actualRequest.getDataset()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDatasetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMapsPlatformDatasetsV1Alpha.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + Dataset dataset = Dataset.newBuilder().build(); + client.createDataset(parent, dataset); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDatasetTest2() throws Exception { + Dataset expectedResponse = + Dataset.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setVersionId("versionId-1407102957") + .addAllUsage(new ArrayList()) + .setStatus(State.forNumber(0)) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionCreateTime(Timestamp.newBuilder().build()) + .setVersionDescription("versionDescription-1736173564") + .build(); + mockMapsPlatformDatasetsV1Alpha.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Dataset dataset = Dataset.newBuilder().build(); + + Dataset actualResponse = client.createDataset(parent, dataset); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMapsPlatformDatasetsV1Alpha.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDatasetRequest actualRequest = ((CreateDatasetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(dataset, actualRequest.getDataset()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDatasetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMapsPlatformDatasetsV1Alpha.addException(exception); + + try { + String parent = "parent-995424086"; + Dataset dataset = Dataset.newBuilder().build(); + client.createDataset(parent, dataset); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDatasetMetadataTest() throws Exception { + Dataset expectedResponse = + Dataset.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setVersionId("versionId-1407102957") + .addAllUsage(new ArrayList()) + .setStatus(State.forNumber(0)) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionCreateTime(Timestamp.newBuilder().build()) + .setVersionDescription("versionDescription-1736173564") + .build(); + mockMapsPlatformDatasetsV1Alpha.addResponse(expectedResponse); + + Dataset dataset = Dataset.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Dataset actualResponse = client.updateDatasetMetadata(dataset, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMapsPlatformDatasetsV1Alpha.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateDatasetMetadataRequest actualRequest = + ((UpdateDatasetMetadataRequest) actualRequests.get(0)); + + Assert.assertEquals(dataset, actualRequest.getDataset()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateDatasetMetadataExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMapsPlatformDatasetsV1Alpha.addException(exception); + + try { + Dataset dataset = Dataset.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateDatasetMetadata(dataset, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDatasetTest() throws Exception { + Dataset expectedResponse = + Dataset.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setVersionId("versionId-1407102957") + .addAllUsage(new ArrayList()) + .setStatus(State.forNumber(0)) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionCreateTime(Timestamp.newBuilder().build()) + .setVersionDescription("versionDescription-1736173564") + .build(); + mockMapsPlatformDatasetsV1Alpha.addResponse(expectedResponse); + + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + + Dataset actualResponse = client.getDataset(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMapsPlatformDatasetsV1Alpha.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDatasetRequest actualRequest = ((GetDatasetRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDatasetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMapsPlatformDatasetsV1Alpha.addException(exception); + + try { + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + client.getDataset(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDatasetTest2() throws Exception { + Dataset expectedResponse = + Dataset.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setVersionId("versionId-1407102957") + .addAllUsage(new ArrayList()) + .setStatus(State.forNumber(0)) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionCreateTime(Timestamp.newBuilder().build()) + .setVersionDescription("versionDescription-1736173564") + .build(); + mockMapsPlatformDatasetsV1Alpha.addResponse(expectedResponse); + + String name = "name3373707"; + + Dataset actualResponse = client.getDataset(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMapsPlatformDatasetsV1Alpha.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDatasetRequest actualRequest = ((GetDatasetRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDatasetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMapsPlatformDatasetsV1Alpha.addException(exception); + + try { + String name = "name3373707"; + client.getDataset(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDatasetVersionsTest() throws Exception { + Dataset responsesElement = Dataset.newBuilder().build(); + ListDatasetVersionsResponse expectedResponse = + ListDatasetVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllDatasets(Arrays.asList(responsesElement)) + .build(); + mockMapsPlatformDatasetsV1Alpha.addResponse(expectedResponse); + + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + + ListDatasetVersionsPagedResponse pagedListResponse = client.listDatasetVersions(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDatasetsList().get(0), resources.get(0)); + + List actualRequests = mockMapsPlatformDatasetsV1Alpha.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDatasetVersionsRequest actualRequest = ((ListDatasetVersionsRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDatasetVersionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMapsPlatformDatasetsV1Alpha.addException(exception); + + try { + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + client.listDatasetVersions(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDatasetVersionsTest2() throws Exception { + Dataset responsesElement = Dataset.newBuilder().build(); + ListDatasetVersionsResponse expectedResponse = + ListDatasetVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllDatasets(Arrays.asList(responsesElement)) + .build(); + mockMapsPlatformDatasetsV1Alpha.addResponse(expectedResponse); + + String name = "name3373707"; + + ListDatasetVersionsPagedResponse pagedListResponse = client.listDatasetVersions(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDatasetsList().get(0), resources.get(0)); + + List actualRequests = mockMapsPlatformDatasetsV1Alpha.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDatasetVersionsRequest actualRequest = ((ListDatasetVersionsRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDatasetVersionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMapsPlatformDatasetsV1Alpha.addException(exception); + + try { + String name = "name3373707"; + client.listDatasetVersions(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDatasetsTest() throws Exception { + Dataset responsesElement = Dataset.newBuilder().build(); + ListDatasetsResponse expectedResponse = + ListDatasetsResponse.newBuilder() + .setNextPageToken("") + .addAllDatasets(Arrays.asList(responsesElement)) + .build(); + mockMapsPlatformDatasetsV1Alpha.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListDatasetsPagedResponse pagedListResponse = client.listDatasets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDatasetsList().get(0), resources.get(0)); + + List actualRequests = mockMapsPlatformDatasetsV1Alpha.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDatasetsRequest actualRequest = ((ListDatasetsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDatasetsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMapsPlatformDatasetsV1Alpha.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + client.listDatasets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDatasetsTest2() throws Exception { + Dataset responsesElement = Dataset.newBuilder().build(); + ListDatasetsResponse expectedResponse = + ListDatasetsResponse.newBuilder() + .setNextPageToken("") + .addAllDatasets(Arrays.asList(responsesElement)) + .build(); + mockMapsPlatformDatasetsV1Alpha.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListDatasetsPagedResponse pagedListResponse = client.listDatasets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDatasetsList().get(0), resources.get(0)); + + List actualRequests = mockMapsPlatformDatasetsV1Alpha.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDatasetsRequest actualRequest = ((ListDatasetsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDatasetsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMapsPlatformDatasetsV1Alpha.addException(exception); + + try { + String parent = "parent-995424086"; + client.listDatasets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDatasetTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMapsPlatformDatasetsV1Alpha.addResponse(expectedResponse); + + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + + client.deleteDataset(name); + + List actualRequests = mockMapsPlatformDatasetsV1Alpha.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDatasetRequest actualRequest = ((DeleteDatasetRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDatasetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMapsPlatformDatasetsV1Alpha.addException(exception); + + try { + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + client.deleteDataset(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDatasetTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMapsPlatformDatasetsV1Alpha.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteDataset(name); + + List actualRequests = mockMapsPlatformDatasetsV1Alpha.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDatasetRequest actualRequest = ((DeleteDatasetRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDatasetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMapsPlatformDatasetsV1Alpha.addException(exception); + + try { + String name = "name3373707"; + client.deleteDataset(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDatasetVersionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMapsPlatformDatasetsV1Alpha.addResponse(expectedResponse); + + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + + client.deleteDatasetVersion(name); + + List actualRequests = mockMapsPlatformDatasetsV1Alpha.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDatasetVersionRequest actualRequest = + ((DeleteDatasetVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDatasetVersionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMapsPlatformDatasetsV1Alpha.addException(exception); + + try { + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + client.deleteDatasetVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDatasetVersionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMapsPlatformDatasetsV1Alpha.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteDatasetVersion(name); + + List actualRequests = mockMapsPlatformDatasetsV1Alpha.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDatasetVersionRequest actualRequest = + ((DeleteDatasetVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDatasetVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMapsPlatformDatasetsV1Alpha.addException(exception); + + try { + String name = "name3373707"; + client.deleteDatasetVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/test/java/com/google/maps/mapsplatformdatasets/v1alpha/MockMapsPlatformDatasetsV1Alpha.java b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/test/java/com/google/maps/mapsplatformdatasets/v1alpha/MockMapsPlatformDatasetsV1Alpha.java new file mode 100644 index 000000000000..3c65c8b608c8 --- /dev/null +++ b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/test/java/com/google/maps/mapsplatformdatasets/v1alpha/MockMapsPlatformDatasetsV1Alpha.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.maps.mapsplatformdatasets.v1alpha; + +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 MockMapsPlatformDatasetsV1Alpha implements MockGrpcService { + private final MockMapsPlatformDatasetsV1AlphaImpl serviceImpl; + + public MockMapsPlatformDatasetsV1Alpha() { + serviceImpl = new MockMapsPlatformDatasetsV1AlphaImpl(); + } + + @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-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/test/java/com/google/maps/mapsplatformdatasets/v1alpha/MockMapsPlatformDatasetsV1AlphaImpl.java b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/test/java/com/google/maps/mapsplatformdatasets/v1alpha/MockMapsPlatformDatasetsV1AlphaImpl.java new file mode 100644 index 000000000000..676df62eb099 --- /dev/null +++ b/java-maps-mapsplatformdatasets/google-maps-mapsplatformdatasets/src/test/java/com/google/maps/mapsplatformdatasets/v1alpha/MockMapsPlatformDatasetsV1AlphaImpl.java @@ -0,0 +1,207 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaGrpc.MapsPlatformDatasetsV1AlphaImplBase; +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 MockMapsPlatformDatasetsV1AlphaImpl extends MapsPlatformDatasetsV1AlphaImplBase { + private List requests; + private Queue responses; + + public MockMapsPlatformDatasetsV1AlphaImpl() { + 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 createDataset( + CreateDatasetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Dataset) { + requests.add(request); + responseObserver.onNext(((Dataset) 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 CreateDataset, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Dataset.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateDatasetMetadata( + UpdateDatasetMetadataRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Dataset) { + requests.add(request); + responseObserver.onNext(((Dataset) 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 UpdateDatasetMetadata, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Dataset.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getDataset(GetDatasetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Dataset) { + requests.add(request); + responseObserver.onNext(((Dataset) 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 GetDataset, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Dataset.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listDatasetVersions( + ListDatasetVersionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListDatasetVersionsResponse) { + requests.add(request); + responseObserver.onNext(((ListDatasetVersionsResponse) 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 ListDatasetVersions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListDatasetVersionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listDatasets( + ListDatasetsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListDatasetsResponse) { + requests.add(request); + responseObserver.onNext(((ListDatasetsResponse) 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 ListDatasets, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListDatasetsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteDataset(DeleteDatasetRequest 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 DeleteDataset, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteDatasetVersion( + DeleteDatasetVersionRequest 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 DeleteDatasetVersion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-maps-mapsplatformdatasets/grpc-google-maps-mapsplatformdatasets-v1alpha/pom.xml b/java-maps-mapsplatformdatasets/grpc-google-maps-mapsplatformdatasets-v1alpha/pom.xml new file mode 100644 index 000000000000..1230023aacba --- /dev/null +++ b/java-maps-mapsplatformdatasets/grpc-google-maps-mapsplatformdatasets-v1alpha/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.maps.api.grpc + grpc-google-maps-mapsplatformdatasets-v1alpha + 0.0.1-SNAPSHOT + grpc-google-maps-mapsplatformdatasets-v1alpha + GRPC library for google-maps-mapsplatformdatasets + + com.google.maps + google-maps-mapsplatformdatasets-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.maps.api.grpc + proto-google-maps-mapsplatformdatasets-v1alpha + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-maps-mapsplatformdatasets/grpc-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaGrpc.java b/java-maps-mapsplatformdatasets/grpc-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaGrpc.java new file mode 100644 index 000000000000..47a194713ffd --- /dev/null +++ b/java-maps-mapsplatformdatasets/grpc-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaGrpc.java @@ -0,0 +1,1117 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service definition for the Maps Platform Datasets API.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = + "Source: google/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets_alpha_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class MapsPlatformDatasetsV1AlphaGrpc { + + private MapsPlatformDatasetsV1AlphaGrpc() {} + + public static final String SERVICE_NAME = + "google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset> + getCreateDatasetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateDataset", + requestType = com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest.class, + responseType = com.google.maps.mapsplatformdatasets.v1alpha.Dataset.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset> + getCreateDatasetMethod() { + io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset> + getCreateDatasetMethod; + if ((getCreateDatasetMethod = MapsPlatformDatasetsV1AlphaGrpc.getCreateDatasetMethod) == null) { + synchronized (MapsPlatformDatasetsV1AlphaGrpc.class) { + if ((getCreateDatasetMethod = MapsPlatformDatasetsV1AlphaGrpc.getCreateDatasetMethod) + == null) { + MapsPlatformDatasetsV1AlphaGrpc.getCreateDatasetMethod = + getCreateDatasetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateDataset")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.mapsplatformdatasets.v1alpha.Dataset + .getDefaultInstance())) + .setSchemaDescriptor( + new MapsPlatformDatasetsV1AlphaMethodDescriptorSupplier("CreateDataset")) + .build(); + } + } + } + return getCreateDatasetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset> + getUpdateDatasetMetadataMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateDatasetMetadata", + requestType = com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest.class, + responseType = com.google.maps.mapsplatformdatasets.v1alpha.Dataset.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset> + getUpdateDatasetMetadataMethod() { + io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset> + getUpdateDatasetMetadataMethod; + if ((getUpdateDatasetMetadataMethod = + MapsPlatformDatasetsV1AlphaGrpc.getUpdateDatasetMetadataMethod) + == null) { + synchronized (MapsPlatformDatasetsV1AlphaGrpc.class) { + if ((getUpdateDatasetMetadataMethod = + MapsPlatformDatasetsV1AlphaGrpc.getUpdateDatasetMetadataMethod) + == null) { + MapsPlatformDatasetsV1AlphaGrpc.getUpdateDatasetMetadataMethod = + getUpdateDatasetMetadataMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateDatasetMetadata")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.mapsplatformdatasets.v1alpha + .UpdateDatasetMetadataRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.mapsplatformdatasets.v1alpha.Dataset + .getDefaultInstance())) + .setSchemaDescriptor( + new MapsPlatformDatasetsV1AlphaMethodDescriptorSupplier( + "UpdateDatasetMetadata")) + .build(); + } + } + } + return getUpdateDatasetMetadataMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset> + getGetDatasetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDataset", + requestType = com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest.class, + responseType = com.google.maps.mapsplatformdatasets.v1alpha.Dataset.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset> + getGetDatasetMethod() { + io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset> + getGetDatasetMethod; + if ((getGetDatasetMethod = MapsPlatformDatasetsV1AlphaGrpc.getGetDatasetMethod) == null) { + synchronized (MapsPlatformDatasetsV1AlphaGrpc.class) { + if ((getGetDatasetMethod = MapsPlatformDatasetsV1AlphaGrpc.getGetDatasetMethod) == null) { + MapsPlatformDatasetsV1AlphaGrpc.getGetDatasetMethod = + getGetDatasetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDataset")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.mapsplatformdatasets.v1alpha.Dataset + .getDefaultInstance())) + .setSchemaDescriptor( + new MapsPlatformDatasetsV1AlphaMethodDescriptorSupplier("GetDataset")) + .build(); + } + } + } + return getGetDatasetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest, + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse> + getListDatasetVersionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListDatasetVersions", + requestType = com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest.class, + responseType = com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest, + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse> + getListDatasetVersionsMethod() { + io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest, + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse> + getListDatasetVersionsMethod; + if ((getListDatasetVersionsMethod = + MapsPlatformDatasetsV1AlphaGrpc.getListDatasetVersionsMethod) + == null) { + synchronized (MapsPlatformDatasetsV1AlphaGrpc.class) { + if ((getListDatasetVersionsMethod = + MapsPlatformDatasetsV1AlphaGrpc.getListDatasetVersionsMethod) + == null) { + MapsPlatformDatasetsV1AlphaGrpc.getListDatasetVersionsMethod = + getListDatasetVersionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListDatasetVersions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.mapsplatformdatasets.v1alpha + .ListDatasetVersionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.mapsplatformdatasets.v1alpha + .ListDatasetVersionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new MapsPlatformDatasetsV1AlphaMethodDescriptorSupplier( + "ListDatasetVersions")) + .build(); + } + } + } + return getListDatasetVersionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest, + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse> + getListDatasetsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListDatasets", + requestType = com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest.class, + responseType = com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest, + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse> + getListDatasetsMethod() { + io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest, + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse> + getListDatasetsMethod; + if ((getListDatasetsMethod = MapsPlatformDatasetsV1AlphaGrpc.getListDatasetsMethod) == null) { + synchronized (MapsPlatformDatasetsV1AlphaGrpc.class) { + if ((getListDatasetsMethod = MapsPlatformDatasetsV1AlphaGrpc.getListDatasetsMethod) + == null) { + MapsPlatformDatasetsV1AlphaGrpc.getListDatasetsMethod = + getListDatasetsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListDatasets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new MapsPlatformDatasetsV1AlphaMethodDescriptorSupplier("ListDatasets")) + .build(); + } + } + } + return getListDatasetsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest, + com.google.protobuf.Empty> + getDeleteDatasetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteDataset", + requestType = com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest, + com.google.protobuf.Empty> + getDeleteDatasetMethod() { + io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest, + com.google.protobuf.Empty> + getDeleteDatasetMethod; + if ((getDeleteDatasetMethod = MapsPlatformDatasetsV1AlphaGrpc.getDeleteDatasetMethod) == null) { + synchronized (MapsPlatformDatasetsV1AlphaGrpc.class) { + if ((getDeleteDatasetMethod = MapsPlatformDatasetsV1AlphaGrpc.getDeleteDatasetMethod) + == null) { + MapsPlatformDatasetsV1AlphaGrpc.getDeleteDatasetMethod = + getDeleteDatasetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteDataset")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new MapsPlatformDatasetsV1AlphaMethodDescriptorSupplier("DeleteDataset")) + .build(); + } + } + } + return getDeleteDatasetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest, + com.google.protobuf.Empty> + getDeleteDatasetVersionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteDatasetVersion", + requestType = com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest, + com.google.protobuf.Empty> + getDeleteDatasetVersionMethod() { + io.grpc.MethodDescriptor< + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest, + com.google.protobuf.Empty> + getDeleteDatasetVersionMethod; + if ((getDeleteDatasetVersionMethod = + MapsPlatformDatasetsV1AlphaGrpc.getDeleteDatasetVersionMethod) + == null) { + synchronized (MapsPlatformDatasetsV1AlphaGrpc.class) { + if ((getDeleteDatasetVersionMethod = + MapsPlatformDatasetsV1AlphaGrpc.getDeleteDatasetVersionMethod) + == null) { + MapsPlatformDatasetsV1AlphaGrpc.getDeleteDatasetVersionMethod = + getDeleteDatasetVersionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteDatasetVersion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.maps.mapsplatformdatasets.v1alpha + .DeleteDatasetVersionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new MapsPlatformDatasetsV1AlphaMethodDescriptorSupplier( + "DeleteDatasetVersion")) + .build(); + } + } + } + return getDeleteDatasetVersionMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static MapsPlatformDatasetsV1AlphaStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MapsPlatformDatasetsV1AlphaStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MapsPlatformDatasetsV1AlphaStub(channel, callOptions); + } + }; + return MapsPlatformDatasetsV1AlphaStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static MapsPlatformDatasetsV1AlphaBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MapsPlatformDatasetsV1AlphaBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MapsPlatformDatasetsV1AlphaBlockingStub(channel, callOptions); + } + }; + return MapsPlatformDatasetsV1AlphaBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static MapsPlatformDatasetsV1AlphaFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MapsPlatformDatasetsV1AlphaFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MapsPlatformDatasetsV1AlphaFutureStub(channel, callOptions); + } + }; + return MapsPlatformDatasetsV1AlphaFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service definition for the Maps Platform Datasets API.
+   * 
+ */ + public abstract static class MapsPlatformDatasetsV1AlphaImplBase + implements io.grpc.BindableService { + + /** + * + * + *
+     * Create a new dataset for the specified project.
+     * 
+ */ + public void createDataset( + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateDatasetMethod(), responseObserver); + } + + /** + * + * + *
+     * Update the metadata for the dataset. To update the data use: UploadDataset.
+     * 
+ */ + public void updateDatasetMetadata( + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateDatasetMetadataMethod(), responseObserver); + } + + /** + * + * + *
+     * Get the published or latest version of the dataset.
+     * 
+ */ + public void getDataset( + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetDatasetMethod(), responseObserver); + } + + /** + * + * + *
+     * List all the versions of a dataset.
+     * 
+ */ + public void listDatasetVersions( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest request, + io.grpc.stub.StreamObserver< + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListDatasetVersionsMethod(), responseObserver); + } + + /** + * + * + *
+     * List all the datasets for the specified project.
+     * 
+ */ + public void listDatasets( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest request, + io.grpc.stub.StreamObserver< + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListDatasetsMethod(), responseObserver); + } + + /** + * + * + *
+     * Delete the specified dataset and optionally all its corresponding
+     * versions.
+     * 
+ */ + public void deleteDataset( + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteDatasetMethod(), responseObserver); + } + + /** + * + * + *
+     * Delete a specific version of the dataset.
+     * 
+ */ + public void deleteDatasetVersion( + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteDatasetVersionMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateDatasetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset>( + this, METHODID_CREATE_DATASET))) + .addMethod( + getUpdateDatasetMetadataMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset>( + this, METHODID_UPDATE_DATASET_METADATA))) + .addMethod( + getGetDatasetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset>( + this, METHODID_GET_DATASET))) + .addMethod( + getListDatasetVersionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest, + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse>( + this, METHODID_LIST_DATASET_VERSIONS))) + .addMethod( + getListDatasetsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest, + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse>( + this, METHODID_LIST_DATASETS))) + .addMethod( + getDeleteDatasetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_DATASET))) + .addMethod( + getDeleteDatasetVersionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_DATASET_VERSION))) + .build(); + } + } + + /** + * + * + *
+   * Service definition for the Maps Platform Datasets API.
+   * 
+ */ + public static final class MapsPlatformDatasetsV1AlphaStub + extends io.grpc.stub.AbstractAsyncStub { + private MapsPlatformDatasetsV1AlphaStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MapsPlatformDatasetsV1AlphaStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MapsPlatformDatasetsV1AlphaStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a new dataset for the specified project.
+     * 
+ */ + public void createDataset( + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateDatasetMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Update the metadata for the dataset. To update the data use: UploadDataset.
+     * 
+ */ + public void updateDatasetMetadata( + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateDatasetMetadataMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get the published or latest version of the dataset.
+     * 
+ */ + public void getDataset( + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDatasetMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * List all the versions of a dataset.
+     * 
+ */ + public void listDatasetVersions( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest request, + io.grpc.stub.StreamObserver< + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListDatasetVersionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List all the datasets for the specified project.
+     * 
+ */ + public void listDatasets( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest request, + io.grpc.stub.StreamObserver< + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListDatasetsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Delete the specified dataset and optionally all its corresponding
+     * versions.
+     * 
+ */ + public void deleteDataset( + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteDatasetMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Delete a specific version of the dataset.
+     * 
+ */ + public void deleteDatasetVersion( + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteDatasetVersionMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service definition for the Maps Platform Datasets API.
+   * 
+ */ + public static final class MapsPlatformDatasetsV1AlphaBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private MapsPlatformDatasetsV1AlphaBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MapsPlatformDatasetsV1AlphaBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MapsPlatformDatasetsV1AlphaBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a new dataset for the specified project.
+     * 
+ */ + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset createDataset( + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateDatasetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Update the metadata for the dataset. To update the data use: UploadDataset.
+     * 
+ */ + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset updateDatasetMetadata( + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateDatasetMetadataMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get the published or latest version of the dataset.
+     * 
+ */ + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset getDataset( + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDatasetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List all the versions of a dataset.
+     * 
+ */ + public com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse + listDatasetVersions( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListDatasetVersionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List all the datasets for the specified project.
+     * 
+ */ + public com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse listDatasets( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListDatasetsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete the specified dataset and optionally all its corresponding
+     * versions.
+     * 
+ */ + public com.google.protobuf.Empty deleteDataset( + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteDatasetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete a specific version of the dataset.
+     * 
+ */ + public com.google.protobuf.Empty deleteDatasetVersion( + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteDatasetVersionMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service definition for the Maps Platform Datasets API.
+   * 
+ */ + public static final class MapsPlatformDatasetsV1AlphaFutureStub + extends io.grpc.stub.AbstractFutureStub { + private MapsPlatformDatasetsV1AlphaFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MapsPlatformDatasetsV1AlphaFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MapsPlatformDatasetsV1AlphaFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a new dataset for the specified project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.maps.mapsplatformdatasets.v1alpha.Dataset> + createDataset(com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateDatasetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Update the metadata for the dataset. To update the data use: UploadDataset.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.maps.mapsplatformdatasets.v1alpha.Dataset> + updateDatasetMetadata( + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateDatasetMetadataMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get the published or latest version of the dataset.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.maps.mapsplatformdatasets.v1alpha.Dataset> + getDataset(com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDatasetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List all the versions of a dataset.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse> + listDatasetVersions( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListDatasetVersionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List all the datasets for the specified project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse> + listDatasets(com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListDatasetsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Delete the specified dataset and optionally all its corresponding
+     * versions.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteDataset(com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteDatasetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Delete a specific version of the dataset.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteDatasetVersion( + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteDatasetVersionMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_DATASET = 0; + private static final int METHODID_UPDATE_DATASET_METADATA = 1; + private static final int METHODID_GET_DATASET = 2; + private static final int METHODID_LIST_DATASET_VERSIONS = 3; + private static final int METHODID_LIST_DATASETS = 4; + private static final int METHODID_DELETE_DATASET = 5; + private static final int METHODID_DELETE_DATASET_VERSION = 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 MapsPlatformDatasetsV1AlphaImplBase serviceImpl; + private final int methodId; + + MethodHandlers(MapsPlatformDatasetsV1AlphaImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_DATASET: + serviceImpl.createDataset( + (com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_DATASET_METADATA: + serviceImpl.updateDatasetMetadata( + (com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_DATASET: + serviceImpl.getDataset( + (com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_DATASET_VERSIONS: + serviceImpl.listDatasetVersions( + (com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse>) + responseObserver); + break; + case METHODID_LIST_DATASETS: + serviceImpl.listDatasets( + (com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse>) + responseObserver); + break; + case METHODID_DELETE_DATASET: + serviceImpl.deleteDataset( + (com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_DATASET_VERSION: + serviceImpl.deleteDatasetVersion( + (com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest) 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(); + } + } + } + + private abstract static class MapsPlatformDatasetsV1AlphaBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + MapsPlatformDatasetsV1AlphaBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaServiceProto + .getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("MapsPlatformDatasetsV1Alpha"); + } + } + + private static final class MapsPlatformDatasetsV1AlphaFileDescriptorSupplier + extends MapsPlatformDatasetsV1AlphaBaseDescriptorSupplier { + MapsPlatformDatasetsV1AlphaFileDescriptorSupplier() {} + } + + private static final class MapsPlatformDatasetsV1AlphaMethodDescriptorSupplier + extends MapsPlatformDatasetsV1AlphaBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + MapsPlatformDatasetsV1AlphaMethodDescriptorSupplier(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 (MapsPlatformDatasetsV1AlphaGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new MapsPlatformDatasetsV1AlphaFileDescriptorSupplier()) + .addMethod(getCreateDatasetMethod()) + .addMethod(getUpdateDatasetMetadataMethod()) + .addMethod(getGetDatasetMethod()) + .addMethod(getListDatasetVersionsMethod()) + .addMethod(getListDatasetsMethod()) + .addMethod(getDeleteDatasetMethod()) + .addMethod(getDeleteDatasetVersionMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-maps-mapsplatformdatasets/owlbot.py b/java-maps-mapsplatformdatasets/owlbot.py new file mode 100644 index 000000000000..03c0f6686d3f --- /dev/null +++ b/java-maps-mapsplatformdatasets/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-maps-mapsplatformdatasets/pom.xml b/java-maps-mapsplatformdatasets/pom.xml new file mode 100644 index 000000000000..a158fef3b118 --- /dev/null +++ b/java-maps-mapsplatformdatasets/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.google.maps + google-maps-mapsplatformdatasets-parent + pom + 0.0.1-SNAPSHOT + Google Maps Platform Datasets API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.6.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-maps-mapsplatformdatasets-parent + + + + + + com.google.maps + google-maps-mapsplatformdatasets + 0.0.1-SNAPSHOT + + + com.google.maps.api.grpc + grpc-google-maps-mapsplatformdatasets-v1alpha + 0.0.1-SNAPSHOT + + + com.google.maps.api.grpc + proto-google-maps-mapsplatformdatasets-v1alpha + 0.0.1-SNAPSHOT + + + + + + google-maps-mapsplatformdatasets + grpc-google-maps-mapsplatformdatasets-v1alpha + proto-google-maps-mapsplatformdatasets-v1alpha + google-maps-mapsplatformdatasets-bom + + diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/clirr-ignored-differences.xml b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/clirr-ignored-differences.xml new file mode 100644 index 000000000000..c48197cfbdaa --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/maps/mapsplatformdatasets/v1alpha/*OrBuilder + * get*(*) + + + 7012 + com/google/maps/mapsplatformdatasets/v1alpha/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/maps/mapsplatformdatasets/v1alpha/*OrBuilder + boolean has*(*) + + diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/pom.xml b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/pom.xml new file mode 100644 index 000000000000..f190da1c6875 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.maps.api.grpc + proto-google-maps-mapsplatformdatasets-v1alpha + 0.0.1-SNAPSHOT + proto-google-maps-mapsplatformdatasets-v1alpha + Proto library for google-maps-mapsplatformdatasets + + com.google.maps + google-maps-mapsplatformdatasets-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-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/CreateDatasetRequest.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/CreateDatasetRequest.java new file mode 100644 index 000000000000..565fe64378b5 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/CreateDatasetRequest.java @@ -0,0 +1,950 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +/** + * + * + *
+ * Request to create a maps dataset.
+ * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest} + */ +public final class CreateDatasetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest) + CreateDatasetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateDatasetRequest.newBuilder() to construct. + private CreateDatasetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateDatasetRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateDatasetRequest(); + } + + @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.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_CreateDatasetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_CreateDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest.class, + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent project that will own the dataset.
+   * Format: projects/{$project_number}
+   * 
+ * + * + * 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 project that will own the dataset.
+   * Format: projects/{$project_number}
+   * 
+ * + * + * 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 DATASET_FIELD_NUMBER = 2; + private com.google.maps.mapsplatformdatasets.v1alpha.Dataset dataset_; + /** + * + * + *
+   * Required. The dataset version to create.
+   * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataset field is set. + */ + @java.lang.Override + public boolean hasDataset() { + return dataset_ != null; + } + /** + * + * + *
+   * Required. The dataset version to create.
+   * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataset. + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset getDataset() { + return dataset_ == null + ? com.google.maps.mapsplatformdatasets.v1alpha.Dataset.getDefaultInstance() + : dataset_; + } + /** + * + * + *
+   * Required. The dataset version to create.
+   * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder getDatasetOrBuilder() { + return dataset_ == null + ? com.google.maps.mapsplatformdatasets.v1alpha.Dataset.getDefaultInstance() + : dataset_; + } + + 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 (dataset_ != null) { + output.writeMessage(2, getDataset()); + } + 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 (dataset_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDataset()); + } + 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.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest)) { + return super.equals(obj); + } + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest other = + (com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasDataset() != other.hasDataset()) return false; + if (hasDataset()) { + if (!getDataset().equals(other.getDataset())) 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 (hasDataset()) { + hash = (37 * hash) + DATASET_FIELD_NUMBER; + hash = (53 * hash) + getDataset().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest 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.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest 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.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest + 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.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest 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.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest 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; + } + /** + * + * + *
+   * Request to create a maps dataset.
+   * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest) + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_CreateDatasetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_CreateDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest.class, + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest.Builder.class); + } + + // Construct using + // com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + dataset_ = null; + if (datasetBuilder_ != null) { + datasetBuilder_.dispose(); + datasetBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_CreateDatasetRequest_descriptor; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest + getDefaultInstanceForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest build() { + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest buildPartial() { + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest result = + new com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.dataset_ = datasetBuilder_ == null ? dataset_ : datasetBuilder_.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.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest) { + return mergeFrom((com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest other) { + if (other + == com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasDataset()) { + mergeDataset(other.getDataset()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getDatasetFieldBuilder().getBuilder(), extensionRegistry); + 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 parent_ = ""; + /** + * + * + *
+     * Required. Parent project that will own the dataset.
+     * Format: projects/{$project_number}
+     * 
+ * + * + * 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 project that will own the dataset.
+     * Format: projects/{$project_number}
+     * 
+ * + * + * 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 project that will own the dataset.
+     * Format: projects/{$project_number}
+     * 
+ * + * + * 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 project that will own the dataset.
+     * Format: projects/{$project_number}
+     * 
+ * + * + * 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 project that will own the dataset.
+     * Format: projects/{$project_number}
+     * 
+ * + * + * 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.maps.mapsplatformdatasets.v1alpha.Dataset dataset_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.Dataset, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder> + datasetBuilder_; + /** + * + * + *
+     * Required. The dataset version to create.
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataset field is set. + */ + public boolean hasDataset() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The dataset version to create.
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataset. + */ + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset getDataset() { + if (datasetBuilder_ == null) { + return dataset_ == null + ? com.google.maps.mapsplatformdatasets.v1alpha.Dataset.getDefaultInstance() + : dataset_; + } else { + return datasetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The dataset version to create.
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDataset(com.google.maps.mapsplatformdatasets.v1alpha.Dataset value) { + if (datasetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataset_ = value; + } else { + datasetBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dataset version to create.
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDataset( + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder builderForValue) { + if (datasetBuilder_ == null) { + dataset_ = builderForValue.build(); + } else { + datasetBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dataset version to create.
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDataset(com.google.maps.mapsplatformdatasets.v1alpha.Dataset value) { + if (datasetBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && dataset_ != null + && dataset_ + != com.google.maps.mapsplatformdatasets.v1alpha.Dataset.getDefaultInstance()) { + getDatasetBuilder().mergeFrom(value); + } else { + dataset_ = value; + } + } else { + datasetBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dataset version to create.
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDataset() { + bitField0_ = (bitField0_ & ~0x00000002); + dataset_ = null; + if (datasetBuilder_ != null) { + datasetBuilder_.dispose(); + datasetBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dataset version to create.
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder getDatasetBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDatasetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The dataset version to create.
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder getDatasetOrBuilder() { + if (datasetBuilder_ != null) { + return datasetBuilder_.getMessageOrBuilder(); + } else { + return dataset_ == null + ? com.google.maps.mapsplatformdatasets.v1alpha.Dataset.getDefaultInstance() + : dataset_; + } + } + /** + * + * + *
+     * Required. The dataset version to create.
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.Dataset, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder> + getDatasetFieldBuilder() { + if (datasetBuilder_ == null) { + datasetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.Dataset, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder>( + getDataset(), getParentForChildren(), isClean()); + dataset_ = null; + } + return datasetBuilder_; + } + + @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.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest) + } + + // @@protoc_insertion_point(class_scope:google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest) + private static final com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest(); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateDatasetRequest 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.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/CreateDatasetRequestOrBuilder.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/CreateDatasetRequestOrBuilder.java new file mode 100644 index 000000000000..c18c93d55a3d --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/CreateDatasetRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +public interface CreateDatasetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent project that will own the dataset.
+   * Format: projects/{$project_number}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent project that will own the dataset.
+   * Format: projects/{$project_number}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The dataset version to create.
+   * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataset field is set. + */ + boolean hasDataset(); + /** + * + * + *
+   * Required. The dataset version to create.
+   * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataset. + */ + com.google.maps.mapsplatformdatasets.v1alpha.Dataset getDataset(); + /** + * + * + *
+   * Required. The dataset version to create.
+   * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder getDatasetOrBuilder(); +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DataSourceProto.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DataSourceProto.java new file mode 100644 index 000000000000..8c2b30302cdf --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DataSourceProto.java @@ -0,0 +1,89 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/data_source.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +public final class DataSourceProto { + private DataSourceProto() {} + + 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_maps_mapsplatformdatasets_v1alpha_LocalFileSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_mapsplatformdatasets_v1alpha_LocalFileSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_mapsplatformdatasets_v1alpha_GcsSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_mapsplatformdatasets_v1alpha_GcsSource_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n:google/maps/mapsplatformdatasets/v1alp" + + "ha/data_source.proto\022(google.maps.mapspl" + + "atformdatasets.v1alpha\"n\n\017LocalFileSourc" + + "e\022\020\n\010filename\030\001 \001(\t\022I\n\013file_format\030\002 \001(\016" + + "24.google.maps.mapsplatformdatasets.v1al" + + "pha.FileFormat\"i\n\tGcsSource\022\021\n\tinput_uri" + + "\030\001 \001(\t\022I\n\013file_format\030\002 \001(\01624.google.map" + + "s.mapsplatformdatasets.v1alpha.FileForma" + + "t*\230\001\n\nFileFormat\022\033\n\027FILE_FORMAT_UNSPECIF" + + "IED\020\000\022\027\n\023FILE_FORMAT_GEOJSON\020\001\022\023\n\017FILE_F" + + "ORMAT_KML\020\002\022\023\n\017FILE_FORMAT_CSV\020\003\022\025\n\021FILE" + + "_FORMAT_PROTO\020\004\022\023\n\017FILE_FORMAT_KMZ\020\005B\365\001\n" + + ",com.google.maps.mapsplatformdatasets.v1" + + "alphaB\017DataSourceProtoP\001Z\\google.golang." + + "org/genproto/googleapis/maps/mapsplatfor" + + "mdatasets/v1alpha;mapsplatformdatasets\252\002" + + "(Google.Maps.MapsPlatformDatasets.V1Alph" + + "a\312\002(Google\\Maps\\MapsPlatformDatasets\\V1a" + + "lphab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_maps_mapsplatformdatasets_v1alpha_LocalFileSource_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_maps_mapsplatformdatasets_v1alpha_LocalFileSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_mapsplatformdatasets_v1alpha_LocalFileSource_descriptor, + new java.lang.String[] { + "Filename", "FileFormat", + }); + internal_static_google_maps_mapsplatformdatasets_v1alpha_GcsSource_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_maps_mapsplatformdatasets_v1alpha_GcsSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_mapsplatformdatasets_v1alpha_GcsSource_descriptor, + new java.lang.String[] { + "InputUri", "FileFormat", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/Dataset.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/Dataset.java new file mode 100644 index 000000000000..9af2d1b761aa --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/Dataset.java @@ -0,0 +1,3458 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/dataset.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +/** + * + * + *
+ * A representation of a maps platform dataset.
+ * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.Dataset} + */ +public final class Dataset extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.mapsplatformdatasets.v1alpha.Dataset) + DatasetOrBuilder { + private static final long serialVersionUID = 0L; + // Use Dataset.newBuilder() to construct. + private Dataset(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Dataset() { + name_ = ""; + displayName_ = ""; + description_ = ""; + versionId_ = ""; + usage_ = java.util.Collections.emptyList(); + status_ = 0; + versionDescription_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Dataset(); + } + + @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.maps.mapsplatformdatasets.v1alpha.DatasetProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_Dataset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.DatasetProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_Dataset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.class, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder.class); + } + + private int dataSourceCase_ = 0; + private java.lang.Object dataSource_; + + public enum DataSourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + LOCAL_FILE_SOURCE(6), + GCS_SOURCE(7), + DATASOURCE_NOT_SET(0); + private final int value; + + private DataSourceCase(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 DataSourceCase valueOf(int value) { + return forNumber(value); + } + + public static DataSourceCase forNumber(int value) { + switch (value) { + case 6: + return LOCAL_FILE_SOURCE; + case 7: + return GCS_SOURCE; + case 0: + return DATASOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DataSourceCase getDataSourceCase() { + return DataSourceCase.forNumber(dataSourceCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Resource name,
+   * projects/{project}/datasets/{dataset_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; + } + } + /** + * + * + *
+   * Resource name,
+   * projects/{project}/datasets/{dataset_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 DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Human readable name, shown in the console UI. Set by customer.
+   * 
+ * + * string display_name = 2; + * + * @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; + } + } + /** + * + * + *
+   * Human readable name, shown in the console UI. Set by customer.
+   * 
+ * + * string display_name = 2; + * + * @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; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * A description of this dataset; set by the customer.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * A description of this dataset; set by the customer.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object versionId_ = ""; + /** + * + * + *
+   * The version of the dataset.
+   * 
+ * + * string version_id = 4; + * + * @return The versionId. + */ + @java.lang.Override + public java.lang.String getVersionId() { + java.lang.Object ref = versionId_; + 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(); + versionId_ = s; + return s; + } + } + /** + * + * + *
+   * The version of the dataset.
+   * 
+ * + * string version_id = 4; + * + * @return The bytes for versionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionIdBytes() { + java.lang.Object ref = versionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + versionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List usage_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.maps.mapsplatformdatasets.v1alpha.Usage> + usage_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.maps.mapsplatformdatasets.v1alpha.Usage>() { + public com.google.maps.mapsplatformdatasets.v1alpha.Usage convert( + java.lang.Integer from) { + com.google.maps.mapsplatformdatasets.v1alpha.Usage result = + com.google.maps.mapsplatformdatasets.v1alpha.Usage.forNumber(from); + return result == null + ? com.google.maps.mapsplatformdatasets.v1alpha.Usage.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Specified use case(s) for this dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @return A list containing the usage. + */ + @java.lang.Override + public java.util.List getUsageList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.maps.mapsplatformdatasets.v1alpha.Usage>( + usage_, usage_converter_); + } + /** + * + * + *
+   * Specified use case(s) for this dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @return The count of usage. + */ + @java.lang.Override + public int getUsageCount() { + return usage_.size(); + } + /** + * + * + *
+   * Specified use case(s) for this dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @param index The index of the element to return. + * @return The usage at the given index. + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.Usage getUsage(int index) { + return usage_converter_.convert(usage_.get(index)); + } + /** + * + * + *
+   * Specified use case(s) for this dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @return A list containing the enum numeric values on the wire for usage. + */ + @java.lang.Override + public java.util.List getUsageValueList() { + return usage_; + } + /** + * + * + *
+   * Specified use case(s) for this dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of usage at the given index. + */ + @java.lang.Override + public int getUsageValue(int index) { + return usage_.get(index); + } + + private int usageMemoizedSerializedSize; + + public static final int LOCAL_FILE_SOURCE_FIELD_NUMBER = 6; + /** + * + * + *
+   * A local file source for the dataset for a single upload.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.LocalFileSource local_file_source = 6; + * + * @return Whether the localFileSource field is set. + */ + @java.lang.Override + public boolean hasLocalFileSource() { + return dataSourceCase_ == 6; + } + /** + * + * + *
+   * A local file source for the dataset for a single upload.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.LocalFileSource local_file_source = 6; + * + * @return The localFileSource. + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource getLocalFileSource() { + if (dataSourceCase_ == 6) { + return (com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource) dataSource_; + } + return com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.getDefaultInstance(); + } + /** + * + * + *
+   * A local file source for the dataset for a single upload.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.LocalFileSource local_file_source = 6; + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSourceOrBuilder + getLocalFileSourceOrBuilder() { + if (dataSourceCase_ == 6) { + return (com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource) dataSource_; + } + return com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.getDefaultInstance(); + } + + public static final int GCS_SOURCE_FIELD_NUMBER = 7; + /** + * + * + *
+   * A Google Cloud Storage file source for the dataset for a single upload.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.GcsSource gcs_source = 7; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return dataSourceCase_ == 7; + } + /** + * + * + *
+   * A Google Cloud Storage file source for the dataset for a single upload.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.GcsSource gcs_source = 7; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.GcsSource getGcsSource() { + if (dataSourceCase_ == 7) { + return (com.google.maps.mapsplatformdatasets.v1alpha.GcsSource) dataSource_; + } + return com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.getDefaultInstance(); + } + /** + * + * + *
+   * A Google Cloud Storage file source for the dataset for a single upload.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.GcsSource gcs_source = 7; + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if (dataSourceCase_ == 7) { + return (com.google.maps.mapsplatformdatasets.v1alpha.GcsSource) dataSource_; + } + return com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.getDefaultInstance(); + } + + public static final int STATUS_FIELD_NUMBER = 12; + private int status_ = 0; + /** + * + * + *
+   * The status of the import of the latest dataset version.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.State status = 12; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + /** + * + * + *
+   * The status of the import of the latest dataset version.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.State status = 12; + * + * @return The status. + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.State getStatus() { + com.google.maps.mapsplatformdatasets.v1alpha.State result = + com.google.maps.mapsplatformdatasets.v1alpha.State.forNumber(status_); + return result == null + ? com.google.maps.mapsplatformdatasets.v1alpha.State.UNRECOGNIZED + : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Time when the dataset was first created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Time when the dataset was first created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.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. Time when the dataset was first created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.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 = 9; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Time when the dataset metadata was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Time when the dataset metadata was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.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. Time when the dataset metadata was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.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 VERSION_CREATE_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp versionCreateTime_; + /** + * + * + *
+   * Output only. Time when this version of dataset was created. (It happened when importing
+   * data to the dataset)
+   * 
+ * + * + * .google.protobuf.Timestamp version_create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the versionCreateTime field is set. + */ + @java.lang.Override + public boolean hasVersionCreateTime() { + return versionCreateTime_ != null; + } + /** + * + * + *
+   * Output only. Time when this version of dataset was created. (It happened when importing
+   * data to the dataset)
+   * 
+ * + * + * .google.protobuf.Timestamp version_create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The versionCreateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getVersionCreateTime() { + return versionCreateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : versionCreateTime_; + } + /** + * + * + *
+   * Output only. Time when this version of dataset was created. (It happened when importing
+   * data to the dataset)
+   * 
+ * + * + * .google.protobuf.Timestamp version_create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getVersionCreateTimeOrBuilder() { + return versionCreateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : versionCreateTime_; + } + + public static final int VERSION_DESCRIPTION_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object versionDescription_ = ""; + /** + * + * + *
+   * Output only. The description for this version of dataset. It is provided when importing
+   * data to the dataset.
+   * 
+ * + * string version_description = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The versionDescription. + */ + @java.lang.Override + public java.lang.String getVersionDescription() { + java.lang.Object ref = versionDescription_; + 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(); + versionDescription_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The description for this version of dataset. It is provided when importing
+   * data to the dataset.
+   * 
+ * + * string version_description = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for versionDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionDescriptionBytes() { + java.lang.Object ref = versionDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + versionDescription_ = 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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(versionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, versionId_); + } + if (getUsageList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(usageMemoizedSerializedSize); + } + for (int i = 0; i < usage_.size(); i++) { + output.writeEnumNoTag(usage_.get(i)); + } + if (dataSourceCase_ == 6) { + output.writeMessage( + 6, (com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource) dataSource_); + } + if (dataSourceCase_ == 7) { + output.writeMessage(7, (com.google.maps.mapsplatformdatasets.v1alpha.GcsSource) dataSource_); + } + if (createTime_ != null) { + output.writeMessage(8, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(9, getUpdateTime()); + } + if (versionCreateTime_ != null) { + output.writeMessage(10, getVersionCreateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(versionDescription_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, versionDescription_); + } + if (status_ + != com.google.maps.mapsplatformdatasets.v1alpha.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(12, status_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(versionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, versionId_); + } + { + int dataSize = 0; + for (int i = 0; i < usage_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(usage_.get(i)); + } + size += dataSize; + if (!getUsageList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + usageMemoizedSerializedSize = dataSize; + } + if (dataSourceCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource) dataSource_); + } + if (dataSourceCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.maps.mapsplatformdatasets.v1alpha.GcsSource) dataSource_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getUpdateTime()); + } + if (versionCreateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getVersionCreateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(versionDescription_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, versionDescription_); + } + if (status_ + != com.google.maps.mapsplatformdatasets.v1alpha.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, status_); + } + 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.maps.mapsplatformdatasets.v1alpha.Dataset)) { + return super.equals(obj); + } + com.google.maps.mapsplatformdatasets.v1alpha.Dataset other = + (com.google.maps.mapsplatformdatasets.v1alpha.Dataset) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getVersionId().equals(other.getVersionId())) return false; + if (!usage_.equals(other.usage_)) return false; + if (status_ != other.status_) 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 (hasVersionCreateTime() != other.hasVersionCreateTime()) return false; + if (hasVersionCreateTime()) { + if (!getVersionCreateTime().equals(other.getVersionCreateTime())) return false; + } + if (!getVersionDescription().equals(other.getVersionDescription())) return false; + if (!getDataSourceCase().equals(other.getDataSourceCase())) return false; + switch (dataSourceCase_) { + case 6: + if (!getLocalFileSource().equals(other.getLocalFileSource())) return false; + break; + case 7: + if (!getGcsSource().equals(other.getGcsSource())) 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(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + VERSION_ID_FIELD_NUMBER; + hash = (53 * hash) + getVersionId().hashCode(); + if (getUsageCount() > 0) { + hash = (37 * hash) + USAGE_FIELD_NUMBER; + hash = (53 * hash) + usage_.hashCode(); + } + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + status_; + 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 (hasVersionCreateTime()) { + hash = (37 * hash) + VERSION_CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getVersionCreateTime().hashCode(); + } + hash = (37 * hash) + VERSION_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getVersionDescription().hashCode(); + switch (dataSourceCase_) { + case 6: + hash = (37 * hash) + LOCAL_FILE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getLocalFileSource().hashCode(); + break; + case 7: + hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getGcsSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.Dataset parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.Dataset parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.Dataset parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.Dataset 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.maps.mapsplatformdatasets.v1alpha.Dataset parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.Dataset parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.Dataset parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.Dataset 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.maps.mapsplatformdatasets.v1alpha.Dataset parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.Dataset 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.maps.mapsplatformdatasets.v1alpha.Dataset parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.Dataset 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.maps.mapsplatformdatasets.v1alpha.Dataset 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; + } + /** + * + * + *
+   * A representation of a maps platform dataset.
+   * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.Dataset} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.mapsplatformdatasets.v1alpha.Dataset) + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.mapsplatformdatasets.v1alpha.DatasetProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_Dataset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.DatasetProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_Dataset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.class, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder.class); + } + + // Construct using com.google.maps.mapsplatformdatasets.v1alpha.Dataset.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + description_ = ""; + versionId_ = ""; + usage_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + if (localFileSourceBuilder_ != null) { + localFileSourceBuilder_.clear(); + } + if (gcsSourceBuilder_ != null) { + gcsSourceBuilder_.clear(); + } + status_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + versionCreateTime_ = null; + if (versionCreateTimeBuilder_ != null) { + versionCreateTimeBuilder_.dispose(); + versionCreateTimeBuilder_ = null; + } + versionDescription_ = ""; + dataSourceCase_ = 0; + dataSource_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.DatasetProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_Dataset_descriptor; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset getDefaultInstanceForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.Dataset.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset build() { + com.google.maps.mapsplatformdatasets.v1alpha.Dataset result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset buildPartial() { + com.google.maps.mapsplatformdatasets.v1alpha.Dataset result = + new com.google.maps.mapsplatformdatasets.v1alpha.Dataset(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.maps.mapsplatformdatasets.v1alpha.Dataset result) { + if (((bitField0_ & 0x00000010) != 0)) { + usage_ = java.util.Collections.unmodifiableList(usage_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.usage_ = usage_; + } + + private void buildPartial0(com.google.maps.mapsplatformdatasets.v1alpha.Dataset result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.versionId_ = versionId_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.status_ = status_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.versionCreateTime_ = + versionCreateTimeBuilder_ == null + ? versionCreateTime_ + : versionCreateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.versionDescription_ = versionDescription_; + } + } + + private void buildPartialOneofs(com.google.maps.mapsplatformdatasets.v1alpha.Dataset result) { + result.dataSourceCase_ = dataSourceCase_; + result.dataSource_ = this.dataSource_; + if (dataSourceCase_ == 6 && localFileSourceBuilder_ != null) { + result.dataSource_ = localFileSourceBuilder_.build(); + } + if (dataSourceCase_ == 7 && gcsSourceBuilder_ != null) { + result.dataSource_ = gcsSourceBuilder_.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.maps.mapsplatformdatasets.v1alpha.Dataset) { + return mergeFrom((com.google.maps.mapsplatformdatasets.v1alpha.Dataset) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.mapsplatformdatasets.v1alpha.Dataset other) { + if (other == com.google.maps.mapsplatformdatasets.v1alpha.Dataset.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getVersionId().isEmpty()) { + versionId_ = other.versionId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.usage_.isEmpty()) { + if (usage_.isEmpty()) { + usage_ = other.usage_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureUsageIsMutable(); + usage_.addAll(other.usage_); + } + onChanged(); + } + if (other.status_ != 0) { + setStatusValue(other.getStatusValue()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasVersionCreateTime()) { + mergeVersionCreateTime(other.getVersionCreateTime()); + } + if (!other.getVersionDescription().isEmpty()) { + versionDescription_ = other.versionDescription_; + bitField0_ |= 0x00000800; + onChanged(); + } + switch (other.getDataSourceCase()) { + case LOCAL_FILE_SOURCE: + { + mergeLocalFileSource(other.getLocalFileSource()); + break; + } + case GCS_SOURCE: + { + mergeGcsSource(other.getGcsSource()); + break; + } + case DATASOURCE_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: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + versionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + int tmpRaw = input.readEnum(); + ensureUsageIsMutable(); + usage_.add(tmpRaw); + break; + } // case 40 + case 42: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureUsageIsMutable(); + usage_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 42 + case 50: + { + input.readMessage(getLocalFileSourceFieldBuilder().getBuilder(), extensionRegistry); + dataSourceCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage(getGcsSourceFieldBuilder().getBuilder(), extensionRegistry); + dataSourceCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 66 + case 74: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 74 + case 82: + { + input.readMessage( + getVersionCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 82 + case 90: + { + versionDescription_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 90 + case 96: + { + status_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 96 + 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 dataSourceCase_ = 0; + private java.lang.Object dataSource_; + + public DataSourceCase getDataSourceCase() { + return DataSourceCase.forNumber(dataSourceCase_); + } + + public Builder clearDataSource() { + dataSourceCase_ = 0; + dataSource_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Resource name,
+     * projects/{project}/datasets/{dataset_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; + } + } + /** + * + * + *
+     * Resource name,
+     * projects/{project}/datasets/{dataset_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; + } + } + /** + * + * + *
+     * Resource name,
+     * projects/{project}/datasets/{dataset_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; + } + /** + * + * + *
+     * Resource name,
+     * projects/{project}/datasets/{dataset_id}
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name,
+     * projects/{project}/datasets/{dataset_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 java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Human readable name, shown in the console UI. Set by customer.
+     * 
+ * + * string display_name = 2; + * + * @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; + } + } + /** + * + * + *
+     * Human readable name, shown in the console UI. Set by customer.
+     * 
+ * + * string display_name = 2; + * + * @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; + } + } + /** + * + * + *
+     * Human readable name, shown in the console UI. Set by customer.
+     * 
+ * + * string display_name = 2; + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Human readable name, shown in the console UI. Set by customer.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Human readable name, shown in the console UI. Set by customer.
+     * 
+ * + * string display_name = 2; + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * A description of this dataset; set by the customer.
+     * 
+ * + * string description = 3; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A description of this dataset; set by the customer.
+     * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A description of this dataset; set by the customer.
+     * 
+ * + * string description = 3; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A description of this dataset; set by the customer.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A description of this dataset; set by the customer.
+     * 
+ * + * string description = 3; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object versionId_ = ""; + /** + * + * + *
+     * The version of the dataset.
+     * 
+ * + * string version_id = 4; + * + * @return The versionId. + */ + public java.lang.String getVersionId() { + java.lang.Object ref = versionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + versionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The version of the dataset.
+     * 
+ * + * string version_id = 4; + * + * @return The bytes for versionId. + */ + public com.google.protobuf.ByteString getVersionIdBytes() { + java.lang.Object ref = versionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + versionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The version of the dataset.
+     * 
+ * + * string version_id = 4; + * + * @param value The versionId to set. + * @return This builder for chaining. + */ + public Builder setVersionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + versionId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The version of the dataset.
+     * 
+ * + * string version_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearVersionId() { + versionId_ = getDefaultInstance().getVersionId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * The version of the dataset.
+     * 
+ * + * string version_id = 4; + * + * @param value The bytes for versionId to set. + * @return This builder for chaining. + */ + public Builder setVersionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + versionId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.util.List usage_ = java.util.Collections.emptyList(); + + private void ensureUsageIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + usage_ = new java.util.ArrayList(usage_); + bitField0_ |= 0x00000010; + } + } + /** + * + * + *
+     * Specified use case(s) for this dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @return A list containing the usage. + */ + public java.util.List getUsageList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.maps.mapsplatformdatasets.v1alpha.Usage>( + usage_, usage_converter_); + } + /** + * + * + *
+     * Specified use case(s) for this dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @return The count of usage. + */ + public int getUsageCount() { + return usage_.size(); + } + /** + * + * + *
+     * Specified use case(s) for this dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @param index The index of the element to return. + * @return The usage at the given index. + */ + public com.google.maps.mapsplatformdatasets.v1alpha.Usage getUsage(int index) { + return usage_converter_.convert(usage_.get(index)); + } + /** + * + * + *
+     * Specified use case(s) for this dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @param index The index to set the value at. + * @param value The usage to set. + * @return This builder for chaining. + */ + public Builder setUsage(int index, com.google.maps.mapsplatformdatasets.v1alpha.Usage value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsageIsMutable(); + usage_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Specified use case(s) for this dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @param value The usage to add. + * @return This builder for chaining. + */ + public Builder addUsage(com.google.maps.mapsplatformdatasets.v1alpha.Usage value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsageIsMutable(); + usage_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Specified use case(s) for this dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @param values The usage to add. + * @return This builder for chaining. + */ + public Builder addAllUsage( + java.lang.Iterable values) { + ensureUsageIsMutable(); + for (com.google.maps.mapsplatformdatasets.v1alpha.Usage value : values) { + usage_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Specified use case(s) for this dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @return This builder for chaining. + */ + public Builder clearUsage() { + usage_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Specified use case(s) for this dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @return A list containing the enum numeric values on the wire for usage. + */ + public java.util.List getUsageValueList() { + return java.util.Collections.unmodifiableList(usage_); + } + /** + * + * + *
+     * Specified use case(s) for this dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of usage at the given index. + */ + public int getUsageValue(int index) { + return usage_.get(index); + } + /** + * + * + *
+     * Specified use case(s) for this dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for usage to set. + * @return This builder for chaining. + */ + public Builder setUsageValue(int index, int value) { + ensureUsageIsMutable(); + usage_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Specified use case(s) for this dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @param value The enum numeric value on the wire for usage to add. + * @return This builder for chaining. + */ + public Builder addUsageValue(int value) { + ensureUsageIsMutable(); + usage_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Specified use case(s) for this dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @param values The enum numeric values on the wire for usage to add. + * @return This builder for chaining. + */ + public Builder addAllUsageValue(java.lang.Iterable values) { + ensureUsageIsMutable(); + for (int value : values) { + usage_.add(value); + } + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource, + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSourceOrBuilder> + localFileSourceBuilder_; + /** + * + * + *
+     * A local file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.LocalFileSource local_file_source = 6; + * + * @return Whether the localFileSource field is set. + */ + @java.lang.Override + public boolean hasLocalFileSource() { + return dataSourceCase_ == 6; + } + /** + * + * + *
+     * A local file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.LocalFileSource local_file_source = 6; + * + * @return The localFileSource. + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource getLocalFileSource() { + if (localFileSourceBuilder_ == null) { + if (dataSourceCase_ == 6) { + return (com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource) dataSource_; + } + return com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.getDefaultInstance(); + } else { + if (dataSourceCase_ == 6) { + return localFileSourceBuilder_.getMessage(); + } + return com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * A local file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.LocalFileSource local_file_source = 6; + */ + public Builder setLocalFileSource( + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource value) { + if (localFileSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataSource_ = value; + onChanged(); + } else { + localFileSourceBuilder_.setMessage(value); + } + dataSourceCase_ = 6; + return this; + } + /** + * + * + *
+     * A local file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.LocalFileSource local_file_source = 6; + */ + public Builder setLocalFileSource( + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.Builder builderForValue) { + if (localFileSourceBuilder_ == null) { + dataSource_ = builderForValue.build(); + onChanged(); + } else { + localFileSourceBuilder_.setMessage(builderForValue.build()); + } + dataSourceCase_ = 6; + return this; + } + /** + * + * + *
+     * A local file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.LocalFileSource local_file_source = 6; + */ + public Builder mergeLocalFileSource( + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource value) { + if (localFileSourceBuilder_ == null) { + if (dataSourceCase_ == 6 + && dataSource_ + != com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource + .getDefaultInstance()) { + dataSource_ = + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.newBuilder( + (com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource) dataSource_) + .mergeFrom(value) + .buildPartial(); + } else { + dataSource_ = value; + } + onChanged(); + } else { + if (dataSourceCase_ == 6) { + localFileSourceBuilder_.mergeFrom(value); + } else { + localFileSourceBuilder_.setMessage(value); + } + } + dataSourceCase_ = 6; + return this; + } + /** + * + * + *
+     * A local file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.LocalFileSource local_file_source = 6; + */ + public Builder clearLocalFileSource() { + if (localFileSourceBuilder_ == null) { + if (dataSourceCase_ == 6) { + dataSourceCase_ = 0; + dataSource_ = null; + onChanged(); + } + } else { + if (dataSourceCase_ == 6) { + dataSourceCase_ = 0; + dataSource_ = null; + } + localFileSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A local file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.LocalFileSource local_file_source = 6; + */ + public com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.Builder + getLocalFileSourceBuilder() { + return getLocalFileSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A local file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.LocalFileSource local_file_source = 6; + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSourceOrBuilder + getLocalFileSourceOrBuilder() { + if ((dataSourceCase_ == 6) && (localFileSourceBuilder_ != null)) { + return localFileSourceBuilder_.getMessageOrBuilder(); + } else { + if (dataSourceCase_ == 6) { + return (com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource) dataSource_; + } + return com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * A local file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.LocalFileSource local_file_source = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource, + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSourceOrBuilder> + getLocalFileSourceFieldBuilder() { + if (localFileSourceBuilder_ == null) { + if (!(dataSourceCase_ == 6)) { + dataSource_ = + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.getDefaultInstance(); + } + localFileSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource, + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSourceOrBuilder>( + (com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource) dataSource_, + getParentForChildren(), + isClean()); + dataSource_ = null; + } + dataSourceCase_ = 6; + onChanged(); + return localFileSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.GcsSource, + com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.GcsSourceOrBuilder> + gcsSourceBuilder_; + /** + * + * + *
+     * A Google Cloud Storage file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.GcsSource gcs_source = 7; + * + * @return Whether the gcsSource field is set. + */ + @java.lang.Override + public boolean hasGcsSource() { + return dataSourceCase_ == 7; + } + /** + * + * + *
+     * A Google Cloud Storage file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.GcsSource gcs_source = 7; + * + * @return The gcsSource. + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.GcsSource getGcsSource() { + if (gcsSourceBuilder_ == null) { + if (dataSourceCase_ == 7) { + return (com.google.maps.mapsplatformdatasets.v1alpha.GcsSource) dataSource_; + } + return com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.getDefaultInstance(); + } else { + if (dataSourceCase_ == 7) { + return gcsSourceBuilder_.getMessage(); + } + return com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * A Google Cloud Storage file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.GcsSource gcs_source = 7; + */ + public Builder setGcsSource(com.google.maps.mapsplatformdatasets.v1alpha.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataSource_ = value; + onChanged(); + } else { + gcsSourceBuilder_.setMessage(value); + } + dataSourceCase_ = 7; + return this; + } + /** + * + * + *
+     * A Google Cloud Storage file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.GcsSource gcs_source = 7; + */ + public Builder setGcsSource( + com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.Builder builderForValue) { + if (gcsSourceBuilder_ == null) { + dataSource_ = builderForValue.build(); + onChanged(); + } else { + gcsSourceBuilder_.setMessage(builderForValue.build()); + } + dataSourceCase_ = 7; + return this; + } + /** + * + * + *
+     * A Google Cloud Storage file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.GcsSource gcs_source = 7; + */ + public Builder mergeGcsSource(com.google.maps.mapsplatformdatasets.v1alpha.GcsSource value) { + if (gcsSourceBuilder_ == null) { + if (dataSourceCase_ == 7 + && dataSource_ + != com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.getDefaultInstance()) { + dataSource_ = + com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.newBuilder( + (com.google.maps.mapsplatformdatasets.v1alpha.GcsSource) dataSource_) + .mergeFrom(value) + .buildPartial(); + } else { + dataSource_ = value; + } + onChanged(); + } else { + if (dataSourceCase_ == 7) { + gcsSourceBuilder_.mergeFrom(value); + } else { + gcsSourceBuilder_.setMessage(value); + } + } + dataSourceCase_ = 7; + return this; + } + /** + * + * + *
+     * A Google Cloud Storage file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.GcsSource gcs_source = 7; + */ + public Builder clearGcsSource() { + if (gcsSourceBuilder_ == null) { + if (dataSourceCase_ == 7) { + dataSourceCase_ = 0; + dataSource_ = null; + onChanged(); + } + } else { + if (dataSourceCase_ == 7) { + dataSourceCase_ = 0; + dataSource_ = null; + } + gcsSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A Google Cloud Storage file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.GcsSource gcs_source = 7; + */ + public com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.Builder getGcsSourceBuilder() { + return getGcsSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A Google Cloud Storage file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.GcsSource gcs_source = 7; + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.GcsSourceOrBuilder getGcsSourceOrBuilder() { + if ((dataSourceCase_ == 7) && (gcsSourceBuilder_ != null)) { + return gcsSourceBuilder_.getMessageOrBuilder(); + } else { + if (dataSourceCase_ == 7) { + return (com.google.maps.mapsplatformdatasets.v1alpha.GcsSource) dataSource_; + } + return com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * A Google Cloud Storage file source for the dataset for a single upload.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.GcsSource gcs_source = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.GcsSource, + com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.GcsSourceOrBuilder> + getGcsSourceFieldBuilder() { + if (gcsSourceBuilder_ == null) { + if (!(dataSourceCase_ == 7)) { + dataSource_ = com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.getDefaultInstance(); + } + gcsSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.GcsSource, + com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.GcsSourceOrBuilder>( + (com.google.maps.mapsplatformdatasets.v1alpha.GcsSource) dataSource_, + getParentForChildren(), + isClean()); + dataSource_ = null; + } + dataSourceCase_ = 7; + onChanged(); + return gcsSourceBuilder_; + } + + private int status_ = 0; + /** + * + * + *
+     * The status of the import of the latest dataset version.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.State status = 12; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + /** + * + * + *
+     * The status of the import of the latest dataset version.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.State status = 12; + * + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + status_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * The status of the import of the latest dataset version.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.State status = 12; + * + * @return The status. + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.State getStatus() { + com.google.maps.mapsplatformdatasets.v1alpha.State result = + com.google.maps.mapsplatformdatasets.v1alpha.State.forNumber(status_); + return result == null + ? com.google.maps.mapsplatformdatasets.v1alpha.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The status of the import of the latest dataset version.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.State status = 12; + * + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(com.google.maps.mapsplatformdatasets.v1alpha.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + status_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The status of the import of the latest dataset version.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.State status = 12; + * + * @return This builder for chaining. + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000080); + status_ = 0; + 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. Time when the dataset was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Output only. Time when the dataset was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.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. Time when the dataset was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.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_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when the dataset was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.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_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when the dataset was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when the dataset was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000100); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when the dataset was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time when the dataset was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.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. Time when the dataset was first created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 8 [(.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. Time when the dataset metadata was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Output only. Time when the dataset metadata was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.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. Time when the dataset metadata was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.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_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when the dataset metadata was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.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_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when the dataset metadata was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when the dataset metadata was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000200); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when the dataset metadata was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time when the dataset metadata was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.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. Time when the dataset metadata was last updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 9 [(.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.protobuf.Timestamp versionCreateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + versionCreateTimeBuilder_; + /** + * + * + *
+     * Output only. Time when this version of dataset was created. (It happened when importing
+     * data to the dataset)
+     * 
+ * + * + * .google.protobuf.Timestamp version_create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the versionCreateTime field is set. + */ + public boolean hasVersionCreateTime() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
+     * Output only. Time when this version of dataset was created. (It happened when importing
+     * data to the dataset)
+     * 
+ * + * + * .google.protobuf.Timestamp version_create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The versionCreateTime. + */ + public com.google.protobuf.Timestamp getVersionCreateTime() { + if (versionCreateTimeBuilder_ == null) { + return versionCreateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : versionCreateTime_; + } else { + return versionCreateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time when this version of dataset was created. (It happened when importing
+     * data to the dataset)
+     * 
+ * + * + * .google.protobuf.Timestamp version_create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setVersionCreateTime(com.google.protobuf.Timestamp value) { + if (versionCreateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + versionCreateTime_ = value; + } else { + versionCreateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this version of dataset was created. (It happened when importing
+     * data to the dataset)
+     * 
+ * + * + * .google.protobuf.Timestamp version_create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setVersionCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (versionCreateTimeBuilder_ == null) { + versionCreateTime_ = builderForValue.build(); + } else { + versionCreateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this version of dataset was created. (It happened when importing
+     * data to the dataset)
+     * 
+ * + * + * .google.protobuf.Timestamp version_create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeVersionCreateTime(com.google.protobuf.Timestamp value) { + if (versionCreateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && versionCreateTime_ != null + && versionCreateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getVersionCreateTimeBuilder().mergeFrom(value); + } else { + versionCreateTime_ = value; + } + } else { + versionCreateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this version of dataset was created. (It happened when importing
+     * data to the dataset)
+     * 
+ * + * + * .google.protobuf.Timestamp version_create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearVersionCreateTime() { + bitField0_ = (bitField0_ & ~0x00000400); + versionCreateTime_ = null; + if (versionCreateTimeBuilder_ != null) { + versionCreateTimeBuilder_.dispose(); + versionCreateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time when this version of dataset was created. (It happened when importing
+     * data to the dataset)
+     * 
+ * + * + * .google.protobuf.Timestamp version_create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getVersionCreateTimeBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getVersionCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time when this version of dataset was created. (It happened when importing
+     * data to the dataset)
+     * 
+ * + * + * .google.protobuf.Timestamp version_create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getVersionCreateTimeOrBuilder() { + if (versionCreateTimeBuilder_ != null) { + return versionCreateTimeBuilder_.getMessageOrBuilder(); + } else { + return versionCreateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : versionCreateTime_; + } + } + /** + * + * + *
+     * Output only. Time when this version of dataset was created. (It happened when importing
+     * data to the dataset)
+     * 
+ * + * + * .google.protobuf.Timestamp version_create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getVersionCreateTimeFieldBuilder() { + if (versionCreateTimeBuilder_ == null) { + versionCreateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getVersionCreateTime(), getParentForChildren(), isClean()); + versionCreateTime_ = null; + } + return versionCreateTimeBuilder_; + } + + private java.lang.Object versionDescription_ = ""; + /** + * + * + *
+     * Output only. The description for this version of dataset. It is provided when importing
+     * data to the dataset.
+     * 
+ * + * string version_description = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The versionDescription. + */ + public java.lang.String getVersionDescription() { + java.lang.Object ref = versionDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + versionDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The description for this version of dataset. It is provided when importing
+     * data to the dataset.
+     * 
+ * + * string version_description = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for versionDescription. + */ + public com.google.protobuf.ByteString getVersionDescriptionBytes() { + java.lang.Object ref = versionDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + versionDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The description for this version of dataset. It is provided when importing
+     * data to the dataset.
+     * 
+ * + * string version_description = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The versionDescription to set. + * @return This builder for chaining. + */ + public Builder setVersionDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + versionDescription_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The description for this version of dataset. It is provided when importing
+     * data to the dataset.
+     * 
+ * + * string version_description = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVersionDescription() { + versionDescription_ = getDefaultInstance().getVersionDescription(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The description for this version of dataset. It is provided when importing
+     * data to the dataset.
+     * 
+ * + * string version_description = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for versionDescription to set. + * @return This builder for chaining. + */ + public Builder setVersionDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + versionDescription_ = value; + bitField0_ |= 0x00000800; + 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.maps.mapsplatformdatasets.v1alpha.Dataset) + } + + // @@protoc_insertion_point(class_scope:google.maps.mapsplatformdatasets.v1alpha.Dataset) + private static final com.google.maps.mapsplatformdatasets.v1alpha.Dataset DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.mapsplatformdatasets.v1alpha.Dataset(); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.Dataset getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Dataset 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.maps.mapsplatformdatasets.v1alpha.Dataset getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DatasetName.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DatasetName.java new file mode 100644 index 000000000000..d4df273cf4df --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DatasetName.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.maps.mapsplatformdatasets.v1alpha; + +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 DatasetName implements ResourceName { + private static final PathTemplate PROJECT_DATASET = + PathTemplate.createWithoutUrlEncoding("projects/{project}/datasets/{dataset}"); + private volatile Map fieldValuesMap; + private final String project; + private final String dataset; + + @Deprecated + protected DatasetName() { + project = null; + dataset = null; + } + + private DatasetName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + dataset = Preconditions.checkNotNull(builder.getDataset()); + } + + public String getProject() { + return project; + } + + public String getDataset() { + return dataset; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static DatasetName of(String project, String dataset) { + return newBuilder().setProject(project).setDataset(dataset).build(); + } + + public static String format(String project, String dataset) { + return newBuilder().setProject(project).setDataset(dataset).build().toString(); + } + + public static DatasetName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_DATASET.validatedMatch( + formattedString, "DatasetName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("dataset")); + } + + 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 (DatasetName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_DATASET.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 (dataset != null) { + fieldMapBuilder.put("dataset", dataset); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_DATASET.instantiate("project", project, "dataset", dataset); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + DatasetName that = ((DatasetName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.dataset, that.dataset); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(dataset); + return h; + } + + /** Builder for projects/{project}/datasets/{dataset}. */ + public static class Builder { + private String project; + private String dataset; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getDataset() { + return dataset; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setDataset(String dataset) { + this.dataset = dataset; + return this; + } + + private Builder(DatasetName datasetName) { + this.project = datasetName.project; + this.dataset = datasetName.dataset; + } + + public DatasetName build() { + return new DatasetName(this); + } + } +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DatasetOrBuilder.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DatasetOrBuilder.java new file mode 100644 index 000000000000..02bed4cf74b0 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DatasetOrBuilder.java @@ -0,0 +1,435 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/dataset.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +public interface DatasetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.mapsplatformdatasets.v1alpha.Dataset) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name,
+   * projects/{project}/datasets/{dataset_id}
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name,
+   * projects/{project}/datasets/{dataset_id}
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Human readable name, shown in the console UI. Set by customer.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Human readable name, shown in the console UI. Set by customer.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * A description of this dataset; set by the customer.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * A description of this dataset; set by the customer.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * The version of the dataset.
+   * 
+ * + * string version_id = 4; + * + * @return The versionId. + */ + java.lang.String getVersionId(); + /** + * + * + *
+   * The version of the dataset.
+   * 
+ * + * string version_id = 4; + * + * @return The bytes for versionId. + */ + com.google.protobuf.ByteString getVersionIdBytes(); + + /** + * + * + *
+   * Specified use case(s) for this dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @return A list containing the usage. + */ + java.util.List getUsageList(); + /** + * + * + *
+   * Specified use case(s) for this dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @return The count of usage. + */ + int getUsageCount(); + /** + * + * + *
+   * Specified use case(s) for this dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @param index The index of the element to return. + * @return The usage at the given index. + */ + com.google.maps.mapsplatformdatasets.v1alpha.Usage getUsage(int index); + /** + * + * + *
+   * Specified use case(s) for this dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @return A list containing the enum numeric values on the wire for usage. + */ + java.util.List getUsageValueList(); + /** + * + * + *
+   * Specified use case(s) for this dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Usage usage = 5; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of usage at the given index. + */ + int getUsageValue(int index); + + /** + * + * + *
+   * A local file source for the dataset for a single upload.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.LocalFileSource local_file_source = 6; + * + * @return Whether the localFileSource field is set. + */ + boolean hasLocalFileSource(); + /** + * + * + *
+   * A local file source for the dataset for a single upload.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.LocalFileSource local_file_source = 6; + * + * @return The localFileSource. + */ + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource getLocalFileSource(); + /** + * + * + *
+   * A local file source for the dataset for a single upload.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.LocalFileSource local_file_source = 6; + */ + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSourceOrBuilder + getLocalFileSourceOrBuilder(); + + /** + * + * + *
+   * A Google Cloud Storage file source for the dataset for a single upload.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.GcsSource gcs_source = 7; + * + * @return Whether the gcsSource field is set. + */ + boolean hasGcsSource(); + /** + * + * + *
+   * A Google Cloud Storage file source for the dataset for a single upload.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.GcsSource gcs_source = 7; + * + * @return The gcsSource. + */ + com.google.maps.mapsplatformdatasets.v1alpha.GcsSource getGcsSource(); + /** + * + * + *
+   * A Google Cloud Storage file source for the dataset for a single upload.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.GcsSource gcs_source = 7; + */ + com.google.maps.mapsplatformdatasets.v1alpha.GcsSourceOrBuilder getGcsSourceOrBuilder(); + + /** + * + * + *
+   * The status of the import of the latest dataset version.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.State status = 12; + * + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + /** + * + * + *
+   * The status of the import of the latest dataset version.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.State status = 12; + * + * @return The status. + */ + com.google.maps.mapsplatformdatasets.v1alpha.State getStatus(); + + /** + * + * + *
+   * Output only. Time when the dataset was first created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Time when the dataset was first created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Time when the dataset was first created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time when the dataset metadata was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Time when the dataset metadata was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Time when the dataset metadata was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time when this version of dataset was created. (It happened when importing
+   * data to the dataset)
+   * 
+ * + * + * .google.protobuf.Timestamp version_create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the versionCreateTime field is set. + */ + boolean hasVersionCreateTime(); + /** + * + * + *
+   * Output only. Time when this version of dataset was created. (It happened when importing
+   * data to the dataset)
+   * 
+ * + * + * .google.protobuf.Timestamp version_create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The versionCreateTime. + */ + com.google.protobuf.Timestamp getVersionCreateTime(); + /** + * + * + *
+   * Output only. Time when this version of dataset was created. (It happened when importing
+   * data to the dataset)
+   * 
+ * + * + * .google.protobuf.Timestamp version_create_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getVersionCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The description for this version of dataset. It is provided when importing
+   * data to the dataset.
+   * 
+ * + * string version_description = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The versionDescription. + */ + java.lang.String getVersionDescription(); + /** + * + * + *
+   * Output only. The description for this version of dataset. It is provided when importing
+   * data to the dataset.
+   * 
+ * + * string version_description = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for versionDescription. + */ + com.google.protobuf.ByteString getVersionDescriptionBytes(); + + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset.DataSourceCase getDataSourceCase(); +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DatasetProto.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DatasetProto.java new file mode 100644 index 000000000000..53142047f447 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DatasetProto.java @@ -0,0 +1,122 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/dataset.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +public final class DatasetProto { + private DatasetProto() {} + + 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_maps_mapsplatformdatasets_v1alpha_Dataset_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_mapsplatformdatasets_v1alpha_Dataset_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n6google/maps/mapsplatformdatasets/v1alp" + + "ha/dataset.proto\022(google.maps.mapsplatfo" + + "rmdatasets.v1alpha\032\037google/api/field_beh" + + "avior.proto\032\031google/api/resource.proto\032:" + + "google/maps/mapsplatformdatasets/v1alpha" + + "/data_source.proto\032\037google/protobuf/time" + + "stamp.proto\"\256\005\n\007Dataset\022\014\n\004name\030\001 \001(\t\022\024\n" + + "\014display_name\030\002 \001(\t\022\023\n\013description\030\003 \001(\t" + + "\022\022\n\nversion_id\030\004 \001(\t\022>\n\005usage\030\005 \003(\0162/.go" + + "ogle.maps.mapsplatformdatasets.v1alpha.U" + + "sage\022V\n\021local_file_source\030\006 \001(\01329.google" + + ".maps.mapsplatformdatasets.v1alpha.Local" + + "FileSourceH\000\022I\n\ngcs_source\030\007 \001(\01323.googl" + + "e.maps.mapsplatformdatasets.v1alpha.GcsS" + + "ourceH\000\022?\n\006status\030\014 \001(\0162/.google.maps.ma" + + "psplatformdatasets.v1alpha.State\0224\n\013crea" + + "te_time\030\010 \001(\0132\032.google.protobuf.Timestam" + + "pB\003\340A\003\0224\n\013update_time\030\t \001(\0132\032.google.pro" + + "tobuf.TimestampB\003\340A\003\022<\n\023version_create_t" + + "ime\030\n \001(\0132\032.google.protobuf.TimestampB\003\340" + + "A\003\022 \n\023version_description\030\013 \001(\tB\003\340A\003:W\352A" + + "T\n+mapsplatformdatasets.googleapis.com/D" + + "ataset\022%projects/{project}/datasets/{dat" + + "aset}B\r\n\013data_source*u\n\005Usage\022\025\n\021USAGE_U" + + "NSPECIFIED\020\000\022\035\n\031USAGE_DATA_DRIVEN_STYLIN" + + "G\020\001\022\032\n\026USAGE_AREA_AFFORDANCES\020\002\022\032\n\026USAGE" + + "_ASSISTED_DRIVING\020\003*h\n\005State\022\025\n\021STATE_UN" + + "SPECIFIED\020\000\022\023\n\017STATE_IMPORTING\020\001\022\032\n\026STAT" + + "E_IMPORT_SUCCEEDED\020\002\022\027\n\023STATE_IMPORT_FAI" + + "LED\020\003B\362\001\n,com.google.maps.mapsplatformda" + + "tasets.v1alphaB\014DatasetProtoP\001Z\\google.g" + + "olang.org/genproto/googleapis/maps/mapsp" + + "latformdatasets/v1alpha;mapsplatformdata" + + "sets\252\002(Google.Maps.MapsPlatformDatasets." + + "V1Alpha\312\002(Google\\Maps\\MapsPlatformDatase" + + "ts\\V1alphab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.maps.mapsplatformdatasets.v1alpha.DataSourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_maps_mapsplatformdatasets_v1alpha_Dataset_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_maps_mapsplatformdatasets_v1alpha_Dataset_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_mapsplatformdatasets_v1alpha_Dataset_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Description", + "VersionId", + "Usage", + "LocalFileSource", + "GcsSource", + "Status", + "CreateTime", + "UpdateTime", + "VersionCreateTime", + "VersionDescription", + "DataSource", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.maps.mapsplatformdatasets.v1alpha.DataSourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DeleteDatasetRequest.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DeleteDatasetRequest.java new file mode 100644 index 000000000000..e62089bd8d0c --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DeleteDatasetRequest.java @@ -0,0 +1,752 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +/** + * + * + *
+ * Request to delete a dataset.
+ * The dataset to be deleted.
+ * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest} + */ +public final class DeleteDatasetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest) + DeleteDatasetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteDatasetRequest.newBuilder() to construct. + private DeleteDatasetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteDatasetRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteDatasetRequest(); + } + + @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.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest.class, + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Format: projects/${project}/datasets/{dataset_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Format: projects/${project}/datasets/{dataset_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORCE_FIELD_NUMBER = 2; + private boolean force_ = false; + /** + * + * + *
+   * If set to true, any dataset version for this dataset will also be deleted.
+   * (Otherwise, the request will only work if the dataset has no versions.)
+   * 
+ * + * bool force = 2; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + 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_); + } + 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_); + } + 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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest)) { + return super.equals(obj); + } + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest other = + (com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getForce() != other.getForce()) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest 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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest 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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest + 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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest 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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest 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; + } + /** + * + * + *
+   * Request to delete a dataset.
+   * The dataset to be deleted.
+   * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest) + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest.class, + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest.Builder.class); + } + + // Construct using + // com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest.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; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetRequest_descriptor; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest + getDefaultInstanceForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest build() { + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest buildPartial() { + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest result = + new com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.force_ = force_; + } + } + + @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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest) { + return mergeFrom((com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest other) { + if (other + == com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + 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 + 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. Format: projects/${project}/datasets/{dataset_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Format: projects/${project}/datasets/{dataset_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Format: projects/${project}/datasets/{dataset_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Format: projects/${project}/datasets/{dataset_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Format: projects/${project}/datasets/{dataset_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * If set to true, any dataset version for this dataset will also be deleted.
+     * (Otherwise, the request will only work if the dataset has no versions.)
+     * 
+ * + * bool force = 2; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * If set to true, any dataset version for this dataset will also be deleted.
+     * (Otherwise, the request will only work if the dataset has no versions.)
+     * 
+ * + * bool force = 2; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, any dataset version for this dataset will also be deleted.
+     * (Otherwise, the request will only work if the dataset has no versions.)
+     * 
+ * + * bool force = 2; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + bitField0_ = (bitField0_ & ~0x00000002); + force_ = 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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest) + } + + // @@protoc_insertion_point(class_scope:google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest) + private static final com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest(); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteDatasetRequest 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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DeleteDatasetRequestOrBuilder.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DeleteDatasetRequestOrBuilder.java new file mode 100644 index 000000000000..4cb8838bc6c9 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DeleteDatasetRequestOrBuilder.java @@ -0,0 +1,68 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +public interface DeleteDatasetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Format: projects/${project}/datasets/{dataset_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Format: projects/${project}/datasets/{dataset_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * If set to true, any dataset version for this dataset will also be deleted.
+   * (Otherwise, the request will only work if the dataset has no versions.)
+   * 
+ * + * bool force = 2; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DeleteDatasetVersionRequest.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DeleteDatasetVersionRequest.java new file mode 100644 index 000000000000..f2de1e3cd4c0 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DeleteDatasetVersionRequest.java @@ -0,0 +1,660 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +/** + * + * + *
+ * Request to delete a version of a dataset.
+ * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest} + */ +public final class DeleteDatasetVersionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest) + DeleteDatasetVersionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteDatasetVersionRequest.newBuilder() to construct. + private DeleteDatasetVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteDatasetVersionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteDatasetVersionRequest(); + } + + @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.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest.class, + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Format: projects/${project}/datasets/{dataset_id}@{version-id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Format: projects/${project}/datasets/{dataset_id}@{version-id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest)) { + return super.equals(obj); + } + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest other = + (com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest) 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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest 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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest 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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest + 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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest 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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest 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; + } + /** + * + * + *
+   * Request to delete a version of a dataset.
+   * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest) + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetVersionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest.class, + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest.Builder + .class); + } + + // Construct using + // com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest.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.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetVersionRequest_descriptor; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest + getDefaultInstanceForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest build() { + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest buildPartial() { + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest result = + new com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest 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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest) { + return mergeFrom( + (com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest other) { + if (other + == com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest + .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. Format: projects/${project}/datasets/{dataset_id}@{version-id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Format: projects/${project}/datasets/{dataset_id}@{version-id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Format: projects/${project}/datasets/{dataset_id}@{version-id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Format: projects/${project}/datasets/{dataset_id}@{version-id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Format: projects/${project}/datasets/{dataset_id}@{version-id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest) + } + + // @@protoc_insertion_point(class_scope:google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest) + private static final com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest(); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteDatasetVersionRequest 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.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DeleteDatasetVersionRequestOrBuilder.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DeleteDatasetVersionRequestOrBuilder.java new file mode 100644 index 000000000000..2f879f3b6da1 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/DeleteDatasetVersionRequestOrBuilder.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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +public interface DeleteDatasetVersionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Format: projects/${project}/datasets/{dataset_id}@{version-id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Format: projects/${project}/datasets/{dataset_id}@{version-id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/FileFormat.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/FileFormat.java new file mode 100644 index 000000000000..7198f0a253cc --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/FileFormat.java @@ -0,0 +1,244 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/data_source.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +/** + * + * + *
+ * The format of the file being uploaded.
+ * 
+ * + * Protobuf enum {@code google.maps.mapsplatformdatasets.v1alpha.FileFormat} + */ +public enum FileFormat implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified file format.
+   * 
+ * + * FILE_FORMAT_UNSPECIFIED = 0; + */ + FILE_FORMAT_UNSPECIFIED(0), + /** + * + * + *
+   * GeoJson file.
+   * 
+ * + * FILE_FORMAT_GEOJSON = 1; + */ + FILE_FORMAT_GEOJSON(1), + /** + * + * + *
+   * KML file.
+   * 
+ * + * FILE_FORMAT_KML = 2; + */ + FILE_FORMAT_KML(2), + /** + * + * + *
+   * CSV file.
+   * 
+ * + * FILE_FORMAT_CSV = 3; + */ + FILE_FORMAT_CSV(3), + /** + * + * + *
+   * Protobuf file.
+   * 
+ * + * FILE_FORMAT_PROTO = 4; + */ + FILE_FORMAT_PROTO(4), + /** + * + * + *
+   * KMZ file.
+   * 
+ * + * FILE_FORMAT_KMZ = 5; + */ + FILE_FORMAT_KMZ(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified file format.
+   * 
+ * + * FILE_FORMAT_UNSPECIFIED = 0; + */ + public static final int FILE_FORMAT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * GeoJson file.
+   * 
+ * + * FILE_FORMAT_GEOJSON = 1; + */ + public static final int FILE_FORMAT_GEOJSON_VALUE = 1; + /** + * + * + *
+   * KML file.
+   * 
+ * + * FILE_FORMAT_KML = 2; + */ + public static final int FILE_FORMAT_KML_VALUE = 2; + /** + * + * + *
+   * CSV file.
+   * 
+ * + * FILE_FORMAT_CSV = 3; + */ + public static final int FILE_FORMAT_CSV_VALUE = 3; + /** + * + * + *
+   * Protobuf file.
+   * 
+ * + * FILE_FORMAT_PROTO = 4; + */ + public static final int FILE_FORMAT_PROTO_VALUE = 4; + /** + * + * + *
+   * KMZ file.
+   * 
+ * + * FILE_FORMAT_KMZ = 5; + */ + public static final int FILE_FORMAT_KMZ_VALUE = 5; + + 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 FileFormat 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 FileFormat forNumber(int value) { + switch (value) { + case 0: + return FILE_FORMAT_UNSPECIFIED; + case 1: + return FILE_FORMAT_GEOJSON; + case 2: + return FILE_FORMAT_KML; + case 3: + return FILE_FORMAT_CSV; + case 4: + return FILE_FORMAT_PROTO; + case 5: + return FILE_FORMAT_KMZ; + 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 FileFormat findValueByNumber(int number) { + return FileFormat.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.maps.mapsplatformdatasets.v1alpha.DataSourceProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final FileFormat[] VALUES = values(); + + public static FileFormat 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 FileFormat(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.mapsplatformdatasets.v1alpha.FileFormat) +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/GcsSource.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/GcsSource.java new file mode 100644 index 000000000000..4488695c15b9 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/GcsSource.java @@ -0,0 +1,793 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/data_source.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +/** + * + * + *
+ * The details about the data source when it is in Google Cloud Storage.
+ * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.GcsSource} + */ +public final class GcsSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.mapsplatformdatasets.v1alpha.GcsSource) + GcsSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use GcsSource.newBuilder() to construct. + private GcsSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GcsSource() { + inputUri_ = ""; + fileFormat_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcsSource(); + } + + @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.maps.mapsplatformdatasets.v1alpha.DataSourceProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.DataSourceProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.class, + com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.Builder.class); + } + + public static final int INPUT_URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object inputUri_ = ""; + /** + * + * + *
+   * Source data URI. For example, `gs://my_bucket/my_object`.
+   * 
+ * + * string input_uri = 1; + * + * @return The inputUri. + */ + @java.lang.Override + public java.lang.String getInputUri() { + java.lang.Object ref = inputUri_; + 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(); + inputUri_ = s; + return s; + } + } + /** + * + * + *
+   * Source data URI. For example, `gs://my_bucket/my_object`.
+   * 
+ * + * string input_uri = 1; + * + * @return The bytes for inputUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInputUriBytes() { + java.lang.Object ref = inputUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + inputUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILE_FORMAT_FIELD_NUMBER = 2; + private int fileFormat_ = 0; + /** + * + * + *
+   * The file format of the Google Cloud Storage object. This is used mainly for
+   * validation.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @return The enum numeric value on the wire for fileFormat. + */ + @java.lang.Override + public int getFileFormatValue() { + return fileFormat_; + } + /** + * + * + *
+   * The file format of the Google Cloud Storage object. This is used mainly for
+   * validation.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @return The fileFormat. + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.FileFormat getFileFormat() { + com.google.maps.mapsplatformdatasets.v1alpha.FileFormat result = + com.google.maps.mapsplatformdatasets.v1alpha.FileFormat.forNumber(fileFormat_); + return result == null + ? com.google.maps.mapsplatformdatasets.v1alpha.FileFormat.UNRECOGNIZED + : result; + } + + 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(inputUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, inputUri_); + } + if (fileFormat_ + != com.google.maps.mapsplatformdatasets.v1alpha.FileFormat.FILE_FORMAT_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, fileFormat_); + } + 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(inputUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, inputUri_); + } + if (fileFormat_ + != com.google.maps.mapsplatformdatasets.v1alpha.FileFormat.FILE_FORMAT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, fileFormat_); + } + 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.maps.mapsplatformdatasets.v1alpha.GcsSource)) { + return super.equals(obj); + } + com.google.maps.mapsplatformdatasets.v1alpha.GcsSource other = + (com.google.maps.mapsplatformdatasets.v1alpha.GcsSource) obj; + + if (!getInputUri().equals(other.getInputUri())) return false; + if (fileFormat_ != other.fileFormat_) 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) + INPUT_URI_FIELD_NUMBER; + hash = (53 * hash) + getInputUri().hashCode(); + hash = (37 * hash) + FILE_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + fileFormat_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GcsSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GcsSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GcsSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GcsSource 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.maps.mapsplatformdatasets.v1alpha.GcsSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GcsSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GcsSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GcsSource 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.maps.mapsplatformdatasets.v1alpha.GcsSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GcsSource 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.maps.mapsplatformdatasets.v1alpha.GcsSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GcsSource 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.maps.mapsplatformdatasets.v1alpha.GcsSource 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; + } + /** + * + * + *
+   * The details about the data source when it is in Google Cloud Storage.
+   * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.GcsSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.mapsplatformdatasets.v1alpha.GcsSource) + com.google.maps.mapsplatformdatasets.v1alpha.GcsSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.mapsplatformdatasets.v1alpha.DataSourceProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_GcsSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.DataSourceProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_GcsSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.class, + com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.Builder.class); + } + + // Construct using com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + inputUri_ = ""; + fileFormat_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.DataSourceProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_GcsSource_descriptor; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.GcsSource getDefaultInstanceForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.GcsSource build() { + com.google.maps.mapsplatformdatasets.v1alpha.GcsSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.GcsSource buildPartial() { + com.google.maps.mapsplatformdatasets.v1alpha.GcsSource result = + new com.google.maps.mapsplatformdatasets.v1alpha.GcsSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.maps.mapsplatformdatasets.v1alpha.GcsSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.inputUri_ = inputUri_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fileFormat_ = fileFormat_; + } + } + + @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.maps.mapsplatformdatasets.v1alpha.GcsSource) { + return mergeFrom((com.google.maps.mapsplatformdatasets.v1alpha.GcsSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.mapsplatformdatasets.v1alpha.GcsSource other) { + if (other == com.google.maps.mapsplatformdatasets.v1alpha.GcsSource.getDefaultInstance()) + return this; + if (!other.getInputUri().isEmpty()) { + inputUri_ = other.inputUri_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.fileFormat_ != 0) { + setFileFormatValue(other.getFileFormatValue()); + } + 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: + { + inputUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + fileFormat_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object inputUri_ = ""; + /** + * + * + *
+     * Source data URI. For example, `gs://my_bucket/my_object`.
+     * 
+ * + * string input_uri = 1; + * + * @return The inputUri. + */ + public java.lang.String getInputUri() { + java.lang.Object ref = inputUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + inputUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Source data URI. For example, `gs://my_bucket/my_object`.
+     * 
+ * + * string input_uri = 1; + * + * @return The bytes for inputUri. + */ + public com.google.protobuf.ByteString getInputUriBytes() { + java.lang.Object ref = inputUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + inputUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Source data URI. For example, `gs://my_bucket/my_object`.
+     * 
+ * + * string input_uri = 1; + * + * @param value The inputUri to set. + * @return This builder for chaining. + */ + public Builder setInputUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + inputUri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Source data URI. For example, `gs://my_bucket/my_object`.
+     * 
+ * + * string input_uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearInputUri() { + inputUri_ = getDefaultInstance().getInputUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Source data URI. For example, `gs://my_bucket/my_object`.
+     * 
+ * + * string input_uri = 1; + * + * @param value The bytes for inputUri to set. + * @return This builder for chaining. + */ + public Builder setInputUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + inputUri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int fileFormat_ = 0; + /** + * + * + *
+     * The file format of the Google Cloud Storage object. This is used mainly for
+     * validation.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @return The enum numeric value on the wire for fileFormat. + */ + @java.lang.Override + public int getFileFormatValue() { + return fileFormat_; + } + /** + * + * + *
+     * The file format of the Google Cloud Storage object. This is used mainly for
+     * validation.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @param value The enum numeric value on the wire for fileFormat to set. + * @return This builder for chaining. + */ + public Builder setFileFormatValue(int value) { + fileFormat_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The file format of the Google Cloud Storage object. This is used mainly for
+     * validation.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @return The fileFormat. + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.FileFormat getFileFormat() { + com.google.maps.mapsplatformdatasets.v1alpha.FileFormat result = + com.google.maps.mapsplatformdatasets.v1alpha.FileFormat.forNumber(fileFormat_); + return result == null + ? com.google.maps.mapsplatformdatasets.v1alpha.FileFormat.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The file format of the Google Cloud Storage object. This is used mainly for
+     * validation.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @param value The fileFormat to set. + * @return This builder for chaining. + */ + public Builder setFileFormat(com.google.maps.mapsplatformdatasets.v1alpha.FileFormat value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + fileFormat_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The file format of the Google Cloud Storage object. This is used mainly for
+     * validation.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @return This builder for chaining. + */ + public Builder clearFileFormat() { + bitField0_ = (bitField0_ & ~0x00000002); + fileFormat_ = 0; + 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.maps.mapsplatformdatasets.v1alpha.GcsSource) + } + + // @@protoc_insertion_point(class_scope:google.maps.mapsplatformdatasets.v1alpha.GcsSource) + private static final com.google.maps.mapsplatformdatasets.v1alpha.GcsSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.mapsplatformdatasets.v1alpha.GcsSource(); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GcsSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsSource 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.maps.mapsplatformdatasets.v1alpha.GcsSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/GcsSourceOrBuilder.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/GcsSourceOrBuilder.java new file mode 100644 index 000000000000..d566a2c56b92 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/GcsSourceOrBuilder.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/maps/mapsplatformdatasets/v1alpha/data_source.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +public interface GcsSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.mapsplatformdatasets.v1alpha.GcsSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Source data URI. For example, `gs://my_bucket/my_object`.
+   * 
+ * + * string input_uri = 1; + * + * @return The inputUri. + */ + java.lang.String getInputUri(); + /** + * + * + *
+   * Source data URI. For example, `gs://my_bucket/my_object`.
+   * 
+ * + * string input_uri = 1; + * + * @return The bytes for inputUri. + */ + com.google.protobuf.ByteString getInputUriBytes(); + + /** + * + * + *
+   * The file format of the Google Cloud Storage object. This is used mainly for
+   * validation.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @return The enum numeric value on the wire for fileFormat. + */ + int getFileFormatValue(); + /** + * + * + *
+   * The file format of the Google Cloud Storage object. This is used mainly for
+   * validation.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @return The fileFormat. + */ + com.google.maps.mapsplatformdatasets.v1alpha.FileFormat getFileFormat(); +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/GetDatasetRequest.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/GetDatasetRequest.java new file mode 100644 index 000000000000..714c4ca059af --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/GetDatasetRequest.java @@ -0,0 +1,860 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +/** + * + * + *
+ * Request to get the specified dataset.
+ * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest} + */ +public final class GetDatasetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest) + GetDatasetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetDatasetRequest.newBuilder() to construct. + private GetDatasetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDatasetRequest() { + name_ = ""; + publishedUsage_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetDatasetRequest(); + } + + @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.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_GetDatasetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_GetDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest.class, + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Resource name. Can also fetch a specified version
+   * projects/{project}/datasets/{dataset_id}
+   * projects/{project}/datasets/{dataset_id}@{version-id}
+   * In order to retrieve a previous version of the dataset, also provide
+   * the version ID.
+   * Example: projects/123/datasets/assisted-driving-preferences@c7cfa2a8
+   * 
+ * + * + * 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. Resource name. Can also fetch a specified version
+   * projects/{project}/datasets/{dataset_id}
+   * projects/{project}/datasets/{dataset_id}@{version-id}
+   * In order to retrieve a previous version of the dataset, also provide
+   * the version ID.
+   * Example: projects/123/datasets/assisted-driving-preferences@c7cfa2a8
+   * 
+ * + * + * 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 PUBLISHED_USAGE_FIELD_NUMBER = 2; + private int publishedUsage_ = 0; + /** + * + * + *
+   * If specified, will fetch the dataset details of the version published for
+   * the specified use case rather than the latest, if one exists. If a
+   * published version does not exist, will default to getting the dataset
+   * details of the latest version.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.Usage published_usage = 2; + * + * @return The enum numeric value on the wire for publishedUsage. + */ + @java.lang.Override + public int getPublishedUsageValue() { + return publishedUsage_; + } + /** + * + * + *
+   * If specified, will fetch the dataset details of the version published for
+   * the specified use case rather than the latest, if one exists. If a
+   * published version does not exist, will default to getting the dataset
+   * details of the latest version.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.Usage published_usage = 2; + * + * @return The publishedUsage. + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.Usage getPublishedUsage() { + com.google.maps.mapsplatformdatasets.v1alpha.Usage result = + com.google.maps.mapsplatformdatasets.v1alpha.Usage.forNumber(publishedUsage_); + return result == null + ? com.google.maps.mapsplatformdatasets.v1alpha.Usage.UNRECOGNIZED + : result; + } + + 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 (publishedUsage_ + != com.google.maps.mapsplatformdatasets.v1alpha.Usage.USAGE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, publishedUsage_); + } + 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 (publishedUsage_ + != com.google.maps.mapsplatformdatasets.v1alpha.Usage.USAGE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, publishedUsage_); + } + 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.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest)) { + return super.equals(obj); + } + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest other = + (com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (publishedUsage_ != other.publishedUsage_) 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) + PUBLISHED_USAGE_FIELD_NUMBER; + hash = (53 * hash) + publishedUsage_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest 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.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest 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.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest 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.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest 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.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest 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; + } + /** + * + * + *
+   * Request to get the specified dataset.
+   * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest) + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_GetDatasetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_GetDatasetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest.class, + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest.Builder.class); + } + + // Construct using com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + publishedUsage_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_GetDatasetRequest_descriptor; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest + getDefaultInstanceForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest build() { + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest buildPartial() { + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest result = + new com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.publishedUsage_ = publishedUsage_; + } + } + + @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.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest) { + return mergeFrom((com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest other) { + if (other + == com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.publishedUsage_ != 0) { + setPublishedUsageValue(other.getPublishedUsageValue()); + } + 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: + { + publishedUsage_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Resource name. Can also fetch a specified version
+     * projects/{project}/datasets/{dataset_id}
+     * projects/{project}/datasets/{dataset_id}@{version-id}
+     * In order to retrieve a previous version of the dataset, also provide
+     * the version ID.
+     * Example: projects/123/datasets/assisted-driving-preferences@c7cfa2a8
+     * 
+ * + * + * 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. Resource name. Can also fetch a specified version
+     * projects/{project}/datasets/{dataset_id}
+     * projects/{project}/datasets/{dataset_id}@{version-id}
+     * In order to retrieve a previous version of the dataset, also provide
+     * the version ID.
+     * Example: projects/123/datasets/assisted-driving-preferences@c7cfa2a8
+     * 
+ * + * + * 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. Resource name. Can also fetch a specified version
+     * projects/{project}/datasets/{dataset_id}
+     * projects/{project}/datasets/{dataset_id}@{version-id}
+     * In order to retrieve a previous version of the dataset, also provide
+     * the version ID.
+     * Example: projects/123/datasets/assisted-driving-preferences@c7cfa2a8
+     * 
+ * + * + * 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. Resource name. Can also fetch a specified version
+     * projects/{project}/datasets/{dataset_id}
+     * projects/{project}/datasets/{dataset_id}@{version-id}
+     * In order to retrieve a previous version of the dataset, also provide
+     * the version ID.
+     * Example: projects/123/datasets/assisted-driving-preferences@c7cfa2a8
+     * 
+ * + * + * 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. Resource name. Can also fetch a specified version
+     * projects/{project}/datasets/{dataset_id}
+     * projects/{project}/datasets/{dataset_id}@{version-id}
+     * In order to retrieve a previous version of the dataset, also provide
+     * the version ID.
+     * Example: projects/123/datasets/assisted-driving-preferences@c7cfa2a8
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int publishedUsage_ = 0; + /** + * + * + *
+     * If specified, will fetch the dataset details of the version published for
+     * the specified use case rather than the latest, if one exists. If a
+     * published version does not exist, will default to getting the dataset
+     * details of the latest version.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.Usage published_usage = 2; + * + * @return The enum numeric value on the wire for publishedUsage. + */ + @java.lang.Override + public int getPublishedUsageValue() { + return publishedUsage_; + } + /** + * + * + *
+     * If specified, will fetch the dataset details of the version published for
+     * the specified use case rather than the latest, if one exists. If a
+     * published version does not exist, will default to getting the dataset
+     * details of the latest version.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.Usage published_usage = 2; + * + * @param value The enum numeric value on the wire for publishedUsage to set. + * @return This builder for chaining. + */ + public Builder setPublishedUsageValue(int value) { + publishedUsage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * If specified, will fetch the dataset details of the version published for
+     * the specified use case rather than the latest, if one exists. If a
+     * published version does not exist, will default to getting the dataset
+     * details of the latest version.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.Usage published_usage = 2; + * + * @return The publishedUsage. + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.Usage getPublishedUsage() { + com.google.maps.mapsplatformdatasets.v1alpha.Usage result = + com.google.maps.mapsplatformdatasets.v1alpha.Usage.forNumber(publishedUsage_); + return result == null + ? com.google.maps.mapsplatformdatasets.v1alpha.Usage.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * If specified, will fetch the dataset details of the version published for
+     * the specified use case rather than the latest, if one exists. If a
+     * published version does not exist, will default to getting the dataset
+     * details of the latest version.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.Usage published_usage = 2; + * + * @param value The publishedUsage to set. + * @return This builder for chaining. + */ + public Builder setPublishedUsage(com.google.maps.mapsplatformdatasets.v1alpha.Usage value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + publishedUsage_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * If specified, will fetch the dataset details of the version published for
+     * the specified use case rather than the latest, if one exists. If a
+     * published version does not exist, will default to getting the dataset
+     * details of the latest version.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.Usage published_usage = 2; + * + * @return This builder for chaining. + */ + public Builder clearPublishedUsage() { + bitField0_ = (bitField0_ & ~0x00000002); + publishedUsage_ = 0; + 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.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest) + } + + // @@protoc_insertion_point(class_scope:google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest) + private static final com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest(); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDatasetRequest 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.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/GetDatasetRequestOrBuilder.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/GetDatasetRequestOrBuilder.java new file mode 100644 index 000000000000..53080f65e674 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/GetDatasetRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +public interface GetDatasetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name. Can also fetch a specified version
+   * projects/{project}/datasets/{dataset_id}
+   * projects/{project}/datasets/{dataset_id}@{version-id}
+   * In order to retrieve a previous version of the dataset, also provide
+   * the version ID.
+   * Example: projects/123/datasets/assisted-driving-preferences@c7cfa2a8
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Resource name. Can also fetch a specified version
+   * projects/{project}/datasets/{dataset_id}
+   * projects/{project}/datasets/{dataset_id}@{version-id}
+   * In order to retrieve a previous version of the dataset, also provide
+   * the version ID.
+   * Example: projects/123/datasets/assisted-driving-preferences@c7cfa2a8
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * If specified, will fetch the dataset details of the version published for
+   * the specified use case rather than the latest, if one exists. If a
+   * published version does not exist, will default to getting the dataset
+   * details of the latest version.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.Usage published_usage = 2; + * + * @return The enum numeric value on the wire for publishedUsage. + */ + int getPublishedUsageValue(); + /** + * + * + *
+   * If specified, will fetch the dataset details of the version published for
+   * the specified use case rather than the latest, if one exists. If a
+   * published version does not exist, will default to getting the dataset
+   * details of the latest version.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.Usage published_usage = 2; + * + * @return The publishedUsage. + */ + com.google.maps.mapsplatformdatasets.v1alpha.Usage getPublishedUsage(); +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetVersionsRequest.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetVersionsRequest.java new file mode 100644 index 000000000000..2155725e2b4b --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetVersionsRequest.java @@ -0,0 +1,949 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +/** + * + * + *
+ * Request to list of all versions of the dataset.
+ * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest} + */ +public final class ListDatasetVersionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest) + ListDatasetVersionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDatasetVersionsRequest.newBuilder() to construct. + private ListDatasetVersionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDatasetVersionsRequest() { + name_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDatasetVersionsRequest(); + } + + @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.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest.class, + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the dataset to list all the versions for.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the dataset to list all the versions for.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * The maximum number of versions to return per page.
+   * If unspecified (or zero), at most 1000 versions will be returned.
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * 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_ = ""; + /** + * + * + *
+   * The page token, received from a previous GetDatasetVersions call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * The page token, received from a previous GetDatasetVersions call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * 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; + } + } + + 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 (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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_); + } + 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.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest)) { + return super.equals(obj); + } + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest other = + (com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest 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.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest 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.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest + 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.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest 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.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest 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; + } + /** + * + * + *
+   * Request to list of all versions of the dataset.
+   * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest) + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest.class, + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest.Builder + .class); + } + + // Construct using + // com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsRequest_descriptor; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest + getDefaultInstanceForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest build() { + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest buildPartial() { + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest result = + new com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder 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.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest) { + return mergeFrom( + (com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest other) { + if (other + == com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the dataset to list all the versions for.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the dataset to list all the versions for.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the dataset to list all the versions for.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the dataset to list all the versions for.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the dataset to list all the versions for.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of versions to return per page.
+     * If unspecified (or zero), at most 1000 versions will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of versions to return per page.
+     * If unspecified (or zero), at most 1000 versions will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * The maximum number of versions to return per page.
+     * If unspecified (or zero), at most 1000 versions will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * 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_ = ""; + /** + * + * + *
+     * The page token, received from a previous GetDatasetVersions call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The page token, received from a previous GetDatasetVersions call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The page token, received from a previous GetDatasetVersions call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * The page token, received from a previous GetDatasetVersions call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The page token, received from a previous GetDatasetVersions call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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; + } + + @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.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest) + private static final com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest(); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDatasetVersionsRequest 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.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetVersionsRequestOrBuilder.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetVersionsRequestOrBuilder.java new file mode 100644 index 000000000000..832a1b70d25b --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetVersionsRequestOrBuilder.java @@ -0,0 +1,96 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +public interface ListDatasetVersionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the dataset to list all the versions for.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the dataset to list all the versions for.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The maximum number of versions to return per page.
+   * If unspecified (or zero), at most 1000 versions will be returned.
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The page token, received from a previous GetDatasetVersions call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The page token, received from a previous GetDatasetVersions call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetVersionsResponse.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetVersionsResponse.java new file mode 100644 index 000000000000..ab2a52ec0b0d --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetVersionsResponse.java @@ -0,0 +1,1157 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +/** + * + * + *
+ * Response with list of all versions of the dataset.
+ * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse} + */ +public final class ListDatasetVersionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse) + ListDatasetVersionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDatasetVersionsResponse.newBuilder() to construct. + private ListDatasetVersionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDatasetVersionsResponse() { + datasets_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDatasetVersionsResponse(); + } + + @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.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse.class, + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse.Builder.class); + } + + public static final int DATASETS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List datasets_; + /** + * + * + *
+   * All the versions of the dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + @java.lang.Override + public java.util.List getDatasetsList() { + return datasets_; + } + /** + * + * + *
+   * All the versions of the dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + @java.lang.Override + public java.util.List + getDatasetsOrBuilderList() { + return datasets_; + } + /** + * + * + *
+   * All the versions of the dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + @java.lang.Override + public int getDatasetsCount() { + return datasets_.size(); + } + /** + * + * + *
+   * All the versions of the dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset getDatasets(int index) { + return datasets_.get(index); + } + /** + * + * + *
+   * All the versions of the dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder getDatasetsOrBuilder( + int index) { + return datasets_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token that can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token that can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < datasets_.size(); i++) { + output.writeMessage(1, datasets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < datasets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, datasets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse)) { + return super.equals(obj); + } + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse other = + (com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse) obj; + + if (!getDatasetsList().equals(other.getDatasetsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDatasetsCount() > 0) { + hash = (37 * hash) + DATASETS_FIELD_NUMBER; + hash = (53 * hash) + getDatasetsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse 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.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse 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.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse + 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.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse 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.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse 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; + } + /** + * + * + *
+   * Response with list of all versions of the dataset.
+   * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse) + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse.class, + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse.Builder + .class); + } + + // Construct using + // com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (datasetsBuilder_ == null) { + datasets_ = java.util.Collections.emptyList(); + } else { + datasets_ = null; + datasetsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsResponse_descriptor; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse + getDefaultInstanceForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse build() { + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse buildPartial() { + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse result = + new com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse result) { + if (datasetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + datasets_ = java.util.Collections.unmodifiableList(datasets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.datasets_ = datasets_; + } else { + result.datasets_ = datasetsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse 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.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse) { + return mergeFrom( + (com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse other) { + if (other + == com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse + .getDefaultInstance()) return this; + if (datasetsBuilder_ == null) { + if (!other.datasets_.isEmpty()) { + if (datasets_.isEmpty()) { + datasets_ = other.datasets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDatasetsIsMutable(); + datasets_.addAll(other.datasets_); + } + onChanged(); + } + } else { + if (!other.datasets_.isEmpty()) { + if (datasetsBuilder_.isEmpty()) { + datasetsBuilder_.dispose(); + datasetsBuilder_ = null; + datasets_ = other.datasets_; + bitField0_ = (bitField0_ & ~0x00000001); + datasetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDatasetsFieldBuilder() + : null; + } else { + datasetsBuilder_.addAllMessages(other.datasets_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.maps.mapsplatformdatasets.v1alpha.Dataset m = + input.readMessage( + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.parser(), + extensionRegistry); + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + datasets_.add(m); + } else { + datasetsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List datasets_ = + java.util.Collections.emptyList(); + + private void ensureDatasetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + datasets_ = + new java.util.ArrayList( + datasets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.Dataset, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder> + datasetsBuilder_; + + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public java.util.List getDatasetsList() { + if (datasetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(datasets_); + } else { + return datasetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public int getDatasetsCount() { + if (datasetsBuilder_ == null) { + return datasets_.size(); + } else { + return datasetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset getDatasets(int index) { + if (datasetsBuilder_ == null) { + return datasets_.get(index); + } else { + return datasetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder setDatasets( + int index, com.google.maps.mapsplatformdatasets.v1alpha.Dataset value) { + if (datasetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatasetsIsMutable(); + datasets_.set(index, value); + onChanged(); + } else { + datasetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder setDatasets( + int index, com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder builderForValue) { + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + datasets_.set(index, builderForValue.build()); + onChanged(); + } else { + datasetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder addDatasets(com.google.maps.mapsplatformdatasets.v1alpha.Dataset value) { + if (datasetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatasetsIsMutable(); + datasets_.add(value); + onChanged(); + } else { + datasetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder addDatasets( + int index, com.google.maps.mapsplatformdatasets.v1alpha.Dataset value) { + if (datasetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatasetsIsMutable(); + datasets_.add(index, value); + onChanged(); + } else { + datasetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder addDatasets( + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder builderForValue) { + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + datasets_.add(builderForValue.build()); + onChanged(); + } else { + datasetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder addDatasets( + int index, com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder builderForValue) { + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + datasets_.add(index, builderForValue.build()); + onChanged(); + } else { + datasetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder addAllDatasets( + java.lang.Iterable values) { + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, datasets_); + onChanged(); + } else { + datasetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder clearDatasets() { + if (datasetsBuilder_ == null) { + datasets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + datasetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder removeDatasets(int index) { + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + datasets_.remove(index); + onChanged(); + } else { + datasetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder getDatasetsBuilder( + int index) { + return getDatasetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder getDatasetsOrBuilder( + int index) { + if (datasetsBuilder_ == null) { + return datasets_.get(index); + } else { + return datasetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public java.util.List + getDatasetsOrBuilderList() { + if (datasetsBuilder_ != null) { + return datasetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(datasets_); + } + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder addDatasetsBuilder() { + return getDatasetsFieldBuilder() + .addBuilder(com.google.maps.mapsplatformdatasets.v1alpha.Dataset.getDefaultInstance()); + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder addDatasetsBuilder( + int index) { + return getDatasetsFieldBuilder() + .addBuilder( + index, com.google.maps.mapsplatformdatasets.v1alpha.Dataset.getDefaultInstance()); + } + /** + * + * + *
+     * All the versions of the dataset.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public java.util.List + getDatasetsBuilderList() { + return getDatasetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.Dataset, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder> + getDatasetsFieldBuilder() { + if (datasetsBuilder_ == null) { + datasetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.Dataset, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder>( + datasets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + datasets_ = null; + } + return datasetsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @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.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse) + private static final com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse(); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDatasetVersionsResponse 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.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetVersionsResponseOrBuilder.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetVersionsResponseOrBuilder.java new file mode 100644 index 000000000000..8e062293fe2c --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetVersionsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +public interface ListDatasetVersionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * All the versions of the dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + java.util.List getDatasetsList(); + /** + * + * + *
+   * All the versions of the dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + com.google.maps.mapsplatformdatasets.v1alpha.Dataset getDatasets(int index); + /** + * + * + *
+   * All the versions of the dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + int getDatasetsCount(); + /** + * + * + *
+   * All the versions of the dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + java.util.List + getDatasetsOrBuilderList(); + /** + * + * + *
+   * All the versions of the dataset.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder getDatasetsOrBuilder(int index); + + /** + * + * + *
+   * A token that can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token that can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetsRequest.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetsRequest.java new file mode 100644 index 000000000000..d1fe8fc0b411 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetsRequest.java @@ -0,0 +1,941 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +/** + * + * + *
+ * Request to list datasets for the project.
+ * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest} + */ +public final class ListDatasetsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest) + ListDatasetsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDatasetsRequest.newBuilder() to construct. + private ListDatasetsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDatasetsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDatasetsRequest(); + } + + @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.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest.class, + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The name of the project to list all the datasets for.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the project to list all the datasets for.
+   * 
+ * + * + * 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; + /** + * + * + *
+   * The maximum number of versions to return per page.
+   * If unspecified (or zero), at most 1000 datasets will be returned.
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * 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_ = ""; + /** + * + * + *
+   * The page token, received from a previous GetDatasetVersions call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * The page token, received from a previous GetDatasetVersions call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * 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; + } + } + + 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_); + } + 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_); + } + 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.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest)) { + return super.equals(obj); + } + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest other = + (com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest 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.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest 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.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest 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.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest 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.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest 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; + } + /** + * + * + *
+   * Request to list datasets for the project.
+   * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest) + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest.class, + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest.Builder.class); + } + + // Construct using com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest.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_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsRequest_descriptor; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest + getDefaultInstanceForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest build() { + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest buildPartial() { + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest result = + new com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder 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.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest) { + return mergeFrom((com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest other) { + if (other + == com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the project to list all the datasets for.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the project to list all the datasets for.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the project to list all the datasets for.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project to list all the datasets for.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project to list all the datasets for.
+     * 
+ * + * + * 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_; + /** + * + * + *
+     * The maximum number of versions to return per page.
+     * If unspecified (or zero), at most 1000 datasets will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of versions to return per page.
+     * If unspecified (or zero), at most 1000 datasets will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * The maximum number of versions to return per page.
+     * If unspecified (or zero), at most 1000 datasets will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * 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_ = ""; + /** + * + * + *
+     * The page token, received from a previous GetDatasetVersions call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The page token, received from a previous GetDatasetVersions call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The page token, received from a previous GetDatasetVersions call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * The page token, received from a previous GetDatasetVersions call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The page token, received from a previous GetDatasetVersions call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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; + } + + @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.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest) + private static final com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest(); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDatasetsRequest 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.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetsRequestOrBuilder.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetsRequestOrBuilder.java new file mode 100644 index 000000000000..b6992a79188e --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetsRequestOrBuilder.java @@ -0,0 +1,96 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +public interface ListDatasetsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the project to list all the datasets for.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the project to list all the datasets for.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of versions to return per page.
+   * If unspecified (or zero), at most 1000 datasets will be returned.
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The page token, received from a previous GetDatasetVersions call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The page token, received from a previous GetDatasetVersions call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetsResponse.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetsResponse.java new file mode 100644 index 000000000000..22d74936cd72 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetsResponse.java @@ -0,0 +1,1150 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +/** + * + * + *
+ * Response to list datasets for the project.
+ * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse} + */ +public final class ListDatasetsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse) + ListDatasetsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDatasetsResponse.newBuilder() to construct. + private ListDatasetsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDatasetsResponse() { + datasets_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDatasetsResponse(); + } + + @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.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse.class, + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse.Builder.class); + } + + public static final int DATASETS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List datasets_; + /** + * + * + *
+   * All the datasets for the project.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + @java.lang.Override + public java.util.List getDatasetsList() { + return datasets_; + } + /** + * + * + *
+   * All the datasets for the project.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + @java.lang.Override + public java.util.List + getDatasetsOrBuilderList() { + return datasets_; + } + /** + * + * + *
+   * All the datasets for the project.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + @java.lang.Override + public int getDatasetsCount() { + return datasets_.size(); + } + /** + * + * + *
+   * All the datasets for the project.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset getDatasets(int index) { + return datasets_.get(index); + } + /** + * + * + *
+   * All the datasets for the project.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder getDatasetsOrBuilder( + int index) { + return datasets_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token that can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token that can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < datasets_.size(); i++) { + output.writeMessage(1, datasets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < datasets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, datasets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse)) { + return super.equals(obj); + } + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse other = + (com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse) obj; + + if (!getDatasetsList().equals(other.getDatasetsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDatasetsCount() > 0) { + hash = (37 * hash) + DATASETS_FIELD_NUMBER; + hash = (53 * hash) + getDatasetsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse 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.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse 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.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse + 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.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse 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.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse 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; + } + /** + * + * + *
+   * Response to list datasets for the project.
+   * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse) + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse.class, + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse.Builder.class); + } + + // Construct using + // com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (datasetsBuilder_ == null) { + datasets_ = java.util.Collections.emptyList(); + } else { + datasets_ = null; + datasetsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsResponse_descriptor; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse + getDefaultInstanceForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse build() { + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse buildPartial() { + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse result = + new com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse result) { + if (datasetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + datasets_ = java.util.Collections.unmodifiableList(datasets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.datasets_ = datasets_; + } else { + result.datasets_ = datasetsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse 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.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse) { + return mergeFrom((com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse other) { + if (other + == com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse.getDefaultInstance()) + return this; + if (datasetsBuilder_ == null) { + if (!other.datasets_.isEmpty()) { + if (datasets_.isEmpty()) { + datasets_ = other.datasets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDatasetsIsMutable(); + datasets_.addAll(other.datasets_); + } + onChanged(); + } + } else { + if (!other.datasets_.isEmpty()) { + if (datasetsBuilder_.isEmpty()) { + datasetsBuilder_.dispose(); + datasetsBuilder_ = null; + datasets_ = other.datasets_; + bitField0_ = (bitField0_ & ~0x00000001); + datasetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDatasetsFieldBuilder() + : null; + } else { + datasetsBuilder_.addAllMessages(other.datasets_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.maps.mapsplatformdatasets.v1alpha.Dataset m = + input.readMessage( + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.parser(), + extensionRegistry); + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + datasets_.add(m); + } else { + datasetsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List datasets_ = + java.util.Collections.emptyList(); + + private void ensureDatasetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + datasets_ = + new java.util.ArrayList( + datasets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.Dataset, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder> + datasetsBuilder_; + + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public java.util.List getDatasetsList() { + if (datasetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(datasets_); + } else { + return datasetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public int getDatasetsCount() { + if (datasetsBuilder_ == null) { + return datasets_.size(); + } else { + return datasetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset getDatasets(int index) { + if (datasetsBuilder_ == null) { + return datasets_.get(index); + } else { + return datasetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder setDatasets( + int index, com.google.maps.mapsplatformdatasets.v1alpha.Dataset value) { + if (datasetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatasetsIsMutable(); + datasets_.set(index, value); + onChanged(); + } else { + datasetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder setDatasets( + int index, com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder builderForValue) { + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + datasets_.set(index, builderForValue.build()); + onChanged(); + } else { + datasetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder addDatasets(com.google.maps.mapsplatformdatasets.v1alpha.Dataset value) { + if (datasetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatasetsIsMutable(); + datasets_.add(value); + onChanged(); + } else { + datasetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder addDatasets( + int index, com.google.maps.mapsplatformdatasets.v1alpha.Dataset value) { + if (datasetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDatasetsIsMutable(); + datasets_.add(index, value); + onChanged(); + } else { + datasetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder addDatasets( + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder builderForValue) { + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + datasets_.add(builderForValue.build()); + onChanged(); + } else { + datasetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder addDatasets( + int index, com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder builderForValue) { + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + datasets_.add(index, builderForValue.build()); + onChanged(); + } else { + datasetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder addAllDatasets( + java.lang.Iterable values) { + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, datasets_); + onChanged(); + } else { + datasetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder clearDatasets() { + if (datasetsBuilder_ == null) { + datasets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + datasetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public Builder removeDatasets(int index) { + if (datasetsBuilder_ == null) { + ensureDatasetsIsMutable(); + datasets_.remove(index); + onChanged(); + } else { + datasetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder getDatasetsBuilder( + int index) { + return getDatasetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder getDatasetsOrBuilder( + int index) { + if (datasetsBuilder_ == null) { + return datasets_.get(index); + } else { + return datasetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public java.util.List + getDatasetsOrBuilderList() { + if (datasetsBuilder_ != null) { + return datasetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(datasets_); + } + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder addDatasetsBuilder() { + return getDatasetsFieldBuilder() + .addBuilder(com.google.maps.mapsplatformdatasets.v1alpha.Dataset.getDefaultInstance()); + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder addDatasetsBuilder( + int index) { + return getDatasetsFieldBuilder() + .addBuilder( + index, com.google.maps.mapsplatformdatasets.v1alpha.Dataset.getDefaultInstance()); + } + /** + * + * + *
+     * All the datasets for the project.
+     * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + public java.util.List + getDatasetsBuilderList() { + return getDatasetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.Dataset, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder> + getDatasetsFieldBuilder() { + if (datasetsBuilder_ == null) { + datasetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.Dataset, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder>( + datasets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + datasets_ = null; + } + return datasetsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token that can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @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.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse) + private static final com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse(); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDatasetsResponse 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.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetsResponseOrBuilder.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetsResponseOrBuilder.java new file mode 100644 index 000000000000..aa520a57a944 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ListDatasetsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +public interface ListDatasetsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * All the datasets for the project.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + java.util.List getDatasetsList(); + /** + * + * + *
+   * All the datasets for the project.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + com.google.maps.mapsplatformdatasets.v1alpha.Dataset getDatasets(int index); + /** + * + * + *
+   * All the datasets for the project.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + int getDatasetsCount(); + /** + * + * + *
+   * All the datasets for the project.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + java.util.List + getDatasetsOrBuilderList(); + /** + * + * + *
+   * All the datasets for the project.
+   * 
+ * + * repeated .google.maps.mapsplatformdatasets.v1alpha.Dataset datasets = 1; + */ + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder getDatasetsOrBuilder(int index); + + /** + * + * + *
+   * A token that can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token that can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/LocalFileSource.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/LocalFileSource.java new file mode 100644 index 000000000000..161212d12281 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/LocalFileSource.java @@ -0,0 +1,790 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/data_source.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +/** + * + * + *
+ * The details about the data source when it is a local file.
+ * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.LocalFileSource} + */ +public final class LocalFileSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.mapsplatformdatasets.v1alpha.LocalFileSource) + LocalFileSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use LocalFileSource.newBuilder() to construct. + private LocalFileSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LocalFileSource() { + filename_ = ""; + fileFormat_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LocalFileSource(); + } + + @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.maps.mapsplatformdatasets.v1alpha.DataSourceProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_LocalFileSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.DataSourceProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_LocalFileSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.class, + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.Builder.class); + } + + public static final int FILENAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object filename_ = ""; + /** + * + * + *
+   * The file name and extension of the uploaded file.
+   * 
+ * + * string filename = 1; + * + * @return The filename. + */ + @java.lang.Override + public java.lang.String getFilename() { + java.lang.Object ref = filename_; + 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(); + filename_ = s; + return s; + } + } + /** + * + * + *
+   * The file name and extension of the uploaded file.
+   * 
+ * + * string filename = 1; + * + * @return The bytes for filename. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilenameBytes() { + java.lang.Object ref = filename_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filename_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILE_FORMAT_FIELD_NUMBER = 2; + private int fileFormat_ = 0; + /** + * + * + *
+   * The format of the file that is being uploaded.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @return The enum numeric value on the wire for fileFormat. + */ + @java.lang.Override + public int getFileFormatValue() { + return fileFormat_; + } + /** + * + * + *
+   * The format of the file that is being uploaded.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @return The fileFormat. + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.FileFormat getFileFormat() { + com.google.maps.mapsplatformdatasets.v1alpha.FileFormat result = + com.google.maps.mapsplatformdatasets.v1alpha.FileFormat.forNumber(fileFormat_); + return result == null + ? com.google.maps.mapsplatformdatasets.v1alpha.FileFormat.UNRECOGNIZED + : result; + } + + 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(filename_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, filename_); + } + if (fileFormat_ + != com.google.maps.mapsplatformdatasets.v1alpha.FileFormat.FILE_FORMAT_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, fileFormat_); + } + 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(filename_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, filename_); + } + if (fileFormat_ + != com.google.maps.mapsplatformdatasets.v1alpha.FileFormat.FILE_FORMAT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, fileFormat_); + } + 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.maps.mapsplatformdatasets.v1alpha.LocalFileSource)) { + return super.equals(obj); + } + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource other = + (com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource) obj; + + if (!getFilename().equals(other.getFilename())) return false; + if (fileFormat_ != other.fileFormat_) 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) + FILENAME_FIELD_NUMBER; + hash = (53 * hash) + getFilename().hashCode(); + hash = (37 * hash) + FILE_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + fileFormat_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource 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.maps.mapsplatformdatasets.v1alpha.LocalFileSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource 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.maps.mapsplatformdatasets.v1alpha.LocalFileSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource 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.maps.mapsplatformdatasets.v1alpha.LocalFileSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource 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.maps.mapsplatformdatasets.v1alpha.LocalFileSource 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; + } + /** + * + * + *
+   * The details about the data source when it is a local file.
+   * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.LocalFileSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.mapsplatformdatasets.v1alpha.LocalFileSource) + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.mapsplatformdatasets.v1alpha.DataSourceProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_LocalFileSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.DataSourceProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_LocalFileSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.class, + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.Builder.class); + } + + // Construct using com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + filename_ = ""; + fileFormat_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.DataSourceProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_LocalFileSource_descriptor; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource + getDefaultInstanceForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource build() { + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource buildPartial() { + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource result = + new com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.filename_ = filename_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fileFormat_ = fileFormat_; + } + } + + @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.maps.mapsplatformdatasets.v1alpha.LocalFileSource) { + return mergeFrom((com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource other) { + if (other + == com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource.getDefaultInstance()) + return this; + if (!other.getFilename().isEmpty()) { + filename_ = other.filename_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.fileFormat_ != 0) { + setFileFormatValue(other.getFileFormatValue()); + } + 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: + { + filename_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + fileFormat_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object filename_ = ""; + /** + * + * + *
+     * The file name and extension of the uploaded file.
+     * 
+ * + * string filename = 1; + * + * @return The filename. + */ + public java.lang.String getFilename() { + java.lang.Object ref = filename_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filename_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The file name and extension of the uploaded file.
+     * 
+ * + * string filename = 1; + * + * @return The bytes for filename. + */ + public com.google.protobuf.ByteString getFilenameBytes() { + java.lang.Object ref = filename_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filename_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The file name and extension of the uploaded file.
+     * 
+ * + * string filename = 1; + * + * @param value The filename to set. + * @return This builder for chaining. + */ + public Builder setFilename(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filename_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The file name and extension of the uploaded file.
+     * 
+ * + * string filename = 1; + * + * @return This builder for chaining. + */ + public Builder clearFilename() { + filename_ = getDefaultInstance().getFilename(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The file name and extension of the uploaded file.
+     * 
+ * + * string filename = 1; + * + * @param value The bytes for filename to set. + * @return This builder for chaining. + */ + public Builder setFilenameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filename_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int fileFormat_ = 0; + /** + * + * + *
+     * The format of the file that is being uploaded.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @return The enum numeric value on the wire for fileFormat. + */ + @java.lang.Override + public int getFileFormatValue() { + return fileFormat_; + } + /** + * + * + *
+     * The format of the file that is being uploaded.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @param value The enum numeric value on the wire for fileFormat to set. + * @return This builder for chaining. + */ + public Builder setFileFormatValue(int value) { + fileFormat_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The format of the file that is being uploaded.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @return The fileFormat. + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.FileFormat getFileFormat() { + com.google.maps.mapsplatformdatasets.v1alpha.FileFormat result = + com.google.maps.mapsplatformdatasets.v1alpha.FileFormat.forNumber(fileFormat_); + return result == null + ? com.google.maps.mapsplatformdatasets.v1alpha.FileFormat.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The format of the file that is being uploaded.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @param value The fileFormat to set. + * @return This builder for chaining. + */ + public Builder setFileFormat(com.google.maps.mapsplatformdatasets.v1alpha.FileFormat value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + fileFormat_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The format of the file that is being uploaded.
+     * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @return This builder for chaining. + */ + public Builder clearFileFormat() { + bitField0_ = (bitField0_ & ~0x00000002); + fileFormat_ = 0; + 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.maps.mapsplatformdatasets.v1alpha.LocalFileSource) + } + + // @@protoc_insertion_point(class_scope:google.maps.mapsplatformdatasets.v1alpha.LocalFileSource) + private static final com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource(); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.LocalFileSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LocalFileSource 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.maps.mapsplatformdatasets.v1alpha.LocalFileSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/LocalFileSourceOrBuilder.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/LocalFileSourceOrBuilder.java new file mode 100644 index 000000000000..d462a358d687 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/LocalFileSourceOrBuilder.java @@ -0,0 +1,75 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/data_source.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +public interface LocalFileSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.mapsplatformdatasets.v1alpha.LocalFileSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The file name and extension of the uploaded file.
+   * 
+ * + * string filename = 1; + * + * @return The filename. + */ + java.lang.String getFilename(); + /** + * + * + *
+   * The file name and extension of the uploaded file.
+   * 
+ * + * string filename = 1; + * + * @return The bytes for filename. + */ + com.google.protobuf.ByteString getFilenameBytes(); + + /** + * + * + *
+   * The format of the file that is being uploaded.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @return The enum numeric value on the wire for fileFormat. + */ + int getFileFormatValue(); + /** + * + * + *
+   * The format of the file that is being uploaded.
+   * 
+ * + * .google.maps.mapsplatformdatasets.v1alpha.FileFormat file_format = 2; + * + * @return The fileFormat. + */ + com.google.maps.mapsplatformdatasets.v1alpha.FileFormat getFileFormat(); +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsProto.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsProto.java new file mode 100644 index 000000000000..a154d4bd8966 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsProto.java @@ -0,0 +1,214 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +public final class MapsPlatformDatasetsProto { + private MapsPlatformDatasetsProto() {} + + 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_maps_mapsplatformdatasets_v1alpha_CreateDatasetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_mapsplatformdatasets_v1alpha_CreateDatasetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_mapsplatformdatasets_v1alpha_UpdateDatasetMetadataRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_mapsplatformdatasets_v1alpha_UpdateDatasetMetadataRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_mapsplatformdatasets_v1alpha_GetDatasetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_mapsplatformdatasets_v1alpha_GetDatasetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetVersionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetVersionRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nEgoogle/maps/mapsplatformdatasets/v1alp" + + "ha/maps_platform_datasets.proto\022(google." + + "maps.mapsplatformdatasets.v1alpha\032\037googl" + + "e/api/field_behavior.proto\032\031google/api/r" + + "esource.proto\0326google/maps/mapsplatformd" + + "atasets/v1alpha/dataset.proto\032 google/pr" + + "otobuf/field_mask.proto\"\244\001\n\024CreateDatase" + + "tRequest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+cloudr" + + "esourcemanager.googleapis.com/Project\022G\n" + + "\007dataset\030\002 \001(\01321.google.maps.mapsplatfor" + + "mdatasets.v1alpha.DatasetB\003\340A\002\"\230\001\n\034Updat" + + "eDatasetMetadataRequest\022G\n\007dataset\030\001 \001(\013" + + "21.google.maps.mapsplatformdatasets.v1al" + + "pha.DatasetB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032." + + "google.protobuf.FieldMask\"\240\001\n\021GetDataset" + + "Request\022A\n\004name\030\001 \001(\tB3\340A\002\372A-\n+mapsplatf" + + "ormdatasets.googleapis.com/Dataset\022H\n\017pu" + + "blished_usage\030\002 \001(\0162/.google.maps.mapspl" + + "atformdatasets.v1alpha.Usage\"\206\001\n\032ListDat" + + "asetVersionsRequest\022A\n\004name\030\001 \001(\tB3\340A\002\372A" + + "-\n+mapsplatformdatasets.googleapis.com/D" + + "ataset\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030" + + "\003 \001(\t\"{\n\033ListDatasetVersionsResponse\022C\n\010" + + "datasets\030\001 \003(\01321.google.maps.mapsplatfor" + + "mdatasets.v1alpha.Dataset\022\027\n\017next_page_t" + + "oken\030\002 \001(\t\"\201\001\n\023ListDatasetsRequest\022C\n\006pa" + + "rent\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanager" + + ".googleapis.com/Project\022\021\n\tpage_size\030\002 \001" + + "(\005\022\022\n\npage_token\030\003 \001(\t\"t\n\024ListDatasetsRe" + + "sponse\022C\n\010datasets\030\001 \003(\01321.google.maps.m" + + "apsplatformdatasets.v1alpha.Dataset\022\027\n\017n" + + "ext_page_token\030\002 \001(\t\"h\n\024DeleteDatasetReq" + + "uest\022A\n\004name\030\001 \001(\tB3\340A\002\372A-\n+mapsplatform" + + "datasets.googleapis.com/Dataset\022\r\n\005force" + + "\030\002 \001(\010\"`\n\033DeleteDatasetVersionRequest\022A\n" + + "\004name\030\001 \001(\tB3\340A\002\372A-\n+mapsplatformdataset" + + "s.googleapis.com/DatasetB\377\001\n,com.google." + + "maps.mapsplatformdatasets.v1alphaB\031MapsP" + + "latformDatasetsProtoP\001Z\\google.golang.or" + + "g/genproto/googleapis/maps/mapsplatformd" + + "atasets/v1alpha;mapsplatformdatasets\252\002(G" + + "oogle.Maps.MapsPlatformDatasets.V1Alpha\312" + + "\002(Google\\Maps\\MapsPlatformDatasets\\V1alp" + + "hab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.maps.mapsplatformdatasets.v1alpha.DatasetProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_maps_mapsplatformdatasets_v1alpha_CreateDatasetRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_maps_mapsplatformdatasets_v1alpha_CreateDatasetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_mapsplatformdatasets_v1alpha_CreateDatasetRequest_descriptor, + new java.lang.String[] { + "Parent", "Dataset", + }); + internal_static_google_maps_mapsplatformdatasets_v1alpha_UpdateDatasetMetadataRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_maps_mapsplatformdatasets_v1alpha_UpdateDatasetMetadataRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_mapsplatformdatasets_v1alpha_UpdateDatasetMetadataRequest_descriptor, + new java.lang.String[] { + "Dataset", "UpdateMask", + }); + internal_static_google_maps_mapsplatformdatasets_v1alpha_GetDatasetRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_maps_mapsplatformdatasets_v1alpha_GetDatasetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_mapsplatformdatasets_v1alpha_GetDatasetRequest_descriptor, + new java.lang.String[] { + "Name", "PublishedUsage", + }); + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsRequest_descriptor, + new java.lang.String[] { + "Name", "PageSize", "PageToken", + }); + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetVersionsResponse_descriptor, + new java.lang.String[] { + "Datasets", "NextPageToken", + }); + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_mapsplatformdatasets_v1alpha_ListDatasetsResponse_descriptor, + new java.lang.String[] { + "Datasets", "NextPageToken", + }); + internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetRequest_descriptor, + new java.lang.String[] { + "Name", "Force", + }); + internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetVersionRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetVersionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_maps_mapsplatformdatasets_v1alpha_DeleteDatasetVersionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.maps.mapsplatformdatasets.v1alpha.DatasetProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaServiceProto.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaServiceProto.java new file mode 100644 index 000000000000..c06978c1c847 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/MapsPlatformDatasetsV1AlphaServiceProto.java @@ -0,0 +1,120 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets_alpha_service.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +public final class MapsPlatformDatasetsV1AlphaServiceProto { + private MapsPlatformDatasetsV1AlphaServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nSgoogle/maps/mapsplatformdatasets/v1alp" + + "ha/maps_platform_datasets_alpha_service." + + "proto\022(google.maps.mapsplatformdatasets." + + "v1alpha\032\034google/api/annotations.proto\032\027g" + + "oogle/api/client.proto\0326google/maps/maps" + + "platformdatasets/v1alpha/dataset.proto\032E" + + "google/maps/mapsplatformdatasets/v1alpha" + + "/maps_platform_datasets.proto\032\033google/pr" + + "otobuf/empty.proto2\360\013\n\033MapsPlatformDatas" + + "etsV1Alpha\022\313\001\n\rCreateDataset\022>.google.ma" + + "ps.mapsplatformdatasets.v1alpha.CreateDa" + + "tasetRequest\0321.google.maps.mapsplatformd" + + "atasets.v1alpha.Dataset\"G\202\323\344\223\0020\"%/v1alph" + + "a/{parent=projects/*}/datasets:\007dataset\332" + + "A\016parent,dataset\022\350\001\n\025UpdateDatasetMetada" + + "ta\022F.google.maps.mapsplatformdatasets.v1" + + "alpha.UpdateDatasetMetadataRequest\0321.goo" + + "gle.maps.mapsplatformdatasets.v1alpha.Da" + + "taset\"T\202\323\344\223\00282-/v1alpha/{dataset.name=pr" + + "ojects/*/datasets/*}:\007dataset\332A\023dataset," + + "update_mask\022\262\001\n\nGetDataset\022;.google.maps" + + ".mapsplatformdatasets.v1alpha.GetDataset" + + "Request\0321.google.maps.mapsplatformdatase" + + "ts.v1alpha.Dataset\"4\202\323\344\223\002\'\022%/v1alpha/{na" + + "me=projects/*/datasets/*}\332A\004name\022\345\001\n\023Lis" + + "tDatasetVersions\022D.google.maps.mapsplatf" + + "ormdatasets.v1alpha.ListDatasetVersionsR" + + "equest\032E.google.maps.mapsplatformdataset" + + "s.v1alpha.ListDatasetVersionsResponse\"A\202" + + "\323\344\223\0024\0222/v1alpha/{name=projects/*/dataset" + + "s/*}:listVersions\332A\004name\022\305\001\n\014ListDataset" + + "s\022=.google.maps.mapsplatformdatasets.v1a" + + "lpha.ListDatasetsRequest\032>.google.maps.m" + + "apsplatformdatasets.v1alpha.ListDatasets" + + "Response\"6\202\323\344\223\002\'\022%/v1alpha/{parent=proje" + + "cts/*}/datasets\332A\006parent\022\235\001\n\rDeleteDatas" + + "et\022>.google.maps.mapsplatformdatasets.v1" + + "alpha.DeleteDatasetRequest\032\026.google.prot" + + "obuf.Empty\"4\202\323\344\223\002\'*%/v1alpha/{name=proje" + + "cts/*/datasets/*}\332A\004name\022\271\001\n\024DeleteDatas" + + "etVersion\022E.google.maps.mapsplatformdata" + + "sets.v1alpha.DeleteDatasetVersionRequest" + + "\032\026.google.protobuf.Empty\"B\202\323\344\223\0025*3/v1alp" + + "ha/{name=projects/*/datasets/*}:deleteVe" + + "rsion\332A\004name\032W\312A#mapsplatformdatasets.go" + + "ogleapis.com\322A.https://www.googleapis.co" + + "m/auth/cloud-platformB\230\002\n,com.google.map" + + "s.mapsplatformdatasets.v1alphaB\'MapsPlat" + + "formDatasetsV1AlphaServiceProtoP\001Z\\googl" + + "e.golang.org/genproto/googleapis/maps/ma" + + "psplatformdatasets/v1alpha;mapsplatformd" + + "atasets\370\001\001\242\002\005MDV1A\252\002(Google.Maps.MapsPla" + + "tformDatasets.V1Alpha\312\002(Google\\Maps\\Maps" + + "PlatformDatasets\\V1alphab\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.maps.mapsplatformdatasets.v1alpha.DatasetProto.getDescriptor(), + com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.maps.mapsplatformdatasets.v1alpha.DatasetProto.getDescriptor(); + com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ProjectName.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ProjectName.java new file mode 100644 index 000000000000..c7a8b3ede19b --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/ProjectName.java @@ -0,0 +1,168 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha; + +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 ProjectName implements ResourceName { + private static final PathTemplate PROJECT = + PathTemplate.createWithoutUrlEncoding("projects/{project}"); + private volatile Map fieldValuesMap; + private final String project; + + @Deprecated + protected ProjectName() { + project = null; + } + + private ProjectName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + } + + public String getProject() { + return project; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProjectName of(String project) { + return newBuilder().setProject(project).build(); + } + + public static String format(String project) { + return newBuilder().setProject(project).build().toString(); + } + + public static ProjectName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT.validatedMatch( + formattedString, "ProjectName.parse: formattedString not in valid format"); + return of(matchMap.get("project")); + } + + 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 (ProjectName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT.instantiate("project", project); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ProjectName that = ((ProjectName) o); + return Objects.equals(this.project, that.project); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + return h; + } + + /** Builder for projects/{project}. */ + public static class Builder { + private String project; + + protected Builder() {} + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder(ProjectName projectName) { + this.project = projectName.project; + } + + public ProjectName build() { + return new ProjectName(this); + } + } +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/State.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/State.java new file mode 100644 index 000000000000..583c767c37a6 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/State.java @@ -0,0 +1,200 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/dataset.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +/** + * + * + *
+ * State specifies the status of the import of the latest dataset version.
+ * 
+ * + * Protobuf enum {@code google.maps.mapsplatformdatasets.v1alpha.State} + */ +public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The state of this dataset is not set.
+   * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+   * The dataset version is getting imported.
+   * 
+ * + * STATE_IMPORTING = 1; + */ + STATE_IMPORTING(1), + /** + * + * + *
+   * The dataset version succeeded in getting imported.
+   * 
+ * + * STATE_IMPORT_SUCCEEDED = 2; + */ + STATE_IMPORT_SUCCEEDED(2), + /** + * + * + *
+   * The dataset version failed to get imported.
+   * 
+ * + * STATE_IMPORT_FAILED = 3; + */ + STATE_IMPORT_FAILED(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The state of this dataset is not set.
+   * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * The dataset version is getting imported.
+   * 
+ * + * STATE_IMPORTING = 1; + */ + public static final int STATE_IMPORTING_VALUE = 1; + /** + * + * + *
+   * The dataset version succeeded in getting imported.
+   * 
+ * + * STATE_IMPORT_SUCCEEDED = 2; + */ + public static final int STATE_IMPORT_SUCCEEDED_VALUE = 2; + /** + * + * + *
+   * The dataset version failed to get imported.
+   * 
+ * + * STATE_IMPORT_FAILED = 3; + */ + public static final int STATE_IMPORT_FAILED_VALUE = 3; + + 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 State 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 State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return STATE_IMPORTING; + case 2: + return STATE_IMPORT_SUCCEEDED; + case 3: + return STATE_IMPORT_FAILED; + 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 State findValueByNumber(int number) { + return State.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.maps.mapsplatformdatasets.v1alpha.DatasetProto.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final State[] VALUES = values(); + + public static State 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 State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.mapsplatformdatasets.v1alpha.State) +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/UpdateDatasetMetadataRequest.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/UpdateDatasetMetadataRequest.java new file mode 100644 index 000000000000..6c988b4176f5 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/UpdateDatasetMetadataRequest.java @@ -0,0 +1,1051 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +/** + * + * + *
+ * Request to update the metadata fields of the dataset.
+ * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest} + */ +public final class UpdateDatasetMetadataRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest) + UpdateDatasetMetadataRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateDatasetMetadataRequest.newBuilder() to construct. + private UpdateDatasetMetadataRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateDatasetMetadataRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateDatasetMetadataRequest(); + } + + @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.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_UpdateDatasetMetadataRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_UpdateDatasetMetadataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest.class, + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest.Builder + .class); + } + + public static final int DATASET_FIELD_NUMBER = 1; + private com.google.maps.mapsplatformdatasets.v1alpha.Dataset dataset_; + /** + * + * + *
+   * Required. The dataset to update. The dataset's name is used to identify the dataset
+   * to be updated. The name has the format:
+   * projects/{project}/datasets/{dataset_id}
+   * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataset field is set. + */ + @java.lang.Override + public boolean hasDataset() { + return dataset_ != null; + } + /** + * + * + *
+   * Required. The dataset to update. The dataset's name is used to identify the dataset
+   * to be updated. The name has the format:
+   * projects/{project}/datasets/{dataset_id}
+   * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataset. + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset getDataset() { + return dataset_ == null + ? com.google.maps.mapsplatformdatasets.v1alpha.Dataset.getDefaultInstance() + : dataset_; + } + /** + * + * + *
+   * Required. The dataset to update. The dataset's name is used to identify the dataset
+   * to be updated. The name has the format:
+   * projects/{project}/datasets/{dataset_id}
+   * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder getDatasetOrBuilder() { + return dataset_ == null + ? com.google.maps.mapsplatformdatasets.v1alpha.Dataset.getDefaultInstance() + : dataset_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The list of fields to be updated. Support the value "*" for full
+   * replacement.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The list of fields to be updated. Support the value "*" for full
+   * replacement.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The list of fields to be updated. Support the value "*" for full
+   * replacement.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (dataset_ != null) { + output.writeMessage(1, getDataset()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dataset_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDataset()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + 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.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest)) { + return super.equals(obj); + } + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest other = + (com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest) obj; + + if (hasDataset() != other.hasDataset()) return false; + if (hasDataset()) { + if (!getDataset().equals(other.getDataset())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) 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 (hasDataset()) { + hash = (37 * hash) + DATASET_FIELD_NUMBER; + hash = (53 * hash) + getDataset().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest 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.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest 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.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest + 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.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest 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.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest 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; + } + /** + * + * + *
+   * Request to update the metadata fields of the dataset.
+   * 
+ * + * Protobuf type {@code google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest) + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_UpdateDatasetMetadataRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_UpdateDatasetMetadataRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest.class, + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest.Builder + .class); + } + + // Construct using + // com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dataset_ = null; + if (datasetBuilder_ != null) { + datasetBuilder_.dispose(); + datasetBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsProto + .internal_static_google_maps_mapsplatformdatasets_v1alpha_UpdateDatasetMetadataRequest_descriptor; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest + getDefaultInstanceForType() { + return com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest build() { + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest + buildPartial() { + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest result = + new com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dataset_ = datasetBuilder_ == null ? dataset_ : datasetBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.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.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest) { + return mergeFrom( + (com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest other) { + if (other + == com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest + .getDefaultInstance()) return this; + if (other.hasDataset()) { + mergeDataset(other.getDataset()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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(getDatasetFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.maps.mapsplatformdatasets.v1alpha.Dataset dataset_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.Dataset, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder> + datasetBuilder_; + /** + * + * + *
+     * Required. The dataset to update. The dataset's name is used to identify the dataset
+     * to be updated. The name has the format:
+     * projects/{project}/datasets/{dataset_id}
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataset field is set. + */ + public boolean hasDataset() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The dataset to update. The dataset's name is used to identify the dataset
+     * to be updated. The name has the format:
+     * projects/{project}/datasets/{dataset_id}
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataset. + */ + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset getDataset() { + if (datasetBuilder_ == null) { + return dataset_ == null + ? com.google.maps.mapsplatformdatasets.v1alpha.Dataset.getDefaultInstance() + : dataset_; + } else { + return datasetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The dataset to update. The dataset's name is used to identify the dataset
+     * to be updated. The name has the format:
+     * projects/{project}/datasets/{dataset_id}
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDataset(com.google.maps.mapsplatformdatasets.v1alpha.Dataset value) { + if (datasetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataset_ = value; + } else { + datasetBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dataset to update. The dataset's name is used to identify the dataset
+     * to be updated. The name has the format:
+     * projects/{project}/datasets/{dataset_id}
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDataset( + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder builderForValue) { + if (datasetBuilder_ == null) { + dataset_ = builderForValue.build(); + } else { + datasetBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dataset to update. The dataset's name is used to identify the dataset
+     * to be updated. The name has the format:
+     * projects/{project}/datasets/{dataset_id}
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDataset(com.google.maps.mapsplatformdatasets.v1alpha.Dataset value) { + if (datasetBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && dataset_ != null + && dataset_ + != com.google.maps.mapsplatformdatasets.v1alpha.Dataset.getDefaultInstance()) { + getDatasetBuilder().mergeFrom(value); + } else { + dataset_ = value; + } + } else { + datasetBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dataset to update. The dataset's name is used to identify the dataset
+     * to be updated. The name has the format:
+     * projects/{project}/datasets/{dataset_id}
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDataset() { + bitField0_ = (bitField0_ & ~0x00000001); + dataset_ = null; + if (datasetBuilder_ != null) { + datasetBuilder_.dispose(); + datasetBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dataset to update. The dataset's name is used to identify the dataset
+     * to be updated. The name has the format:
+     * projects/{project}/datasets/{dataset_id}
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder getDatasetBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getDatasetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The dataset to update. The dataset's name is used to identify the dataset
+     * to be updated. The name has the format:
+     * projects/{project}/datasets/{dataset_id}
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder getDatasetOrBuilder() { + if (datasetBuilder_ != null) { + return datasetBuilder_.getMessageOrBuilder(); + } else { + return dataset_ == null + ? com.google.maps.mapsplatformdatasets.v1alpha.Dataset.getDefaultInstance() + : dataset_; + } + } + /** + * + * + *
+     * Required. The dataset to update. The dataset's name is used to identify the dataset
+     * to be updated. The name has the format:
+     * projects/{project}/datasets/{dataset_id}
+     * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.Dataset, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder> + getDatasetFieldBuilder() { + if (datasetBuilder_ == null) { + datasetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.maps.mapsplatformdatasets.v1alpha.Dataset, + com.google.maps.mapsplatformdatasets.v1alpha.Dataset.Builder, + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder>( + getDataset(), getParentForChildren(), isClean()); + dataset_ = null; + } + return datasetBuilder_; + } + + 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_; + /** + * + * + *
+     * The list of fields to be updated. Support the value "*" for full
+     * replacement.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The list of fields to be updated. Support the value "*" for full
+     * replacement.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @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(); + } + } + /** + * + * + *
+     * The list of fields to be updated. Support the value "*" for full
+     * replacement.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of fields to be updated. Support the value "*" for full
+     * replacement.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of fields to be updated. Support the value "*" for full
+     * replacement.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of fields to be updated. Support the value "*" for full
+     * replacement.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The list of fields to be updated. Support the value "*" for full
+     * replacement.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The list of fields to be updated. Support the value "*" for full
+     * replacement.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The list of fields to be updated. Support the value "*" for full
+     * replacement.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + 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_; + } + + @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.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest) + } + + // @@protoc_insertion_point(class_scope:google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest) + private static final com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest(); + } + + public static com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateDatasetMetadataRequest 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.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/UpdateDatasetMetadataRequestOrBuilder.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/UpdateDatasetMetadataRequestOrBuilder.java new file mode 100644 index 000000000000..e4dca572cfc7 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/UpdateDatasetMetadataRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +public interface UpdateDatasetMetadataRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The dataset to update. The dataset's name is used to identify the dataset
+   * to be updated. The name has the format:
+   * projects/{project}/datasets/{dataset_id}
+   * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataset field is set. + */ + boolean hasDataset(); + /** + * + * + *
+   * Required. The dataset to update. The dataset's name is used to identify the dataset
+   * to be updated. The name has the format:
+   * projects/{project}/datasets/{dataset_id}
+   * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataset. + */ + com.google.maps.mapsplatformdatasets.v1alpha.Dataset getDataset(); + /** + * + * + *
+   * Required. The dataset to update. The dataset's name is used to identify the dataset
+   * to be updated. The name has the format:
+   * projects/{project}/datasets/{dataset_id}
+   * 
+ * + * + * .google.maps.mapsplatformdatasets.v1alpha.Dataset dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.maps.mapsplatformdatasets.v1alpha.DatasetOrBuilder getDatasetOrBuilder(); + + /** + * + * + *
+   * The list of fields to be updated. Support the value "*" for full
+   * replacement.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The list of fields to be updated. Support the value "*" for full
+   * replacement.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The list of fields to be updated. Support the value "*" for full
+   * replacement.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/Usage.java b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/Usage.java new file mode 100644 index 000000000000..ecec881a3c0a --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/java/com/google/maps/mapsplatformdatasets/v1alpha/Usage.java @@ -0,0 +1,201 @@ +/* + * 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/maps/mapsplatformdatasets/v1alpha/dataset.proto + +package com.google.maps.mapsplatformdatasets.v1alpha; + +/** + * + * + *
+ * Usage specifies where the data is intended to be used to inform how to
+ * process the data.
+ * 
+ * + * Protobuf enum {@code google.maps.mapsplatformdatasets.v1alpha.Usage} + */ +public enum Usage implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The usage of this dataset is not set.
+   * 
+ * + * USAGE_UNSPECIFIED = 0; + */ + USAGE_UNSPECIFIED(0), + /** + * + * + *
+   * This dataset will be used for data driven styling.
+   * 
+ * + * USAGE_DATA_DRIVEN_STYLING = 1; + */ + USAGE_DATA_DRIVEN_STYLING(1), + /** + * + * + *
+   * This dataset will be used for area affordances in routing.
+   * 
+ * + * USAGE_AREA_AFFORDANCES = 2; + */ + USAGE_AREA_AFFORDANCES(2), + /** + * + * + *
+   * This dataset will be used for assisted driving in routing.
+   * 
+ * + * USAGE_ASSISTED_DRIVING = 3; + */ + USAGE_ASSISTED_DRIVING(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The usage of this dataset is not set.
+   * 
+ * + * USAGE_UNSPECIFIED = 0; + */ + public static final int USAGE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * This dataset will be used for data driven styling.
+   * 
+ * + * USAGE_DATA_DRIVEN_STYLING = 1; + */ + public static final int USAGE_DATA_DRIVEN_STYLING_VALUE = 1; + /** + * + * + *
+   * This dataset will be used for area affordances in routing.
+   * 
+ * + * USAGE_AREA_AFFORDANCES = 2; + */ + public static final int USAGE_AREA_AFFORDANCES_VALUE = 2; + /** + * + * + *
+   * This dataset will be used for assisted driving in routing.
+   * 
+ * + * USAGE_ASSISTED_DRIVING = 3; + */ + public static final int USAGE_ASSISTED_DRIVING_VALUE = 3; + + 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 Usage 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 Usage forNumber(int value) { + switch (value) { + case 0: + return USAGE_UNSPECIFIED; + case 1: + return USAGE_DATA_DRIVEN_STYLING; + case 2: + return USAGE_AREA_AFFORDANCES; + case 3: + return USAGE_ASSISTED_DRIVING; + 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 Usage findValueByNumber(int number) { + return Usage.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.maps.mapsplatformdatasets.v1alpha.DatasetProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Usage[] VALUES = values(); + + public static Usage 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 Usage(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.maps.mapsplatformdatasets.v1alpha.Usage) +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/proto/google/maps/mapsplatformdatasets/v1alpha/data_source.proto b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/proto/google/maps/mapsplatformdatasets/v1alpha/data_source.proto new file mode 100644 index 000000000000..cc80b58f3be3 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/proto/google/maps/mapsplatformdatasets/v1alpha/data_source.proto @@ -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 +// +// 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.maps.mapsplatformdatasets.v1alpha; + +option csharp_namespace = "Google.Maps.MapsPlatformDatasets.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/maps/mapsplatformdatasets/v1alpha;mapsplatformdatasets"; +option java_multiple_files = true; +option java_outer_classname = "DataSourceProto"; +option java_package = "com.google.maps.mapsplatformdatasets.v1alpha"; +option php_namespace = "Google\\Maps\\MapsPlatformDatasets\\V1alpha"; + +// The details about the data source when it is a local file. +message LocalFileSource { + // The file name and extension of the uploaded file. + string filename = 1; + + // The format of the file that is being uploaded. + FileFormat file_format = 2; +} + +// The details about the data source when it is in Google Cloud Storage. +message GcsSource { + // Source data URI. For example, `gs://my_bucket/my_object`. + string input_uri = 1; + + // The file format of the Google Cloud Storage object. This is used mainly for + // validation. + FileFormat file_format = 2; +} + +// The format of the file being uploaded. +enum FileFormat { + // Unspecified file format. + FILE_FORMAT_UNSPECIFIED = 0; + + // GeoJson file. + FILE_FORMAT_GEOJSON = 1; + + // KML file. + FILE_FORMAT_KML = 2; + + // CSV file. + FILE_FORMAT_CSV = 3; + + // Protobuf file. + FILE_FORMAT_PROTO = 4; + + // KMZ file. + FILE_FORMAT_KMZ = 5; +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/proto/google/maps/mapsplatformdatasets/v1alpha/dataset.proto b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/proto/google/maps/mapsplatformdatasets/v1alpha/dataset.proto new file mode 100644 index 000000000000..64e83cb4d908 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/proto/google/maps/mapsplatformdatasets/v1alpha/dataset.proto @@ -0,0 +1,110 @@ +// 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. + +syntax = "proto3"; + +package google.maps.mapsplatformdatasets.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/maps/mapsplatformdatasets/v1alpha/data_source.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Maps.MapsPlatformDatasets.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/maps/mapsplatformdatasets/v1alpha;mapsplatformdatasets"; +option java_multiple_files = true; +option java_outer_classname = "DatasetProto"; +option java_package = "com.google.maps.mapsplatformdatasets.v1alpha"; +option php_namespace = "Google\\Maps\\MapsPlatformDatasets\\V1alpha"; + +// A representation of a maps platform dataset. +message Dataset { + option (google.api.resource) = { + type: "mapsplatformdatasets.googleapis.com/Dataset" + pattern: "projects/{project}/datasets/{dataset}" + }; + + // Resource name, + // projects/{project}/datasets/{dataset_id} + string name = 1; + + // Human readable name, shown in the console UI. Set by customer. + string display_name = 2; + + // A description of this dataset; set by the customer. + string description = 3; + + // The version of the dataset. + string version_id = 4; + + // Specified use case(s) for this dataset. + repeated Usage usage = 5; + + // Details about the source of the data for the dataset. + oneof data_source { + // A local file source for the dataset for a single upload. + LocalFileSource local_file_source = 6; + + // A Google Cloud Storage file source for the dataset for a single upload. + GcsSource gcs_source = 7; + } + + // The status of the import of the latest dataset version. + State status = 12; + + // Output only. Time when the dataset was first created. + google.protobuf.Timestamp create_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the dataset metadata was last updated. + google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when this version of dataset was created. (It happened when importing + // data to the dataset) + google.protobuf.Timestamp version_create_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The description for this version of dataset. It is provided when importing + // data to the dataset. + string version_description = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Usage specifies where the data is intended to be used to inform how to +// process the data. +enum Usage { + // The usage of this dataset is not set. + USAGE_UNSPECIFIED = 0; + + // This dataset will be used for data driven styling. + USAGE_DATA_DRIVEN_STYLING = 1; + + // This dataset will be used for area affordances in routing. + USAGE_AREA_AFFORDANCES = 2; + + // This dataset will be used for assisted driving in routing. + USAGE_ASSISTED_DRIVING = 3; +} + +// State specifies the status of the import of the latest dataset version. +enum State { + // The state of this dataset is not set. + STATE_UNSPECIFIED = 0; + + // The dataset version is getting imported. + STATE_IMPORTING = 1; + + // The dataset version succeeded in getting imported. + STATE_IMPORT_SUCCEEDED = 2; + + // The dataset version failed to get imported. + STATE_IMPORT_FAILED = 3; +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/proto/google/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/proto/google/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto new file mode 100644 index 000000000000..7f2f42035683 --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/proto/google/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto @@ -0,0 +1,167 @@ +// 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. + +syntax = "proto3"; + +package google.maps.mapsplatformdatasets.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/maps/mapsplatformdatasets/v1alpha/dataset.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Maps.MapsPlatformDatasets.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/maps/mapsplatformdatasets/v1alpha;mapsplatformdatasets"; +option java_multiple_files = true; +option java_outer_classname = "MapsPlatformDatasetsProto"; +option java_package = "com.google.maps.mapsplatformdatasets.v1alpha"; +option php_namespace = "Google\\Maps\\MapsPlatformDatasets\\V1alpha"; + +// Request to create a maps dataset. +message CreateDatasetRequest { + // Required. Parent project that will own the dataset. + // Format: projects/{$project_number} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The dataset version to create. + Dataset dataset = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to update the metadata fields of the dataset. +message UpdateDatasetMetadataRequest { + // Required. The dataset to update. The dataset's name is used to identify the dataset + // to be updated. The name has the format: + // projects/{project}/datasets/{dataset_id} + Dataset dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. Support the value "*" for full + // replacement. + google.protobuf.FieldMask update_mask = 2; +} + +// Request to get the specified dataset. +message GetDatasetRequest { + // Required. Resource name. Can also fetch a specified version + // projects/{project}/datasets/{dataset_id} + // projects/{project}/datasets/{dataset_id}@{version-id} + // + // In order to retrieve a previous version of the dataset, also provide + // the version ID. + // Example: projects/123/datasets/assisted-driving-preferences@c7cfa2a8 + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "mapsplatformdatasets.googleapis.com/Dataset" + } + ]; + + // If specified, will fetch the dataset details of the version published for + // the specified use case rather than the latest, if one exists. If a + // published version does not exist, will default to getting the dataset + // details of the latest version. + Usage published_usage = 2; +} + +// Request to list of all versions of the dataset. +message ListDatasetVersionsRequest { + // Required. The name of the dataset to list all the versions for. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "mapsplatformdatasets.googleapis.com/Dataset" + } + ]; + + // The maximum number of versions to return per page. + // If unspecified (or zero), at most 1000 versions will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // The page token, received from a previous GetDatasetVersions call. + // Provide this to retrieve the subsequent page. + string page_token = 3; +} + +// Response with list of all versions of the dataset. +message ListDatasetVersionsResponse { + // All the versions of the dataset. + repeated Dataset datasets = 1; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request to list datasets for the project. +message ListDatasetsRequest { + // Required. The name of the project to list all the datasets for. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // The maximum number of versions to return per page. + // If unspecified (or zero), at most 1000 datasets will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // The page token, received from a previous GetDatasetVersions call. + // Provide this to retrieve the subsequent page. + string page_token = 3; +} + +// Response to list datasets for the project. +message ListDatasetsResponse { + // All the datasets for the project. + repeated Dataset datasets = 1; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request to delete a dataset. +// +// The dataset to be deleted. +message DeleteDatasetRequest { + // Required. Format: projects/${project}/datasets/{dataset_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "mapsplatformdatasets.googleapis.com/Dataset" + } + ]; + + // If set to true, any dataset version for this dataset will also be deleted. + // (Otherwise, the request will only work if the dataset has no versions.) + bool force = 2; +} + +// Request to delete a version of a dataset. +message DeleteDatasetVersionRequest { + // Required. Format: projects/${project}/datasets/{dataset_id}@{version-id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "mapsplatformdatasets.googleapis.com/Dataset" + } + ]; +} diff --git a/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/proto/google/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets_alpha_service.proto b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/proto/google/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets_alpha_service.proto new file mode 100644 index 000000000000..fe071546fdbd --- /dev/null +++ b/java-maps-mapsplatformdatasets/proto-google-maps-mapsplatformdatasets-v1alpha/src/main/proto/google/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets_alpha_service.proto @@ -0,0 +1,97 @@ +// 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. + +syntax = "proto3"; + +package google.maps.mapsplatformdatasets.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/maps/mapsplatformdatasets/v1alpha/dataset.proto"; +import "google/maps/mapsplatformdatasets/v1alpha/maps_platform_datasets.proto"; +import "google/protobuf/empty.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.MapsPlatformDatasets.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/maps/mapsplatformdatasets/v1alpha;mapsplatformdatasets"; +option java_multiple_files = true; +option java_outer_classname = "MapsPlatformDatasetsV1AlphaServiceProto"; +option java_package = "com.google.maps.mapsplatformdatasets.v1alpha"; +option objc_class_prefix = "MDV1A"; +option php_namespace = "Google\\Maps\\MapsPlatformDatasets\\V1alpha"; + +// Service definition for the Maps Platform Datasets API. +service MapsPlatformDatasetsV1Alpha { + option (google.api.default_host) = "mapsplatformdatasets.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Create a new dataset for the specified project. + rpc CreateDataset(CreateDatasetRequest) returns (Dataset) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*}/datasets" + body: "dataset" + }; + option (google.api.method_signature) = "parent,dataset"; + } + + // Update the metadata for the dataset. To update the data use: UploadDataset. + rpc UpdateDatasetMetadata(UpdateDatasetMetadataRequest) returns (Dataset) { + option (google.api.http) = { + patch: "/v1alpha/{dataset.name=projects/*/datasets/*}" + body: "dataset" + }; + option (google.api.method_signature) = "dataset,update_mask"; + } + + // Get the published or latest version of the dataset. + rpc GetDataset(GetDatasetRequest) returns (Dataset) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List all the versions of a dataset. + rpc ListDatasetVersions(ListDatasetVersionsRequest) returns (ListDatasetVersionsResponse) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/datasets/*}:listVersions" + }; + option (google.api.method_signature) = "name"; + } + + // List all the datasets for the specified project. + rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*}/datasets" + }; + option (google.api.method_signature) = "parent"; + } + + // Delete the specified dataset and optionally all its corresponding + // versions. + rpc DeleteDataset(DeleteDatasetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Delete a specific version of the dataset. + rpc DeleteDatasetVersion(DeleteDatasetVersionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/datasets/*}:deleteVersion" + }; + option (google.api.method_signature) = "name"; + } +} diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/create/SyncCreateSetCredentialsProvider.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..1807fc1cca30 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaSettings; +import com.google.maps.mapsplatformdatasets.v1alpha.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 + MapsPlatformDatasetsV1AlphaSettings mapsPlatformDatasetsV1AlphaSettings = + MapsPlatformDatasetsV1AlphaSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create(mapsPlatformDatasetsV1AlphaSettings); + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_Create_SetCredentialsProvider_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/create/SyncCreateSetCredentialsProvider1.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..11607acea928 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_Create_SetCredentialsProvider1_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaSettings; + +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 + MapsPlatformDatasetsV1AlphaSettings mapsPlatformDatasetsV1AlphaSettings = + MapsPlatformDatasetsV1AlphaSettings.newHttpJsonBuilder().build(); + MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create(mapsPlatformDatasetsV1AlphaSettings); + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_Create_SetCredentialsProvider1_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/create/SyncCreateSetEndpoint.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..2aabce8e202e --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_Create_SetEndpoint_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaSettings; +import com.google.maps.mapsplatformdatasets.v1alpha.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 + MapsPlatformDatasetsV1AlphaSettings mapsPlatformDatasetsV1AlphaSettings = + MapsPlatformDatasetsV1AlphaSettings.newBuilder().setEndpoint(myEndpoint).build(); + MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create(mapsPlatformDatasetsV1AlphaSettings); + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_Create_SetEndpoint_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/createdataset/AsyncCreateDataset.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/createdataset/AsyncCreateDataset.java new file mode 100644 index 000000000000..549089e375f1 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/createdataset/AsyncCreateDataset.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_CreateDataset_async] +import com.google.api.core.ApiFuture; +import com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.maps.mapsplatformdatasets.v1alpha.ProjectName; + +public class AsyncCreateDataset { + + public static void main(String[] args) throws Exception { + asyncCreateDataset(); + } + + public static void asyncCreateDataset() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + CreateDatasetRequest request = + CreateDatasetRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setDataset(Dataset.newBuilder().build()) + .build(); + ApiFuture future = + mapsPlatformDatasetsV1AlphaClient.createDatasetCallable().futureCall(request); + // Do something. + Dataset response = future.get(); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_CreateDataset_async] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/createdataset/SyncCreateDataset.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/createdataset/SyncCreateDataset.java new file mode 100644 index 000000000000..bf266f36d9b5 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/createdataset/SyncCreateDataset.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_CreateDataset_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.CreateDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.maps.mapsplatformdatasets.v1alpha.ProjectName; + +public class SyncCreateDataset { + + public static void main(String[] args) throws Exception { + syncCreateDataset(); + } + + public static void syncCreateDataset() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + CreateDatasetRequest request = + CreateDatasetRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setDataset(Dataset.newBuilder().build()) + .build(); + Dataset response = mapsPlatformDatasetsV1AlphaClient.createDataset(request); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_CreateDataset_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/createdataset/SyncCreateDatasetProjectnameDataset.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/createdataset/SyncCreateDatasetProjectnameDataset.java new file mode 100644 index 000000000000..2c672e49c5fe --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/createdataset/SyncCreateDatasetProjectnameDataset.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_CreateDataset_ProjectnameDataset_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.maps.mapsplatformdatasets.v1alpha.ProjectName; + +public class SyncCreateDatasetProjectnameDataset { + + public static void main(String[] args) throws Exception { + syncCreateDatasetProjectnameDataset(); + } + + public static void syncCreateDatasetProjectnameDataset() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + Dataset dataset = Dataset.newBuilder().build(); + Dataset response = mapsPlatformDatasetsV1AlphaClient.createDataset(parent, dataset); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_CreateDataset_ProjectnameDataset_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/createdataset/SyncCreateDatasetStringDataset.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/createdataset/SyncCreateDatasetStringDataset.java new file mode 100644 index 000000000000..e1437751de4c --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/createdataset/SyncCreateDatasetStringDataset.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_CreateDataset_StringDataset_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.maps.mapsplatformdatasets.v1alpha.ProjectName; + +public class SyncCreateDatasetStringDataset { + + public static void main(String[] args) throws Exception { + syncCreateDatasetStringDataset(); + } + + public static void syncCreateDatasetStringDataset() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + Dataset dataset = Dataset.newBuilder().build(); + Dataset response = mapsPlatformDatasetsV1AlphaClient.createDataset(parent, dataset); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_CreateDataset_StringDataset_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedataset/AsyncDeleteDataset.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedataset/AsyncDeleteDataset.java new file mode 100644 index 000000000000..08eb6f9e58e6 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedataset/AsyncDeleteDataset.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_DeleteDataset_async] +import com.google.api.core.ApiFuture; +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.protobuf.Empty; + +public class AsyncDeleteDataset { + + public static void main(String[] args) throws Exception { + asyncDeleteDataset(); + } + + public static void asyncDeleteDataset() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + DeleteDatasetRequest request = + DeleteDatasetRequest.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setForce(true) + .build(); + ApiFuture future = + mapsPlatformDatasetsV1AlphaClient.deleteDatasetCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_DeleteDataset_async] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedataset/SyncDeleteDataset.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedataset/SyncDeleteDataset.java new file mode 100644 index 000000000000..00466427750e --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedataset/SyncDeleteDataset.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_DeleteDataset_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.protobuf.Empty; + +public class SyncDeleteDataset { + + public static void main(String[] args) throws Exception { + syncDeleteDataset(); + } + + public static void syncDeleteDataset() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + DeleteDatasetRequest request = + DeleteDatasetRequest.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setForce(true) + .build(); + mapsPlatformDatasetsV1AlphaClient.deleteDataset(request); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_DeleteDataset_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedataset/SyncDeleteDatasetDatasetname.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedataset/SyncDeleteDatasetDatasetname.java new file mode 100644 index 000000000000..1aee2bccd8ea --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedataset/SyncDeleteDatasetDatasetname.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_DeleteDataset_Datasetname_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.protobuf.Empty; + +public class SyncDeleteDatasetDatasetname { + + public static void main(String[] args) throws Exception { + syncDeleteDatasetDatasetname(); + } + + public static void syncDeleteDatasetDatasetname() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + mapsPlatformDatasetsV1AlphaClient.deleteDataset(name); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_DeleteDataset_Datasetname_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedataset/SyncDeleteDatasetString.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedataset/SyncDeleteDatasetString.java new file mode 100644 index 000000000000..85eb46d788f9 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedataset/SyncDeleteDatasetString.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_DeleteDataset_String_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.protobuf.Empty; + +public class SyncDeleteDatasetString { + + public static void main(String[] args) throws Exception { + syncDeleteDatasetString(); + } + + public static void syncDeleteDatasetString() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + String name = DatasetName.of("[PROJECT]", "[DATASET]").toString(); + mapsPlatformDatasetsV1AlphaClient.deleteDataset(name); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_DeleteDataset_String_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedatasetversion/AsyncDeleteDatasetVersion.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedatasetversion/AsyncDeleteDatasetVersion.java new file mode 100644 index 000000000000..eefe9edb2d74 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedatasetversion/AsyncDeleteDatasetVersion.java @@ -0,0 +1,51 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_DeleteDatasetVersion_async] +import com.google.api.core.ApiFuture; +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.protobuf.Empty; + +public class AsyncDeleteDatasetVersion { + + public static void main(String[] args) throws Exception { + asyncDeleteDatasetVersion(); + } + + public static void asyncDeleteDatasetVersion() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + DeleteDatasetVersionRequest request = + DeleteDatasetVersionRequest.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .build(); + ApiFuture future = + mapsPlatformDatasetsV1AlphaClient.deleteDatasetVersionCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_DeleteDatasetVersion_async] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedatasetversion/SyncDeleteDatasetVersion.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedatasetversion/SyncDeleteDatasetVersion.java new file mode 100644 index 000000000000..da799b562717 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedatasetversion/SyncDeleteDatasetVersion.java @@ -0,0 +1,47 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_DeleteDatasetVersion_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.DeleteDatasetVersionRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.protobuf.Empty; + +public class SyncDeleteDatasetVersion { + + public static void main(String[] args) throws Exception { + syncDeleteDatasetVersion(); + } + + public static void syncDeleteDatasetVersion() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + DeleteDatasetVersionRequest request = + DeleteDatasetVersionRequest.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .build(); + mapsPlatformDatasetsV1AlphaClient.deleteDatasetVersion(request); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_DeleteDatasetVersion_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedatasetversion/SyncDeleteDatasetVersionDatasetname.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedatasetversion/SyncDeleteDatasetVersionDatasetname.java new file mode 100644 index 000000000000..0b7e8aba741e --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedatasetversion/SyncDeleteDatasetVersionDatasetname.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_DeleteDatasetVersion_Datasetname_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.protobuf.Empty; + +public class SyncDeleteDatasetVersionDatasetname { + + public static void main(String[] args) throws Exception { + syncDeleteDatasetVersionDatasetname(); + } + + public static void syncDeleteDatasetVersionDatasetname() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + mapsPlatformDatasetsV1AlphaClient.deleteDatasetVersion(name); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_DeleteDatasetVersion_Datasetname_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedatasetversion/SyncDeleteDatasetVersionString.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedatasetversion/SyncDeleteDatasetVersionString.java new file mode 100644 index 000000000000..b0bae26d6894 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/deletedatasetversion/SyncDeleteDatasetVersionString.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_DeleteDatasetVersion_String_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.protobuf.Empty; + +public class SyncDeleteDatasetVersionString { + + public static void main(String[] args) throws Exception { + syncDeleteDatasetVersionString(); + } + + public static void syncDeleteDatasetVersionString() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + String name = DatasetName.of("[PROJECT]", "[DATASET]").toString(); + mapsPlatformDatasetsV1AlphaClient.deleteDatasetVersion(name); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_DeleteDatasetVersion_String_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/getdataset/AsyncGetDataset.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/getdataset/AsyncGetDataset.java new file mode 100644 index 000000000000..997416db54b5 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/getdataset/AsyncGetDataset.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_GetDataset_async] +import com.google.api.core.ApiFuture; +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.maps.mapsplatformdatasets.v1alpha.Usage; + +public class AsyncGetDataset { + + public static void main(String[] args) throws Exception { + asyncGetDataset(); + } + + public static void asyncGetDataset() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + GetDatasetRequest request = + GetDatasetRequest.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setPublishedUsage(Usage.forNumber(0)) + .build(); + ApiFuture future = + mapsPlatformDatasetsV1AlphaClient.getDatasetCallable().futureCall(request); + // Do something. + Dataset response = future.get(); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_GetDataset_async] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/getdataset/SyncGetDataset.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/getdataset/SyncGetDataset.java new file mode 100644 index 000000000000..46e7092cac46 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/getdataset/SyncGetDataset.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_GetDataset_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.GetDatasetRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.maps.mapsplatformdatasets.v1alpha.Usage; + +public class SyncGetDataset { + + public static void main(String[] args) throws Exception { + syncGetDataset(); + } + + public static void syncGetDataset() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + GetDatasetRequest request = + GetDatasetRequest.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setPublishedUsage(Usage.forNumber(0)) + .build(); + Dataset response = mapsPlatformDatasetsV1AlphaClient.getDataset(request); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_GetDataset_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/getdataset/SyncGetDatasetDatasetname.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/getdataset/SyncGetDatasetDatasetname.java new file mode 100644 index 000000000000..a26a68910078 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/getdataset/SyncGetDatasetDatasetname.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_GetDataset_Datasetname_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; + +public class SyncGetDatasetDatasetname { + + public static void main(String[] args) throws Exception { + syncGetDatasetDatasetname(); + } + + public static void syncGetDatasetDatasetname() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + Dataset response = mapsPlatformDatasetsV1AlphaClient.getDataset(name); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_GetDataset_Datasetname_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/getdataset/SyncGetDatasetString.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/getdataset/SyncGetDatasetString.java new file mode 100644 index 000000000000..80bd22c157e1 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/getdataset/SyncGetDatasetString.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_GetDataset_String_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; + +public class SyncGetDatasetString { + + public static void main(String[] args) throws Exception { + syncGetDatasetString(); + } + + public static void syncGetDatasetString() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + String name = DatasetName.of("[PROJECT]", "[DATASET]").toString(); + Dataset response = mapsPlatformDatasetsV1AlphaClient.getDataset(name); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_GetDataset_String_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasets/AsyncListDatasets.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasets/AsyncListDatasets.java new file mode 100644 index 000000000000..0f2c5ddded63 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasets/AsyncListDatasets.java @@ -0,0 +1,55 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasets_async] +import com.google.api.core.ApiFuture; +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.maps.mapsplatformdatasets.v1alpha.ProjectName; + +public class AsyncListDatasets { + + public static void main(String[] args) throws Exception { + asyncListDatasets(); + } + + public static void asyncListDatasets() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + ListDatasetsRequest request = + ListDatasetsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + mapsPlatformDatasetsV1AlphaClient.listDatasetsPagedCallable().futureCall(request); + // Do something. + for (Dataset element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasets_async] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasets/AsyncListDatasetsPaged.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasets/AsyncListDatasetsPaged.java new file mode 100644 index 000000000000..d3cada6db92a --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasets/AsyncListDatasetsPaged.java @@ -0,0 +1,63 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasets_Paged_async] +import com.google.common.base.Strings; +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsResponse; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.maps.mapsplatformdatasets.v1alpha.ProjectName; + +public class AsyncListDatasetsPaged { + + public static void main(String[] args) throws Exception { + asyncListDatasetsPaged(); + } + + public static void asyncListDatasetsPaged() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + ListDatasetsRequest request = + ListDatasetsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListDatasetsResponse response = + mapsPlatformDatasetsV1AlphaClient.listDatasetsCallable().call(request); + for (Dataset element : response.getDatasetsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasets_Paged_async] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasets/SyncListDatasets.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasets/SyncListDatasets.java new file mode 100644 index 000000000000..f09bb96bfdef --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasets/SyncListDatasets.java @@ -0,0 +1,51 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasets_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetsRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.maps.mapsplatformdatasets.v1alpha.ProjectName; + +public class SyncListDatasets { + + public static void main(String[] args) throws Exception { + syncListDatasets(); + } + + public static void syncListDatasets() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + ListDatasetsRequest request = + ListDatasetsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Dataset element : mapsPlatformDatasetsV1AlphaClient.listDatasets(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasets_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasets/SyncListDatasetsProjectname.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasets/SyncListDatasetsProjectname.java new file mode 100644 index 000000000000..75cb4d244de0 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasets/SyncListDatasetsProjectname.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasets_Projectname_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.maps.mapsplatformdatasets.v1alpha.ProjectName; + +public class SyncListDatasetsProjectname { + + public static void main(String[] args) throws Exception { + syncListDatasetsProjectname(); + } + + public static void syncListDatasetsProjectname() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (Dataset element : mapsPlatformDatasetsV1AlphaClient.listDatasets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasets_Projectname_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasets/SyncListDatasetsString.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasets/SyncListDatasetsString.java new file mode 100644 index 000000000000..fcd45cdbacd0 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasets/SyncListDatasetsString.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasets_String_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.maps.mapsplatformdatasets.v1alpha.ProjectName; + +public class SyncListDatasetsString { + + public static void main(String[] args) throws Exception { + syncListDatasetsString(); + } + + public static void syncListDatasetsString() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (Dataset element : mapsPlatformDatasetsV1AlphaClient.listDatasets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasets_String_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasetversions/AsyncListDatasetVersions.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasetversions/AsyncListDatasetVersions.java new file mode 100644 index 000000000000..f85f17938ad6 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasetversions/AsyncListDatasetVersions.java @@ -0,0 +1,55 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasetVersions_async] +import com.google.api.core.ApiFuture; +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; + +public class AsyncListDatasetVersions { + + public static void main(String[] args) throws Exception { + asyncListDatasetVersions(); + } + + public static void asyncListDatasetVersions() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + ListDatasetVersionsRequest request = + ListDatasetVersionsRequest.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + mapsPlatformDatasetsV1AlphaClient.listDatasetVersionsPagedCallable().futureCall(request); + // Do something. + for (Dataset element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasetVersions_async] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasetversions/AsyncListDatasetVersionsPaged.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasetversions/AsyncListDatasetVersionsPaged.java new file mode 100644 index 000000000000..6f3cdd502119 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasetversions/AsyncListDatasetVersionsPaged.java @@ -0,0 +1,63 @@ +/* + * 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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasetVersions_Paged_async] +import com.google.common.base.Strings; +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsResponse; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; + +public class AsyncListDatasetVersionsPaged { + + public static void main(String[] args) throws Exception { + asyncListDatasetVersionsPaged(); + } + + public static void asyncListDatasetVersionsPaged() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + ListDatasetVersionsRequest request = + ListDatasetVersionsRequest.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListDatasetVersionsResponse response = + mapsPlatformDatasetsV1AlphaClient.listDatasetVersionsCallable().call(request); + for (Dataset element : response.getDatasetsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasetVersions_Paged_async] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasetversions/SyncListDatasetVersions.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasetversions/SyncListDatasetVersions.java new file mode 100644 index 000000000000..180d4457fe20 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasetversions/SyncListDatasetVersions.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasetVersions_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.ListDatasetVersionsRequest; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; + +public class SyncListDatasetVersions { + + public static void main(String[] args) throws Exception { + syncListDatasetVersions(); + } + + public static void syncListDatasetVersions() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + ListDatasetVersionsRequest request = + ListDatasetVersionsRequest.newBuilder() + .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Dataset element : + mapsPlatformDatasetsV1AlphaClient.listDatasetVersions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasetVersions_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasetversions/SyncListDatasetVersionsDatasetname.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasetversions/SyncListDatasetVersionsDatasetname.java new file mode 100644 index 000000000000..3707c5b95f29 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasetversions/SyncListDatasetVersionsDatasetname.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasetVersions_Datasetname_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; + +public class SyncListDatasetVersionsDatasetname { + + public static void main(String[] args) throws Exception { + syncListDatasetVersionsDatasetname(); + } + + public static void syncListDatasetVersionsDatasetname() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]"); + for (Dataset element : + mapsPlatformDatasetsV1AlphaClient.listDatasetVersions(name).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasetVersions_Datasetname_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasetversions/SyncListDatasetVersionsString.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasetversions/SyncListDatasetVersionsString.java new file mode 100644 index 000000000000..d24ba2522a3b --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/listdatasetversions/SyncListDatasetVersionsString.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasetVersions_String_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.DatasetName; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; + +public class SyncListDatasetVersionsString { + + public static void main(String[] args) throws Exception { + syncListDatasetVersionsString(); + } + + public static void syncListDatasetVersionsString() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + String name = DatasetName.of("[PROJECT]", "[DATASET]").toString(); + for (Dataset element : + mapsPlatformDatasetsV1AlphaClient.listDatasetVersions(name).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_ListDatasetVersions_String_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/updatedatasetmetadata/AsyncUpdateDatasetMetadata.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/updatedatasetmetadata/AsyncUpdateDatasetMetadata.java new file mode 100644 index 000000000000..7303eb409c2d --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/updatedatasetmetadata/AsyncUpdateDatasetMetadata.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_UpdateDatasetMetadata_async] +import com.google.api.core.ApiFuture; +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateDatasetMetadata { + + public static void main(String[] args) throws Exception { + asyncUpdateDatasetMetadata(); + } + + public static void asyncUpdateDatasetMetadata() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + UpdateDatasetMetadataRequest request = + UpdateDatasetMetadataRequest.newBuilder() + .setDataset(Dataset.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + mapsPlatformDatasetsV1AlphaClient.updateDatasetMetadataCallable().futureCall(request); + // Do something. + Dataset response = future.get(); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_UpdateDatasetMetadata_async] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/updatedatasetmetadata/SyncUpdateDatasetMetadata.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/updatedatasetmetadata/SyncUpdateDatasetMetadata.java new file mode 100644 index 000000000000..9bff57bdef04 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/updatedatasetmetadata/SyncUpdateDatasetMetadata.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_UpdateDatasetMetadata_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.maps.mapsplatformdatasets.v1alpha.UpdateDatasetMetadataRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateDatasetMetadata { + + public static void main(String[] args) throws Exception { + syncUpdateDatasetMetadata(); + } + + public static void syncUpdateDatasetMetadata() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + UpdateDatasetMetadataRequest request = + UpdateDatasetMetadataRequest.newBuilder() + .setDataset(Dataset.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Dataset response = mapsPlatformDatasetsV1AlphaClient.updateDatasetMetadata(request); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_UpdateDatasetMetadata_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/updatedatasetmetadata/SyncUpdateDatasetMetadataDatasetFieldmask.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/updatedatasetmetadata/SyncUpdateDatasetMetadataDatasetFieldmask.java new file mode 100644 index 000000000000..90bb2b7158f0 --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alpha/updatedatasetmetadata/SyncUpdateDatasetMetadataDatasetFieldmask.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_UpdateDatasetMetadata_DatasetFieldmask_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.Dataset; +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateDatasetMetadataDatasetFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateDatasetMetadataDatasetFieldmask(); + } + + public static void syncUpdateDatasetMetadataDatasetFieldmask() 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 (MapsPlatformDatasetsV1AlphaClient mapsPlatformDatasetsV1AlphaClient = + MapsPlatformDatasetsV1AlphaClient.create()) { + Dataset dataset = Dataset.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Dataset response = + mapsPlatformDatasetsV1AlphaClient.updateDatasetMetadata(dataset, updateMask); + } + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1Alpha_UpdateDatasetMetadata_DatasetFieldmask_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alphasettings/createdataset/SyncCreateDataset.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alphasettings/createdataset/SyncCreateDataset.java new file mode 100644 index 000000000000..9ca05050f92e --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/mapsplatformdatasetsv1alphasettings/createdataset/SyncCreateDataset.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.maps.mapsplatformdatasets.v1alpha.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1AlphaSettings_CreateDataset_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1AlphaSettings; +import java.time.Duration; + +public class SyncCreateDataset { + + public static void main(String[] args) throws Exception { + syncCreateDataset(); + } + + public static void syncCreateDataset() 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 + MapsPlatformDatasetsV1AlphaSettings.Builder mapsPlatformDatasetsV1AlphaSettingsBuilder = + MapsPlatformDatasetsV1AlphaSettings.newBuilder(); + mapsPlatformDatasetsV1AlphaSettingsBuilder + .createDatasetSettings() + .setRetrySettings( + mapsPlatformDatasetsV1AlphaSettingsBuilder + .createDatasetSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + MapsPlatformDatasetsV1AlphaSettings mapsPlatformDatasetsV1AlphaSettings = + mapsPlatformDatasetsV1AlphaSettingsBuilder.build(); + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1AlphaSettings_CreateDataset_sync] diff --git a/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/stub/mapsplatformdatasetsv1alphastubsettings/createdataset/SyncCreateDataset.java b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/stub/mapsplatformdatasetsv1alphastubsettings/createdataset/SyncCreateDataset.java new file mode 100644 index 000000000000..1f86f12f153e --- /dev/null +++ b/java-maps-mapsplatformdatasets/samples/snippets/generated/com/google/maps/mapsplatformdatasets/v1alpha/stub/mapsplatformdatasetsv1alphastubsettings/createdataset/SyncCreateDataset.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.maps.mapsplatformdatasets.v1alpha.stub.samples; + +// [START mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1AlphaStubSettings_CreateDataset_sync] +import com.google.maps.mapsplatformdatasets.v1alpha.stub.MapsPlatformDatasetsV1AlphaStubSettings; +import java.time.Duration; + +public class SyncCreateDataset { + + public static void main(String[] args) throws Exception { + syncCreateDataset(); + } + + public static void syncCreateDataset() 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 + MapsPlatformDatasetsV1AlphaStubSettings.Builder mapsPlatformDatasetsV1AlphaSettingsBuilder = + MapsPlatformDatasetsV1AlphaStubSettings.newBuilder(); + mapsPlatformDatasetsV1AlphaSettingsBuilder + .createDatasetSettings() + .setRetrySettings( + mapsPlatformDatasetsV1AlphaSettingsBuilder + .createDatasetSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + MapsPlatformDatasetsV1AlphaStubSettings mapsPlatformDatasetsV1AlphaSettings = + mapsPlatformDatasetsV1AlphaSettingsBuilder.build(); + } +} +// [END mapsplatformdatasets_v1alpha_generated_MapsPlatformDatasetsV1AlphaStubSettings_CreateDataset_sync] diff --git a/pom.xml b/pom.xml index 8533b4f85b45..c95414e60c8a 100644 --- a/pom.xml +++ b/pom.xml @@ -102,6 +102,7 @@ java-life-sciences java-managed-identities java-maps-addressvalidation + java-maps-mapsplatformdatasets java-maps-routing java-mediatranslation java-memcache diff --git a/versions.txt b/versions.txt index 41fc6d8d18bf..b2d9c784314f 100644 --- a/versions.txt +++ b/versions.txt @@ -611,3 +611,6 @@ grpc-google-cloud-build-v2:3.13.0:3.14.0-SNAPSHOT google-cloud-advisorynotifications:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-advisorynotifications-v1:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-advisorynotifications-v1:0.0.0:0.0.1-SNAPSHOT +google-maps-mapsplatformdatasets:0.0.0:0.0.1-SNAPSHOT +proto-google-maps-mapsplatformdatasets-v1alpha:0.0.0:0.0.1-SNAPSHOT +grpc-google-maps-mapsplatformdatasets-v1alpha:0.0.0:0.0.1-SNAPSHOT