diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml index d110678c0..d89045599 100644 --- a/.github/.OwlBot.yaml +++ b/.github/.OwlBot.yaml @@ -23,3 +23,10 @@ deep-preserve-regex: deep-copy-regex: - source: "/google/datastore/(v.*)/.*-java/proto-google-.*/src" dest: "/owl-bot-staging/$1/proto-google-cloud-datastore-$1/src" +- source: "/google/datastore/admin/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/$1/proto-google-cloud-datastore-admin-$1/src" +- source: "/google/datastore/admin/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/$1/grpc-google-cloud-datastore-admin-$1/src" +# Admin & Data APIs share the same wrapper library. +- source: "/google/datastore/admin/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/$1/google-cloud-datastore/src" \ No newline at end of file diff --git a/google-cloud-datastore-bom/pom.xml b/google-cloud-datastore-bom/pom.xml index a23405e48..61f5da040 100644 --- a/google-cloud-datastore-bom/pom.xml +++ b/google-cloud-datastore-bom/pom.xml @@ -54,11 +54,21 @@ google-cloud-datastore 2.5.2-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-datastore-admin-v1 + 2.5.2-SNAPSHOT + com.google.api.grpc proto-google-cloud-datastore-v1 0.96.2-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-datastore-admin-v1 + 2.5.2-SNAPSHOT + diff --git a/google-cloud-datastore/pom.xml b/google-cloud-datastore/pom.xml index 9635f1c75..53ebc76a0 100644 --- a/google-cloud-datastore/pom.xml +++ b/google-cloud-datastore/pom.xml @@ -18,6 +18,10 @@ google-cloud-datastore + + com.google.api.grpc + grpc-google-cloud-datastore-admin-v1 + com.google.cloud google-cloud-core-http @@ -26,6 +30,10 @@ com.google.api.grpc proto-google-cloud-datastore-v1 + + com.google.api.grpc + proto-google-cloud-datastore-admin-v1 + com.google.cloud.datastore datastore-v1-proto-client @@ -34,6 +42,14 @@ io.grpc grpc-api + + io.grpc + grpc-protobuf + + + io.grpc + grpc-stub + com.google.api api-common @@ -50,6 +66,10 @@ com.google.api gax + + com.google.api + gax-grpc + com.google.guava guava @@ -90,6 +110,13 @@ test-jar test + + + com.google.api + gax-grpc + testlib + test + junit junit diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminClient.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminClient.java new file mode 100644 index 000000000..5bbcc6a29 --- /dev/null +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminClient.java @@ -0,0 +1,970 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.datastore.admin.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.datastore.admin.v1.stub.DatastoreAdminStub; +import com.google.cloud.datastore.admin.v1.stub.DatastoreAdminStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.datastore.admin.v1.CreateIndexRequest; +import com.google.datastore.admin.v1.DeleteIndexRequest; +import com.google.datastore.admin.v1.EntityFilter; +import com.google.datastore.admin.v1.ExportEntitiesMetadata; +import com.google.datastore.admin.v1.ExportEntitiesRequest; +import com.google.datastore.admin.v1.ExportEntitiesResponse; +import com.google.datastore.admin.v1.GetIndexRequest; +import com.google.datastore.admin.v1.ImportEntitiesMetadata; +import com.google.datastore.admin.v1.ImportEntitiesRequest; +import com.google.datastore.admin.v1.Index; +import com.google.datastore.admin.v1.IndexOperationMetadata; +import com.google.datastore.admin.v1.ListIndexesRequest; +import com.google.datastore.admin.v1.ListIndexesResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Google Cloud Datastore Admin API + * + *

The Datastore Admin API provides several admin services for Cloud Datastore. + * + *

----------------------------------------------------------------------------- ## Concepts + * + *

Project, namespace, kind, and entity as defined in the Google Cloud Datastore API. + * + *

Operation: An Operation represents work being performed in the background. + * + *

EntityFilter: Allows specifying a subset of entities in a project. This is specified as a + * combination of kinds and namespaces (either or both of which may be all). + * + *

----------------------------------------------------------------------------- ## Services + * + *

# Export/Import + * + *

The Export/Import service provides the ability to copy all or a subset of entities to/from + * Google Cloud Storage. + * + *

Exported data may be imported into Cloud Datastore for any Google Cloud Platform project. It + * is not restricted to the export source project. It is possible to export from one project and + * then import into another. + * + *

Exported data can also be loaded into Google BigQuery for analysis. + * + *

Exports and imports are performed asynchronously. An Operation resource is created for each + * export/import. The state (including any errors encountered) of the export/import may be queried + * via the Operation resource. + * + *

# Index + * + *

The index service manages Cloud Datastore composite indexes. + * + *

Index creation and deletion are performed asynchronously. An Operation resource is created for + * each such asynchronous operation. The state of the operation (including any errors encountered) + * may be queried via the Operation resource. + * + *

# Operation + * + *

The Operations collection provides a record of actions performed for the specified project + * (including any operations in progress). Operations are not created directly but through calls on + * other collections or resources. + * + *

An operation that is not yet done may be cancelled. The request to cancel is asynchronous and + * the operation may continue to run for some time after the request to cancel is made. + * + *

An operation that is done may be deleted so that it is no longer listed as part of the + * Operation collection. + * + *

ListOperations returns all pending operations, but not completed operations. + * + *

Operations are created by service DatastoreAdmin, but are accessed via service + * google.longrunning.Operations. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+ *   GetIndexRequest request =
+ *       GetIndexRequest.newBuilder()
+ *           .setProjectId("projectId-894832108")
+ *           .setIndexId("indexId1943291277")
+ *           .build();
+ *   Index response = datastoreAdminClient.getIndex(request);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the DatastoreAdminClient 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 DatastoreAdminSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * DatastoreAdminSettings datastoreAdminSettings =
+ *     DatastoreAdminSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create(datastoreAdminSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * DatastoreAdminSettings datastoreAdminSettings =
+ *     DatastoreAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create(datastoreAdminSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class DatastoreAdminClient implements BackgroundResource { + private final DatastoreAdminSettings settings; + private final DatastoreAdminStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of DatastoreAdminClient with default settings. */ + public static final DatastoreAdminClient create() throws IOException { + return create(DatastoreAdminSettings.newBuilder().build()); + } + + /** + * Constructs an instance of DatastoreAdminClient, 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 DatastoreAdminClient create(DatastoreAdminSettings settings) + throws IOException { + return new DatastoreAdminClient(settings); + } + + /** + * Constructs an instance of DatastoreAdminClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(DatastoreAdminSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final DatastoreAdminClient create(DatastoreAdminStub stub) { + return new DatastoreAdminClient(stub); + } + + /** + * Constructs an instance of DatastoreAdminClient, 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 DatastoreAdminClient(DatastoreAdminSettings settings) throws IOException { + this.settings = settings; + this.stub = ((DatastoreAdminStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected DatastoreAdminClient(DatastoreAdminStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final DatastoreAdminSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public DatastoreAdminStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage + * system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the + * export. The export occurs in the background and its progress can be monitored and managed via + * the Operation resource that is created. The output of an export may only be used once the + * associated operation is done. If an export operation is cancelled before completion it may + * leave partial data behind in Google Cloud Storage. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   String projectId = "projectId-894832108";
+   *   Map labels = new HashMap<>();
+   *   EntityFilter entityFilter = EntityFilter.newBuilder().build();
+   *   String outputUrlPrefix = "outputUrlPrefix-1132598048";
+   *   ExportEntitiesResponse response =
+   *       datastoreAdminClient
+   *           .exportEntitiesAsync(projectId, labels, entityFilter, outputUrlPrefix)
+   *           .get();
+   * }
+   * }
+ * + * @param projectId Required. Project ID against which to make the request. + * @param labels Client-assigned labels. + * @param entityFilter Description of what data from the project is included in the export. + * @param outputUrlPrefix Required. Location for the export metadata and data files. + *

The full resource URL of the external storage location. Currently, only Google Cloud + * Storage is supported. So output_url_prefix should be of the form: + * `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name of the Cloud Storage + * bucket and `NAMESPACE_PATH` is an optional Cloud Storage namespace path (this is not a + * Cloud Datastore namespace). For more information about Cloud Storage namespace paths, see + * [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + *

The resulting files will be nested deeper than the specified URL prefix. The final + * output URL will be provided in the + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. That value should be used for subsequent ImportEntities operations. + *

By nesting the data files deeper, the same Cloud Storage bucket can be used in multiple + * ExportEntities operations without conflict. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture exportEntitiesAsync( + String projectId, + Map labels, + EntityFilter entityFilter, + String outputUrlPrefix) { + ExportEntitiesRequest request = + ExportEntitiesRequest.newBuilder() + .setProjectId(projectId) + .putAllLabels(labels) + .setEntityFilter(entityFilter) + .setOutputUrlPrefix(outputUrlPrefix) + .build(); + return exportEntitiesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage + * system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the + * export. The export occurs in the background and its progress can be monitored and managed via + * the Operation resource that is created. The output of an export may only be used once the + * associated operation is done. If an export operation is cancelled before completion it may + * leave partial data behind in Google Cloud Storage. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   ExportEntitiesRequest request =
+   *       ExportEntitiesRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .putAllLabels(new HashMap())
+   *           .setEntityFilter(EntityFilter.newBuilder().build())
+   *           .setOutputUrlPrefix("outputUrlPrefix-1132598048")
+   *           .build();
+   *   ExportEntitiesResponse response = datastoreAdminClient.exportEntitiesAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture exportEntitiesAsync( + ExportEntitiesRequest request) { + return exportEntitiesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage + * system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the + * export. The export occurs in the background and its progress can be monitored and managed via + * the Operation resource that is created. The output of an export may only be used once the + * associated operation is done. If an export operation is cancelled before completion it may + * leave partial data behind in Google Cloud Storage. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   ExportEntitiesRequest request =
+   *       ExportEntitiesRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .putAllLabels(new HashMap())
+   *           .setEntityFilter(EntityFilter.newBuilder().build())
+   *           .setOutputUrlPrefix("outputUrlPrefix-1132598048")
+   *           .build();
+   *   OperationFuture future =
+   *       datastoreAdminClient.exportEntitiesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ExportEntitiesResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + ExportEntitiesRequest, ExportEntitiesResponse, ExportEntitiesMetadata> + exportEntitiesOperationCallable() { + return stub.exportEntitiesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage + * system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the + * export. The export occurs in the background and its progress can be monitored and managed via + * the Operation resource that is created. The output of an export may only be used once the + * associated operation is done. If an export operation is cancelled before completion it may + * leave partial data behind in Google Cloud Storage. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   ExportEntitiesRequest request =
+   *       ExportEntitiesRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .putAllLabels(new HashMap())
+   *           .setEntityFilter(EntityFilter.newBuilder().build())
+   *           .setOutputUrlPrefix("outputUrlPrefix-1132598048")
+   *           .build();
+   *   ApiFuture future =
+   *       datastoreAdminClient.exportEntitiesCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable exportEntitiesCallable() { + return stub.exportEntitiesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Imports entities into Google Cloud Datastore. Existing entities with the same key are + * overwritten. The import occurs in the background and its progress can be monitored and managed + * via the Operation resource that is created. If an ImportEntities operation is cancelled, it is + * possible that a subset of the data has already been imported to Cloud Datastore. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   String projectId = "projectId-894832108";
+   *   Map labels = new HashMap<>();
+   *   String inputUrl = "inputUrl470706501";
+   *   EntityFilter entityFilter = EntityFilter.newBuilder().build();
+   *   datastoreAdminClient.importEntitiesAsync(projectId, labels, inputUrl, entityFilter).get();
+   * }
+   * }
+ * + * @param projectId Required. Project ID against which to make the request. + * @param labels Client-assigned labels. + * @param inputUrl Required. The full resource URL of the external storage location. Currently, + * only Google Cloud Storage is supported. So input_url should be of the form: + * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where `BUCKET_NAME` is + * the name of the Cloud Storage bucket, `NAMESPACE_PATH` is an optional Cloud Storage + * namespace path (this is not a Cloud Datastore namespace), and + * `OVERALL_EXPORT_METADATA_FILE` is the metadata file written by the ExportEntities + * operation. For more information about Cloud Storage namespace paths, see [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + *

For more information, see + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. + * @param entityFilter Optionally specify which kinds/namespaces are to be imported. If provided, + * the list must be a subset of the EntityFilter used in creating the export, otherwise a + * FAILED_PRECONDITION error will be returned. If no filter is specified then all entities + * from the export are imported. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture importEntitiesAsync( + String projectId, Map labels, String inputUrl, EntityFilter entityFilter) { + ImportEntitiesRequest request = + ImportEntitiesRequest.newBuilder() + .setProjectId(projectId) + .putAllLabels(labels) + .setInputUrl(inputUrl) + .setEntityFilter(entityFilter) + .build(); + return importEntitiesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Imports entities into Google Cloud Datastore. Existing entities with the same key are + * overwritten. The import occurs in the background and its progress can be monitored and managed + * via the Operation resource that is created. If an ImportEntities operation is cancelled, it is + * possible that a subset of the data has already been imported to Cloud Datastore. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   ImportEntitiesRequest request =
+   *       ImportEntitiesRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .putAllLabels(new HashMap())
+   *           .setInputUrl("inputUrl470706501")
+   *           .setEntityFilter(EntityFilter.newBuilder().build())
+   *           .build();
+   *   datastoreAdminClient.importEntitiesAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture importEntitiesAsync( + ImportEntitiesRequest request) { + return importEntitiesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Imports entities into Google Cloud Datastore. Existing entities with the same key are + * overwritten. The import occurs in the background and its progress can be monitored and managed + * via the Operation resource that is created. If an ImportEntities operation is cancelled, it is + * possible that a subset of the data has already been imported to Cloud Datastore. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   ImportEntitiesRequest request =
+   *       ImportEntitiesRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .putAllLabels(new HashMap())
+   *           .setInputUrl("inputUrl470706501")
+   *           .setEntityFilter(EntityFilter.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       datastoreAdminClient.importEntitiesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + importEntitiesOperationCallable() { + return stub.importEntitiesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Imports entities into Google Cloud Datastore. Existing entities with the same key are + * overwritten. The import occurs in the background and its progress can be monitored and managed + * via the Operation resource that is created. If an ImportEntities operation is cancelled, it is + * possible that a subset of the data has already been imported to Cloud Datastore. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   ImportEntitiesRequest request =
+   *       ImportEntitiesRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .putAllLabels(new HashMap())
+   *           .setInputUrl("inputUrl470706501")
+   *           .setEntityFilter(EntityFilter.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       datastoreAdminClient.importEntitiesCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable importEntitiesCallable() { + return stub.importEntitiesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates the specified index. A newly created index's initial state is `CREATING`. On completion + * of the returned [google.longrunning.Operation][google.longrunning.Operation], the state will be + * `READY`. If the index already exists, the call will return an `ALREADY_EXISTS` status. + * + *

During index creation, the process could result in an error, in which case the index will + * move to the `ERROR` state. The process can be recovered by fixing the data that caused the + * error, removing the index with [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], + * then re-creating the index with [create] + * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex]. + * + *

Indexes with a single property cannot be created. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   CreateIndexRequest request =
+   *       CreateIndexRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .setIndex(Index.newBuilder().build())
+   *           .build();
+   *   Index response = datastoreAdminClient.createIndexAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createIndexAsync( + CreateIndexRequest request) { + return createIndexOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates the specified index. A newly created index's initial state is `CREATING`. On completion + * of the returned [google.longrunning.Operation][google.longrunning.Operation], the state will be + * `READY`. If the index already exists, the call will return an `ALREADY_EXISTS` status. + * + *

During index creation, the process could result in an error, in which case the index will + * move to the `ERROR` state. The process can be recovered by fixing the data that caused the + * error, removing the index with [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], + * then re-creating the index with [create] + * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex]. + * + *

Indexes with a single property cannot be created. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   CreateIndexRequest request =
+   *       CreateIndexRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .setIndex(Index.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       datastoreAdminClient.createIndexOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Index response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createIndexOperationCallable() { + return stub.createIndexOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates the specified index. A newly created index's initial state is `CREATING`. On completion + * of the returned [google.longrunning.Operation][google.longrunning.Operation], the state will be + * `READY`. If the index already exists, the call will return an `ALREADY_EXISTS` status. + * + *

During index creation, the process could result in an error, in which case the index will + * move to the `ERROR` state. The process can be recovered by fixing the data that caused the + * error, removing the index with [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], + * then re-creating the index with [create] + * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex]. + * + *

Indexes with a single property cannot be created. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   CreateIndexRequest request =
+   *       CreateIndexRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .setIndex(Index.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = datastoreAdminClient.createIndexCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createIndexCallable() { + return stub.createIndexCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an existing index. An index can only be deleted if it is in a `READY` or `ERROR` state. + * On successful execution of the request, the index will be in a `DELETING` + * [state][google.datastore.admin.v1.Index.State]. And on completion of the returned + * [google.longrunning.Operation][google.longrunning.Operation], the index will be removed. + * + *

During index deletion, the process could result in an error, in which case the index will + * move to the `ERROR` state. The process can be recovered by fixing the data that caused the + * error, followed by calling [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] + * again. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   DeleteIndexRequest request =
+   *       DeleteIndexRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .setIndexId("indexId1943291277")
+   *           .build();
+   *   Index response = datastoreAdminClient.deleteIndexAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteIndexAsync( + DeleteIndexRequest request) { + return deleteIndexOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an existing index. An index can only be deleted if it is in a `READY` or `ERROR` state. + * On successful execution of the request, the index will be in a `DELETING` + * [state][google.datastore.admin.v1.Index.State]. And on completion of the returned + * [google.longrunning.Operation][google.longrunning.Operation], the index will be removed. + * + *

During index deletion, the process could result in an error, in which case the index will + * move to the `ERROR` state. The process can be recovered by fixing the data that caused the + * error, followed by calling [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] + * again. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   DeleteIndexRequest request =
+   *       DeleteIndexRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .setIndexId("indexId1943291277")
+   *           .build();
+   *   OperationFuture future =
+   *       datastoreAdminClient.deleteIndexOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Index response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteIndexOperationCallable() { + return stub.deleteIndexOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an existing index. An index can only be deleted if it is in a `READY` or `ERROR` state. + * On successful execution of the request, the index will be in a `DELETING` + * [state][google.datastore.admin.v1.Index.State]. And on completion of the returned + * [google.longrunning.Operation][google.longrunning.Operation], the index will be removed. + * + *

During index deletion, the process could result in an error, in which case the index will + * move to the `ERROR` state. The process can be recovered by fixing the data that caused the + * error, followed by calling [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] + * again. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   DeleteIndexRequest request =
+   *       DeleteIndexRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .setIndexId("indexId1943291277")
+   *           .build();
+   *   ApiFuture future = datastoreAdminClient.deleteIndexCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteIndexCallable() { + return stub.deleteIndexCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an index. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   GetIndexRequest request =
+   *       GetIndexRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .setIndexId("indexId1943291277")
+   *           .build();
+   *   Index response = datastoreAdminClient.getIndex(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 Index getIndex(GetIndexRequest request) { + return getIndexCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an index. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   GetIndexRequest request =
+   *       GetIndexRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .setIndexId("indexId1943291277")
+   *           .build();
+   *   ApiFuture future = datastoreAdminClient.getIndexCallable().futureCall(request);
+   *   // Do something.
+   *   Index response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIndexCallable() { + return stub.getIndexCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the indexes that match the specified filters. Datastore uses an eventually consistent + * query to fetch the list of indexes and may occasionally return stale results. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   ListIndexesRequest request =
+   *       ListIndexesRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Index element : datastoreAdminClient.listIndexes(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 ListIndexesPagedResponse listIndexes(ListIndexesRequest request) { + return listIndexesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the indexes that match the specified filters. Datastore uses an eventually consistent + * query to fetch the list of indexes and may occasionally return stale results. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   ListIndexesRequest request =
+   *       ListIndexesRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = datastoreAdminClient.listIndexesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Index element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listIndexesPagedCallable() { + return stub.listIndexesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the indexes that match the specified filters. Datastore uses an eventually consistent + * query to fetch the list of indexes and may occasionally return stale results. + * + *

Sample code: + * + *

{@code
+   * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+   *   ListIndexesRequest request =
+   *       ListIndexesRequest.newBuilder()
+   *           .setProjectId("projectId-894832108")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListIndexesResponse response = datastoreAdminClient.listIndexesCallable().call(request);
+   *     for (Index element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listIndexesCallable() { + return stub.listIndexesCallable(); + } + + @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 ListIndexesPagedResponse + extends AbstractPagedListResponse< + ListIndexesRequest, + ListIndexesResponse, + Index, + ListIndexesPage, + ListIndexesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListIndexesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListIndexesPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListIndexesPagedResponse(ListIndexesPage page) { + super(page, ListIndexesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListIndexesPage + extends AbstractPage { + + private ListIndexesPage( + PageContext context, + ListIndexesResponse response) { + super(context, response); + } + + private static ListIndexesPage createEmptyPage() { + return new ListIndexesPage(null, null); + } + + @Override + protected ListIndexesPage createPage( + PageContext context, + ListIndexesResponse response) { + return new ListIndexesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListIndexesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListIndexesRequest, + ListIndexesResponse, + Index, + ListIndexesPage, + ListIndexesFixedSizeCollection> { + + private ListIndexesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListIndexesFixedSizeCollection createEmptyCollection() { + return new ListIndexesFixedSizeCollection(null, 0); + } + + @Override + protected ListIndexesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListIndexesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminSettings.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminSettings.java new file mode 100644 index 000000000..ebb971f50 --- /dev/null +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/DatastoreAdminSettings.java @@ -0,0 +1,302 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.datastore.admin.v1; + +import static com.google.cloud.datastore.admin.v1.DatastoreAdminClient.ListIndexesPagedResponse; + +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.datastore.admin.v1.stub.DatastoreAdminStubSettings; +import com.google.datastore.admin.v1.CreateIndexRequest; +import com.google.datastore.admin.v1.DeleteIndexRequest; +import com.google.datastore.admin.v1.ExportEntitiesMetadata; +import com.google.datastore.admin.v1.ExportEntitiesRequest; +import com.google.datastore.admin.v1.ExportEntitiesResponse; +import com.google.datastore.admin.v1.GetIndexRequest; +import com.google.datastore.admin.v1.ImportEntitiesMetadata; +import com.google.datastore.admin.v1.ImportEntitiesRequest; +import com.google.datastore.admin.v1.Index; +import com.google.datastore.admin.v1.IndexOperationMetadata; +import com.google.datastore.admin.v1.ListIndexesRequest; +import com.google.datastore.admin.v1.ListIndexesResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link DatastoreAdminClient}. + * + *

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

    + *
  • The default service address (datastore.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 getIndex to 30 seconds: + * + *

{@code
+ * DatastoreAdminSettings.Builder datastoreAdminSettingsBuilder =
+ *     DatastoreAdminSettings.newBuilder();
+ * datastoreAdminSettingsBuilder
+ *     .getIndexSettings()
+ *     .setRetrySettings(
+ *         datastoreAdminSettingsBuilder
+ *             .getIndexSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * DatastoreAdminSettings datastoreAdminSettings = datastoreAdminSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class DatastoreAdminSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to exportEntities. */ + public UnaryCallSettings exportEntitiesSettings() { + return ((DatastoreAdminStubSettings) getStubSettings()).exportEntitiesSettings(); + } + + /** Returns the object with the settings used for calls to exportEntities. */ + public OperationCallSettings< + ExportEntitiesRequest, ExportEntitiesResponse, ExportEntitiesMetadata> + exportEntitiesOperationSettings() { + return ((DatastoreAdminStubSettings) getStubSettings()).exportEntitiesOperationSettings(); + } + + /** Returns the object with the settings used for calls to importEntities. */ + public UnaryCallSettings importEntitiesSettings() { + return ((DatastoreAdminStubSettings) getStubSettings()).importEntitiesSettings(); + } + + /** Returns the object with the settings used for calls to importEntities. */ + public OperationCallSettings + importEntitiesOperationSettings() { + return ((DatastoreAdminStubSettings) getStubSettings()).importEntitiesOperationSettings(); + } + + /** Returns the object with the settings used for calls to createIndex. */ + public UnaryCallSettings createIndexSettings() { + return ((DatastoreAdminStubSettings) getStubSettings()).createIndexSettings(); + } + + /** Returns the object with the settings used for calls to createIndex. */ + public OperationCallSettings + createIndexOperationSettings() { + return ((DatastoreAdminStubSettings) getStubSettings()).createIndexOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteIndex. */ + public UnaryCallSettings deleteIndexSettings() { + return ((DatastoreAdminStubSettings) getStubSettings()).deleteIndexSettings(); + } + + /** Returns the object with the settings used for calls to deleteIndex. */ + public OperationCallSettings + deleteIndexOperationSettings() { + return ((DatastoreAdminStubSettings) getStubSettings()).deleteIndexOperationSettings(); + } + + /** Returns the object with the settings used for calls to getIndex. */ + public UnaryCallSettings getIndexSettings() { + return ((DatastoreAdminStubSettings) getStubSettings()).getIndexSettings(); + } + + /** Returns the object with the settings used for calls to listIndexes. */ + public PagedCallSettings + listIndexesSettings() { + return ((DatastoreAdminStubSettings) getStubSettings()).listIndexesSettings(); + } + + public static final DatastoreAdminSettings create(DatastoreAdminStubSettings stub) + throws IOException { + return new DatastoreAdminSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DatastoreAdminStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return DatastoreAdminStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DatastoreAdminStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DatastoreAdminStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return DatastoreAdminStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DatastoreAdminStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DatastoreAdminStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 DatastoreAdminSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for DatastoreAdminSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(DatastoreAdminStubSettings.newBuilder(clientContext)); + } + + protected Builder(DatastoreAdminSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DatastoreAdminStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(DatastoreAdminStubSettings.newBuilder()); + } + + public DatastoreAdminStubSettings.Builder getStubSettingsBuilder() { + return ((DatastoreAdminStubSettings.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 exportEntities. */ + public UnaryCallSettings.Builder exportEntitiesSettings() { + return getStubSettingsBuilder().exportEntitiesSettings(); + } + + /** Returns the builder for the settings used for calls to exportEntities. */ + public OperationCallSettings.Builder< + ExportEntitiesRequest, ExportEntitiesResponse, ExportEntitiesMetadata> + exportEntitiesOperationSettings() { + return getStubSettingsBuilder().exportEntitiesOperationSettings(); + } + + /** Returns the builder for the settings used for calls to importEntities. */ + public UnaryCallSettings.Builder importEntitiesSettings() { + return getStubSettingsBuilder().importEntitiesSettings(); + } + + /** Returns the builder for the settings used for calls to importEntities. */ + public OperationCallSettings.Builder + importEntitiesOperationSettings() { + return getStubSettingsBuilder().importEntitiesOperationSettings(); + } + + /** Returns the builder for the settings used for calls to createIndex. */ + public UnaryCallSettings.Builder createIndexSettings() { + return getStubSettingsBuilder().createIndexSettings(); + } + + /** Returns the builder for the settings used for calls to createIndex. */ + public OperationCallSettings.Builder + createIndexOperationSettings() { + return getStubSettingsBuilder().createIndexOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteIndex. */ + public UnaryCallSettings.Builder deleteIndexSettings() { + return getStubSettingsBuilder().deleteIndexSettings(); + } + + /** Returns the builder for the settings used for calls to deleteIndex. */ + public OperationCallSettings.Builder + deleteIndexOperationSettings() { + return getStubSettingsBuilder().deleteIndexOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getIndex. */ + public UnaryCallSettings.Builder getIndexSettings() { + return getStubSettingsBuilder().getIndexSettings(); + } + + /** Returns the builder for the settings used for calls to listIndexes. */ + public PagedCallSettings.Builder< + ListIndexesRequest, ListIndexesResponse, ListIndexesPagedResponse> + listIndexesSettings() { + return getStubSettingsBuilder().listIndexesSettings(); + } + + @Override + public DatastoreAdminSettings build() throws IOException { + return new DatastoreAdminSettings(this); + } + } +} diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/gapic_metadata.json b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/gapic_metadata.json new file mode 100644 index 000000000..205eb5dcd --- /dev/null +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/gapic_metadata.json @@ -0,0 +1,36 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.datastore.admin.v1", + "libraryPackage": "com.google.cloud.datastore.admin.v1", + "services": { + "DatastoreAdmin": { + "clients": { + "grpc": { + "libraryClient": "DatastoreAdminClient", + "rpcs": { + "CreateIndex": { + "methods": ["createIndexAsync", "createIndexOperationCallable", "createIndexCallable"] + }, + "DeleteIndex": { + "methods": ["deleteIndexAsync", "deleteIndexOperationCallable", "deleteIndexCallable"] + }, + "ExportEntities": { + "methods": ["exportEntitiesAsync", "exportEntitiesAsync", "exportEntitiesOperationCallable", "exportEntitiesCallable"] + }, + "GetIndex": { + "methods": ["getIndex", "getIndexCallable"] + }, + "ImportEntities": { + "methods": ["importEntitiesAsync", "importEntitiesAsync", "importEntitiesOperationCallable", "importEntitiesCallable"] + }, + "ListIndexes": { + "methods": ["listIndexes", "listIndexesPagedCallable", "listIndexesCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/package-info.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/package-info.java new file mode 100644 index 000000000..dd1642f61 --- /dev/null +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/package-info.java @@ -0,0 +1,95 @@ +/* + * 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. + */ + +/** + * A client to Cloud Datastore API + * + *

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

======================= DatastoreAdminClient ======================= + * + *

Service Description: Google Cloud Datastore Admin API + * + *

The Datastore Admin API provides several admin services for Cloud Datastore. + * + *

----------------------------------------------------------------------------- ## Concepts + * + *

Project, namespace, kind, and entity as defined in the Google Cloud Datastore API. + * + *

Operation: An Operation represents work being performed in the background. + * + *

EntityFilter: Allows specifying a subset of entities in a project. This is specified as a + * combination of kinds and namespaces (either or both of which may be all). + * + *

----------------------------------------------------------------------------- ## Services + * + *

# Export/Import + * + *

The Export/Import service provides the ability to copy all or a subset of entities to/from + * Google Cloud Storage. + * + *

Exported data may be imported into Cloud Datastore for any Google Cloud Platform project. It + * is not restricted to the export source project. It is possible to export from one project and + * then import into another. + * + *

Exported data can also be loaded into Google BigQuery for analysis. + * + *

Exports and imports are performed asynchronously. An Operation resource is created for each + * export/import. The state (including any errors encountered) of the export/import may be queried + * via the Operation resource. + * + *

# Index + * + *

The index service manages Cloud Datastore composite indexes. + * + *

Index creation and deletion are performed asynchronously. An Operation resource is created for + * each such asynchronous operation. The state of the operation (including any errors encountered) + * may be queried via the Operation resource. + * + *

# Operation + * + *

The Operations collection provides a record of actions performed for the specified project + * (including any operations in progress). Operations are not created directly but through calls on + * other collections or resources. + * + *

An operation that is not yet done may be cancelled. The request to cancel is asynchronous and + * the operation may continue to run for some time after the request to cancel is made. + * + *

An operation that is done may be deleted so that it is no longer listed as part of the + * Operation collection. + * + *

ListOperations returns all pending operations, but not completed operations. + * + *

Operations are created by service DatastoreAdmin, but are accessed via service + * google.longrunning.Operations. + * + *

Sample for DatastoreAdminClient: + * + *

{@code
+ * try (DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.create()) {
+ *   GetIndexRequest request =
+ *       GetIndexRequest.newBuilder()
+ *           .setProjectId("projectId-894832108")
+ *           .setIndexId("indexId1943291277")
+ *           .build();
+ *   Index response = datastoreAdminClient.getIndex(request);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.datastore.admin.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/DatastoreAdminStub.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/DatastoreAdminStub.java new file mode 100644 index 000000000..8014b0192 --- /dev/null +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/DatastoreAdminStub.java @@ -0,0 +1,104 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.datastore.admin.v1.stub; + +import static com.google.cloud.datastore.admin.v1.DatastoreAdminClient.ListIndexesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.datastore.admin.v1.CreateIndexRequest; +import com.google.datastore.admin.v1.DeleteIndexRequest; +import com.google.datastore.admin.v1.ExportEntitiesMetadata; +import com.google.datastore.admin.v1.ExportEntitiesRequest; +import com.google.datastore.admin.v1.ExportEntitiesResponse; +import com.google.datastore.admin.v1.GetIndexRequest; +import com.google.datastore.admin.v1.ImportEntitiesMetadata; +import com.google.datastore.admin.v1.ImportEntitiesRequest; +import com.google.datastore.admin.v1.Index; +import com.google.datastore.admin.v1.IndexOperationMetadata; +import com.google.datastore.admin.v1.ListIndexesRequest; +import com.google.datastore.admin.v1.ListIndexesResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the DatastoreAdmin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class DatastoreAdminStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public OperationCallable + exportEntitiesOperationCallable() { + throw new UnsupportedOperationException("Not implemented: exportEntitiesOperationCallable()"); + } + + public UnaryCallable exportEntitiesCallable() { + throw new UnsupportedOperationException("Not implemented: exportEntitiesCallable()"); + } + + public OperationCallable + importEntitiesOperationCallable() { + throw new UnsupportedOperationException("Not implemented: importEntitiesOperationCallable()"); + } + + public UnaryCallable importEntitiesCallable() { + throw new UnsupportedOperationException("Not implemented: importEntitiesCallable()"); + } + + public OperationCallable + createIndexOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createIndexOperationCallable()"); + } + + public UnaryCallable createIndexCallable() { + throw new UnsupportedOperationException("Not implemented: createIndexCallable()"); + } + + public OperationCallable + deleteIndexOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteIndexOperationCallable()"); + } + + public UnaryCallable deleteIndexCallable() { + throw new UnsupportedOperationException("Not implemented: deleteIndexCallable()"); + } + + public UnaryCallable getIndexCallable() { + throw new UnsupportedOperationException("Not implemented: getIndexCallable()"); + } + + public UnaryCallable listIndexesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listIndexesPagedCallable()"); + } + + public UnaryCallable listIndexesCallable() { + throw new UnsupportedOperationException("Not implemented: listIndexesCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/DatastoreAdminStubSettings.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/DatastoreAdminStubSettings.java new file mode 100644 index 000000000..682fe82f3 --- /dev/null +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/DatastoreAdminStubSettings.java @@ -0,0 +1,670 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.datastore.admin.v1.stub; + +import static com.google.cloud.datastore.admin.v1.DatastoreAdminClient.ListIndexesPagedResponse; + +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.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.datastore.admin.v1.CreateIndexRequest; +import com.google.datastore.admin.v1.DeleteIndexRequest; +import com.google.datastore.admin.v1.ExportEntitiesMetadata; +import com.google.datastore.admin.v1.ExportEntitiesRequest; +import com.google.datastore.admin.v1.ExportEntitiesResponse; +import com.google.datastore.admin.v1.GetIndexRequest; +import com.google.datastore.admin.v1.ImportEntitiesMetadata; +import com.google.datastore.admin.v1.ImportEntitiesRequest; +import com.google.datastore.admin.v1.Index; +import com.google.datastore.admin.v1.IndexOperationMetadata; +import com.google.datastore.admin.v1.ListIndexesRequest; +import com.google.datastore.admin.v1.ListIndexesResponse; +import com.google.longrunning.Operation; +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 DatastoreAdminStub}. + * + *

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

    + *
  • The default service address (datastore.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 getIndex to 30 seconds: + * + *

{@code
+ * DatastoreAdminStubSettings.Builder datastoreAdminSettingsBuilder =
+ *     DatastoreAdminStubSettings.newBuilder();
+ * datastoreAdminSettingsBuilder
+ *     .getIndexSettings()
+ *     .setRetrySettings(
+ *         datastoreAdminSettingsBuilder
+ *             .getIndexSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * DatastoreAdminStubSettings datastoreAdminSettings = datastoreAdminSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class DatastoreAdminStubSettings 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") + .add("https://www.googleapis.com/auth/datastore") + .build(); + + private final UnaryCallSettings exportEntitiesSettings; + private final OperationCallSettings< + ExportEntitiesRequest, ExportEntitiesResponse, ExportEntitiesMetadata> + exportEntitiesOperationSettings; + private final UnaryCallSettings importEntitiesSettings; + private final OperationCallSettings + importEntitiesOperationSettings; + private final UnaryCallSettings createIndexSettings; + private final OperationCallSettings + createIndexOperationSettings; + private final UnaryCallSettings deleteIndexSettings; + private final OperationCallSettings + deleteIndexOperationSettings; + private final UnaryCallSettings getIndexSettings; + private final PagedCallSettings + listIndexesSettings; + + private static final PagedListDescriptor + LIST_INDEXES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListIndexesRequest injectToken(ListIndexesRequest payload, String token) { + return ListIndexesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListIndexesRequest injectPageSize(ListIndexesRequest payload, int pageSize) { + return ListIndexesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListIndexesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListIndexesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListIndexesResponse payload) { + return payload.getIndexesList() == null + ? ImmutableList.of() + : payload.getIndexesList(); + } + }; + + private static final PagedListResponseFactory< + ListIndexesRequest, ListIndexesResponse, ListIndexesPagedResponse> + LIST_INDEXES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListIndexesRequest, ListIndexesResponse, ListIndexesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListIndexesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INDEXES_PAGE_STR_DESC, request, context); + return ListIndexesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to exportEntities. */ + public UnaryCallSettings exportEntitiesSettings() { + return exportEntitiesSettings; + } + + /** Returns the object with the settings used for calls to exportEntities. */ + public OperationCallSettings< + ExportEntitiesRequest, ExportEntitiesResponse, ExportEntitiesMetadata> + exportEntitiesOperationSettings() { + return exportEntitiesOperationSettings; + } + + /** Returns the object with the settings used for calls to importEntities. */ + public UnaryCallSettings importEntitiesSettings() { + return importEntitiesSettings; + } + + /** Returns the object with the settings used for calls to importEntities. */ + public OperationCallSettings + importEntitiesOperationSettings() { + return importEntitiesOperationSettings; + } + + /** Returns the object with the settings used for calls to createIndex. */ + public UnaryCallSettings createIndexSettings() { + return createIndexSettings; + } + + /** Returns the object with the settings used for calls to createIndex. */ + public OperationCallSettings + createIndexOperationSettings() { + return createIndexOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteIndex. */ + public UnaryCallSettings deleteIndexSettings() { + return deleteIndexSettings; + } + + /** Returns the object with the settings used for calls to deleteIndex. */ + public OperationCallSettings + deleteIndexOperationSettings() { + return deleteIndexOperationSettings; + } + + /** Returns the object with the settings used for calls to getIndex. */ + public UnaryCallSettings getIndexSettings() { + return getIndexSettings; + } + + /** Returns the object with the settings used for calls to listIndexes. */ + public PagedCallSettings + listIndexesSettings() { + return listIndexesSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public DatastoreAdminStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcDatastoreAdminStub.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 "datastore.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "datastore.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 ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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 defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(DatastoreAdminStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 DatastoreAdminStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + exportEntitiesSettings = settingsBuilder.exportEntitiesSettings().build(); + exportEntitiesOperationSettings = settingsBuilder.exportEntitiesOperationSettings().build(); + importEntitiesSettings = settingsBuilder.importEntitiesSettings().build(); + importEntitiesOperationSettings = settingsBuilder.importEntitiesOperationSettings().build(); + createIndexSettings = settingsBuilder.createIndexSettings().build(); + createIndexOperationSettings = settingsBuilder.createIndexOperationSettings().build(); + deleteIndexSettings = settingsBuilder.deleteIndexSettings().build(); + deleteIndexOperationSettings = settingsBuilder.deleteIndexOperationSettings().build(); + getIndexSettings = settingsBuilder.getIndexSettings().build(); + listIndexesSettings = settingsBuilder.listIndexesSettings().build(); + } + + /** Builder for DatastoreAdminStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + exportEntitiesSettings; + private final OperationCallSettings.Builder< + ExportEntitiesRequest, ExportEntitiesResponse, ExportEntitiesMetadata> + exportEntitiesOperationSettings; + private final UnaryCallSettings.Builder + importEntitiesSettings; + private final OperationCallSettings.Builder< + ImportEntitiesRequest, Empty, ImportEntitiesMetadata> + importEntitiesOperationSettings; + private final UnaryCallSettings.Builder createIndexSettings; + private final OperationCallSettings.Builder + createIndexOperationSettings; + private final UnaryCallSettings.Builder deleteIndexSettings; + private final OperationCallSettings.Builder + deleteIndexOperationSettings; + private final UnaryCallSettings.Builder getIndexSettings; + private final PagedCallSettings.Builder< + ListIndexesRequest, ListIndexesResponse, ListIndexesPagedResponse> + listIndexesSettings; + 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, StatusCode.Code.DEADLINE_EXCEEDED))); + 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(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + exportEntitiesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + exportEntitiesOperationSettings = OperationCallSettings.newBuilder(); + importEntitiesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + importEntitiesOperationSettings = OperationCallSettings.newBuilder(); + createIndexSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createIndexOperationSettings = OperationCallSettings.newBuilder(); + deleteIndexSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteIndexOperationSettings = OperationCallSettings.newBuilder(); + getIndexSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listIndexesSettings = PagedCallSettings.newBuilder(LIST_INDEXES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + exportEntitiesSettings, + importEntitiesSettings, + createIndexSettings, + deleteIndexSettings, + getIndexSettings, + listIndexesSettings); + initDefaults(this); + } + + protected Builder(DatastoreAdminStubSettings settings) { + super(settings); + + exportEntitiesSettings = settings.exportEntitiesSettings.toBuilder(); + exportEntitiesOperationSettings = settings.exportEntitiesOperationSettings.toBuilder(); + importEntitiesSettings = settings.importEntitiesSettings.toBuilder(); + importEntitiesOperationSettings = settings.importEntitiesOperationSettings.toBuilder(); + createIndexSettings = settings.createIndexSettings.toBuilder(); + createIndexOperationSettings = settings.createIndexOperationSettings.toBuilder(); + deleteIndexSettings = settings.deleteIndexSettings.toBuilder(); + deleteIndexOperationSettings = settings.deleteIndexOperationSettings.toBuilder(); + getIndexSettings = settings.getIndexSettings.toBuilder(); + listIndexesSettings = settings.listIndexesSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + exportEntitiesSettings, + importEntitiesSettings, + createIndexSettings, + deleteIndexSettings, + getIndexSettings, + listIndexesSettings); + } + + 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 initDefaults(Builder builder) { + builder + .exportEntitiesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .importEntitiesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createIndexSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteIndexSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getIndexSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listIndexesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .exportEntitiesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ExportEntitiesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ExportEntitiesMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .importEntitiesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ImportEntitiesMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createIndexOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Index.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(IndexOperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteIndexOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Index.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(IndexOperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to exportEntities. */ + public UnaryCallSettings.Builder exportEntitiesSettings() { + return exportEntitiesSettings; + } + + /** Returns the builder for the settings used for calls to exportEntities. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ExportEntitiesRequest, ExportEntitiesResponse, ExportEntitiesMetadata> + exportEntitiesOperationSettings() { + return exportEntitiesOperationSettings; + } + + /** Returns the builder for the settings used for calls to importEntities. */ + public UnaryCallSettings.Builder importEntitiesSettings() { + return importEntitiesSettings; + } + + /** Returns the builder for the settings used for calls to importEntities. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + importEntitiesOperationSettings() { + return importEntitiesOperationSettings; + } + + /** Returns the builder for the settings used for calls to createIndex. */ + public UnaryCallSettings.Builder createIndexSettings() { + return createIndexSettings; + } + + /** Returns the builder for the settings used for calls to createIndex. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createIndexOperationSettings() { + return createIndexOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteIndex. */ + public UnaryCallSettings.Builder deleteIndexSettings() { + return deleteIndexSettings; + } + + /** Returns the builder for the settings used for calls to deleteIndex. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteIndexOperationSettings() { + return deleteIndexOperationSettings; + } + + /** Returns the builder for the settings used for calls to getIndex. */ + public UnaryCallSettings.Builder getIndexSettings() { + return getIndexSettings; + } + + /** Returns the builder for the settings used for calls to listIndexes. */ + public PagedCallSettings.Builder< + ListIndexesRequest, ListIndexesResponse, ListIndexesPagedResponse> + listIndexesSettings() { + return listIndexesSettings; + } + + @Override + public DatastoreAdminStubSettings build() throws IOException { + return new DatastoreAdminStubSettings(this); + } + } +} diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/GrpcDatastoreAdminCallableFactory.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/GrpcDatastoreAdminCallableFactory.java new file mode 100644 index 000000000..6fa63fd35 --- /dev/null +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/GrpcDatastoreAdminCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.datastore.admin.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the DatastoreAdmin service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcDatastoreAdminCallableFactory 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/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/GrpcDatastoreAdminStub.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/GrpcDatastoreAdminStub.java new file mode 100644 index 000000000..81e35b3a0 --- /dev/null +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/admin/v1/stub/GrpcDatastoreAdminStub.java @@ -0,0 +1,385 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.datastore.admin.v1.stub; + +import static com.google.cloud.datastore.admin.v1.DatastoreAdminClient.ListIndexesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.datastore.admin.v1.CreateIndexRequest; +import com.google.datastore.admin.v1.DeleteIndexRequest; +import com.google.datastore.admin.v1.ExportEntitiesMetadata; +import com.google.datastore.admin.v1.ExportEntitiesRequest; +import com.google.datastore.admin.v1.ExportEntitiesResponse; +import com.google.datastore.admin.v1.GetIndexRequest; +import com.google.datastore.admin.v1.ImportEntitiesMetadata; +import com.google.datastore.admin.v1.ImportEntitiesRequest; +import com.google.datastore.admin.v1.Index; +import com.google.datastore.admin.v1.IndexOperationMetadata; +import com.google.datastore.admin.v1.ListIndexesRequest; +import com.google.datastore.admin.v1.ListIndexesResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the DatastoreAdmin service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcDatastoreAdminStub extends DatastoreAdminStub { + private static final MethodDescriptor + exportEntitiesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.datastore.admin.v1.DatastoreAdmin/ExportEntities") + .setRequestMarshaller( + ProtoUtils.marshaller(ExportEntitiesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + importEntitiesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.datastore.admin.v1.DatastoreAdmin/ImportEntities") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportEntitiesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor createIndexMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.datastore.admin.v1.DatastoreAdmin/CreateIndex") + .setRequestMarshaller(ProtoUtils.marshaller(CreateIndexRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteIndexMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.datastore.admin.v1.DatastoreAdmin/DeleteIndex") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteIndexRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIndexMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.datastore.admin.v1.DatastoreAdmin/GetIndex") + .setRequestMarshaller(ProtoUtils.marshaller(GetIndexRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Index.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listIndexesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.datastore.admin.v1.DatastoreAdmin/ListIndexes") + .setRequestMarshaller(ProtoUtils.marshaller(ListIndexesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListIndexesResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable exportEntitiesCallable; + private final OperationCallable< + ExportEntitiesRequest, ExportEntitiesResponse, ExportEntitiesMetadata> + exportEntitiesOperationCallable; + private final UnaryCallable importEntitiesCallable; + private final OperationCallable + importEntitiesOperationCallable; + private final UnaryCallable createIndexCallable; + private final OperationCallable + createIndexOperationCallable; + private final UnaryCallable deleteIndexCallable; + private final OperationCallable + deleteIndexOperationCallable; + private final UnaryCallable getIndexCallable; + private final UnaryCallable listIndexesCallable; + private final UnaryCallable + listIndexesPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcDatastoreAdminStub create(DatastoreAdminStubSettings settings) + throws IOException { + return new GrpcDatastoreAdminStub(settings, ClientContext.create(settings)); + } + + public static final GrpcDatastoreAdminStub create(ClientContext clientContext) + throws IOException { + return new GrpcDatastoreAdminStub( + DatastoreAdminStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcDatastoreAdminStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcDatastoreAdminStub( + DatastoreAdminStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcDatastoreAdminStub, 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 GrpcDatastoreAdminStub(DatastoreAdminStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcDatastoreAdminCallableFactory()); + } + + /** + * Constructs an instance of GrpcDatastoreAdminStub, 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 GrpcDatastoreAdminStub( + DatastoreAdminStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings exportEntitiesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(exportEntitiesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("project_id", String.valueOf(request.getProjectId())); + return params.build(); + }) + .build(); + GrpcCallSettings importEntitiesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importEntitiesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("project_id", String.valueOf(request.getProjectId())); + return params.build(); + }) + .build(); + GrpcCallSettings createIndexTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createIndexMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("project_id", String.valueOf(request.getProjectId())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteIndexTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteIndexMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("index_id", String.valueOf(request.getIndexId())); + params.put("project_id", String.valueOf(request.getProjectId())); + return params.build(); + }) + .build(); + GrpcCallSettings getIndexTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIndexMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("index_id", String.valueOf(request.getIndexId())); + params.put("project_id", String.valueOf(request.getProjectId())); + return params.build(); + }) + .build(); + GrpcCallSettings listIndexesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listIndexesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("project_id", String.valueOf(request.getProjectId())); + return params.build(); + }) + .build(); + + this.exportEntitiesCallable = + callableFactory.createUnaryCallable( + exportEntitiesTransportSettings, settings.exportEntitiesSettings(), clientContext); + this.exportEntitiesOperationCallable = + callableFactory.createOperationCallable( + exportEntitiesTransportSettings, + settings.exportEntitiesOperationSettings(), + clientContext, + operationsStub); + this.importEntitiesCallable = + callableFactory.createUnaryCallable( + importEntitiesTransportSettings, settings.importEntitiesSettings(), clientContext); + this.importEntitiesOperationCallable = + callableFactory.createOperationCallable( + importEntitiesTransportSettings, + settings.importEntitiesOperationSettings(), + clientContext, + operationsStub); + this.createIndexCallable = + callableFactory.createUnaryCallable( + createIndexTransportSettings, settings.createIndexSettings(), clientContext); + this.createIndexOperationCallable = + callableFactory.createOperationCallable( + createIndexTransportSettings, + settings.createIndexOperationSettings(), + clientContext, + operationsStub); + this.deleteIndexCallable = + callableFactory.createUnaryCallable( + deleteIndexTransportSettings, settings.deleteIndexSettings(), clientContext); + this.deleteIndexOperationCallable = + callableFactory.createOperationCallable( + deleteIndexTransportSettings, + settings.deleteIndexOperationSettings(), + clientContext, + operationsStub); + this.getIndexCallable = + callableFactory.createUnaryCallable( + getIndexTransportSettings, settings.getIndexSettings(), clientContext); + this.listIndexesCallable = + callableFactory.createUnaryCallable( + listIndexesTransportSettings, settings.listIndexesSettings(), clientContext); + this.listIndexesPagedCallable = + callableFactory.createPagedCallable( + listIndexesTransportSettings, settings.listIndexesSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable exportEntitiesCallable() { + return exportEntitiesCallable; + } + + @Override + public OperationCallable + exportEntitiesOperationCallable() { + return exportEntitiesOperationCallable; + } + + @Override + public UnaryCallable importEntitiesCallable() { + return importEntitiesCallable; + } + + @Override + public OperationCallable + importEntitiesOperationCallable() { + return importEntitiesOperationCallable; + } + + @Override + public UnaryCallable createIndexCallable() { + return createIndexCallable; + } + + @Override + public OperationCallable + createIndexOperationCallable() { + return createIndexOperationCallable; + } + + @Override + public UnaryCallable deleteIndexCallable() { + return deleteIndexCallable; + } + + @Override + public OperationCallable + deleteIndexOperationCallable() { + return deleteIndexOperationCallable; + } + + @Override + public UnaryCallable getIndexCallable() { + return getIndexCallable; + } + + @Override + public UnaryCallable listIndexesCallable() { + return listIndexesCallable; + } + + @Override + public UnaryCallable listIndexesPagedCallable() { + return listIndexesPagedCallable; + } + + @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/google-cloud-datastore/src/test/java/com/google/cloud/datastore/admin/v1/DatastoreAdminClientTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/admin/v1/DatastoreAdminClientTest.java new file mode 100644 index 000000000..577037ec4 --- /dev/null +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/admin/v1/DatastoreAdminClientTest.java @@ -0,0 +1,428 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.datastore.admin.v1; + +import static com.google.cloud.datastore.admin.v1.DatastoreAdminClient.ListIndexesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.datastore.admin.v1.CreateIndexRequest; +import com.google.datastore.admin.v1.DeleteIndexRequest; +import com.google.datastore.admin.v1.EntityFilter; +import com.google.datastore.admin.v1.ExportEntitiesRequest; +import com.google.datastore.admin.v1.ExportEntitiesResponse; +import com.google.datastore.admin.v1.GetIndexRequest; +import com.google.datastore.admin.v1.ImportEntitiesRequest; +import com.google.datastore.admin.v1.Index; +import com.google.datastore.admin.v1.ListIndexesRequest; +import com.google.datastore.admin.v1.ListIndexesResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class DatastoreAdminClientTest { + private static MockDatastoreAdmin mockDatastoreAdmin; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private DatastoreAdminClient client; + + @BeforeClass + public static void startStaticServer() { + mockDatastoreAdmin = new MockDatastoreAdmin(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockDatastoreAdmin)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + DatastoreAdminSettings settings = + DatastoreAdminSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DatastoreAdminClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void exportEntitiesTest() throws Exception { + ExportEntitiesResponse expectedResponse = + ExportEntitiesResponse.newBuilder().setOutputUrl("outputUrl-2119300946").build(); + Operation resultOperation = + Operation.newBuilder() + .setName("exportEntitiesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDatastoreAdmin.addResponse(resultOperation); + + String projectId = "projectId-894832108"; + Map labels = new HashMap<>(); + EntityFilter entityFilter = EntityFilter.newBuilder().build(); + String outputUrlPrefix = "outputUrlPrefix-1132598048"; + + ExportEntitiesResponse actualResponse = + client.exportEntitiesAsync(projectId, labels, entityFilter, outputUrlPrefix).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDatastoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ExportEntitiesRequest actualRequest = ((ExportEntitiesRequest) actualRequests.get(0)); + + Assert.assertEquals(projectId, actualRequest.getProjectId()); + Assert.assertEquals(labels, actualRequest.getLabelsMap()); + Assert.assertEquals(entityFilter, actualRequest.getEntityFilter()); + Assert.assertEquals(outputUrlPrefix, actualRequest.getOutputUrlPrefix()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void exportEntitiesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDatastoreAdmin.addException(exception); + + try { + String projectId = "projectId-894832108"; + Map labels = new HashMap<>(); + EntityFilter entityFilter = EntityFilter.newBuilder().build(); + String outputUrlPrefix = "outputUrlPrefix-1132598048"; + client.exportEntitiesAsync(projectId, labels, entityFilter, outputUrlPrefix).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void importEntitiesTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importEntitiesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDatastoreAdmin.addResponse(resultOperation); + + String projectId = "projectId-894832108"; + Map labels = new HashMap<>(); + String inputUrl = "inputUrl470706501"; + EntityFilter entityFilter = EntityFilter.newBuilder().build(); + + client.importEntitiesAsync(projectId, labels, inputUrl, entityFilter).get(); + + List actualRequests = mockDatastoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportEntitiesRequest actualRequest = ((ImportEntitiesRequest) actualRequests.get(0)); + + Assert.assertEquals(projectId, actualRequest.getProjectId()); + Assert.assertEquals(labels, actualRequest.getLabelsMap()); + Assert.assertEquals(inputUrl, actualRequest.getInputUrl()); + Assert.assertEquals(entityFilter, actualRequest.getEntityFilter()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void importEntitiesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDatastoreAdmin.addException(exception); + + try { + String projectId = "projectId-894832108"; + Map labels = new HashMap<>(); + String inputUrl = "inputUrl470706501"; + EntityFilter entityFilter = EntityFilter.newBuilder().build(); + client.importEntitiesAsync(projectId, labels, inputUrl, entityFilter).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createIndexTest() throws Exception { + Index expectedResponse = + Index.newBuilder() + .setProjectId("projectId-894832108") + .setIndexId("indexId1943291277") + .setKind("kind3292052") + .addAllProperties(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createIndexTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDatastoreAdmin.addResponse(resultOperation); + + CreateIndexRequest request = + CreateIndexRequest.newBuilder() + .setProjectId("projectId-894832108") + .setIndex(Index.newBuilder().build()) + .build(); + + Index actualResponse = client.createIndexAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDatastoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateIndexRequest actualRequest = ((CreateIndexRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getProjectId(), actualRequest.getProjectId()); + Assert.assertEquals(request.getIndex(), actualRequest.getIndex()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createIndexExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDatastoreAdmin.addException(exception); + + try { + CreateIndexRequest request = + CreateIndexRequest.newBuilder() + .setProjectId("projectId-894832108") + .setIndex(Index.newBuilder().build()) + .build(); + client.createIndexAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteIndexTest() throws Exception { + Index expectedResponse = + Index.newBuilder() + .setProjectId("projectId-894832108") + .setIndexId("indexId1943291277") + .setKind("kind3292052") + .addAllProperties(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteIndexTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockDatastoreAdmin.addResponse(resultOperation); + + DeleteIndexRequest request = + DeleteIndexRequest.newBuilder() + .setProjectId("projectId-894832108") + .setIndexId("indexId1943291277") + .build(); + + Index actualResponse = client.deleteIndexAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDatastoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteIndexRequest actualRequest = ((DeleteIndexRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getProjectId(), actualRequest.getProjectId()); + Assert.assertEquals(request.getIndexId(), actualRequest.getIndexId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteIndexExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDatastoreAdmin.addException(exception); + + try { + DeleteIndexRequest request = + DeleteIndexRequest.newBuilder() + .setProjectId("projectId-894832108") + .setIndexId("indexId1943291277") + .build(); + client.deleteIndexAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getIndexTest() throws Exception { + Index expectedResponse = + Index.newBuilder() + .setProjectId("projectId-894832108") + .setIndexId("indexId1943291277") + .setKind("kind3292052") + .addAllProperties(new ArrayList()) + .build(); + mockDatastoreAdmin.addResponse(expectedResponse); + + GetIndexRequest request = + GetIndexRequest.newBuilder() + .setProjectId("projectId-894832108") + .setIndexId("indexId1943291277") + .build(); + + Index actualResponse = client.getIndex(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDatastoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIndexRequest actualRequest = ((GetIndexRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getProjectId(), actualRequest.getProjectId()); + Assert.assertEquals(request.getIndexId(), actualRequest.getIndexId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIndexExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDatastoreAdmin.addException(exception); + + try { + GetIndexRequest request = + GetIndexRequest.newBuilder() + .setProjectId("projectId-894832108") + .setIndexId("indexId1943291277") + .build(); + client.getIndex(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listIndexesTest() throws Exception { + Index responsesElement = Index.newBuilder().build(); + ListIndexesResponse expectedResponse = + ListIndexesResponse.newBuilder() + .setNextPageToken("") + .addAllIndexes(Arrays.asList(responsesElement)) + .build(); + mockDatastoreAdmin.addResponse(expectedResponse); + + ListIndexesRequest request = + ListIndexesRequest.newBuilder() + .setProjectId("projectId-894832108") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListIndexesPagedResponse pagedListResponse = client.listIndexes(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getIndexesList().get(0), resources.get(0)); + + List actualRequests = mockDatastoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListIndexesRequest actualRequest = ((ListIndexesRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getProjectId(), actualRequest.getProjectId()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listIndexesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDatastoreAdmin.addException(exception); + + try { + ListIndexesRequest request = + ListIndexesRequest.newBuilder() + .setProjectId("projectId-894832108") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listIndexes(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/admin/v1/MockDatastoreAdmin.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/admin/v1/MockDatastoreAdmin.java new file mode 100644 index 000000000..ee0a0961b --- /dev/null +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/admin/v1/MockDatastoreAdmin.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.datastore.admin.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockDatastoreAdmin implements MockGrpcService { + private final MockDatastoreAdminImpl serviceImpl; + + public MockDatastoreAdmin() { + serviceImpl = new MockDatastoreAdminImpl(); + } + + @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/google-cloud-datastore/src/test/java/com/google/cloud/datastore/admin/v1/MockDatastoreAdminImpl.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/admin/v1/MockDatastoreAdminImpl.java new file mode 100644 index 000000000..9536e69e2 --- /dev/null +++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/admin/v1/MockDatastoreAdminImpl.java @@ -0,0 +1,192 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.datastore.admin.v1; + +import com.google.api.core.BetaApi; +import com.google.datastore.admin.v1.CreateIndexRequest; +import com.google.datastore.admin.v1.DatastoreAdminGrpc.DatastoreAdminImplBase; +import com.google.datastore.admin.v1.DeleteIndexRequest; +import com.google.datastore.admin.v1.ExportEntitiesRequest; +import com.google.datastore.admin.v1.GetIndexRequest; +import com.google.datastore.admin.v1.ImportEntitiesRequest; +import com.google.datastore.admin.v1.Index; +import com.google.datastore.admin.v1.ListIndexesRequest; +import com.google.datastore.admin.v1.ListIndexesResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockDatastoreAdminImpl extends DatastoreAdminImplBase { + private List requests; + private Queue responses; + + public MockDatastoreAdminImpl() { + 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 exportEntities( + ExportEntitiesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ExportEntities, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void importEntities( + ImportEntitiesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ImportEntities, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createIndex(CreateIndexRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateIndex, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteIndex(DeleteIndexRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteIndex, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIndex(GetIndexRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Index) { + requests.add(request); + responseObserver.onNext(((Index) 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 GetIndex, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Index.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listIndexes( + ListIndexesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListIndexesResponse) { + requests.add(request); + responseObserver.onNext(((ListIndexesResponse) 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 ListIndexes, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListIndexesResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/grpc-google-cloud-datastore-admin-v1/pom.xml b/grpc-google-cloud-datastore-admin-v1/pom.xml new file mode 100644 index 000000000..170eea0c2 --- /dev/null +++ b/grpc-google-cloud-datastore-admin-v1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-datastore-admin-v1 + 2.5.2-SNAPSHOT + grpc-google-cloud-datastore-admin-v1 + GRPC library for google-cloud-datastore + + com.google.cloud + google-cloud-datastore-parent + 2.5.2-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-datastore-admin-v1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DatastoreAdminGrpc.java b/grpc-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DatastoreAdminGrpc.java new file mode 100644 index 000000000..29fc8fcdc --- /dev/null +++ b/grpc-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DatastoreAdminGrpc.java @@ -0,0 +1,1241 @@ +/* + * 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.datastore.admin.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Google Cloud Datastore Admin API
+ * The Datastore Admin API provides several admin services for Cloud Datastore.
+ * -----------------------------------------------------------------------------
+ * ## Concepts
+ * Project, namespace, kind, and entity as defined in the Google Cloud Datastore
+ * API.
+ * Operation: An Operation represents work being performed in the background.
+ * EntityFilter: Allows specifying a subset of entities in a project. This is
+ * specified as a combination of kinds and namespaces (either or both of which
+ * may be all).
+ * -----------------------------------------------------------------------------
+ * ## Services
+ * # Export/Import
+ * The Export/Import service provides the ability to copy all or a subset of
+ * entities to/from Google Cloud Storage.
+ * Exported data may be imported into Cloud Datastore for any Google Cloud
+ * Platform project. It is not restricted to the export source project. It is
+ * possible to export from one project and then import into another.
+ * Exported data can also be loaded into Google BigQuery for analysis.
+ * Exports and imports are performed asynchronously. An Operation resource is
+ * created for each export/import. The state (including any errors encountered)
+ * of the export/import may be queried via the Operation resource.
+ * # Index
+ * The index service manages Cloud Datastore composite indexes.
+ * Index creation and deletion are performed asynchronously.
+ * An Operation resource is created for each such asynchronous operation.
+ * The state of the operation (including any errors encountered)
+ * may be queried via the Operation resource.
+ * # Operation
+ * The Operations collection provides a record of actions performed for the
+ * specified project (including any operations in progress). Operations are not
+ * created directly but through calls on other collections or resources.
+ * An operation that is not yet done may be cancelled. The request to cancel is
+ * asynchronous and the operation may continue to run for some time after the
+ * request to cancel is made.
+ * An operation that is done may be deleted so that it is no longer listed as
+ * part of the Operation collection.
+ * ListOperations returns all pending operations, but not completed operations.
+ * Operations are created by service DatastoreAdmin,
+ * but are accessed via service google.longrunning.Operations.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/datastore/admin/v1/datastore_admin.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class DatastoreAdminGrpc { + + private DatastoreAdminGrpc() {} + + public static final String SERVICE_NAME = "google.datastore.admin.v1.DatastoreAdmin"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.ExportEntitiesRequest, com.google.longrunning.Operation> + getExportEntitiesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ExportEntities", + requestType = com.google.datastore.admin.v1.ExportEntitiesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.ExportEntitiesRequest, com.google.longrunning.Operation> + getExportEntitiesMethod() { + io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.ExportEntitiesRequest, com.google.longrunning.Operation> + getExportEntitiesMethod; + if ((getExportEntitiesMethod = DatastoreAdminGrpc.getExportEntitiesMethod) == null) { + synchronized (DatastoreAdminGrpc.class) { + if ((getExportEntitiesMethod = DatastoreAdminGrpc.getExportEntitiesMethod) == null) { + DatastoreAdminGrpc.getExportEntitiesMethod = + getExportEntitiesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ExportEntities")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.datastore.admin.v1.ExportEntitiesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DatastoreAdminMethodDescriptorSupplier("ExportEntities")) + .build(); + } + } + } + return getExportEntitiesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.ImportEntitiesRequest, com.google.longrunning.Operation> + getImportEntitiesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ImportEntities", + requestType = com.google.datastore.admin.v1.ImportEntitiesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.ImportEntitiesRequest, com.google.longrunning.Operation> + getImportEntitiesMethod() { + io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.ImportEntitiesRequest, com.google.longrunning.Operation> + getImportEntitiesMethod; + if ((getImportEntitiesMethod = DatastoreAdminGrpc.getImportEntitiesMethod) == null) { + synchronized (DatastoreAdminGrpc.class) { + if ((getImportEntitiesMethod = DatastoreAdminGrpc.getImportEntitiesMethod) == null) { + DatastoreAdminGrpc.getImportEntitiesMethod = + getImportEntitiesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ImportEntities")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.datastore.admin.v1.ImportEntitiesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DatastoreAdminMethodDescriptorSupplier("ImportEntities")) + .build(); + } + } + } + return getImportEntitiesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.CreateIndexRequest, com.google.longrunning.Operation> + getCreateIndexMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateIndex", + requestType = com.google.datastore.admin.v1.CreateIndexRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.CreateIndexRequest, com.google.longrunning.Operation> + getCreateIndexMethod() { + io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.CreateIndexRequest, com.google.longrunning.Operation> + getCreateIndexMethod; + if ((getCreateIndexMethod = DatastoreAdminGrpc.getCreateIndexMethod) == null) { + synchronized (DatastoreAdminGrpc.class) { + if ((getCreateIndexMethod = DatastoreAdminGrpc.getCreateIndexMethod) == null) { + DatastoreAdminGrpc.getCreateIndexMethod = + getCreateIndexMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateIndex")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.datastore.admin.v1.CreateIndexRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DatastoreAdminMethodDescriptorSupplier("CreateIndex")) + .build(); + } + } + } + return getCreateIndexMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.DeleteIndexRequest, com.google.longrunning.Operation> + getDeleteIndexMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteIndex", + requestType = com.google.datastore.admin.v1.DeleteIndexRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.DeleteIndexRequest, com.google.longrunning.Operation> + getDeleteIndexMethod() { + io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.DeleteIndexRequest, com.google.longrunning.Operation> + getDeleteIndexMethod; + if ((getDeleteIndexMethod = DatastoreAdminGrpc.getDeleteIndexMethod) == null) { + synchronized (DatastoreAdminGrpc.class) { + if ((getDeleteIndexMethod = DatastoreAdminGrpc.getDeleteIndexMethod) == null) { + DatastoreAdminGrpc.getDeleteIndexMethod = + getDeleteIndexMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteIndex")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.datastore.admin.v1.DeleteIndexRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new DatastoreAdminMethodDescriptorSupplier("DeleteIndex")) + .build(); + } + } + } + return getDeleteIndexMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.GetIndexRequest, com.google.datastore.admin.v1.Index> + getGetIndexMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetIndex", + requestType = com.google.datastore.admin.v1.GetIndexRequest.class, + responseType = com.google.datastore.admin.v1.Index.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.GetIndexRequest, com.google.datastore.admin.v1.Index> + getGetIndexMethod() { + io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.GetIndexRequest, com.google.datastore.admin.v1.Index> + getGetIndexMethod; + if ((getGetIndexMethod = DatastoreAdminGrpc.getGetIndexMethod) == null) { + synchronized (DatastoreAdminGrpc.class) { + if ((getGetIndexMethod = DatastoreAdminGrpc.getGetIndexMethod) == null) { + DatastoreAdminGrpc.getGetIndexMethod = + getGetIndexMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetIndex")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.datastore.admin.v1.GetIndexRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.datastore.admin.v1.Index.getDefaultInstance())) + .setSchemaDescriptor(new DatastoreAdminMethodDescriptorSupplier("GetIndex")) + .build(); + } + } + } + return getGetIndexMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.ListIndexesRequest, + com.google.datastore.admin.v1.ListIndexesResponse> + getListIndexesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListIndexes", + requestType = com.google.datastore.admin.v1.ListIndexesRequest.class, + responseType = com.google.datastore.admin.v1.ListIndexesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.ListIndexesRequest, + com.google.datastore.admin.v1.ListIndexesResponse> + getListIndexesMethod() { + io.grpc.MethodDescriptor< + com.google.datastore.admin.v1.ListIndexesRequest, + com.google.datastore.admin.v1.ListIndexesResponse> + getListIndexesMethod; + if ((getListIndexesMethod = DatastoreAdminGrpc.getListIndexesMethod) == null) { + synchronized (DatastoreAdminGrpc.class) { + if ((getListIndexesMethod = DatastoreAdminGrpc.getListIndexesMethod) == null) { + DatastoreAdminGrpc.getListIndexesMethod = + getListIndexesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListIndexes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.datastore.admin.v1.ListIndexesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.datastore.admin.v1.ListIndexesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DatastoreAdminMethodDescriptorSupplier("ListIndexes")) + .build(); + } + } + } + return getListIndexesMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static DatastoreAdminStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DatastoreAdminStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DatastoreAdminStub(channel, callOptions); + } + }; + return DatastoreAdminStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static DatastoreAdminBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DatastoreAdminBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DatastoreAdminBlockingStub(channel, callOptions); + } + }; + return DatastoreAdminBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static DatastoreAdminFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DatastoreAdminFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DatastoreAdminFutureStub(channel, callOptions); + } + }; + return DatastoreAdminFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Google Cloud Datastore Admin API
+   * The Datastore Admin API provides several admin services for Cloud Datastore.
+   * -----------------------------------------------------------------------------
+   * ## Concepts
+   * Project, namespace, kind, and entity as defined in the Google Cloud Datastore
+   * API.
+   * Operation: An Operation represents work being performed in the background.
+   * EntityFilter: Allows specifying a subset of entities in a project. This is
+   * specified as a combination of kinds and namespaces (either or both of which
+   * may be all).
+   * -----------------------------------------------------------------------------
+   * ## Services
+   * # Export/Import
+   * The Export/Import service provides the ability to copy all or a subset of
+   * entities to/from Google Cloud Storage.
+   * Exported data may be imported into Cloud Datastore for any Google Cloud
+   * Platform project. It is not restricted to the export source project. It is
+   * possible to export from one project and then import into another.
+   * Exported data can also be loaded into Google BigQuery for analysis.
+   * Exports and imports are performed asynchronously. An Operation resource is
+   * created for each export/import. The state (including any errors encountered)
+   * of the export/import may be queried via the Operation resource.
+   * # Index
+   * The index service manages Cloud Datastore composite indexes.
+   * Index creation and deletion are performed asynchronously.
+   * An Operation resource is created for each such asynchronous operation.
+   * The state of the operation (including any errors encountered)
+   * may be queried via the Operation resource.
+   * # Operation
+   * The Operations collection provides a record of actions performed for the
+   * specified project (including any operations in progress). Operations are not
+   * created directly but through calls on other collections or resources.
+   * An operation that is not yet done may be cancelled. The request to cancel is
+   * asynchronous and the operation may continue to run for some time after the
+   * request to cancel is made.
+   * An operation that is done may be deleted so that it is no longer listed as
+   * part of the Operation collection.
+   * ListOperations returns all pending operations, but not completed operations.
+   * Operations are created by service DatastoreAdmin,
+   * but are accessed via service google.longrunning.Operations.
+   * 
+ */ + public abstract static class DatastoreAdminImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Exports a copy of all or a subset of entities from Google Cloud Datastore
+     * to another storage system, such as Google Cloud Storage. Recent updates to
+     * entities may not be reflected in the export. The export occurs in the
+     * background and its progress can be monitored and managed via the
+     * Operation resource that is created. The output of an export may only be
+     * used once the associated operation is done. If an export operation is
+     * cancelled before completion it may leave partial data behind in Google
+     * Cloud Storage.
+     * 
+ */ + public void exportEntities( + com.google.datastore.admin.v1.ExportEntitiesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getExportEntitiesMethod(), responseObserver); + } + + /** + * + * + *
+     * Imports entities into Google Cloud Datastore. Existing entities with the
+     * same key are overwritten. The import occurs in the background and its
+     * progress can be monitored and managed via the Operation resource that is
+     * created. If an ImportEntities operation is cancelled, it is possible
+     * that a subset of the data has already been imported to Cloud Datastore.
+     * 
+ */ + public void importEntities( + com.google.datastore.admin.v1.ImportEntitiesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getImportEntitiesMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates the specified index.
+     * A newly created index's initial state is `CREATING`. On completion of the
+     * returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`.
+     * If the index already exists, the call will return an `ALREADY_EXISTS`
+     * status.
+     * During index creation, the process could result in an error, in which
+     * case the index will move to the `ERROR` state. The process can be recovered
+     * by fixing the data that caused the error, removing the index with
+     * [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then
+     * re-creating the index with [create]
+     * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex].
+     * Indexes with a single property cannot be created.
+     * 
+ */ + public void createIndex( + com.google.datastore.admin.v1.CreateIndexRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateIndexMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes an existing index.
+     * An index can only be deleted if it is in a `READY` or `ERROR` state. On
+     * successful execution of the request, the index will be in a `DELETING`
+     * [state][google.datastore.admin.v1.Index.State]. And on completion of the
+     * returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed.
+     * During index deletion, the process could result in an error, in which
+     * case the index will move to the `ERROR` state. The process can be recovered
+     * by fixing the data that caused the error, followed by calling
+     * [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again.
+     * 
+ */ + public void deleteIndex( + com.google.datastore.admin.v1.DeleteIndexRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteIndexMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets an index.
+     * 
+ */ + public void getIndex( + com.google.datastore.admin.v1.GetIndexRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetIndexMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists the indexes that match the specified filters.  Datastore uses an
+     * eventually consistent query to fetch the list of indexes and may
+     * occasionally return stale results.
+     * 
+ */ + public void listIndexes( + com.google.datastore.admin.v1.ListIndexesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListIndexesMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getExportEntitiesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.datastore.admin.v1.ExportEntitiesRequest, + com.google.longrunning.Operation>(this, METHODID_EXPORT_ENTITIES))) + .addMethod( + getImportEntitiesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.datastore.admin.v1.ImportEntitiesRequest, + com.google.longrunning.Operation>(this, METHODID_IMPORT_ENTITIES))) + .addMethod( + getCreateIndexMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.datastore.admin.v1.CreateIndexRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_INDEX))) + .addMethod( + getDeleteIndexMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.datastore.admin.v1.DeleteIndexRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_INDEX))) + .addMethod( + getGetIndexMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.datastore.admin.v1.GetIndexRequest, + com.google.datastore.admin.v1.Index>(this, METHODID_GET_INDEX))) + .addMethod( + getListIndexesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.datastore.admin.v1.ListIndexesRequest, + com.google.datastore.admin.v1.ListIndexesResponse>( + this, METHODID_LIST_INDEXES))) + .build(); + } + } + + /** + * + * + *
+   * Google Cloud Datastore Admin API
+   * The Datastore Admin API provides several admin services for Cloud Datastore.
+   * -----------------------------------------------------------------------------
+   * ## Concepts
+   * Project, namespace, kind, and entity as defined in the Google Cloud Datastore
+   * API.
+   * Operation: An Operation represents work being performed in the background.
+   * EntityFilter: Allows specifying a subset of entities in a project. This is
+   * specified as a combination of kinds and namespaces (either or both of which
+   * may be all).
+   * -----------------------------------------------------------------------------
+   * ## Services
+   * # Export/Import
+   * The Export/Import service provides the ability to copy all or a subset of
+   * entities to/from Google Cloud Storage.
+   * Exported data may be imported into Cloud Datastore for any Google Cloud
+   * Platform project. It is not restricted to the export source project. It is
+   * possible to export from one project and then import into another.
+   * Exported data can also be loaded into Google BigQuery for analysis.
+   * Exports and imports are performed asynchronously. An Operation resource is
+   * created for each export/import. The state (including any errors encountered)
+   * of the export/import may be queried via the Operation resource.
+   * # Index
+   * The index service manages Cloud Datastore composite indexes.
+   * Index creation and deletion are performed asynchronously.
+   * An Operation resource is created for each such asynchronous operation.
+   * The state of the operation (including any errors encountered)
+   * may be queried via the Operation resource.
+   * # Operation
+   * The Operations collection provides a record of actions performed for the
+   * specified project (including any operations in progress). Operations are not
+   * created directly but through calls on other collections or resources.
+   * An operation that is not yet done may be cancelled. The request to cancel is
+   * asynchronous and the operation may continue to run for some time after the
+   * request to cancel is made.
+   * An operation that is done may be deleted so that it is no longer listed as
+   * part of the Operation collection.
+   * ListOperations returns all pending operations, but not completed operations.
+   * Operations are created by service DatastoreAdmin,
+   * but are accessed via service google.longrunning.Operations.
+   * 
+ */ + public static final class DatastoreAdminStub + extends io.grpc.stub.AbstractAsyncStub { + private DatastoreAdminStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DatastoreAdminStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DatastoreAdminStub(channel, callOptions); + } + + /** + * + * + *
+     * Exports a copy of all or a subset of entities from Google Cloud Datastore
+     * to another storage system, such as Google Cloud Storage. Recent updates to
+     * entities may not be reflected in the export. The export occurs in the
+     * background and its progress can be monitored and managed via the
+     * Operation resource that is created. The output of an export may only be
+     * used once the associated operation is done. If an export operation is
+     * cancelled before completion it may leave partial data behind in Google
+     * Cloud Storage.
+     * 
+ */ + public void exportEntities( + com.google.datastore.admin.v1.ExportEntitiesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getExportEntitiesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Imports entities into Google Cloud Datastore. Existing entities with the
+     * same key are overwritten. The import occurs in the background and its
+     * progress can be monitored and managed via the Operation resource that is
+     * created. If an ImportEntities operation is cancelled, it is possible
+     * that a subset of the data has already been imported to Cloud Datastore.
+     * 
+ */ + public void importEntities( + com.google.datastore.admin.v1.ImportEntitiesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getImportEntitiesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates the specified index.
+     * A newly created index's initial state is `CREATING`. On completion of the
+     * returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`.
+     * If the index already exists, the call will return an `ALREADY_EXISTS`
+     * status.
+     * During index creation, the process could result in an error, in which
+     * case the index will move to the `ERROR` state. The process can be recovered
+     * by fixing the data that caused the error, removing the index with
+     * [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then
+     * re-creating the index with [create]
+     * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex].
+     * Indexes with a single property cannot be created.
+     * 
+ */ + public void createIndex( + com.google.datastore.admin.v1.CreateIndexRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateIndexMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes an existing index.
+     * An index can only be deleted if it is in a `READY` or `ERROR` state. On
+     * successful execution of the request, the index will be in a `DELETING`
+     * [state][google.datastore.admin.v1.Index.State]. And on completion of the
+     * returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed.
+     * During index deletion, the process could result in an error, in which
+     * case the index will move to the `ERROR` state. The process can be recovered
+     * by fixing the data that caused the error, followed by calling
+     * [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again.
+     * 
+ */ + public void deleteIndex( + com.google.datastore.admin.v1.DeleteIndexRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteIndexMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets an index.
+     * 
+ */ + public void getIndex( + com.google.datastore.admin.v1.GetIndexRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetIndexMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists the indexes that match the specified filters.  Datastore uses an
+     * eventually consistent query to fetch the list of indexes and may
+     * occasionally return stale results.
+     * 
+ */ + public void listIndexes( + com.google.datastore.admin.v1.ListIndexesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListIndexesMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Google Cloud Datastore Admin API
+   * The Datastore Admin API provides several admin services for Cloud Datastore.
+   * -----------------------------------------------------------------------------
+   * ## Concepts
+   * Project, namespace, kind, and entity as defined in the Google Cloud Datastore
+   * API.
+   * Operation: An Operation represents work being performed in the background.
+   * EntityFilter: Allows specifying a subset of entities in a project. This is
+   * specified as a combination of kinds and namespaces (either or both of which
+   * may be all).
+   * -----------------------------------------------------------------------------
+   * ## Services
+   * # Export/Import
+   * The Export/Import service provides the ability to copy all or a subset of
+   * entities to/from Google Cloud Storage.
+   * Exported data may be imported into Cloud Datastore for any Google Cloud
+   * Platform project. It is not restricted to the export source project. It is
+   * possible to export from one project and then import into another.
+   * Exported data can also be loaded into Google BigQuery for analysis.
+   * Exports and imports are performed asynchronously. An Operation resource is
+   * created for each export/import. The state (including any errors encountered)
+   * of the export/import may be queried via the Operation resource.
+   * # Index
+   * The index service manages Cloud Datastore composite indexes.
+   * Index creation and deletion are performed asynchronously.
+   * An Operation resource is created for each such asynchronous operation.
+   * The state of the operation (including any errors encountered)
+   * may be queried via the Operation resource.
+   * # Operation
+   * The Operations collection provides a record of actions performed for the
+   * specified project (including any operations in progress). Operations are not
+   * created directly but through calls on other collections or resources.
+   * An operation that is not yet done may be cancelled. The request to cancel is
+   * asynchronous and the operation may continue to run for some time after the
+   * request to cancel is made.
+   * An operation that is done may be deleted so that it is no longer listed as
+   * part of the Operation collection.
+   * ListOperations returns all pending operations, but not completed operations.
+   * Operations are created by service DatastoreAdmin,
+   * but are accessed via service google.longrunning.Operations.
+   * 
+ */ + public static final class DatastoreAdminBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private DatastoreAdminBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DatastoreAdminBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DatastoreAdminBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Exports a copy of all or a subset of entities from Google Cloud Datastore
+     * to another storage system, such as Google Cloud Storage. Recent updates to
+     * entities may not be reflected in the export. The export occurs in the
+     * background and its progress can be monitored and managed via the
+     * Operation resource that is created. The output of an export may only be
+     * used once the associated operation is done. If an export operation is
+     * cancelled before completion it may leave partial data behind in Google
+     * Cloud Storage.
+     * 
+ */ + public com.google.longrunning.Operation exportEntities( + com.google.datastore.admin.v1.ExportEntitiesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getExportEntitiesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Imports entities into Google Cloud Datastore. Existing entities with the
+     * same key are overwritten. The import occurs in the background and its
+     * progress can be monitored and managed via the Operation resource that is
+     * created. If an ImportEntities operation is cancelled, it is possible
+     * that a subset of the data has already been imported to Cloud Datastore.
+     * 
+ */ + public com.google.longrunning.Operation importEntities( + com.google.datastore.admin.v1.ImportEntitiesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getImportEntitiesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates the specified index.
+     * A newly created index's initial state is `CREATING`. On completion of the
+     * returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`.
+     * If the index already exists, the call will return an `ALREADY_EXISTS`
+     * status.
+     * During index creation, the process could result in an error, in which
+     * case the index will move to the `ERROR` state. The process can be recovered
+     * by fixing the data that caused the error, removing the index with
+     * [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then
+     * re-creating the index with [create]
+     * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex].
+     * Indexes with a single property cannot be created.
+     * 
+ */ + public com.google.longrunning.Operation createIndex( + com.google.datastore.admin.v1.CreateIndexRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateIndexMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes an existing index.
+     * An index can only be deleted if it is in a `READY` or `ERROR` state. On
+     * successful execution of the request, the index will be in a `DELETING`
+     * [state][google.datastore.admin.v1.Index.State]. And on completion of the
+     * returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed.
+     * During index deletion, the process could result in an error, in which
+     * case the index will move to the `ERROR` state. The process can be recovered
+     * by fixing the data that caused the error, followed by calling
+     * [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again.
+     * 
+ */ + public com.google.longrunning.Operation deleteIndex( + com.google.datastore.admin.v1.DeleteIndexRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteIndexMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets an index.
+     * 
+ */ + public com.google.datastore.admin.v1.Index getIndex( + com.google.datastore.admin.v1.GetIndexRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIndexMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the indexes that match the specified filters.  Datastore uses an
+     * eventually consistent query to fetch the list of indexes and may
+     * occasionally return stale results.
+     * 
+ */ + public com.google.datastore.admin.v1.ListIndexesResponse listIndexes( + com.google.datastore.admin.v1.ListIndexesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListIndexesMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Google Cloud Datastore Admin API
+   * The Datastore Admin API provides several admin services for Cloud Datastore.
+   * -----------------------------------------------------------------------------
+   * ## Concepts
+   * Project, namespace, kind, and entity as defined in the Google Cloud Datastore
+   * API.
+   * Operation: An Operation represents work being performed in the background.
+   * EntityFilter: Allows specifying a subset of entities in a project. This is
+   * specified as a combination of kinds and namespaces (either or both of which
+   * may be all).
+   * -----------------------------------------------------------------------------
+   * ## Services
+   * # Export/Import
+   * The Export/Import service provides the ability to copy all or a subset of
+   * entities to/from Google Cloud Storage.
+   * Exported data may be imported into Cloud Datastore for any Google Cloud
+   * Platform project. It is not restricted to the export source project. It is
+   * possible to export from one project and then import into another.
+   * Exported data can also be loaded into Google BigQuery for analysis.
+   * Exports and imports are performed asynchronously. An Operation resource is
+   * created for each export/import. The state (including any errors encountered)
+   * of the export/import may be queried via the Operation resource.
+   * # Index
+   * The index service manages Cloud Datastore composite indexes.
+   * Index creation and deletion are performed asynchronously.
+   * An Operation resource is created for each such asynchronous operation.
+   * The state of the operation (including any errors encountered)
+   * may be queried via the Operation resource.
+   * # Operation
+   * The Operations collection provides a record of actions performed for the
+   * specified project (including any operations in progress). Operations are not
+   * created directly but through calls on other collections or resources.
+   * An operation that is not yet done may be cancelled. The request to cancel is
+   * asynchronous and the operation may continue to run for some time after the
+   * request to cancel is made.
+   * An operation that is done may be deleted so that it is no longer listed as
+   * part of the Operation collection.
+   * ListOperations returns all pending operations, but not completed operations.
+   * Operations are created by service DatastoreAdmin,
+   * but are accessed via service google.longrunning.Operations.
+   * 
+ */ + public static final class DatastoreAdminFutureStub + extends io.grpc.stub.AbstractFutureStub { + private DatastoreAdminFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DatastoreAdminFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DatastoreAdminFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Exports a copy of all or a subset of entities from Google Cloud Datastore
+     * to another storage system, such as Google Cloud Storage. Recent updates to
+     * entities may not be reflected in the export. The export occurs in the
+     * background and its progress can be monitored and managed via the
+     * Operation resource that is created. The output of an export may only be
+     * used once the associated operation is done. If an export operation is
+     * cancelled before completion it may leave partial data behind in Google
+     * Cloud Storage.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + exportEntities(com.google.datastore.admin.v1.ExportEntitiesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getExportEntitiesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Imports entities into Google Cloud Datastore. Existing entities with the
+     * same key are overwritten. The import occurs in the background and its
+     * progress can be monitored and managed via the Operation resource that is
+     * created. If an ImportEntities operation is cancelled, it is possible
+     * that a subset of the data has already been imported to Cloud Datastore.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + importEntities(com.google.datastore.admin.v1.ImportEntitiesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getImportEntitiesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates the specified index.
+     * A newly created index's initial state is `CREATING`. On completion of the
+     * returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`.
+     * If the index already exists, the call will return an `ALREADY_EXISTS`
+     * status.
+     * During index creation, the process could result in an error, in which
+     * case the index will move to the `ERROR` state. The process can be recovered
+     * by fixing the data that caused the error, removing the index with
+     * [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then
+     * re-creating the index with [create]
+     * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex].
+     * Indexes with a single property cannot be created.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createIndex(com.google.datastore.admin.v1.CreateIndexRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateIndexMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes an existing index.
+     * An index can only be deleted if it is in a `READY` or `ERROR` state. On
+     * successful execution of the request, the index will be in a `DELETING`
+     * [state][google.datastore.admin.v1.Index.State]. And on completion of the
+     * returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed.
+     * During index deletion, the process could result in an error, in which
+     * case the index will move to the `ERROR` state. The process can be recovered
+     * by fixing the data that caused the error, followed by calling
+     * [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteIndex(com.google.datastore.admin.v1.DeleteIndexRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteIndexMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets an index.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getIndex(com.google.datastore.admin.v1.GetIndexRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetIndexMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists the indexes that match the specified filters.  Datastore uses an
+     * eventually consistent query to fetch the list of indexes and may
+     * occasionally return stale results.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.datastore.admin.v1.ListIndexesResponse> + listIndexes(com.google.datastore.admin.v1.ListIndexesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListIndexesMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_EXPORT_ENTITIES = 0; + private static final int METHODID_IMPORT_ENTITIES = 1; + private static final int METHODID_CREATE_INDEX = 2; + private static final int METHODID_DELETE_INDEX = 3; + private static final int METHODID_GET_INDEX = 4; + private static final int METHODID_LIST_INDEXES = 5; + + 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 DatastoreAdminImplBase serviceImpl; + private final int methodId; + + MethodHandlers(DatastoreAdminImplBase 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_EXPORT_ENTITIES: + serviceImpl.exportEntities( + (com.google.datastore.admin.v1.ExportEntitiesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_IMPORT_ENTITIES: + serviceImpl.importEntities( + (com.google.datastore.admin.v1.ImportEntitiesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_INDEX: + serviceImpl.createIndex( + (com.google.datastore.admin.v1.CreateIndexRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_INDEX: + serviceImpl.deleteIndex( + (com.google.datastore.admin.v1.DeleteIndexRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_INDEX: + serviceImpl.getIndex( + (com.google.datastore.admin.v1.GetIndexRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_INDEXES: + serviceImpl.listIndexes( + (com.google.datastore.admin.v1.ListIndexesRequest) 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 DatastoreAdminBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + DatastoreAdminBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("DatastoreAdmin"); + } + } + + private static final class DatastoreAdminFileDescriptorSupplier + extends DatastoreAdminBaseDescriptorSupplier { + DatastoreAdminFileDescriptorSupplier() {} + } + + private static final class DatastoreAdminMethodDescriptorSupplier + extends DatastoreAdminBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + DatastoreAdminMethodDescriptorSupplier(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 (DatastoreAdminGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new DatastoreAdminFileDescriptorSupplier()) + .addMethod(getExportEntitiesMethod()) + .addMethod(getImportEntitiesMethod()) + .addMethod(getCreateIndexMethod()) + .addMethod(getDeleteIndexMethod()) + .addMethod(getGetIndexMethod()) + .addMethod(getListIndexesMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index 73853572c..391e807f0 100644 --- a/pom.xml +++ b/pom.xml @@ -156,6 +156,21 @@ import + + com.google.api.grpc + proto-google-cloud-datastore-admin-v1 + 2.5.2-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-datastore-v1 + 2.5.2-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-datastore-admin-v1 + 2.5.2-SNAPSHOT + com.google.cloud google-cloud-datastore @@ -256,7 +271,9 @@ google-cloud-datastore + grpc-google-cloud-datastore-admin-v1 proto-google-cloud-datastore-v1 + proto-google-cloud-datastore-admin-v1 datastore-v1-proto-client google-cloud-datastore-bom diff --git a/proto-google-cloud-datastore-admin-v1/clirr-ignored-differences.xml b/proto-google-cloud-datastore-admin-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000..c384c422e --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/datastore/admin/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/datastore/admin/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/datastore/admin/v1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-datastore-admin-v1/pom.xml b/proto-google-cloud-datastore-admin-v1/pom.xml new file mode 100644 index 000000000..ac1106424 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/pom.xml @@ -0,0 +1,34 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-datastore-admin-v1 + 2.5.2-SNAPSHOT + proto-google-cloud-datastore-admin-v1 + Proto library for google-cloud-datastore + + com.google.cloud + google-cloud-datastore-parent + 2.5.2-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/CommonMetadata.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/CommonMetadata.java new file mode 100644 index 000000000..240290b30 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/CommonMetadata.java @@ -0,0 +1,1912 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * Metadata common to all Datastore Admin operations.
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.CommonMetadata} + */ +public final class CommonMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.CommonMetadata) + CommonMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CommonMetadata.newBuilder() to construct. + private CommonMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CommonMetadata() { + operationType_ = 0; + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CommonMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CommonMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 24: + { + int rawValue = input.readEnum(); + + operationType_ = rawValue; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 40: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_CommonMetadata_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_CommonMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.CommonMetadata.class, + com.google.datastore.admin.v1.CommonMetadata.Builder.class); + } + + /** + * + * + *
+   * The various possible states for an ongoing Operation.
+   * 
+ * + * Protobuf enum {@code google.datastore.admin.v1.CommonMetadata.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Request is being prepared for processing.
+     * 
+ * + * INITIALIZING = 1; + */ + INITIALIZING(1), + /** + * + * + *
+     * Request is actively being processed.
+     * 
+ * + * PROCESSING = 2; + */ + PROCESSING(2), + /** + * + * + *
+     * Request is in the process of being cancelled after user called
+     * google.longrunning.Operations.CancelOperation on the operation.
+     * 
+ * + * CANCELLING = 3; + */ + CANCELLING(3), + /** + * + * + *
+     * Request has been processed and is in its finalization stage.
+     * 
+ * + * FINALIZING = 4; + */ + FINALIZING(4), + /** + * + * + *
+     * Request has completed successfully.
+     * 
+ * + * SUCCESSFUL = 5; + */ + SUCCESSFUL(5), + /** + * + * + *
+     * Request has finished being processed, but encountered an error.
+     * 
+ * + * FAILED = 6; + */ + FAILED(6), + /** + * + * + *
+     * Request has finished being cancelled after user called
+     * google.longrunning.Operations.CancelOperation.
+     * 
+ * + * CANCELLED = 7; + */ + CANCELLED(7), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Request is being prepared for processing.
+     * 
+ * + * INITIALIZING = 1; + */ + public static final int INITIALIZING_VALUE = 1; + /** + * + * + *
+     * Request is actively being processed.
+     * 
+ * + * PROCESSING = 2; + */ + public static final int PROCESSING_VALUE = 2; + /** + * + * + *
+     * Request is in the process of being cancelled after user called
+     * google.longrunning.Operations.CancelOperation on the operation.
+     * 
+ * + * CANCELLING = 3; + */ + public static final int CANCELLING_VALUE = 3; + /** + * + * + *
+     * Request has been processed and is in its finalization stage.
+     * 
+ * + * FINALIZING = 4; + */ + public static final int FINALIZING_VALUE = 4; + /** + * + * + *
+     * Request has completed successfully.
+     * 
+ * + * SUCCESSFUL = 5; + */ + public static final int SUCCESSFUL_VALUE = 5; + /** + * + * + *
+     * Request has finished being processed, but encountered an error.
+     * 
+ * + * FAILED = 6; + */ + public static final int FAILED_VALUE = 6; + /** + * + * + *
+     * Request has finished being cancelled after user called
+     * google.longrunning.Operations.CancelOperation.
+     * 
+ * + * CANCELLED = 7; + */ + public static final int CANCELLED_VALUE = 7; + + 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 INITIALIZING; + case 2: + return PROCESSING; + case 3: + return CANCELLING; + case 4: + return FINALIZING; + case 5: + return SUCCESSFUL; + case 6: + return FAILED; + case 7: + return CANCELLED; + 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.datastore.admin.v1.CommonMetadata.getDescriptor().getEnumTypes().get(0); + } + + 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.datastore.admin.v1.CommonMetadata.State) + } + + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The time that work began on the operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * The time that work began on the operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The time that work began on the operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * The time the operation ended, either successfully or otherwise.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * The time the operation ended, either successfully or otherwise.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * The time the operation ended, either successfully or otherwise.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int OPERATION_TYPE_FIELD_NUMBER = 3; + private int operationType_; + /** + * + * + *
+   * The type of the operation. Can be used as a filter in
+   * ListOperationsRequest.
+   * 
+ * + * .google.datastore.admin.v1.OperationType operation_type = 3; + * + * @return The enum numeric value on the wire for operationType. + */ + @java.lang.Override + public int getOperationTypeValue() { + return operationType_; + } + /** + * + * + *
+   * The type of the operation. Can be used as a filter in
+   * ListOperationsRequest.
+   * 
+ * + * .google.datastore.admin.v1.OperationType operation_type = 3; + * + * @return The operationType. + */ + @java.lang.Override + public com.google.datastore.admin.v1.OperationType getOperationType() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.OperationType result = + com.google.datastore.admin.v1.OperationType.valueOf(operationType_); + return result == null ? com.google.datastore.admin.v1.OperationType.UNRECOGNIZED : result; + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_CommonMetadata_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * The client-assigned labels which were provided when the operation was
+   * created. May also include additional labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * The client-assigned labels which were provided when the operation was
+   * created. May also include additional labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * The client-assigned labels which were provided when the operation was
+   * created. May also include additional labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The client-assigned labels which were provided when the operation was
+   * created. May also include additional labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATE_FIELD_NUMBER = 5; + private int state_; + /** + * + * + *
+   * The current state of the Operation.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata.State state = 5; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The current state of the Operation.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata.State state = 5; + * + * @return The state. + */ + @java.lang.Override + public com.google.datastore.admin.v1.CommonMetadata.State getState() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.CommonMetadata.State result = + com.google.datastore.admin.v1.CommonMetadata.State.valueOf(state_); + return result == null + ? com.google.datastore.admin.v1.CommonMetadata.State.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 (startTime_ != null) { + output.writeMessage(1, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (operationType_ + != com.google.datastore.admin.v1.OperationType.OPERATION_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, operationType_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (state_ + != com.google.datastore.admin.v1.CommonMetadata.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, state_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (operationType_ + != com.google.datastore.admin.v1.OperationType.OPERATION_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, operationType_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); + } + if (state_ + != com.google.datastore.admin.v1.CommonMetadata.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_); + } + size += unknownFields.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.datastore.admin.v1.CommonMetadata)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.CommonMetadata other = + (com.google.datastore.admin.v1.CommonMetadata) obj; + + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (operationType_ != other.operationType_) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (state_ != other.state_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + OPERATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + operationType_; + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.CommonMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.CommonMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.CommonMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.CommonMetadata 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.datastore.admin.v1.CommonMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.CommonMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.CommonMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.CommonMetadata 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.datastore.admin.v1.CommonMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.CommonMetadata 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.datastore.admin.v1.CommonMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.CommonMetadata 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.datastore.admin.v1.CommonMetadata 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; + } + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.CommonMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.CommonMetadata) + com.google.datastore.admin.v1.CommonMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_CommonMetadata_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_CommonMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.CommonMetadata.class, + com.google.datastore.admin.v1.CommonMetadata.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.CommonMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + operationType_ = 0; + + internalGetMutableLabels().clear(); + state_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_CommonMetadata_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.CommonMetadata getDefaultInstanceForType() { + return com.google.datastore.admin.v1.CommonMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.CommonMetadata build() { + com.google.datastore.admin.v1.CommonMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.CommonMetadata buildPartial() { + com.google.datastore.admin.v1.CommonMetadata result = + new com.google.datastore.admin.v1.CommonMetadata(this); + int from_bitField0_ = bitField0_; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.operationType_ = operationType_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.state_ = state_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.CommonMetadata) { + return mergeFrom((com.google.datastore.admin.v1.CommonMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.CommonMetadata other) { + if (other == com.google.datastore.admin.v1.CommonMetadata.getDefaultInstance()) return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.operationType_ != 0) { + setOperationTypeValue(other.getOperationTypeValue()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.CommonMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.datastore.admin.v1.CommonMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * The time that work began on the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * The time that work began on the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time that work began on the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time that work began on the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time that work began on the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time that work began on the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time that work began on the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time that work began on the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * The time that work began on the operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * The time the operation ended, either successfully or otherwise.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * The time the operation ended, either successfully or otherwise.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time the operation ended, either successfully or otherwise.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation ended, either successfully or otherwise.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time the operation ended, either successfully or otherwise.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation ended, either successfully or otherwise.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time the operation ended, either successfully or otherwise.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the operation ended, either successfully or otherwise.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * The time the operation ended, either successfully or otherwise.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private int operationType_ = 0; + /** + * + * + *
+     * The type of the operation. Can be used as a filter in
+     * ListOperationsRequest.
+     * 
+ * + * .google.datastore.admin.v1.OperationType operation_type = 3; + * + * @return The enum numeric value on the wire for operationType. + */ + @java.lang.Override + public int getOperationTypeValue() { + return operationType_; + } + /** + * + * + *
+     * The type of the operation. Can be used as a filter in
+     * ListOperationsRequest.
+     * 
+ * + * .google.datastore.admin.v1.OperationType operation_type = 3; + * + * @param value The enum numeric value on the wire for operationType to set. + * @return This builder for chaining. + */ + public Builder setOperationTypeValue(int value) { + + operationType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the operation. Can be used as a filter in
+     * ListOperationsRequest.
+     * 
+ * + * .google.datastore.admin.v1.OperationType operation_type = 3; + * + * @return The operationType. + */ + @java.lang.Override + public com.google.datastore.admin.v1.OperationType getOperationType() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.OperationType result = + com.google.datastore.admin.v1.OperationType.valueOf(operationType_); + return result == null ? com.google.datastore.admin.v1.OperationType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The type of the operation. Can be used as a filter in
+     * ListOperationsRequest.
+     * 
+ * + * .google.datastore.admin.v1.OperationType operation_type = 3; + * + * @param value The operationType to set. + * @return This builder for chaining. + */ + public Builder setOperationType(com.google.datastore.admin.v1.OperationType value) { + if (value == null) { + throw new NullPointerException(); + } + + operationType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the operation. Can be used as a filter in
+     * ListOperationsRequest.
+     * 
+ * + * .google.datastore.admin.v1.OperationType operation_type = 3; + * + * @return This builder for chaining. + */ + public Builder clearOperationType() { + + operationType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * The client-assigned labels which were provided when the operation was
+     * created. May also include additional labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * The client-assigned labels which were provided when the operation was
+     * created. May also include additional labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * The client-assigned labels which were provided when the operation was
+     * created. May also include additional labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The client-assigned labels which were provided when the operation was
+     * created. May also include additional labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The client-assigned labels which were provided when the operation was
+     * created. May also include additional labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * The client-assigned labels which were provided when the operation was
+     * created. May also include additional labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * The client-assigned labels which were provided when the operation was
+     * created. May also include additional labels.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * The current state of the Operation.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata.State state = 5; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The current state of the Operation.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata.State state = 5; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The current state of the Operation.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata.State state = 5; + * + * @return The state. + */ + @java.lang.Override + public com.google.datastore.admin.v1.CommonMetadata.State getState() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.CommonMetadata.State result = + com.google.datastore.admin.v1.CommonMetadata.State.valueOf(state_); + return result == null + ? com.google.datastore.admin.v1.CommonMetadata.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The current state of the Operation.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata.State state = 5; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.datastore.admin.v1.CommonMetadata.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The current state of the Operation.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata.State state = 5; + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 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.datastore.admin.v1.CommonMetadata) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.CommonMetadata) + private static final com.google.datastore.admin.v1.CommonMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.CommonMetadata(); + } + + public static com.google.datastore.admin.v1.CommonMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CommonMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CommonMetadata(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.CommonMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/CommonMetadataOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/CommonMetadataOrBuilder.java new file mode 100644 index 000000000..470d8c040 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/CommonMetadataOrBuilder.java @@ -0,0 +1,206 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +public interface CommonMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.CommonMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time that work began on the operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * The time that work began on the operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The time that work began on the operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The time the operation ended, either successfully or otherwise.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * The time the operation ended, either successfully or otherwise.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * The time the operation ended, either successfully or otherwise.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * The type of the operation. Can be used as a filter in
+   * ListOperationsRequest.
+   * 
+ * + * .google.datastore.admin.v1.OperationType operation_type = 3; + * + * @return The enum numeric value on the wire for operationType. + */ + int getOperationTypeValue(); + /** + * + * + *
+   * The type of the operation. Can be used as a filter in
+   * ListOperationsRequest.
+   * 
+ * + * .google.datastore.admin.v1.OperationType operation_type = 3; + * + * @return The operationType. + */ + com.google.datastore.admin.v1.OperationType getOperationType(); + + /** + * + * + *
+   * The client-assigned labels which were provided when the operation was
+   * created. May also include additional labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + int getLabelsCount(); + /** + * + * + *
+   * The client-assigned labels which were provided when the operation was
+   * created. May also include additional labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * The client-assigned labels which were provided when the operation was
+   * created. May also include additional labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * The client-assigned labels which were provided when the operation was
+   * created. May also include additional labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * The client-assigned labels which were provided when the operation was
+   * created. May also include additional labels.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * The current state of the Operation.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata.State state = 5; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The current state of the Operation.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata.State state = 5; + * + * @return The state. + */ + com.google.datastore.admin.v1.CommonMetadata.State getState(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/CreateIndexRequest.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/CreateIndexRequest.java new file mode 100644 index 000000000..49f317523 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/CreateIndexRequest.java @@ -0,0 +1,920 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * The request for
+ * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex][google.datastore.admin.v1.DatastoreAdmin.CreateIndex].
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.CreateIndexRequest} + */ +public final class CreateIndexRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.CreateIndexRequest) + CreateIndexRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateIndexRequest.newBuilder() to construct. + private CreateIndexRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateIndexRequest() { + projectId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateIndexRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateIndexRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 26: + { + com.google.datastore.admin.v1.Index.Builder subBuilder = null; + if (index_ != null) { + subBuilder = index_.toBuilder(); + } + index_ = + input.readMessage( + com.google.datastore.admin.v1.Index.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(index_); + index_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_CreateIndexRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_CreateIndexRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.CreateIndexRequest.class, + com.google.datastore.admin.v1.CreateIndexRequest.Builder.class); + } + + public static final int PROJECT_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * Project ID against which to make the request.
+   * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + 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(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * Project ID against which to make the request.
+   * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDEX_FIELD_NUMBER = 3; + private com.google.datastore.admin.v1.Index index_; + /** + * + * + *
+   * The index to create. The name and state fields are output only and will be
+   * ignored. Single property indexes cannot be created or deleted.
+   * 
+ * + * .google.datastore.admin.v1.Index index = 3; + * + * @return Whether the index field is set. + */ + @java.lang.Override + public boolean hasIndex() { + return index_ != null; + } + /** + * + * + *
+   * The index to create. The name and state fields are output only and will be
+   * ignored. Single property indexes cannot be created or deleted.
+   * 
+ * + * .google.datastore.admin.v1.Index index = 3; + * + * @return The index. + */ + @java.lang.Override + public com.google.datastore.admin.v1.Index getIndex() { + return index_ == null ? com.google.datastore.admin.v1.Index.getDefaultInstance() : index_; + } + /** + * + * + *
+   * The index to create. The name and state fields are output only and will be
+   * ignored. Single property indexes cannot be created or deleted.
+   * 
+ * + * .google.datastore.admin.v1.Index index = 3; + */ + @java.lang.Override + public com.google.datastore.admin.v1.IndexOrBuilder getIndexOrBuilder() { + return getIndex(); + } + + 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(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectId_); + } + if (index_ != null) { + output.writeMessage(3, getIndex()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectId_); + } + if (index_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getIndex()); + } + size += unknownFields.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.datastore.admin.v1.CreateIndexRequest)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.CreateIndexRequest other = + (com.google.datastore.admin.v1.CreateIndexRequest) obj; + + if (!getProjectId().equals(other.getProjectId())) return false; + if (hasIndex() != other.hasIndex()) return false; + if (hasIndex()) { + if (!getIndex().equals(other.getIndex())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + if (hasIndex()) { + hash = (37 * hash) + INDEX_FIELD_NUMBER; + hash = (53 * hash) + getIndex().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.CreateIndexRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.CreateIndexRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.CreateIndexRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.CreateIndexRequest 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.datastore.admin.v1.CreateIndexRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.CreateIndexRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.CreateIndexRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.CreateIndexRequest 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.datastore.admin.v1.CreateIndexRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.CreateIndexRequest 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.datastore.admin.v1.CreateIndexRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.CreateIndexRequest 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.datastore.admin.v1.CreateIndexRequest 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 request for
+   * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex][google.datastore.admin.v1.DatastoreAdmin.CreateIndex].
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.CreateIndexRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.CreateIndexRequest) + com.google.datastore.admin.v1.CreateIndexRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_CreateIndexRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_CreateIndexRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.CreateIndexRequest.class, + com.google.datastore.admin.v1.CreateIndexRequest.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.CreateIndexRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + projectId_ = ""; + + if (indexBuilder_ == null) { + index_ = null; + } else { + index_ = null; + indexBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_CreateIndexRequest_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.CreateIndexRequest getDefaultInstanceForType() { + return com.google.datastore.admin.v1.CreateIndexRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.CreateIndexRequest build() { + com.google.datastore.admin.v1.CreateIndexRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.CreateIndexRequest buildPartial() { + com.google.datastore.admin.v1.CreateIndexRequest result = + new com.google.datastore.admin.v1.CreateIndexRequest(this); + result.projectId_ = projectId_; + if (indexBuilder_ == null) { + result.index_ = index_; + } else { + result.index_ = indexBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.CreateIndexRequest) { + return mergeFrom((com.google.datastore.admin.v1.CreateIndexRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.CreateIndexRequest other) { + if (other == com.google.datastore.admin.v1.CreateIndexRequest.getDefaultInstance()) + return this; + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (other.hasIndex()) { + mergeIndex(other.getIndex()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.CreateIndexRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.datastore.admin.v1.CreateIndexRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private com.google.datastore.admin.v1.Index index_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Index, + com.google.datastore.admin.v1.Index.Builder, + com.google.datastore.admin.v1.IndexOrBuilder> + indexBuilder_; + /** + * + * + *
+     * The index to create. The name and state fields are output only and will be
+     * ignored. Single property indexes cannot be created or deleted.
+     * 
+ * + * .google.datastore.admin.v1.Index index = 3; + * + * @return Whether the index field is set. + */ + public boolean hasIndex() { + return indexBuilder_ != null || index_ != null; + } + /** + * + * + *
+     * The index to create. The name and state fields are output only and will be
+     * ignored. Single property indexes cannot be created or deleted.
+     * 
+ * + * .google.datastore.admin.v1.Index index = 3; + * + * @return The index. + */ + public com.google.datastore.admin.v1.Index getIndex() { + if (indexBuilder_ == null) { + return index_ == null ? com.google.datastore.admin.v1.Index.getDefaultInstance() : index_; + } else { + return indexBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The index to create. The name and state fields are output only and will be
+     * ignored. Single property indexes cannot be created or deleted.
+     * 
+ * + * .google.datastore.admin.v1.Index index = 3; + */ + public Builder setIndex(com.google.datastore.admin.v1.Index value) { + if (indexBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + index_ = value; + onChanged(); + } else { + indexBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The index to create. The name and state fields are output only and will be
+     * ignored. Single property indexes cannot be created or deleted.
+     * 
+ * + * .google.datastore.admin.v1.Index index = 3; + */ + public Builder setIndex(com.google.datastore.admin.v1.Index.Builder builderForValue) { + if (indexBuilder_ == null) { + index_ = builderForValue.build(); + onChanged(); + } else { + indexBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The index to create. The name and state fields are output only and will be
+     * ignored. Single property indexes cannot be created or deleted.
+     * 
+ * + * .google.datastore.admin.v1.Index index = 3; + */ + public Builder mergeIndex(com.google.datastore.admin.v1.Index value) { + if (indexBuilder_ == null) { + if (index_ != null) { + index_ = + com.google.datastore.admin.v1.Index.newBuilder(index_) + .mergeFrom(value) + .buildPartial(); + } else { + index_ = value; + } + onChanged(); + } else { + indexBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The index to create. The name and state fields are output only and will be
+     * ignored. Single property indexes cannot be created or deleted.
+     * 
+ * + * .google.datastore.admin.v1.Index index = 3; + */ + public Builder clearIndex() { + if (indexBuilder_ == null) { + index_ = null; + onChanged(); + } else { + index_ = null; + indexBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The index to create. The name and state fields are output only and will be
+     * ignored. Single property indexes cannot be created or deleted.
+     * 
+ * + * .google.datastore.admin.v1.Index index = 3; + */ + public com.google.datastore.admin.v1.Index.Builder getIndexBuilder() { + + onChanged(); + return getIndexFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The index to create. The name and state fields are output only and will be
+     * ignored. Single property indexes cannot be created or deleted.
+     * 
+ * + * .google.datastore.admin.v1.Index index = 3; + */ + public com.google.datastore.admin.v1.IndexOrBuilder getIndexOrBuilder() { + if (indexBuilder_ != null) { + return indexBuilder_.getMessageOrBuilder(); + } else { + return index_ == null ? com.google.datastore.admin.v1.Index.getDefaultInstance() : index_; + } + } + /** + * + * + *
+     * The index to create. The name and state fields are output only and will be
+     * ignored. Single property indexes cannot be created or deleted.
+     * 
+ * + * .google.datastore.admin.v1.Index index = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Index, + com.google.datastore.admin.v1.Index.Builder, + com.google.datastore.admin.v1.IndexOrBuilder> + getIndexFieldBuilder() { + if (indexBuilder_ == null) { + indexBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Index, + com.google.datastore.admin.v1.Index.Builder, + com.google.datastore.admin.v1.IndexOrBuilder>( + getIndex(), getParentForChildren(), isClean()); + index_ = null; + } + return indexBuilder_; + } + + @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.datastore.admin.v1.CreateIndexRequest) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.CreateIndexRequest) + private static final com.google.datastore.admin.v1.CreateIndexRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.CreateIndexRequest(); + } + + public static com.google.datastore.admin.v1.CreateIndexRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateIndexRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateIndexRequest(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.CreateIndexRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/CreateIndexRequestOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/CreateIndexRequestOrBuilder.java new file mode 100644 index 000000000..5aa22c75b --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/CreateIndexRequestOrBuilder.java @@ -0,0 +1,88 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +public interface CreateIndexRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.CreateIndexRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Project ID against which to make the request.
+   * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Project ID against which to make the request.
+   * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * The index to create. The name and state fields are output only and will be
+   * ignored. Single property indexes cannot be created or deleted.
+   * 
+ * + * .google.datastore.admin.v1.Index index = 3; + * + * @return Whether the index field is set. + */ + boolean hasIndex(); + /** + * + * + *
+   * The index to create. The name and state fields are output only and will be
+   * ignored. Single property indexes cannot be created or deleted.
+   * 
+ * + * .google.datastore.admin.v1.Index index = 3; + * + * @return The index. + */ + com.google.datastore.admin.v1.Index getIndex(); + /** + * + * + *
+   * The index to create. The name and state fields are output only and will be
+   * ignored. Single property indexes cannot be created or deleted.
+   * 
+ * + * .google.datastore.admin.v1.Index index = 3; + */ + com.google.datastore.admin.v1.IndexOrBuilder getIndexOrBuilder(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DatastoreAdminProto.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DatastoreAdminProto.java new file mode 100644 index 000000000..810e65ae7 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DatastoreAdminProto.java @@ -0,0 +1,405 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +public final class DatastoreAdminProto { + private DatastoreAdminProto() {} + + 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_datastore_admin_v1_CommonMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_CommonMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_CommonMetadata_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_CommonMetadata_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_Progress_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_Progress_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_ExportEntitiesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_ExportEntitiesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_ExportEntitiesRequest_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_ExportEntitiesRequest_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_ImportEntitiesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_ImportEntitiesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_ImportEntitiesRequest_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_ImportEntitiesRequest_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_ExportEntitiesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_ExportEntitiesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_ExportEntitiesMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_ExportEntitiesMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_ImportEntitiesMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_ImportEntitiesMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_EntityFilter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_EntityFilter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_CreateIndexRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_CreateIndexRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_DeleteIndexRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_DeleteIndexRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_GetIndexRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_GetIndexRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_ListIndexesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_ListIndexesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_ListIndexesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_ListIndexesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_IndexOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_IndexOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_DatastoreFirestoreMigrationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_DatastoreFirestoreMigrationMetadata_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/datastore/admin/v1/datastore_ad" + + "min.proto\022\031google.datastore.admin.v1\032\034go" + + "ogle/api/annotations.proto\032\027google/api/c" + + "lient.proto\032\037google/api/field_behavior.p" + + "roto\032%google/datastore/admin/v1/index.pr" + + "oto\032)google/datastore/admin/v1/migration" + + ".proto\032#google/longrunning/operations.pr" + + "oto\032\037google/protobuf/timestamp.proto\"\364\003\n" + + "\016CommonMetadata\022.\n\nstart_time\030\001 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\022,\n\010end_time\030\002 \001(" + + "\0132\032.google.protobuf.Timestamp\022@\n\016operati" + + "on_type\030\003 \001(\0162(.google.datastore.admin.v" + + "1.OperationType\022E\n\006labels\030\004 \003(\01325.google" + + ".datastore.admin.v1.CommonMetadata.Label" + + "sEntry\022>\n\005state\030\005 \001(\0162/.google.datastore" + + ".admin.v1.CommonMetadata.State\032-\n\013Labels" + + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\213\001" + + "\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\020\n\014INITIA" + + "LIZING\020\001\022\016\n\nPROCESSING\020\002\022\016\n\nCANCELLING\020\003" + + "\022\016\n\nFINALIZING\020\004\022\016\n\nSUCCESSFUL\020\005\022\n\n\006FAIL" + + "ED\020\006\022\r\n\tCANCELLED\020\007\":\n\010Progress\022\026\n\016work_" + + "completed\030\001 \001(\003\022\026\n\016work_estimated\030\002 \001(\003\"" + + "\215\002\n\025ExportEntitiesRequest\022\027\n\nproject_id\030" + + "\001 \001(\tB\003\340A\002\022L\n\006labels\030\002 \003(\0132<.google.data" + + "store.admin.v1.ExportEntitiesRequest.Lab" + + "elsEntry\022>\n\rentity_filter\030\003 \001(\0132\'.google" + + ".datastore.admin.v1.EntityFilter\022\036\n\021outp" + + "ut_url_prefix\030\004 \001(\tB\003\340A\002\032-\n\013LabelsEntry\022" + + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\205\002\n\025Impo" + + "rtEntitiesRequest\022\027\n\nproject_id\030\001 \001(\tB\003\340" + + "A\002\022L\n\006labels\030\002 \003(\0132<.google.datastore.ad" + + "min.v1.ImportEntitiesRequest.LabelsEntry" + + "\022\026\n\tinput_url\030\003 \001(\tB\003\340A\002\022>\n\rentity_filte" + + "r\030\004 \001(\0132\'.google.datastore.admin.v1.Enti" + + "tyFilter\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" + + "value\030\002 \001(\t:\0028\001\",\n\026ExportEntitiesRespons" + + "e\022\022\n\noutput_url\030\001 \001(\t\"\253\002\n\026ExportEntities" + + "Metadata\0229\n\006common\030\001 \001(\0132).google.datast" + + "ore.admin.v1.CommonMetadata\022>\n\021progress_" + + "entities\030\002 \001(\0132#.google.datastore.admin." + + "v1.Progress\022;\n\016progress_bytes\030\003 \001(\0132#.go" + + "ogle.datastore.admin.v1.Progress\022>\n\renti" + + "ty_filter\030\004 \001(\0132\'.google.datastore.admin" + + ".v1.EntityFilter\022\031\n\021output_url_prefix\030\005 " + + "\001(\t\"\243\002\n\026ImportEntitiesMetadata\0229\n\006common" + + "\030\001 \001(\0132).google.datastore.admin.v1.Commo" + + "nMetadata\022>\n\021progress_entities\030\002 \001(\0132#.g" + + "oogle.datastore.admin.v1.Progress\022;\n\016pro" + + "gress_bytes\030\003 \001(\0132#.google.datastore.adm" + + "in.v1.Progress\022>\n\rentity_filter\030\004 \001(\0132\'." + + "google.datastore.admin.v1.EntityFilter\022\021" + + "\n\tinput_url\030\005 \001(\t\"4\n\014EntityFilter\022\r\n\005kin" + + "ds\030\001 \003(\t\022\025\n\rnamespace_ids\030\002 \003(\t\"Y\n\022Creat" + + "eIndexRequest\022\022\n\nproject_id\030\001 \001(\t\022/\n\005ind" + + "ex\030\003 \001(\0132 .google.datastore.admin.v1.Ind" + + "ex\":\n\022DeleteIndexRequest\022\022\n\nproject_id\030\001" + + " \001(\t\022\020\n\010index_id\030\003 \001(\t\"7\n\017GetIndexReques" + + "t\022\022\n\nproject_id\030\001 \001(\t\022\020\n\010index_id\030\003 \001(\t\"" + + "_\n\022ListIndexesRequest\022\022\n\nproject_id\030\001 \001(" + + "\t\022\016\n\006filter\030\003 \001(\t\022\021\n\tpage_size\030\004 \001(\005\022\022\n\n" + + "page_token\030\005 \001(\t\"a\n\023ListIndexesResponse\022" + + "1\n\007indexes\030\001 \003(\0132 .google.datastore.admi" + + "n.v1.Index\022\027\n\017next_page_token\030\002 \001(\t\"\245\001\n\026" + + "IndexOperationMetadata\0229\n\006common\030\001 \001(\0132)" + + ".google.datastore.admin.v1.CommonMetadat" + + "a\022>\n\021progress_entities\030\002 \001(\0132#.google.da" + + "tastore.admin.v1.Progress\022\020\n\010index_id\030\003 " + + "\001(\t\"\253\001\n#DatastoreFirestoreMigrationMetad" + + "ata\022B\n\017migration_state\030\001 \001(\0162).google.da" + + "tastore.admin.v1.MigrationState\022@\n\016migra" + + "tion_step\030\002 \001(\0162(.google.datastore.admin" + + ".v1.MigrationStep*}\n\rOperationType\022\036\n\032OP" + + "ERATION_TYPE_UNSPECIFIED\020\000\022\023\n\017EXPORT_ENT" + + "ITIES\020\001\022\023\n\017IMPORT_ENTITIES\020\002\022\020\n\014CREATE_I" + + "NDEX\020\003\022\020\n\014DELETE_INDEX\020\0042\204\n\n\016DatastoreAd" + + "min\022\366\001\n\016ExportEntities\0220.google.datastor" + + "e.admin.v1.ExportEntitiesRequest\032\035.googl" + + "e.longrunning.Operation\"\222\001\202\323\344\223\002%\" /v1/pr" + + "ojects/{project_id}:export:\001*\332A1project_" + + "id,labels,entity_filter,output_url_prefi" + + "x\312A0\n\026ExportEntitiesResponse\022\026ExportEnti" + + "tiesMetadata\022\355\001\n\016ImportEntities\0220.google" + + ".datastore.admin.v1.ImportEntitiesReques" + + "t\032\035.google.longrunning.Operation\"\211\001\202\323\344\223\002" + + "%\" /v1/projects/{project_id}:import:\001*\332A" + + ")project_id,labels,input_url,entity_filt" + + "er\312A/\n\025google.protobuf.Empty\022\026ImportEnti" + + "tiesMetadata\022\257\001\n\013CreateIndex\022-.google.da" + + "tastore.admin.v1.CreateIndexRequest\032\035.go" + + "ogle.longrunning.Operation\"R\202\323\344\223\002*\"!/v1/" + + "projects/{project_id}/indexes:\005index\312A\037\n" + + "\005Index\022\026IndexOperationMetadata\022\263\001\n\013Delet" + + "eIndex\022-.google.datastore.admin.v1.Delet" + + "eIndexRequest\032\035.google.longrunning.Opera" + + "tion\"V\202\323\344\223\002.*,/v1/projects/{project_id}/" + + "indexes/{index_id}\312A\037\n\005Index\022\026IndexOpera" + + "tionMetadata\022\216\001\n\010GetIndex\022*.google.datas" + + "tore.admin.v1.GetIndexRequest\032 .google.d" + + "atastore.admin.v1.Index\"4\202\323\344\223\002.\022,/v1/pro" + + "jects/{project_id}/indexes/{index_id}\022\227\001" + + "\n\013ListIndexes\022-.google.datastore.admin.v" + + "1.ListIndexesRequest\032..google.datastore." + + "admin.v1.ListIndexesResponse\")\202\323\344\223\002#\022!/v" + + "1/projects/{project_id}/indexes\032v\312A\030data" + + "store.googleapis.com\322AXhttps://www.googl" + + "eapis.com/auth/cloud-platform,https://ww" + + "w.googleapis.com/auth/datastoreB\340\001\n\035com." + + "google.datastore.admin.v1B\023DatastoreAdmi" + + "nProtoP\001Z>google.golang.org/genproto/goo" + + "gleapis/datastore/admin/v1;admin\252\002\037Googl" + + "e.Cloud.Datastore.Admin.V1\312\002\037Google\\Clou" + + "d\\Datastore\\Admin\\V1\352\002#Google::Cloud::Da" + + "tastore::Admin::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.datastore.admin.v1.IndexProto.getDescriptor(), + com.google.datastore.admin.v1.MigrationProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_datastore_admin_v1_CommonMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_datastore_admin_v1_CommonMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_CommonMetadata_descriptor, + new java.lang.String[] { + "StartTime", "EndTime", "OperationType", "Labels", "State", + }); + internal_static_google_datastore_admin_v1_CommonMetadata_LabelsEntry_descriptor = + internal_static_google_datastore_admin_v1_CommonMetadata_descriptor.getNestedTypes().get(0); + internal_static_google_datastore_admin_v1_CommonMetadata_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_CommonMetadata_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_datastore_admin_v1_Progress_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_datastore_admin_v1_Progress_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_Progress_descriptor, + new java.lang.String[] { + "WorkCompleted", "WorkEstimated", + }); + internal_static_google_datastore_admin_v1_ExportEntitiesRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_datastore_admin_v1_ExportEntitiesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_ExportEntitiesRequest_descriptor, + new java.lang.String[] { + "ProjectId", "Labels", "EntityFilter", "OutputUrlPrefix", + }); + internal_static_google_datastore_admin_v1_ExportEntitiesRequest_LabelsEntry_descriptor = + internal_static_google_datastore_admin_v1_ExportEntitiesRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_datastore_admin_v1_ExportEntitiesRequest_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_ExportEntitiesRequest_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_datastore_admin_v1_ImportEntitiesRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_datastore_admin_v1_ImportEntitiesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_ImportEntitiesRequest_descriptor, + new java.lang.String[] { + "ProjectId", "Labels", "InputUrl", "EntityFilter", + }); + internal_static_google_datastore_admin_v1_ImportEntitiesRequest_LabelsEntry_descriptor = + internal_static_google_datastore_admin_v1_ImportEntitiesRequest_descriptor + .getNestedTypes() + .get(0); + internal_static_google_datastore_admin_v1_ImportEntitiesRequest_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_ImportEntitiesRequest_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_datastore_admin_v1_ExportEntitiesResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_datastore_admin_v1_ExportEntitiesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_ExportEntitiesResponse_descriptor, + new java.lang.String[] { + "OutputUrl", + }); + internal_static_google_datastore_admin_v1_ExportEntitiesMetadata_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_datastore_admin_v1_ExportEntitiesMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_ExportEntitiesMetadata_descriptor, + new java.lang.String[] { + "Common", "ProgressEntities", "ProgressBytes", "EntityFilter", "OutputUrlPrefix", + }); + internal_static_google_datastore_admin_v1_ImportEntitiesMetadata_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_datastore_admin_v1_ImportEntitiesMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_ImportEntitiesMetadata_descriptor, + new java.lang.String[] { + "Common", "ProgressEntities", "ProgressBytes", "EntityFilter", "InputUrl", + }); + internal_static_google_datastore_admin_v1_EntityFilter_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_datastore_admin_v1_EntityFilter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_EntityFilter_descriptor, + new java.lang.String[] { + "Kinds", "NamespaceIds", + }); + internal_static_google_datastore_admin_v1_CreateIndexRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_datastore_admin_v1_CreateIndexRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_CreateIndexRequest_descriptor, + new java.lang.String[] { + "ProjectId", "Index", + }); + internal_static_google_datastore_admin_v1_DeleteIndexRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_datastore_admin_v1_DeleteIndexRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_DeleteIndexRequest_descriptor, + new java.lang.String[] { + "ProjectId", "IndexId", + }); + internal_static_google_datastore_admin_v1_GetIndexRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_datastore_admin_v1_GetIndexRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_GetIndexRequest_descriptor, + new java.lang.String[] { + "ProjectId", "IndexId", + }); + internal_static_google_datastore_admin_v1_ListIndexesRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_datastore_admin_v1_ListIndexesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_ListIndexesRequest_descriptor, + new java.lang.String[] { + "ProjectId", "Filter", "PageSize", "PageToken", + }); + internal_static_google_datastore_admin_v1_ListIndexesResponse_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_datastore_admin_v1_ListIndexesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_ListIndexesResponse_descriptor, + new java.lang.String[] { + "Indexes", "NextPageToken", + }); + internal_static_google_datastore_admin_v1_IndexOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_datastore_admin_v1_IndexOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_IndexOperationMetadata_descriptor, + new java.lang.String[] { + "Common", "ProgressEntities", "IndexId", + }); + internal_static_google_datastore_admin_v1_DatastoreFirestoreMigrationMetadata_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_datastore_admin_v1_DatastoreFirestoreMigrationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_DatastoreFirestoreMigrationMetadata_descriptor, + new java.lang.String[] { + "MigrationState", "MigrationStep", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.datastore.admin.v1.IndexProto.getDescriptor(); + com.google.datastore.admin.v1.MigrationProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DatastoreFirestoreMigrationMetadata.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DatastoreFirestoreMigrationMetadata.java new file mode 100644 index 000000000..911de0dae --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DatastoreFirestoreMigrationMetadata.java @@ -0,0 +1,797 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * Metadata for Datastore to Firestore migration operations.
+ * The DatastoreFirestoreMigration operation is not started by the end-user via
+ * an explicit "creation" method. This is an intentional deviation from the LRO
+ * design pattern.
+ * This singleton resource can be accessed at:
+ * `projects/{project_id}/datastore-firestore-migration`
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} + */ +public final class DatastoreFirestoreMigrationMetadata + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata) + DatastoreFirestoreMigrationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DatastoreFirestoreMigrationMetadata.newBuilder() to construct. + private DatastoreFirestoreMigrationMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DatastoreFirestoreMigrationMetadata() { + migrationState_ = 0; + migrationStep_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DatastoreFirestoreMigrationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DatastoreFirestoreMigrationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + migrationState_ = rawValue; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + migrationStep_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_DatastoreFirestoreMigrationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_DatastoreFirestoreMigrationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.class, + com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.Builder.class); + } + + public static final int MIGRATION_STATE_FIELD_NUMBER = 1; + private int migrationState_; + /** + * + * + *
+   * The current state of migration from Cloud Datastore to Cloud Firestore in
+   * Datastore mode.
+   * 
+ * + * .google.datastore.admin.v1.MigrationState migration_state = 1; + * + * @return The enum numeric value on the wire for migrationState. + */ + @java.lang.Override + public int getMigrationStateValue() { + return migrationState_; + } + /** + * + * + *
+   * The current state of migration from Cloud Datastore to Cloud Firestore in
+   * Datastore mode.
+   * 
+ * + * .google.datastore.admin.v1.MigrationState migration_state = 1; + * + * @return The migrationState. + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationState getMigrationState() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.MigrationState result = + com.google.datastore.admin.v1.MigrationState.valueOf(migrationState_); + return result == null ? com.google.datastore.admin.v1.MigrationState.UNRECOGNIZED : result; + } + + public static final int MIGRATION_STEP_FIELD_NUMBER = 2; + private int migrationStep_; + /** + * + * + *
+   * The current step of migration from Cloud Datastore to Cloud Firestore in
+   * Datastore mode.
+   * 
+ * + * .google.datastore.admin.v1.MigrationStep migration_step = 2; + * + * @return The enum numeric value on the wire for migrationStep. + */ + @java.lang.Override + public int getMigrationStepValue() { + return migrationStep_; + } + /** + * + * + *
+   * The current step of migration from Cloud Datastore to Cloud Firestore in
+   * Datastore mode.
+   * 
+ * + * .google.datastore.admin.v1.MigrationStep migration_step = 2; + * + * @return The migrationStep. + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationStep getMigrationStep() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.MigrationStep result = + com.google.datastore.admin.v1.MigrationStep.valueOf(migrationStep_); + return result == null ? com.google.datastore.admin.v1.MigrationStep.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 (migrationState_ + != com.google.datastore.admin.v1.MigrationState.MIGRATION_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, migrationState_); + } + if (migrationStep_ + != com.google.datastore.admin.v1.MigrationStep.MIGRATION_STEP_UNSPECIFIED.getNumber()) { + output.writeEnum(2, migrationStep_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (migrationState_ + != com.google.datastore.admin.v1.MigrationState.MIGRATION_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, migrationState_); + } + if (migrationStep_ + != com.google.datastore.admin.v1.MigrationStep.MIGRATION_STEP_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, migrationStep_); + } + size += unknownFields.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.datastore.admin.v1.DatastoreFirestoreMigrationMetadata)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata other = + (com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata) obj; + + if (migrationState_ != other.migrationState_) return false; + if (migrationStep_ != other.migrationStep_) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + MIGRATION_STATE_FIELD_NUMBER; + hash = (53 * hash) + migrationState_; + hash = (37 * hash) + MIGRATION_STEP_FIELD_NUMBER; + hash = (53 * hash) + migrationStep_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata 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.datastore.admin.v1.DatastoreFirestoreMigrationMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata 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.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + 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.datastore.admin.v1.DatastoreFirestoreMigrationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata 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.datastore.admin.v1.DatastoreFirestoreMigrationMetadata 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; + } + /** + * + * + *
+   * Metadata for Datastore to Firestore migration operations.
+   * The DatastoreFirestoreMigration operation is not started by the end-user via
+   * an explicit "creation" method. This is an intentional deviation from the LRO
+   * design pattern.
+   * This singleton resource can be accessed at:
+   * `projects/{project_id}/datastore-firestore-migration`
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata) + com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_DatastoreFirestoreMigrationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_DatastoreFirestoreMigrationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.class, + com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.Builder.class); + } + + // Construct using + // com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + migrationState_ = 0; + + migrationStep_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_DatastoreFirestoreMigrationMetadata_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + getDefaultInstanceForType() { + return com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata build() { + com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata buildPartial() { + com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata result = + new com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata(this); + result.migrationState_ = migrationState_; + result.migrationStep_ = migrationStep_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata) { + return mergeFrom((com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata other) { + if (other + == com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.getDefaultInstance()) + return this; + if (other.migrationState_ != 0) { + setMigrationStateValue(other.getMigrationStateValue()); + } + if (other.migrationStep_ != 0) { + setMigrationStepValue(other.getMigrationStepValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int migrationState_ = 0; + /** + * + * + *
+     * The current state of migration from Cloud Datastore to Cloud Firestore in
+     * Datastore mode.
+     * 
+ * + * .google.datastore.admin.v1.MigrationState migration_state = 1; + * + * @return The enum numeric value on the wire for migrationState. + */ + @java.lang.Override + public int getMigrationStateValue() { + return migrationState_; + } + /** + * + * + *
+     * The current state of migration from Cloud Datastore to Cloud Firestore in
+     * Datastore mode.
+     * 
+ * + * .google.datastore.admin.v1.MigrationState migration_state = 1; + * + * @param value The enum numeric value on the wire for migrationState to set. + * @return This builder for chaining. + */ + public Builder setMigrationStateValue(int value) { + + migrationState_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The current state of migration from Cloud Datastore to Cloud Firestore in
+     * Datastore mode.
+     * 
+ * + * .google.datastore.admin.v1.MigrationState migration_state = 1; + * + * @return The migrationState. + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationState getMigrationState() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.MigrationState result = + com.google.datastore.admin.v1.MigrationState.valueOf(migrationState_); + return result == null ? com.google.datastore.admin.v1.MigrationState.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The current state of migration from Cloud Datastore to Cloud Firestore in
+     * Datastore mode.
+     * 
+ * + * .google.datastore.admin.v1.MigrationState migration_state = 1; + * + * @param value The migrationState to set. + * @return This builder for chaining. + */ + public Builder setMigrationState(com.google.datastore.admin.v1.MigrationState value) { + if (value == null) { + throw new NullPointerException(); + } + + migrationState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The current state of migration from Cloud Datastore to Cloud Firestore in
+     * Datastore mode.
+     * 
+ * + * .google.datastore.admin.v1.MigrationState migration_state = 1; + * + * @return This builder for chaining. + */ + public Builder clearMigrationState() { + + migrationState_ = 0; + onChanged(); + return this; + } + + private int migrationStep_ = 0; + /** + * + * + *
+     * The current step of migration from Cloud Datastore to Cloud Firestore in
+     * Datastore mode.
+     * 
+ * + * .google.datastore.admin.v1.MigrationStep migration_step = 2; + * + * @return The enum numeric value on the wire for migrationStep. + */ + @java.lang.Override + public int getMigrationStepValue() { + return migrationStep_; + } + /** + * + * + *
+     * The current step of migration from Cloud Datastore to Cloud Firestore in
+     * Datastore mode.
+     * 
+ * + * .google.datastore.admin.v1.MigrationStep migration_step = 2; + * + * @param value The enum numeric value on the wire for migrationStep to set. + * @return This builder for chaining. + */ + public Builder setMigrationStepValue(int value) { + + migrationStep_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The current step of migration from Cloud Datastore to Cloud Firestore in
+     * Datastore mode.
+     * 
+ * + * .google.datastore.admin.v1.MigrationStep migration_step = 2; + * + * @return The migrationStep. + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationStep getMigrationStep() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.MigrationStep result = + com.google.datastore.admin.v1.MigrationStep.valueOf(migrationStep_); + return result == null ? com.google.datastore.admin.v1.MigrationStep.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The current step of migration from Cloud Datastore to Cloud Firestore in
+     * Datastore mode.
+     * 
+ * + * .google.datastore.admin.v1.MigrationStep migration_step = 2; + * + * @param value The migrationStep to set. + * @return This builder for chaining. + */ + public Builder setMigrationStep(com.google.datastore.admin.v1.MigrationStep value) { + if (value == null) { + throw new NullPointerException(); + } + + migrationStep_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The current step of migration from Cloud Datastore to Cloud Firestore in
+     * Datastore mode.
+     * 
+ * + * .google.datastore.admin.v1.MigrationStep migration_step = 2; + * + * @return This builder for chaining. + */ + public Builder clearMigrationStep() { + + migrationStep_ = 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.datastore.admin.v1.DatastoreFirestoreMigrationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata) + private static final com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata(); + } + + public static com.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DatastoreFirestoreMigrationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DatastoreFirestoreMigrationMetadata(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DatastoreFirestoreMigrationMetadataOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DatastoreFirestoreMigrationMetadataOrBuilder.java new file mode 100644 index 000000000..5030636e5 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DatastoreFirestoreMigrationMetadataOrBuilder.java @@ -0,0 +1,79 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +public interface DatastoreFirestoreMigrationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The current state of migration from Cloud Datastore to Cloud Firestore in
+   * Datastore mode.
+   * 
+ * + * .google.datastore.admin.v1.MigrationState migration_state = 1; + * + * @return The enum numeric value on the wire for migrationState. + */ + int getMigrationStateValue(); + /** + * + * + *
+   * The current state of migration from Cloud Datastore to Cloud Firestore in
+   * Datastore mode.
+   * 
+ * + * .google.datastore.admin.v1.MigrationState migration_state = 1; + * + * @return The migrationState. + */ + com.google.datastore.admin.v1.MigrationState getMigrationState(); + + /** + * + * + *
+   * The current step of migration from Cloud Datastore to Cloud Firestore in
+   * Datastore mode.
+   * 
+ * + * .google.datastore.admin.v1.MigrationStep migration_step = 2; + * + * @return The enum numeric value on the wire for migrationStep. + */ + int getMigrationStepValue(); + /** + * + * + *
+   * The current step of migration from Cloud Datastore to Cloud Firestore in
+   * Datastore mode.
+   * 
+ * + * .google.datastore.admin.v1.MigrationStep migration_step = 2; + * + * @return The migrationStep. + */ + com.google.datastore.admin.v1.MigrationStep getMigrationStep(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DeleteIndexRequest.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DeleteIndexRequest.java new file mode 100644 index 000000000..f3b255d0e --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DeleteIndexRequest.java @@ -0,0 +1,816 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * The request for
+ * [google.datastore.admin.v1.DatastoreAdmin.DeleteIndex][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex].
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.DeleteIndexRequest} + */ +public final class DeleteIndexRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.DeleteIndexRequest) + DeleteIndexRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteIndexRequest.newBuilder() to construct. + private DeleteIndexRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteIndexRequest() { + projectId_ = ""; + indexId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteIndexRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteIndexRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + indexId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_DeleteIndexRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_DeleteIndexRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.DeleteIndexRequest.class, + com.google.datastore.admin.v1.DeleteIndexRequest.Builder.class); + } + + public static final int PROJECT_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * Project ID against which to make the request.
+   * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + 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(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * Project ID against which to make the request.
+   * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDEX_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object indexId_; + /** + * + * + *
+   * The resource ID of the index to delete.
+   * 
+ * + * string index_id = 3; + * + * @return The indexId. + */ + @java.lang.Override + public java.lang.String getIndexId() { + java.lang.Object ref = indexId_; + 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(); + indexId_ = s; + return s; + } + } + /** + * + * + *
+   * The resource ID of the index to delete.
+   * 
+ * + * string index_id = 3; + * + * @return The bytes for indexId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIndexIdBytes() { + java.lang.Object ref = indexId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + indexId_ = 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(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(indexId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, indexId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(indexId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, indexId_); + } + size += unknownFields.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.datastore.admin.v1.DeleteIndexRequest)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.DeleteIndexRequest other = + (com.google.datastore.admin.v1.DeleteIndexRequest) obj; + + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getIndexId().equals(other.getIndexId())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + INDEX_ID_FIELD_NUMBER; + hash = (53 * hash) + getIndexId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.DeleteIndexRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.DeleteIndexRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.DeleteIndexRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.DeleteIndexRequest 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.datastore.admin.v1.DeleteIndexRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.DeleteIndexRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.DeleteIndexRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.DeleteIndexRequest 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.datastore.admin.v1.DeleteIndexRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.DeleteIndexRequest 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.datastore.admin.v1.DeleteIndexRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.DeleteIndexRequest 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.datastore.admin.v1.DeleteIndexRequest 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 request for
+   * [google.datastore.admin.v1.DatastoreAdmin.DeleteIndex][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex].
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.DeleteIndexRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.DeleteIndexRequest) + com.google.datastore.admin.v1.DeleteIndexRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_DeleteIndexRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_DeleteIndexRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.DeleteIndexRequest.class, + com.google.datastore.admin.v1.DeleteIndexRequest.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.DeleteIndexRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + projectId_ = ""; + + indexId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_DeleteIndexRequest_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.DeleteIndexRequest getDefaultInstanceForType() { + return com.google.datastore.admin.v1.DeleteIndexRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.DeleteIndexRequest build() { + com.google.datastore.admin.v1.DeleteIndexRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.DeleteIndexRequest buildPartial() { + com.google.datastore.admin.v1.DeleteIndexRequest result = + new com.google.datastore.admin.v1.DeleteIndexRequest(this); + result.projectId_ = projectId_; + result.indexId_ = indexId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.DeleteIndexRequest) { + return mergeFrom((com.google.datastore.admin.v1.DeleteIndexRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.DeleteIndexRequest other) { + if (other == com.google.datastore.admin.v1.DeleteIndexRequest.getDefaultInstance()) + return this; + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (!other.getIndexId().isEmpty()) { + indexId_ = other.indexId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.DeleteIndexRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.datastore.admin.v1.DeleteIndexRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.lang.Object indexId_ = ""; + /** + * + * + *
+     * The resource ID of the index to delete.
+     * 
+ * + * string index_id = 3; + * + * @return The indexId. + */ + public java.lang.String getIndexId() { + java.lang.Object ref = indexId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + indexId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource ID of the index to delete.
+     * 
+ * + * string index_id = 3; + * + * @return The bytes for indexId. + */ + public com.google.protobuf.ByteString getIndexIdBytes() { + java.lang.Object ref = indexId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + indexId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource ID of the index to delete.
+     * 
+ * + * string index_id = 3; + * + * @param value The indexId to set. + * @return This builder for chaining. + */ + public Builder setIndexId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + indexId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource ID of the index to delete.
+     * 
+ * + * string index_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearIndexId() { + + indexId_ = getDefaultInstance().getIndexId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource ID of the index to delete.
+     * 
+ * + * string index_id = 3; + * + * @param value The bytes for indexId to set. + * @return This builder for chaining. + */ + public Builder setIndexIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + indexId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.datastore.admin.v1.DeleteIndexRequest) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.DeleteIndexRequest) + private static final com.google.datastore.admin.v1.DeleteIndexRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.DeleteIndexRequest(); + } + + public static com.google.datastore.admin.v1.DeleteIndexRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteIndexRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteIndexRequest(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.DeleteIndexRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DeleteIndexRequestOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DeleteIndexRequestOrBuilder.java new file mode 100644 index 000000000..b33b297ed --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/DeleteIndexRequestOrBuilder.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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +public interface DeleteIndexRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.DeleteIndexRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Project ID against which to make the request.
+   * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Project ID against which to make the request.
+   * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * The resource ID of the index to delete.
+   * 
+ * + * string index_id = 3; + * + * @return The indexId. + */ + java.lang.String getIndexId(); + /** + * + * + *
+   * The resource ID of the index to delete.
+   * 
+ * + * string index_id = 3; + * + * @return The bytes for indexId. + */ + com.google.protobuf.ByteString getIndexIdBytes(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/EntityFilter.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/EntityFilter.java new file mode 100644 index 000000000..f67639cd1 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/EntityFilter.java @@ -0,0 +1,1102 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * Identifies a subset of entities in a project. This is specified as
+ * combinations of kinds and namespaces (either or both of which may be all, as
+ * described in the following examples).
+ * Example usage:
+ * Entire project:
+ *   kinds=[], namespace_ids=[]
+ * Kinds Foo and Bar in all namespaces:
+ *   kinds=['Foo', 'Bar'], namespace_ids=[]
+ * Kinds Foo and Bar only in the default namespace:
+ *   kinds=['Foo', 'Bar'], namespace_ids=['']
+ * Kinds Foo and Bar in both the default and Baz namespaces:
+ *   kinds=['Foo', 'Bar'], namespace_ids=['', 'Baz']
+ * The entire Baz namespace:
+ *   kinds=[], namespace_ids=['Baz']
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.EntityFilter} + */ +public final class EntityFilter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.EntityFilter) + EntityFilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use EntityFilter.newBuilder() to construct. + private EntityFilter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EntityFilter() { + kinds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + namespaceIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EntityFilter(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EntityFilter( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + kinds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + kinds_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + namespaceIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + namespaceIds_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + kinds_ = kinds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + namespaceIds_ = namespaceIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_EntityFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_EntityFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.EntityFilter.class, + com.google.datastore.admin.v1.EntityFilter.Builder.class); + } + + public static final int KINDS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList kinds_; + /** + * + * + *
+   * If empty, then this represents all kinds.
+   * 
+ * + * repeated string kinds = 1; + * + * @return A list containing the kinds. + */ + public com.google.protobuf.ProtocolStringList getKindsList() { + return kinds_; + } + /** + * + * + *
+   * If empty, then this represents all kinds.
+   * 
+ * + * repeated string kinds = 1; + * + * @return The count of kinds. + */ + public int getKindsCount() { + return kinds_.size(); + } + /** + * + * + *
+   * If empty, then this represents all kinds.
+   * 
+ * + * repeated string kinds = 1; + * + * @param index The index of the element to return. + * @return The kinds at the given index. + */ + public java.lang.String getKinds(int index) { + return kinds_.get(index); + } + /** + * + * + *
+   * If empty, then this represents all kinds.
+   * 
+ * + * repeated string kinds = 1; + * + * @param index The index of the value to return. + * @return The bytes of the kinds at the given index. + */ + public com.google.protobuf.ByteString getKindsBytes(int index) { + return kinds_.getByteString(index); + } + + public static final int NAMESPACE_IDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList namespaceIds_; + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for projects that don't use namespaces.
+   * An empty string element represents the default namespace. This should be
+   * used if the project has data in non-default namespaces, but doesn't want to
+   * include them.
+   * Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 2; + * + * @return A list containing the namespaceIds. + */ + public com.google.protobuf.ProtocolStringList getNamespaceIdsList() { + return namespaceIds_; + } + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for projects that don't use namespaces.
+   * An empty string element represents the default namespace. This should be
+   * used if the project has data in non-default namespaces, but doesn't want to
+   * include them.
+   * Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 2; + * + * @return The count of namespaceIds. + */ + public int getNamespaceIdsCount() { + return namespaceIds_.size(); + } + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for projects that don't use namespaces.
+   * An empty string element represents the default namespace. This should be
+   * used if the project has data in non-default namespaces, but doesn't want to
+   * include them.
+   * Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 2; + * + * @param index The index of the element to return. + * @return The namespaceIds at the given index. + */ + public java.lang.String getNamespaceIds(int index) { + return namespaceIds_.get(index); + } + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for projects that don't use namespaces.
+   * An empty string element represents the default namespace. This should be
+   * used if the project has data in non-default namespaces, but doesn't want to
+   * include them.
+   * Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the namespaceIds at the given index. + */ + public com.google.protobuf.ByteString getNamespaceIdsBytes(int index) { + return namespaceIds_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < kinds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kinds_.getRaw(i)); + } + for (int i = 0; i < namespaceIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, namespaceIds_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < kinds_.size(); i++) { + dataSize += computeStringSizeNoTag(kinds_.getRaw(i)); + } + size += dataSize; + size += 1 * getKindsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < namespaceIds_.size(); i++) { + dataSize += computeStringSizeNoTag(namespaceIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getNamespaceIdsList().size(); + } + size += unknownFields.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.datastore.admin.v1.EntityFilter)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.EntityFilter other = + (com.google.datastore.admin.v1.EntityFilter) obj; + + if (!getKindsList().equals(other.getKindsList())) return false; + if (!getNamespaceIdsList().equals(other.getNamespaceIdsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getKindsCount() > 0) { + hash = (37 * hash) + KINDS_FIELD_NUMBER; + hash = (53 * hash) + getKindsList().hashCode(); + } + if (getNamespaceIdsCount() > 0) { + hash = (37 * hash) + NAMESPACE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getNamespaceIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.EntityFilter parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.EntityFilter parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.EntityFilter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.EntityFilter 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.datastore.admin.v1.EntityFilter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.EntityFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.EntityFilter parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.EntityFilter 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.datastore.admin.v1.EntityFilter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.EntityFilter 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.datastore.admin.v1.EntityFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.EntityFilter 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.datastore.admin.v1.EntityFilter 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; + } + /** + * + * + *
+   * Identifies a subset of entities in a project. This is specified as
+   * combinations of kinds and namespaces (either or both of which may be all, as
+   * described in the following examples).
+   * Example usage:
+   * Entire project:
+   *   kinds=[], namespace_ids=[]
+   * Kinds Foo and Bar in all namespaces:
+   *   kinds=['Foo', 'Bar'], namespace_ids=[]
+   * Kinds Foo and Bar only in the default namespace:
+   *   kinds=['Foo', 'Bar'], namespace_ids=['']
+   * Kinds Foo and Bar in both the default and Baz namespaces:
+   *   kinds=['Foo', 'Bar'], namespace_ids=['', 'Baz']
+   * The entire Baz namespace:
+   *   kinds=[], namespace_ids=['Baz']
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.EntityFilter} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.EntityFilter) + com.google.datastore.admin.v1.EntityFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_EntityFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_EntityFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.EntityFilter.class, + com.google.datastore.admin.v1.EntityFilter.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.EntityFilter.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + kinds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + namespaceIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_EntityFilter_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.EntityFilter getDefaultInstanceForType() { + return com.google.datastore.admin.v1.EntityFilter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.EntityFilter build() { + com.google.datastore.admin.v1.EntityFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.EntityFilter buildPartial() { + com.google.datastore.admin.v1.EntityFilter result = + new com.google.datastore.admin.v1.EntityFilter(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + kinds_ = kinds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.kinds_ = kinds_; + if (((bitField0_ & 0x00000002) != 0)) { + namespaceIds_ = namespaceIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.namespaceIds_ = namespaceIds_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.EntityFilter) { + return mergeFrom((com.google.datastore.admin.v1.EntityFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.EntityFilter other) { + if (other == com.google.datastore.admin.v1.EntityFilter.getDefaultInstance()) return this; + if (!other.kinds_.isEmpty()) { + if (kinds_.isEmpty()) { + kinds_ = other.kinds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKindsIsMutable(); + kinds_.addAll(other.kinds_); + } + onChanged(); + } + if (!other.namespaceIds_.isEmpty()) { + if (namespaceIds_.isEmpty()) { + namespaceIds_ = other.namespaceIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureNamespaceIdsIsMutable(); + namespaceIds_.addAll(other.namespaceIds_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.EntityFilter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.datastore.admin.v1.EntityFilter) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList kinds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureKindsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + kinds_ = new com.google.protobuf.LazyStringArrayList(kinds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * If empty, then this represents all kinds.
+     * 
+ * + * repeated string kinds = 1; + * + * @return A list containing the kinds. + */ + public com.google.protobuf.ProtocolStringList getKindsList() { + return kinds_.getUnmodifiableView(); + } + /** + * + * + *
+     * If empty, then this represents all kinds.
+     * 
+ * + * repeated string kinds = 1; + * + * @return The count of kinds. + */ + public int getKindsCount() { + return kinds_.size(); + } + /** + * + * + *
+     * If empty, then this represents all kinds.
+     * 
+ * + * repeated string kinds = 1; + * + * @param index The index of the element to return. + * @return The kinds at the given index. + */ + public java.lang.String getKinds(int index) { + return kinds_.get(index); + } + /** + * + * + *
+     * If empty, then this represents all kinds.
+     * 
+ * + * repeated string kinds = 1; + * + * @param index The index of the value to return. + * @return The bytes of the kinds at the given index. + */ + public com.google.protobuf.ByteString getKindsBytes(int index) { + return kinds_.getByteString(index); + } + /** + * + * + *
+     * If empty, then this represents all kinds.
+     * 
+ * + * repeated string kinds = 1; + * + * @param index The index to set the value at. + * @param value The kinds to set. + * @return This builder for chaining. + */ + public Builder setKinds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKindsIsMutable(); + kinds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * If empty, then this represents all kinds.
+     * 
+ * + * repeated string kinds = 1; + * + * @param value The kinds to add. + * @return This builder for chaining. + */ + public Builder addKinds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKindsIsMutable(); + kinds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * If empty, then this represents all kinds.
+     * 
+ * + * repeated string kinds = 1; + * + * @param values The kinds to add. + * @return This builder for chaining. + */ + public Builder addAllKinds(java.lang.Iterable values) { + ensureKindsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, kinds_); + onChanged(); + return this; + } + /** + * + * + *
+     * If empty, then this represents all kinds.
+     * 
+ * + * repeated string kinds = 1; + * + * @return This builder for chaining. + */ + public Builder clearKinds() { + kinds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * If empty, then this represents all kinds.
+     * 
+ * + * repeated string kinds = 1; + * + * @param value The bytes of the kinds to add. + * @return This builder for chaining. + */ + public Builder addKindsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureKindsIsMutable(); + kinds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList namespaceIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureNamespaceIdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + namespaceIds_ = new com.google.protobuf.LazyStringArrayList(namespaceIds_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for projects that don't use namespaces.
+     * An empty string element represents the default namespace. This should be
+     * used if the project has data in non-default namespaces, but doesn't want to
+     * include them.
+     * Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 2; + * + * @return A list containing the namespaceIds. + */ + public com.google.protobuf.ProtocolStringList getNamespaceIdsList() { + return namespaceIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for projects that don't use namespaces.
+     * An empty string element represents the default namespace. This should be
+     * used if the project has data in non-default namespaces, but doesn't want to
+     * include them.
+     * Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 2; + * + * @return The count of namespaceIds. + */ + public int getNamespaceIdsCount() { + return namespaceIds_.size(); + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for projects that don't use namespaces.
+     * An empty string element represents the default namespace. This should be
+     * used if the project has data in non-default namespaces, but doesn't want to
+     * include them.
+     * Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 2; + * + * @param index The index of the element to return. + * @return The namespaceIds at the given index. + */ + public java.lang.String getNamespaceIds(int index) { + return namespaceIds_.get(index); + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for projects that don't use namespaces.
+     * An empty string element represents the default namespace. This should be
+     * used if the project has data in non-default namespaces, but doesn't want to
+     * include them.
+     * Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the namespaceIds at the given index. + */ + public com.google.protobuf.ByteString getNamespaceIdsBytes(int index) { + return namespaceIds_.getByteString(index); + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for projects that don't use namespaces.
+     * An empty string element represents the default namespace. This should be
+     * used if the project has data in non-default namespaces, but doesn't want to
+     * include them.
+     * Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 2; + * + * @param index The index to set the value at. + * @param value The namespaceIds to set. + * @return This builder for chaining. + */ + public Builder setNamespaceIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamespaceIdsIsMutable(); + namespaceIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for projects that don't use namespaces.
+     * An empty string element represents the default namespace. This should be
+     * used if the project has data in non-default namespaces, but doesn't want to
+     * include them.
+     * Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 2; + * + * @param value The namespaceIds to add. + * @return This builder for chaining. + */ + public Builder addNamespaceIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamespaceIdsIsMutable(); + namespaceIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for projects that don't use namespaces.
+     * An empty string element represents the default namespace. This should be
+     * used if the project has data in non-default namespaces, but doesn't want to
+     * include them.
+     * Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 2; + * + * @param values The namespaceIds to add. + * @return This builder for chaining. + */ + public Builder addAllNamespaceIds(java.lang.Iterable values) { + ensureNamespaceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, namespaceIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for projects that don't use namespaces.
+     * An empty string element represents the default namespace. This should be
+     * used if the project has data in non-default namespaces, but doesn't want to
+     * include them.
+     * Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 2; + * + * @return This builder for chaining. + */ + public Builder clearNamespaceIds() { + namespaceIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for projects that don't use namespaces.
+     * An empty string element represents the default namespace. This should be
+     * used if the project has data in non-default namespaces, but doesn't want to
+     * include them.
+     * Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 2; + * + * @param value The bytes of the namespaceIds to add. + * @return This builder for chaining. + */ + public Builder addNamespaceIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureNamespaceIdsIsMutable(); + namespaceIds_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.datastore.admin.v1.EntityFilter) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.EntityFilter) + private static final com.google.datastore.admin.v1.EntityFilter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.EntityFilter(); + } + + public static com.google.datastore.admin.v1.EntityFilter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EntityFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EntityFilter(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.EntityFilter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/EntityFilterOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/EntityFilterOrBuilder.java new file mode 100644 index 000000000..b39e13297 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/EntityFilterOrBuilder.java @@ -0,0 +1,147 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +public interface EntityFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.EntityFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If empty, then this represents all kinds.
+   * 
+ * + * repeated string kinds = 1; + * + * @return A list containing the kinds. + */ + java.util.List getKindsList(); + /** + * + * + *
+   * If empty, then this represents all kinds.
+   * 
+ * + * repeated string kinds = 1; + * + * @return The count of kinds. + */ + int getKindsCount(); + /** + * + * + *
+   * If empty, then this represents all kinds.
+   * 
+ * + * repeated string kinds = 1; + * + * @param index The index of the element to return. + * @return The kinds at the given index. + */ + java.lang.String getKinds(int index); + /** + * + * + *
+   * If empty, then this represents all kinds.
+   * 
+ * + * repeated string kinds = 1; + * + * @param index The index of the value to return. + * @return The bytes of the kinds at the given index. + */ + com.google.protobuf.ByteString getKindsBytes(int index); + + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for projects that don't use namespaces.
+   * An empty string element represents the default namespace. This should be
+   * used if the project has data in non-default namespaces, but doesn't want to
+   * include them.
+   * Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 2; + * + * @return A list containing the namespaceIds. + */ + java.util.List getNamespaceIdsList(); + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for projects that don't use namespaces.
+   * An empty string element represents the default namespace. This should be
+   * used if the project has data in non-default namespaces, but doesn't want to
+   * include them.
+   * Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 2; + * + * @return The count of namespaceIds. + */ + int getNamespaceIdsCount(); + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for projects that don't use namespaces.
+   * An empty string element represents the default namespace. This should be
+   * used if the project has data in non-default namespaces, but doesn't want to
+   * include them.
+   * Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 2; + * + * @param index The index of the element to return. + * @return The namespaceIds at the given index. + */ + java.lang.String getNamespaceIds(int index); + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for projects that don't use namespaces.
+   * An empty string element represents the default namespace. This should be
+   * used if the project has data in non-default namespaces, but doesn't want to
+   * include them.
+   * Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the namespaceIds at the given index. + */ + com.google.protobuf.ByteString getNamespaceIdsBytes(int index); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesMetadata.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesMetadata.java new file mode 100644 index 000000000..646fc6921 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesMetadata.java @@ -0,0 +1,1775 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * Metadata for ExportEntities operations.
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.ExportEntitiesMetadata} + */ +public final class ExportEntitiesMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.ExportEntitiesMetadata) + ExportEntitiesMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportEntitiesMetadata.newBuilder() to construct. + private ExportEntitiesMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportEntitiesMetadata() { + outputUrlPrefix_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportEntitiesMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportEntitiesMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.datastore.admin.v1.CommonMetadata.Builder subBuilder = null; + if (common_ != null) { + subBuilder = common_.toBuilder(); + } + common_ = + input.readMessage( + com.google.datastore.admin.v1.CommonMetadata.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(common_); + common_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.datastore.admin.v1.Progress.Builder subBuilder = null; + if (progressEntities_ != null) { + subBuilder = progressEntities_.toBuilder(); + } + progressEntities_ = + input.readMessage( + com.google.datastore.admin.v1.Progress.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progressEntities_); + progressEntities_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.datastore.admin.v1.Progress.Builder subBuilder = null; + if (progressBytes_ != null) { + subBuilder = progressBytes_.toBuilder(); + } + progressBytes_ = + input.readMessage( + com.google.datastore.admin.v1.Progress.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progressBytes_); + progressBytes_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.datastore.admin.v1.EntityFilter.Builder subBuilder = null; + if (entityFilter_ != null) { + subBuilder = entityFilter_.toBuilder(); + } + entityFilter_ = + input.readMessage( + com.google.datastore.admin.v1.EntityFilter.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(entityFilter_); + entityFilter_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + outputUrlPrefix_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ExportEntitiesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ExportEntitiesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.ExportEntitiesMetadata.class, + com.google.datastore.admin.v1.ExportEntitiesMetadata.Builder.class); + } + + public static final int COMMON_FIELD_NUMBER = 1; + private com.google.datastore.admin.v1.CommonMetadata common_; + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return Whether the common field is set. + */ + @java.lang.Override + public boolean hasCommon() { + return common_ != null; + } + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return The common. + */ + @java.lang.Override + public com.google.datastore.admin.v1.CommonMetadata getCommon() { + return common_ == null + ? com.google.datastore.admin.v1.CommonMetadata.getDefaultInstance() + : common_; + } + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + @java.lang.Override + public com.google.datastore.admin.v1.CommonMetadataOrBuilder getCommonOrBuilder() { + return getCommon(); + } + + public static final int PROGRESS_ENTITIES_FIELD_NUMBER = 2; + private com.google.datastore.admin.v1.Progress progressEntities_; + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return Whether the progressEntities field is set. + */ + @java.lang.Override + public boolean hasProgressEntities() { + return progressEntities_ != null; + } + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return The progressEntities. + */ + @java.lang.Override + public com.google.datastore.admin.v1.Progress getProgressEntities() { + return progressEntities_ == null + ? com.google.datastore.admin.v1.Progress.getDefaultInstance() + : progressEntities_; + } + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + @java.lang.Override + public com.google.datastore.admin.v1.ProgressOrBuilder getProgressEntitiesOrBuilder() { + return getProgressEntities(); + } + + public static final int PROGRESS_BYTES_FIELD_NUMBER = 3; + private com.google.datastore.admin.v1.Progress progressBytes_; + /** + * + * + *
+   * An estimate of the number of bytes processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + * + * @return Whether the progressBytes field is set. + */ + @java.lang.Override + public boolean hasProgressBytes() { + return progressBytes_ != null; + } + /** + * + * + *
+   * An estimate of the number of bytes processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + * + * @return The progressBytes. + */ + @java.lang.Override + public com.google.datastore.admin.v1.Progress getProgressBytes() { + return progressBytes_ == null + ? com.google.datastore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } + /** + * + * + *
+   * An estimate of the number of bytes processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + @java.lang.Override + public com.google.datastore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder() { + return getProgressBytes(); + } + + public static final int ENTITY_FILTER_FIELD_NUMBER = 4; + private com.google.datastore.admin.v1.EntityFilter entityFilter_; + /** + * + * + *
+   * Description of which entities are being exported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return Whether the entityFilter field is set. + */ + @java.lang.Override + public boolean hasEntityFilter() { + return entityFilter_ != null; + } + /** + * + * + *
+   * Description of which entities are being exported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return The entityFilter. + */ + @java.lang.Override + public com.google.datastore.admin.v1.EntityFilter getEntityFilter() { + return entityFilter_ == null + ? com.google.datastore.admin.v1.EntityFilter.getDefaultInstance() + : entityFilter_; + } + /** + * + * + *
+   * Description of which entities are being exported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + @java.lang.Override + public com.google.datastore.admin.v1.EntityFilterOrBuilder getEntityFilterOrBuilder() { + return getEntityFilter(); + } + + public static final int OUTPUT_URL_PREFIX_FIELD_NUMBER = 5; + private volatile java.lang.Object outputUrlPrefix_; + /** + * + * + *
+   * Location for the export metadata and data files. This will be the same
+   * value as the
+   * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix]
+   * field. The final output location is provided in
+   * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+   * 
+ * + * string output_url_prefix = 5; + * + * @return The outputUrlPrefix. + */ + @java.lang.Override + public java.lang.String getOutputUrlPrefix() { + java.lang.Object ref = outputUrlPrefix_; + 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(); + outputUrlPrefix_ = s; + return s; + } + } + /** + * + * + *
+   * Location for the export metadata and data files. This will be the same
+   * value as the
+   * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix]
+   * field. The final output location is provided in
+   * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+   * 
+ * + * string output_url_prefix = 5; + * + * @return The bytes for outputUrlPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputUrlPrefixBytes() { + java.lang.Object ref = outputUrlPrefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUrlPrefix_ = 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 (common_ != null) { + output.writeMessage(1, getCommon()); + } + if (progressEntities_ != null) { + output.writeMessage(2, getProgressEntities()); + } + if (progressBytes_ != null) { + output.writeMessage(3, getProgressBytes()); + } + if (entityFilter_ != null) { + output.writeMessage(4, getEntityFilter()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUrlPrefix_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, outputUrlPrefix_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (common_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommon()); + } + if (progressEntities_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProgressEntities()); + } + if (progressBytes_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getProgressBytes()); + } + if (entityFilter_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getEntityFilter()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUrlPrefix_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, outputUrlPrefix_); + } + size += unknownFields.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.datastore.admin.v1.ExportEntitiesMetadata)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.ExportEntitiesMetadata other = + (com.google.datastore.admin.v1.ExportEntitiesMetadata) obj; + + if (hasCommon() != other.hasCommon()) return false; + if (hasCommon()) { + if (!getCommon().equals(other.getCommon())) return false; + } + if (hasProgressEntities() != other.hasProgressEntities()) return false; + if (hasProgressEntities()) { + if (!getProgressEntities().equals(other.getProgressEntities())) return false; + } + if (hasProgressBytes() != other.hasProgressBytes()) return false; + if (hasProgressBytes()) { + if (!getProgressBytes().equals(other.getProgressBytes())) return false; + } + if (hasEntityFilter() != other.hasEntityFilter()) return false; + if (hasEntityFilter()) { + if (!getEntityFilter().equals(other.getEntityFilter())) return false; + } + if (!getOutputUrlPrefix().equals(other.getOutputUrlPrefix())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCommon()) { + hash = (37 * hash) + COMMON_FIELD_NUMBER; + hash = (53 * hash) + getCommon().hashCode(); + } + if (hasProgressEntities()) { + hash = (37 * hash) + PROGRESS_ENTITIES_FIELD_NUMBER; + hash = (53 * hash) + getProgressEntities().hashCode(); + } + if (hasProgressBytes()) { + hash = (37 * hash) + PROGRESS_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getProgressBytes().hashCode(); + } + if (hasEntityFilter()) { + hash = (37 * hash) + ENTITY_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getEntityFilter().hashCode(); + } + hash = (37 * hash) + OUTPUT_URL_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getOutputUrlPrefix().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.ExportEntitiesMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ExportEntitiesMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.ExportEntitiesMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ExportEntitiesMetadata 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.datastore.admin.v1.ExportEntitiesMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ExportEntitiesMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.ExportEntitiesMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ExportEntitiesMetadata 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.datastore.admin.v1.ExportEntitiesMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ExportEntitiesMetadata 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.datastore.admin.v1.ExportEntitiesMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ExportEntitiesMetadata 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.datastore.admin.v1.ExportEntitiesMetadata 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; + } + /** + * + * + *
+   * Metadata for ExportEntities operations.
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.ExportEntitiesMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.ExportEntitiesMetadata) + com.google.datastore.admin.v1.ExportEntitiesMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ExportEntitiesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ExportEntitiesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.ExportEntitiesMetadata.class, + com.google.datastore.admin.v1.ExportEntitiesMetadata.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.ExportEntitiesMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (commonBuilder_ == null) { + common_ = null; + } else { + common_ = null; + commonBuilder_ = null; + } + if (progressEntitiesBuilder_ == null) { + progressEntities_ = null; + } else { + progressEntities_ = null; + progressEntitiesBuilder_ = null; + } + if (progressBytesBuilder_ == null) { + progressBytes_ = null; + } else { + progressBytes_ = null; + progressBytesBuilder_ = null; + } + if (entityFilterBuilder_ == null) { + entityFilter_ = null; + } else { + entityFilter_ = null; + entityFilterBuilder_ = null; + } + outputUrlPrefix_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ExportEntitiesMetadata_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.ExportEntitiesMetadata getDefaultInstanceForType() { + return com.google.datastore.admin.v1.ExportEntitiesMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.ExportEntitiesMetadata build() { + com.google.datastore.admin.v1.ExportEntitiesMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.ExportEntitiesMetadata buildPartial() { + com.google.datastore.admin.v1.ExportEntitiesMetadata result = + new com.google.datastore.admin.v1.ExportEntitiesMetadata(this); + if (commonBuilder_ == null) { + result.common_ = common_; + } else { + result.common_ = commonBuilder_.build(); + } + if (progressEntitiesBuilder_ == null) { + result.progressEntities_ = progressEntities_; + } else { + result.progressEntities_ = progressEntitiesBuilder_.build(); + } + if (progressBytesBuilder_ == null) { + result.progressBytes_ = progressBytes_; + } else { + result.progressBytes_ = progressBytesBuilder_.build(); + } + if (entityFilterBuilder_ == null) { + result.entityFilter_ = entityFilter_; + } else { + result.entityFilter_ = entityFilterBuilder_.build(); + } + result.outputUrlPrefix_ = outputUrlPrefix_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.ExportEntitiesMetadata) { + return mergeFrom((com.google.datastore.admin.v1.ExportEntitiesMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.ExportEntitiesMetadata other) { + if (other == com.google.datastore.admin.v1.ExportEntitiesMetadata.getDefaultInstance()) + return this; + if (other.hasCommon()) { + mergeCommon(other.getCommon()); + } + if (other.hasProgressEntities()) { + mergeProgressEntities(other.getProgressEntities()); + } + if (other.hasProgressBytes()) { + mergeProgressBytes(other.getProgressBytes()); + } + if (other.hasEntityFilter()) { + mergeEntityFilter(other.getEntityFilter()); + } + if (!other.getOutputUrlPrefix().isEmpty()) { + outputUrlPrefix_ = other.outputUrlPrefix_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.ExportEntitiesMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.datastore.admin.v1.ExportEntitiesMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.datastore.admin.v1.CommonMetadata common_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.CommonMetadata, + com.google.datastore.admin.v1.CommonMetadata.Builder, + com.google.datastore.admin.v1.CommonMetadataOrBuilder> + commonBuilder_; + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return Whether the common field is set. + */ + public boolean hasCommon() { + return commonBuilder_ != null || common_ != null; + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return The common. + */ + public com.google.datastore.admin.v1.CommonMetadata getCommon() { + if (commonBuilder_ == null) { + return common_ == null + ? com.google.datastore.admin.v1.CommonMetadata.getDefaultInstance() + : common_; + } else { + return commonBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public Builder setCommon(com.google.datastore.admin.v1.CommonMetadata value) { + if (commonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + common_ = value; + onChanged(); + } else { + commonBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public Builder setCommon(com.google.datastore.admin.v1.CommonMetadata.Builder builderForValue) { + if (commonBuilder_ == null) { + common_ = builderForValue.build(); + onChanged(); + } else { + commonBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public Builder mergeCommon(com.google.datastore.admin.v1.CommonMetadata value) { + if (commonBuilder_ == null) { + if (common_ != null) { + common_ = + com.google.datastore.admin.v1.CommonMetadata.newBuilder(common_) + .mergeFrom(value) + .buildPartial(); + } else { + common_ = value; + } + onChanged(); + } else { + commonBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public Builder clearCommon() { + if (commonBuilder_ == null) { + common_ = null; + onChanged(); + } else { + common_ = null; + commonBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public com.google.datastore.admin.v1.CommonMetadata.Builder getCommonBuilder() { + + onChanged(); + return getCommonFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public com.google.datastore.admin.v1.CommonMetadataOrBuilder getCommonOrBuilder() { + if (commonBuilder_ != null) { + return commonBuilder_.getMessageOrBuilder(); + } else { + return common_ == null + ? com.google.datastore.admin.v1.CommonMetadata.getDefaultInstance() + : common_; + } + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.CommonMetadata, + com.google.datastore.admin.v1.CommonMetadata.Builder, + com.google.datastore.admin.v1.CommonMetadataOrBuilder> + getCommonFieldBuilder() { + if (commonBuilder_ == null) { + commonBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.CommonMetadata, + com.google.datastore.admin.v1.CommonMetadata.Builder, + com.google.datastore.admin.v1.CommonMetadataOrBuilder>( + getCommon(), getParentForChildren(), isClean()); + common_ = null; + } + return commonBuilder_; + } + + private com.google.datastore.admin.v1.Progress progressEntities_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Progress, + com.google.datastore.admin.v1.Progress.Builder, + com.google.datastore.admin.v1.ProgressOrBuilder> + progressEntitiesBuilder_; + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return Whether the progressEntities field is set. + */ + public boolean hasProgressEntities() { + return progressEntitiesBuilder_ != null || progressEntities_ != null; + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return The progressEntities. + */ + public com.google.datastore.admin.v1.Progress getProgressEntities() { + if (progressEntitiesBuilder_ == null) { + return progressEntities_ == null + ? com.google.datastore.admin.v1.Progress.getDefaultInstance() + : progressEntities_; + } else { + return progressEntitiesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public Builder setProgressEntities(com.google.datastore.admin.v1.Progress value) { + if (progressEntitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progressEntities_ = value; + onChanged(); + } else { + progressEntitiesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public Builder setProgressEntities( + com.google.datastore.admin.v1.Progress.Builder builderForValue) { + if (progressEntitiesBuilder_ == null) { + progressEntities_ = builderForValue.build(); + onChanged(); + } else { + progressEntitiesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public Builder mergeProgressEntities(com.google.datastore.admin.v1.Progress value) { + if (progressEntitiesBuilder_ == null) { + if (progressEntities_ != null) { + progressEntities_ = + com.google.datastore.admin.v1.Progress.newBuilder(progressEntities_) + .mergeFrom(value) + .buildPartial(); + } else { + progressEntities_ = value; + } + onChanged(); + } else { + progressEntitiesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public Builder clearProgressEntities() { + if (progressEntitiesBuilder_ == null) { + progressEntities_ = null; + onChanged(); + } else { + progressEntities_ = null; + progressEntitiesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public com.google.datastore.admin.v1.Progress.Builder getProgressEntitiesBuilder() { + + onChanged(); + return getProgressEntitiesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public com.google.datastore.admin.v1.ProgressOrBuilder getProgressEntitiesOrBuilder() { + if (progressEntitiesBuilder_ != null) { + return progressEntitiesBuilder_.getMessageOrBuilder(); + } else { + return progressEntities_ == null + ? com.google.datastore.admin.v1.Progress.getDefaultInstance() + : progressEntities_; + } + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Progress, + com.google.datastore.admin.v1.Progress.Builder, + com.google.datastore.admin.v1.ProgressOrBuilder> + getProgressEntitiesFieldBuilder() { + if (progressEntitiesBuilder_ == null) { + progressEntitiesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Progress, + com.google.datastore.admin.v1.Progress.Builder, + com.google.datastore.admin.v1.ProgressOrBuilder>( + getProgressEntities(), getParentForChildren(), isClean()); + progressEntities_ = null; + } + return progressEntitiesBuilder_; + } + + private com.google.datastore.admin.v1.Progress progressBytes_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Progress, + com.google.datastore.admin.v1.Progress.Builder, + com.google.datastore.admin.v1.ProgressOrBuilder> + progressBytesBuilder_; + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + * + * @return Whether the progressBytes field is set. + */ + public boolean hasProgressBytes() { + return progressBytesBuilder_ != null || progressBytes_ != null; + } + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + * + * @return The progressBytes. + */ + public com.google.datastore.admin.v1.Progress getProgressBytes() { + if (progressBytesBuilder_ == null) { + return progressBytes_ == null + ? com.google.datastore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } else { + return progressBytesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + public Builder setProgressBytes(com.google.datastore.admin.v1.Progress value) { + if (progressBytesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progressBytes_ = value; + onChanged(); + } else { + progressBytesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + public Builder setProgressBytes( + com.google.datastore.admin.v1.Progress.Builder builderForValue) { + if (progressBytesBuilder_ == null) { + progressBytes_ = builderForValue.build(); + onChanged(); + } else { + progressBytesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + public Builder mergeProgressBytes(com.google.datastore.admin.v1.Progress value) { + if (progressBytesBuilder_ == null) { + if (progressBytes_ != null) { + progressBytes_ = + com.google.datastore.admin.v1.Progress.newBuilder(progressBytes_) + .mergeFrom(value) + .buildPartial(); + } else { + progressBytes_ = value; + } + onChanged(); + } else { + progressBytesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + public Builder clearProgressBytes() { + if (progressBytesBuilder_ == null) { + progressBytes_ = null; + onChanged(); + } else { + progressBytes_ = null; + progressBytesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + public com.google.datastore.admin.v1.Progress.Builder getProgressBytesBuilder() { + + onChanged(); + return getProgressBytesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + public com.google.datastore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder() { + if (progressBytesBuilder_ != null) { + return progressBytesBuilder_.getMessageOrBuilder(); + } else { + return progressBytes_ == null + ? com.google.datastore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } + } + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Progress, + com.google.datastore.admin.v1.Progress.Builder, + com.google.datastore.admin.v1.ProgressOrBuilder> + getProgressBytesFieldBuilder() { + if (progressBytesBuilder_ == null) { + progressBytesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Progress, + com.google.datastore.admin.v1.Progress.Builder, + com.google.datastore.admin.v1.ProgressOrBuilder>( + getProgressBytes(), getParentForChildren(), isClean()); + progressBytes_ = null; + } + return progressBytesBuilder_; + } + + private com.google.datastore.admin.v1.EntityFilter entityFilter_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.EntityFilter, + com.google.datastore.admin.v1.EntityFilter.Builder, + com.google.datastore.admin.v1.EntityFilterOrBuilder> + entityFilterBuilder_; + /** + * + * + *
+     * Description of which entities are being exported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return Whether the entityFilter field is set. + */ + public boolean hasEntityFilter() { + return entityFilterBuilder_ != null || entityFilter_ != null; + } + /** + * + * + *
+     * Description of which entities are being exported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return The entityFilter. + */ + public com.google.datastore.admin.v1.EntityFilter getEntityFilter() { + if (entityFilterBuilder_ == null) { + return entityFilter_ == null + ? com.google.datastore.admin.v1.EntityFilter.getDefaultInstance() + : entityFilter_; + } else { + return entityFilterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Description of which entities are being exported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public Builder setEntityFilter(com.google.datastore.admin.v1.EntityFilter value) { + if (entityFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + entityFilter_ = value; + onChanged(); + } else { + entityFilterBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Description of which entities are being exported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public Builder setEntityFilter( + com.google.datastore.admin.v1.EntityFilter.Builder builderForValue) { + if (entityFilterBuilder_ == null) { + entityFilter_ = builderForValue.build(); + onChanged(); + } else { + entityFilterBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Description of which entities are being exported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public Builder mergeEntityFilter(com.google.datastore.admin.v1.EntityFilter value) { + if (entityFilterBuilder_ == null) { + if (entityFilter_ != null) { + entityFilter_ = + com.google.datastore.admin.v1.EntityFilter.newBuilder(entityFilter_) + .mergeFrom(value) + .buildPartial(); + } else { + entityFilter_ = value; + } + onChanged(); + } else { + entityFilterBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Description of which entities are being exported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public Builder clearEntityFilter() { + if (entityFilterBuilder_ == null) { + entityFilter_ = null; + onChanged(); + } else { + entityFilter_ = null; + entityFilterBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Description of which entities are being exported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public com.google.datastore.admin.v1.EntityFilter.Builder getEntityFilterBuilder() { + + onChanged(); + return getEntityFilterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Description of which entities are being exported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public com.google.datastore.admin.v1.EntityFilterOrBuilder getEntityFilterOrBuilder() { + if (entityFilterBuilder_ != null) { + return entityFilterBuilder_.getMessageOrBuilder(); + } else { + return entityFilter_ == null + ? com.google.datastore.admin.v1.EntityFilter.getDefaultInstance() + : entityFilter_; + } + } + /** + * + * + *
+     * Description of which entities are being exported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.EntityFilter, + com.google.datastore.admin.v1.EntityFilter.Builder, + com.google.datastore.admin.v1.EntityFilterOrBuilder> + getEntityFilterFieldBuilder() { + if (entityFilterBuilder_ == null) { + entityFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.EntityFilter, + com.google.datastore.admin.v1.EntityFilter.Builder, + com.google.datastore.admin.v1.EntityFilterOrBuilder>( + getEntityFilter(), getParentForChildren(), isClean()); + entityFilter_ = null; + } + return entityFilterBuilder_; + } + + private java.lang.Object outputUrlPrefix_ = ""; + /** + * + * + *
+     * Location for the export metadata and data files. This will be the same
+     * value as the
+     * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix]
+     * field. The final output location is provided in
+     * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+     * 
+ * + * string output_url_prefix = 5; + * + * @return The outputUrlPrefix. + */ + public java.lang.String getOutputUrlPrefix() { + java.lang.Object ref = outputUrlPrefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUrlPrefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Location for the export metadata and data files. This will be the same
+     * value as the
+     * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix]
+     * field. The final output location is provided in
+     * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+     * 
+ * + * string output_url_prefix = 5; + * + * @return The bytes for outputUrlPrefix. + */ + public com.google.protobuf.ByteString getOutputUrlPrefixBytes() { + java.lang.Object ref = outputUrlPrefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUrlPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Location for the export metadata and data files. This will be the same
+     * value as the
+     * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix]
+     * field. The final output location is provided in
+     * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+     * 
+ * + * string output_url_prefix = 5; + * + * @param value The outputUrlPrefix to set. + * @return This builder for chaining. + */ + public Builder setOutputUrlPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + outputUrlPrefix_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Location for the export metadata and data files. This will be the same
+     * value as the
+     * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix]
+     * field. The final output location is provided in
+     * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+     * 
+ * + * string output_url_prefix = 5; + * + * @return This builder for chaining. + */ + public Builder clearOutputUrlPrefix() { + + outputUrlPrefix_ = getDefaultInstance().getOutputUrlPrefix(); + onChanged(); + return this; + } + /** + * + * + *
+     * Location for the export metadata and data files. This will be the same
+     * value as the
+     * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix]
+     * field. The final output location is provided in
+     * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+     * 
+ * + * string output_url_prefix = 5; + * + * @param value The bytes for outputUrlPrefix to set. + * @return This builder for chaining. + */ + public Builder setOutputUrlPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + outputUrlPrefix_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.datastore.admin.v1.ExportEntitiesMetadata) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.ExportEntitiesMetadata) + private static final com.google.datastore.admin.v1.ExportEntitiesMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.ExportEntitiesMetadata(); + } + + public static com.google.datastore.admin.v1.ExportEntitiesMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportEntitiesMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportEntitiesMetadata(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.ExportEntitiesMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesMetadataOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesMetadataOrBuilder.java new file mode 100644 index 000000000..408049d0c --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesMetadataOrBuilder.java @@ -0,0 +1,198 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +public interface ExportEntitiesMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.ExportEntitiesMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return Whether the common field is set. + */ + boolean hasCommon(); + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return The common. + */ + com.google.datastore.admin.v1.CommonMetadata getCommon(); + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + com.google.datastore.admin.v1.CommonMetadataOrBuilder getCommonOrBuilder(); + + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return Whether the progressEntities field is set. + */ + boolean hasProgressEntities(); + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return The progressEntities. + */ + com.google.datastore.admin.v1.Progress getProgressEntities(); + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + com.google.datastore.admin.v1.ProgressOrBuilder getProgressEntitiesOrBuilder(); + + /** + * + * + *
+   * An estimate of the number of bytes processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + * + * @return Whether the progressBytes field is set. + */ + boolean hasProgressBytes(); + /** + * + * + *
+   * An estimate of the number of bytes processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + * + * @return The progressBytes. + */ + com.google.datastore.admin.v1.Progress getProgressBytes(); + /** + * + * + *
+   * An estimate of the number of bytes processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + com.google.datastore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder(); + + /** + * + * + *
+   * Description of which entities are being exported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return Whether the entityFilter field is set. + */ + boolean hasEntityFilter(); + /** + * + * + *
+   * Description of which entities are being exported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return The entityFilter. + */ + com.google.datastore.admin.v1.EntityFilter getEntityFilter(); + /** + * + * + *
+   * Description of which entities are being exported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + com.google.datastore.admin.v1.EntityFilterOrBuilder getEntityFilterOrBuilder(); + + /** + * + * + *
+   * Location for the export metadata and data files. This will be the same
+   * value as the
+   * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix]
+   * field. The final output location is provided in
+   * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+   * 
+ * + * string output_url_prefix = 5; + * + * @return The outputUrlPrefix. + */ + java.lang.String getOutputUrlPrefix(); + /** + * + * + *
+   * Location for the export metadata and data files. This will be the same
+   * value as the
+   * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix]
+   * field. The final output location is provided in
+   * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+   * 
+ * + * string output_url_prefix = 5; + * + * @return The bytes for outputUrlPrefix. + */ + com.google.protobuf.ByteString getOutputUrlPrefixBytes(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesRequest.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesRequest.java new file mode 100644 index 000000000..692159673 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesRequest.java @@ -0,0 +1,1517 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * The request for
+ * [google.datastore.admin.v1.DatastoreAdmin.ExportEntities][google.datastore.admin.v1.DatastoreAdmin.ExportEntities].
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.ExportEntitiesRequest} + */ +public final class ExportEntitiesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.ExportEntitiesRequest) + ExportEntitiesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportEntitiesRequest.newBuilder() to construct. + private ExportEntitiesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportEntitiesRequest() { + projectId_ = ""; + outputUrlPrefix_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportEntitiesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportEntitiesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 26: + { + com.google.datastore.admin.v1.EntityFilter.Builder subBuilder = null; + if (entityFilter_ != null) { + subBuilder = entityFilter_.toBuilder(); + } + entityFilter_ = + input.readMessage( + com.google.datastore.admin.v1.EntityFilter.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(entityFilter_); + entityFilter_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + outputUrlPrefix_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ExportEntitiesRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ExportEntitiesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.ExportEntitiesRequest.class, + com.google.datastore.admin.v1.ExportEntitiesRequest.Builder.class); + } + + public static final int PROJECT_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * Required. Project ID against which to make the request.
+   * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + 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(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Project ID against which to make the request.
+   * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABELS_FIELD_NUMBER = 2; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ExportEntitiesRequest_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ENTITY_FILTER_FIELD_NUMBER = 3; + private com.google.datastore.admin.v1.EntityFilter entityFilter_; + /** + * + * + *
+   * Description of what data from the project is included in the export.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 3; + * + * @return Whether the entityFilter field is set. + */ + @java.lang.Override + public boolean hasEntityFilter() { + return entityFilter_ != null; + } + /** + * + * + *
+   * Description of what data from the project is included in the export.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 3; + * + * @return The entityFilter. + */ + @java.lang.Override + public com.google.datastore.admin.v1.EntityFilter getEntityFilter() { + return entityFilter_ == null + ? com.google.datastore.admin.v1.EntityFilter.getDefaultInstance() + : entityFilter_; + } + /** + * + * + *
+   * Description of what data from the project is included in the export.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 3; + */ + @java.lang.Override + public com.google.datastore.admin.v1.EntityFilterOrBuilder getEntityFilterOrBuilder() { + return getEntityFilter(); + } + + public static final int OUTPUT_URL_PREFIX_FIELD_NUMBER = 4; + private volatile java.lang.Object outputUrlPrefix_; + /** + * + * + *
+   * Required. Location for the export metadata and data files.
+   * The full resource URL of the external storage location. Currently, only
+   * Google Cloud Storage is supported. So output_url_prefix should be of the
+   * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the
+   * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud
+   * Storage namespace path (this is not a Cloud Datastore namespace). For more
+   * information about Cloud Storage namespace paths, see
+   * [Object name
+   * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+   * The resulting files will be nested deeper than the specified URL prefix.
+   * The final output URL will be provided in the
+   * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That
+   * value should be used for subsequent ImportEntities operations.
+   * By nesting the data files deeper, the same Cloud Storage bucket can be used
+   * in multiple ExportEntities operations without conflict.
+   * 
+ * + * string output_url_prefix = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUrlPrefix. + */ + @java.lang.Override + public java.lang.String getOutputUrlPrefix() { + java.lang.Object ref = outputUrlPrefix_; + 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(); + outputUrlPrefix_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Location for the export metadata and data files.
+   * The full resource URL of the external storage location. Currently, only
+   * Google Cloud Storage is supported. So output_url_prefix should be of the
+   * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the
+   * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud
+   * Storage namespace path (this is not a Cloud Datastore namespace). For more
+   * information about Cloud Storage namespace paths, see
+   * [Object name
+   * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+   * The resulting files will be nested deeper than the specified URL prefix.
+   * The final output URL will be provided in the
+   * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That
+   * value should be used for subsequent ImportEntities operations.
+   * By nesting the data files deeper, the same Cloud Storage bucket can be used
+   * in multiple ExportEntities operations without conflict.
+   * 
+ * + * string output_url_prefix = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUrlPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputUrlPrefixBytes() { + java.lang.Object ref = outputUrlPrefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUrlPrefix_ = 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(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectId_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 2); + if (entityFilter_ != null) { + output.writeMessage(3, getEntityFilter()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUrlPrefix_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, outputUrlPrefix_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectId_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, labels__); + } + if (entityFilter_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEntityFilter()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUrlPrefix_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, outputUrlPrefix_); + } + size += unknownFields.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.datastore.admin.v1.ExportEntitiesRequest)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.ExportEntitiesRequest other = + (com.google.datastore.admin.v1.ExportEntitiesRequest) obj; + + if (!getProjectId().equals(other.getProjectId())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasEntityFilter() != other.hasEntityFilter()) return false; + if (hasEntityFilter()) { + if (!getEntityFilter().equals(other.getEntityFilter())) return false; + } + if (!getOutputUrlPrefix().equals(other.getOutputUrlPrefix())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasEntityFilter()) { + hash = (37 * hash) + ENTITY_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getEntityFilter().hashCode(); + } + hash = (37 * hash) + OUTPUT_URL_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getOutputUrlPrefix().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.ExportEntitiesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ExportEntitiesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.ExportEntitiesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ExportEntitiesRequest 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.datastore.admin.v1.ExportEntitiesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ExportEntitiesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.ExportEntitiesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ExportEntitiesRequest 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.datastore.admin.v1.ExportEntitiesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ExportEntitiesRequest 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.datastore.admin.v1.ExportEntitiesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ExportEntitiesRequest 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.datastore.admin.v1.ExportEntitiesRequest 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 request for
+   * [google.datastore.admin.v1.DatastoreAdmin.ExportEntities][google.datastore.admin.v1.DatastoreAdmin.ExportEntities].
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.ExportEntitiesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.ExportEntitiesRequest) + com.google.datastore.admin.v1.ExportEntitiesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ExportEntitiesRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ExportEntitiesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.ExportEntitiesRequest.class, + com.google.datastore.admin.v1.ExportEntitiesRequest.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.ExportEntitiesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + projectId_ = ""; + + internalGetMutableLabels().clear(); + if (entityFilterBuilder_ == null) { + entityFilter_ = null; + } else { + entityFilter_ = null; + entityFilterBuilder_ = null; + } + outputUrlPrefix_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ExportEntitiesRequest_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.ExportEntitiesRequest getDefaultInstanceForType() { + return com.google.datastore.admin.v1.ExportEntitiesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.ExportEntitiesRequest build() { + com.google.datastore.admin.v1.ExportEntitiesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.ExportEntitiesRequest buildPartial() { + com.google.datastore.admin.v1.ExportEntitiesRequest result = + new com.google.datastore.admin.v1.ExportEntitiesRequest(this); + int from_bitField0_ = bitField0_; + result.projectId_ = projectId_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (entityFilterBuilder_ == null) { + result.entityFilter_ = entityFilter_; + } else { + result.entityFilter_ = entityFilterBuilder_.build(); + } + result.outputUrlPrefix_ = outputUrlPrefix_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.ExportEntitiesRequest) { + return mergeFrom((com.google.datastore.admin.v1.ExportEntitiesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.ExportEntitiesRequest other) { + if (other == com.google.datastore.admin.v1.ExportEntitiesRequest.getDefaultInstance()) + return this; + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.hasEntityFilter()) { + mergeEntityFilter(other.getEntityFilter()); + } + if (!other.getOutputUrlPrefix().isEmpty()) { + outputUrlPrefix_ = other.outputUrlPrefix_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.ExportEntitiesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.datastore.admin.v1.ExportEntitiesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Required. Project ID against which to make the request.
+     * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Project ID against which to make the request.
+     * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Project ID against which to make the request.
+     * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Project ID against which to make the request.
+     * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Project ID against which to make the request.
+     * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Client-assigned labels.
+     * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Client-assigned labels.
+     * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Client-assigned labels.
+     * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Client-assigned labels.
+     * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Client-assigned labels.
+     * 
+ * + * map<string, string> labels = 2; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Client-assigned labels.
+     * 
+ * + * map<string, string> labels = 2; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Client-assigned labels.
+     * 
+ * + * map<string, string> labels = 2; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private com.google.datastore.admin.v1.EntityFilter entityFilter_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.EntityFilter, + com.google.datastore.admin.v1.EntityFilter.Builder, + com.google.datastore.admin.v1.EntityFilterOrBuilder> + entityFilterBuilder_; + /** + * + * + *
+     * Description of what data from the project is included in the export.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 3; + * + * @return Whether the entityFilter field is set. + */ + public boolean hasEntityFilter() { + return entityFilterBuilder_ != null || entityFilter_ != null; + } + /** + * + * + *
+     * Description of what data from the project is included in the export.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 3; + * + * @return The entityFilter. + */ + public com.google.datastore.admin.v1.EntityFilter getEntityFilter() { + if (entityFilterBuilder_ == null) { + return entityFilter_ == null + ? com.google.datastore.admin.v1.EntityFilter.getDefaultInstance() + : entityFilter_; + } else { + return entityFilterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Description of what data from the project is included in the export.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 3; + */ + public Builder setEntityFilter(com.google.datastore.admin.v1.EntityFilter value) { + if (entityFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + entityFilter_ = value; + onChanged(); + } else { + entityFilterBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Description of what data from the project is included in the export.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 3; + */ + public Builder setEntityFilter( + com.google.datastore.admin.v1.EntityFilter.Builder builderForValue) { + if (entityFilterBuilder_ == null) { + entityFilter_ = builderForValue.build(); + onChanged(); + } else { + entityFilterBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Description of what data from the project is included in the export.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 3; + */ + public Builder mergeEntityFilter(com.google.datastore.admin.v1.EntityFilter value) { + if (entityFilterBuilder_ == null) { + if (entityFilter_ != null) { + entityFilter_ = + com.google.datastore.admin.v1.EntityFilter.newBuilder(entityFilter_) + .mergeFrom(value) + .buildPartial(); + } else { + entityFilter_ = value; + } + onChanged(); + } else { + entityFilterBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Description of what data from the project is included in the export.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 3; + */ + public Builder clearEntityFilter() { + if (entityFilterBuilder_ == null) { + entityFilter_ = null; + onChanged(); + } else { + entityFilter_ = null; + entityFilterBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Description of what data from the project is included in the export.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 3; + */ + public com.google.datastore.admin.v1.EntityFilter.Builder getEntityFilterBuilder() { + + onChanged(); + return getEntityFilterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Description of what data from the project is included in the export.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 3; + */ + public com.google.datastore.admin.v1.EntityFilterOrBuilder getEntityFilterOrBuilder() { + if (entityFilterBuilder_ != null) { + return entityFilterBuilder_.getMessageOrBuilder(); + } else { + return entityFilter_ == null + ? com.google.datastore.admin.v1.EntityFilter.getDefaultInstance() + : entityFilter_; + } + } + /** + * + * + *
+     * Description of what data from the project is included in the export.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.EntityFilter, + com.google.datastore.admin.v1.EntityFilter.Builder, + com.google.datastore.admin.v1.EntityFilterOrBuilder> + getEntityFilterFieldBuilder() { + if (entityFilterBuilder_ == null) { + entityFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.EntityFilter, + com.google.datastore.admin.v1.EntityFilter.Builder, + com.google.datastore.admin.v1.EntityFilterOrBuilder>( + getEntityFilter(), getParentForChildren(), isClean()); + entityFilter_ = null; + } + return entityFilterBuilder_; + } + + private java.lang.Object outputUrlPrefix_ = ""; + /** + * + * + *
+     * Required. Location for the export metadata and data files.
+     * The full resource URL of the external storage location. Currently, only
+     * Google Cloud Storage is supported. So output_url_prefix should be of the
+     * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the
+     * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud
+     * Storage namespace path (this is not a Cloud Datastore namespace). For more
+     * information about Cloud Storage namespace paths, see
+     * [Object name
+     * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+     * The resulting files will be nested deeper than the specified URL prefix.
+     * The final output URL will be provided in the
+     * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That
+     * value should be used for subsequent ImportEntities operations.
+     * By nesting the data files deeper, the same Cloud Storage bucket can be used
+     * in multiple ExportEntities operations without conflict.
+     * 
+ * + * string output_url_prefix = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUrlPrefix. + */ + public java.lang.String getOutputUrlPrefix() { + java.lang.Object ref = outputUrlPrefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUrlPrefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Location for the export metadata and data files.
+     * The full resource URL of the external storage location. Currently, only
+     * Google Cloud Storage is supported. So output_url_prefix should be of the
+     * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the
+     * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud
+     * Storage namespace path (this is not a Cloud Datastore namespace). For more
+     * information about Cloud Storage namespace paths, see
+     * [Object name
+     * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+     * The resulting files will be nested deeper than the specified URL prefix.
+     * The final output URL will be provided in the
+     * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That
+     * value should be used for subsequent ImportEntities operations.
+     * By nesting the data files deeper, the same Cloud Storage bucket can be used
+     * in multiple ExportEntities operations without conflict.
+     * 
+ * + * string output_url_prefix = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUrlPrefix. + */ + public com.google.protobuf.ByteString getOutputUrlPrefixBytes() { + java.lang.Object ref = outputUrlPrefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUrlPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Location for the export metadata and data files.
+     * The full resource URL of the external storage location. Currently, only
+     * Google Cloud Storage is supported. So output_url_prefix should be of the
+     * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the
+     * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud
+     * Storage namespace path (this is not a Cloud Datastore namespace). For more
+     * information about Cloud Storage namespace paths, see
+     * [Object name
+     * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+     * The resulting files will be nested deeper than the specified URL prefix.
+     * The final output URL will be provided in the
+     * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That
+     * value should be used for subsequent ImportEntities operations.
+     * By nesting the data files deeper, the same Cloud Storage bucket can be used
+     * in multiple ExportEntities operations without conflict.
+     * 
+ * + * string output_url_prefix = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The outputUrlPrefix to set. + * @return This builder for chaining. + */ + public Builder setOutputUrlPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + outputUrlPrefix_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Location for the export metadata and data files.
+     * The full resource URL of the external storage location. Currently, only
+     * Google Cloud Storage is supported. So output_url_prefix should be of the
+     * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the
+     * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud
+     * Storage namespace path (this is not a Cloud Datastore namespace). For more
+     * information about Cloud Storage namespace paths, see
+     * [Object name
+     * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+     * The resulting files will be nested deeper than the specified URL prefix.
+     * The final output URL will be provided in the
+     * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That
+     * value should be used for subsequent ImportEntities operations.
+     * By nesting the data files deeper, the same Cloud Storage bucket can be used
+     * in multiple ExportEntities operations without conflict.
+     * 
+ * + * string output_url_prefix = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearOutputUrlPrefix() { + + outputUrlPrefix_ = getDefaultInstance().getOutputUrlPrefix(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Location for the export metadata and data files.
+     * The full resource URL of the external storage location. Currently, only
+     * Google Cloud Storage is supported. So output_url_prefix should be of the
+     * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the
+     * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud
+     * Storage namespace path (this is not a Cloud Datastore namespace). For more
+     * information about Cloud Storage namespace paths, see
+     * [Object name
+     * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+     * The resulting files will be nested deeper than the specified URL prefix.
+     * The final output URL will be provided in the
+     * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That
+     * value should be used for subsequent ImportEntities operations.
+     * By nesting the data files deeper, the same Cloud Storage bucket can be used
+     * in multiple ExportEntities operations without conflict.
+     * 
+ * + * string output_url_prefix = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for outputUrlPrefix to set. + * @return This builder for chaining. + */ + public Builder setOutputUrlPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + outputUrlPrefix_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.datastore.admin.v1.ExportEntitiesRequest) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.ExportEntitiesRequest) + private static final com.google.datastore.admin.v1.ExportEntitiesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.ExportEntitiesRequest(); + } + + public static com.google.datastore.admin.v1.ExportEntitiesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportEntitiesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportEntitiesRequest(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.ExportEntitiesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesRequestOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesRequestOrBuilder.java new file mode 100644 index 000000000..1e89f39dc --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesRequestOrBuilder.java @@ -0,0 +1,192 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +public interface ExportEntitiesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.ExportEntitiesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Project ID against which to make the request.
+   * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Required. Project ID against which to make the request.
+   * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + int getLabelsCount(); + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Description of what data from the project is included in the export.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 3; + * + * @return Whether the entityFilter field is set. + */ + boolean hasEntityFilter(); + /** + * + * + *
+   * Description of what data from the project is included in the export.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 3; + * + * @return The entityFilter. + */ + com.google.datastore.admin.v1.EntityFilter getEntityFilter(); + /** + * + * + *
+   * Description of what data from the project is included in the export.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 3; + */ + com.google.datastore.admin.v1.EntityFilterOrBuilder getEntityFilterOrBuilder(); + + /** + * + * + *
+   * Required. Location for the export metadata and data files.
+   * The full resource URL of the external storage location. Currently, only
+   * Google Cloud Storage is supported. So output_url_prefix should be of the
+   * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the
+   * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud
+   * Storage namespace path (this is not a Cloud Datastore namespace). For more
+   * information about Cloud Storage namespace paths, see
+   * [Object name
+   * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+   * The resulting files will be nested deeper than the specified URL prefix.
+   * The final output URL will be provided in the
+   * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That
+   * value should be used for subsequent ImportEntities operations.
+   * By nesting the data files deeper, the same Cloud Storage bucket can be used
+   * in multiple ExportEntities operations without conflict.
+   * 
+ * + * string output_url_prefix = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUrlPrefix. + */ + java.lang.String getOutputUrlPrefix(); + /** + * + * + *
+   * Required. Location for the export metadata and data files.
+   * The full resource URL of the external storage location. Currently, only
+   * Google Cloud Storage is supported. So output_url_prefix should be of the
+   * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the
+   * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud
+   * Storage namespace path (this is not a Cloud Datastore namespace). For more
+   * information about Cloud Storage namespace paths, see
+   * [Object name
+   * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+   * The resulting files will be nested deeper than the specified URL prefix.
+   * The final output URL will be provided in the
+   * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That
+   * value should be used for subsequent ImportEntities operations.
+   * By nesting the data files deeper, the same Cloud Storage bucket can be used
+   * in multiple ExportEntities operations without conflict.
+   * 
+ * + * string output_url_prefix = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUrlPrefix. + */ + com.google.protobuf.ByteString getOutputUrlPrefixBytes(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesResponse.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesResponse.java new file mode 100644 index 000000000..43e882659 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesResponse.java @@ -0,0 +1,659 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * The response for
+ * [google.datastore.admin.v1.DatastoreAdmin.ExportEntities][google.datastore.admin.v1.DatastoreAdmin.ExportEntities].
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.ExportEntitiesResponse} + */ +public final class ExportEntitiesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.ExportEntitiesResponse) + ExportEntitiesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportEntitiesResponse.newBuilder() to construct. + private ExportEntitiesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportEntitiesResponse() { + outputUrl_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportEntitiesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportEntitiesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + outputUrl_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ExportEntitiesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ExportEntitiesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.ExportEntitiesResponse.class, + com.google.datastore.admin.v1.ExportEntitiesResponse.Builder.class); + } + + public static final int OUTPUT_URL_FIELD_NUMBER = 1; + private volatile java.lang.Object outputUrl_; + /** + * + * + *
+   * Location of the output metadata file. This can be used to begin an import
+   * into Cloud Datastore (this project or another project). See
+   * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url].
+   * Only present if the operation completed successfully.
+   * 
+ * + * string output_url = 1; + * + * @return The outputUrl. + */ + @java.lang.Override + public java.lang.String getOutputUrl() { + java.lang.Object ref = outputUrl_; + 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(); + outputUrl_ = s; + return s; + } + } + /** + * + * + *
+   * Location of the output metadata file. This can be used to begin an import
+   * into Cloud Datastore (this project or another project). See
+   * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url].
+   * Only present if the operation completed successfully.
+   * 
+ * + * string output_url = 1; + * + * @return The bytes for outputUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputUrlBytes() { + java.lang.Object ref = outputUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUrl_ = 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(outputUrl_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, outputUrl_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUrl_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, outputUrl_); + } + size += unknownFields.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.datastore.admin.v1.ExportEntitiesResponse)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.ExportEntitiesResponse other = + (com.google.datastore.admin.v1.ExportEntitiesResponse) obj; + + if (!getOutputUrl().equals(other.getOutputUrl())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + OUTPUT_URL_FIELD_NUMBER; + hash = (53 * hash) + getOutputUrl().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.ExportEntitiesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ExportEntitiesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.ExportEntitiesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ExportEntitiesResponse 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.datastore.admin.v1.ExportEntitiesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ExportEntitiesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.ExportEntitiesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ExportEntitiesResponse 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.datastore.admin.v1.ExportEntitiesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ExportEntitiesResponse 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.datastore.admin.v1.ExportEntitiesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ExportEntitiesResponse 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.datastore.admin.v1.ExportEntitiesResponse 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 response for
+   * [google.datastore.admin.v1.DatastoreAdmin.ExportEntities][google.datastore.admin.v1.DatastoreAdmin.ExportEntities].
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.ExportEntitiesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.ExportEntitiesResponse) + com.google.datastore.admin.v1.ExportEntitiesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ExportEntitiesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ExportEntitiesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.ExportEntitiesResponse.class, + com.google.datastore.admin.v1.ExportEntitiesResponse.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.ExportEntitiesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + outputUrl_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ExportEntitiesResponse_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.ExportEntitiesResponse getDefaultInstanceForType() { + return com.google.datastore.admin.v1.ExportEntitiesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.ExportEntitiesResponse build() { + com.google.datastore.admin.v1.ExportEntitiesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.ExportEntitiesResponse buildPartial() { + com.google.datastore.admin.v1.ExportEntitiesResponse result = + new com.google.datastore.admin.v1.ExportEntitiesResponse(this); + result.outputUrl_ = outputUrl_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.ExportEntitiesResponse) { + return mergeFrom((com.google.datastore.admin.v1.ExportEntitiesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.ExportEntitiesResponse other) { + if (other == com.google.datastore.admin.v1.ExportEntitiesResponse.getDefaultInstance()) + return this; + if (!other.getOutputUrl().isEmpty()) { + outputUrl_ = other.outputUrl_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.ExportEntitiesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.datastore.admin.v1.ExportEntitiesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object outputUrl_ = ""; + /** + * + * + *
+     * Location of the output metadata file. This can be used to begin an import
+     * into Cloud Datastore (this project or another project). See
+     * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url].
+     * Only present if the operation completed successfully.
+     * 
+ * + * string output_url = 1; + * + * @return The outputUrl. + */ + public java.lang.String getOutputUrl() { + java.lang.Object ref = outputUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Location of the output metadata file. This can be used to begin an import
+     * into Cloud Datastore (this project or another project). See
+     * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url].
+     * Only present if the operation completed successfully.
+     * 
+ * + * string output_url = 1; + * + * @return The bytes for outputUrl. + */ + public com.google.protobuf.ByteString getOutputUrlBytes() { + java.lang.Object ref = outputUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Location of the output metadata file. This can be used to begin an import
+     * into Cloud Datastore (this project or another project). See
+     * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url].
+     * Only present if the operation completed successfully.
+     * 
+ * + * string output_url = 1; + * + * @param value The outputUrl to set. + * @return This builder for chaining. + */ + public Builder setOutputUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + outputUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Location of the output metadata file. This can be used to begin an import
+     * into Cloud Datastore (this project or another project). See
+     * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url].
+     * Only present if the operation completed successfully.
+     * 
+ * + * string output_url = 1; + * + * @return This builder for chaining. + */ + public Builder clearOutputUrl() { + + outputUrl_ = getDefaultInstance().getOutputUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * Location of the output metadata file. This can be used to begin an import
+     * into Cloud Datastore (this project or another project). See
+     * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url].
+     * Only present if the operation completed successfully.
+     * 
+ * + * string output_url = 1; + * + * @param value The bytes for outputUrl to set. + * @return This builder for chaining. + */ + public Builder setOutputUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + outputUrl_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.datastore.admin.v1.ExportEntitiesResponse) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.ExportEntitiesResponse) + private static final com.google.datastore.admin.v1.ExportEntitiesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.ExportEntitiesResponse(); + } + + public static com.google.datastore.admin.v1.ExportEntitiesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportEntitiesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportEntitiesResponse(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.ExportEntitiesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesResponseOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesResponseOrBuilder.java new file mode 100644 index 000000000..74b00e9cd --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ExportEntitiesResponseOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +public interface ExportEntitiesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.ExportEntitiesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Location of the output metadata file. This can be used to begin an import
+   * into Cloud Datastore (this project or another project). See
+   * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url].
+   * Only present if the operation completed successfully.
+   * 
+ * + * string output_url = 1; + * + * @return The outputUrl. + */ + java.lang.String getOutputUrl(); + /** + * + * + *
+   * Location of the output metadata file. This can be used to begin an import
+   * into Cloud Datastore (this project or another project). See
+   * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url].
+   * Only present if the operation completed successfully.
+   * 
+ * + * string output_url = 1; + * + * @return The bytes for outputUrl. + */ + com.google.protobuf.ByteString getOutputUrlBytes(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/GetIndexRequest.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/GetIndexRequest.java new file mode 100644 index 000000000..fa24ee217 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/GetIndexRequest.java @@ -0,0 +1,813 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * The request for [google.datastore.admin.v1.DatastoreAdmin.GetIndex][google.datastore.admin.v1.DatastoreAdmin.GetIndex].
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.GetIndexRequest} + */ +public final class GetIndexRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.GetIndexRequest) + GetIndexRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetIndexRequest.newBuilder() to construct. + private GetIndexRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetIndexRequest() { + projectId_ = ""; + indexId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetIndexRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetIndexRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + indexId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_GetIndexRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_GetIndexRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.GetIndexRequest.class, + com.google.datastore.admin.v1.GetIndexRequest.Builder.class); + } + + public static final int PROJECT_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * Project ID against which to make the request.
+   * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + 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(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * Project ID against which to make the request.
+   * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDEX_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object indexId_; + /** + * + * + *
+   * The resource ID of the index to get.
+   * 
+ * + * string index_id = 3; + * + * @return The indexId. + */ + @java.lang.Override + public java.lang.String getIndexId() { + java.lang.Object ref = indexId_; + 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(); + indexId_ = s; + return s; + } + } + /** + * + * + *
+   * The resource ID of the index to get.
+   * 
+ * + * string index_id = 3; + * + * @return The bytes for indexId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIndexIdBytes() { + java.lang.Object ref = indexId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + indexId_ = 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(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(indexId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, indexId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(indexId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, indexId_); + } + size += unknownFields.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.datastore.admin.v1.GetIndexRequest)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.GetIndexRequest other = + (com.google.datastore.admin.v1.GetIndexRequest) obj; + + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getIndexId().equals(other.getIndexId())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + INDEX_ID_FIELD_NUMBER; + hash = (53 * hash) + getIndexId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.GetIndexRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.GetIndexRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.GetIndexRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.GetIndexRequest 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.datastore.admin.v1.GetIndexRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.GetIndexRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.GetIndexRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.GetIndexRequest 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.datastore.admin.v1.GetIndexRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.GetIndexRequest 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.datastore.admin.v1.GetIndexRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.GetIndexRequest 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.datastore.admin.v1.GetIndexRequest 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 request for [google.datastore.admin.v1.DatastoreAdmin.GetIndex][google.datastore.admin.v1.DatastoreAdmin.GetIndex].
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.GetIndexRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.GetIndexRequest) + com.google.datastore.admin.v1.GetIndexRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_GetIndexRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_GetIndexRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.GetIndexRequest.class, + com.google.datastore.admin.v1.GetIndexRequest.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.GetIndexRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + projectId_ = ""; + + indexId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_GetIndexRequest_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.GetIndexRequest getDefaultInstanceForType() { + return com.google.datastore.admin.v1.GetIndexRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.GetIndexRequest build() { + com.google.datastore.admin.v1.GetIndexRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.GetIndexRequest buildPartial() { + com.google.datastore.admin.v1.GetIndexRequest result = + new com.google.datastore.admin.v1.GetIndexRequest(this); + result.projectId_ = projectId_; + result.indexId_ = indexId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.GetIndexRequest) { + return mergeFrom((com.google.datastore.admin.v1.GetIndexRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.GetIndexRequest other) { + if (other == com.google.datastore.admin.v1.GetIndexRequest.getDefaultInstance()) return this; + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (!other.getIndexId().isEmpty()) { + indexId_ = other.indexId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.GetIndexRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.datastore.admin.v1.GetIndexRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.lang.Object indexId_ = ""; + /** + * + * + *
+     * The resource ID of the index to get.
+     * 
+ * + * string index_id = 3; + * + * @return The indexId. + */ + public java.lang.String getIndexId() { + java.lang.Object ref = indexId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + indexId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource ID of the index to get.
+     * 
+ * + * string index_id = 3; + * + * @return The bytes for indexId. + */ + public com.google.protobuf.ByteString getIndexIdBytes() { + java.lang.Object ref = indexId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + indexId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource ID of the index to get.
+     * 
+ * + * string index_id = 3; + * + * @param value The indexId to set. + * @return This builder for chaining. + */ + public Builder setIndexId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + indexId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource ID of the index to get.
+     * 
+ * + * string index_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearIndexId() { + + indexId_ = getDefaultInstance().getIndexId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource ID of the index to get.
+     * 
+ * + * string index_id = 3; + * + * @param value The bytes for indexId to set. + * @return This builder for chaining. + */ + public Builder setIndexIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + indexId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.datastore.admin.v1.GetIndexRequest) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.GetIndexRequest) + private static final com.google.datastore.admin.v1.GetIndexRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.GetIndexRequest(); + } + + public static com.google.datastore.admin.v1.GetIndexRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetIndexRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetIndexRequest(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.GetIndexRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/GetIndexRequestOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/GetIndexRequestOrBuilder.java new file mode 100644 index 000000000..14e873eb6 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/GetIndexRequestOrBuilder.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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +public interface GetIndexRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.GetIndexRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Project ID against which to make the request.
+   * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Project ID against which to make the request.
+   * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * The resource ID of the index to get.
+   * 
+ * + * string index_id = 3; + * + * @return The indexId. + */ + java.lang.String getIndexId(); + /** + * + * + *
+   * The resource ID of the index to get.
+   * 
+ * + * string index_id = 3; + * + * @return The bytes for indexId. + */ + com.google.protobuf.ByteString getIndexIdBytes(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ImportEntitiesMetadata.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ImportEntitiesMetadata.java new file mode 100644 index 000000000..b4925d13a --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ImportEntitiesMetadata.java @@ -0,0 +1,1754 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * Metadata for ImportEntities operations.
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.ImportEntitiesMetadata} + */ +public final class ImportEntitiesMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.ImportEntitiesMetadata) + ImportEntitiesMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportEntitiesMetadata.newBuilder() to construct. + private ImportEntitiesMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportEntitiesMetadata() { + inputUrl_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportEntitiesMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportEntitiesMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.datastore.admin.v1.CommonMetadata.Builder subBuilder = null; + if (common_ != null) { + subBuilder = common_.toBuilder(); + } + common_ = + input.readMessage( + com.google.datastore.admin.v1.CommonMetadata.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(common_); + common_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.datastore.admin.v1.Progress.Builder subBuilder = null; + if (progressEntities_ != null) { + subBuilder = progressEntities_.toBuilder(); + } + progressEntities_ = + input.readMessage( + com.google.datastore.admin.v1.Progress.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progressEntities_); + progressEntities_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.datastore.admin.v1.Progress.Builder subBuilder = null; + if (progressBytes_ != null) { + subBuilder = progressBytes_.toBuilder(); + } + progressBytes_ = + input.readMessage( + com.google.datastore.admin.v1.Progress.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progressBytes_); + progressBytes_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.datastore.admin.v1.EntityFilter.Builder subBuilder = null; + if (entityFilter_ != null) { + subBuilder = entityFilter_.toBuilder(); + } + entityFilter_ = + input.readMessage( + com.google.datastore.admin.v1.EntityFilter.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(entityFilter_); + entityFilter_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + inputUrl_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ImportEntitiesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ImportEntitiesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.ImportEntitiesMetadata.class, + com.google.datastore.admin.v1.ImportEntitiesMetadata.Builder.class); + } + + public static final int COMMON_FIELD_NUMBER = 1; + private com.google.datastore.admin.v1.CommonMetadata common_; + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return Whether the common field is set. + */ + @java.lang.Override + public boolean hasCommon() { + return common_ != null; + } + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return The common. + */ + @java.lang.Override + public com.google.datastore.admin.v1.CommonMetadata getCommon() { + return common_ == null + ? com.google.datastore.admin.v1.CommonMetadata.getDefaultInstance() + : common_; + } + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + @java.lang.Override + public com.google.datastore.admin.v1.CommonMetadataOrBuilder getCommonOrBuilder() { + return getCommon(); + } + + public static final int PROGRESS_ENTITIES_FIELD_NUMBER = 2; + private com.google.datastore.admin.v1.Progress progressEntities_; + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return Whether the progressEntities field is set. + */ + @java.lang.Override + public boolean hasProgressEntities() { + return progressEntities_ != null; + } + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return The progressEntities. + */ + @java.lang.Override + public com.google.datastore.admin.v1.Progress getProgressEntities() { + return progressEntities_ == null + ? com.google.datastore.admin.v1.Progress.getDefaultInstance() + : progressEntities_; + } + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + @java.lang.Override + public com.google.datastore.admin.v1.ProgressOrBuilder getProgressEntitiesOrBuilder() { + return getProgressEntities(); + } + + public static final int PROGRESS_BYTES_FIELD_NUMBER = 3; + private com.google.datastore.admin.v1.Progress progressBytes_; + /** + * + * + *
+   * An estimate of the number of bytes processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + * + * @return Whether the progressBytes field is set. + */ + @java.lang.Override + public boolean hasProgressBytes() { + return progressBytes_ != null; + } + /** + * + * + *
+   * An estimate of the number of bytes processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + * + * @return The progressBytes. + */ + @java.lang.Override + public com.google.datastore.admin.v1.Progress getProgressBytes() { + return progressBytes_ == null + ? com.google.datastore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } + /** + * + * + *
+   * An estimate of the number of bytes processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + @java.lang.Override + public com.google.datastore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder() { + return getProgressBytes(); + } + + public static final int ENTITY_FILTER_FIELD_NUMBER = 4; + private com.google.datastore.admin.v1.EntityFilter entityFilter_; + /** + * + * + *
+   * Description of which entities are being imported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return Whether the entityFilter field is set. + */ + @java.lang.Override + public boolean hasEntityFilter() { + return entityFilter_ != null; + } + /** + * + * + *
+   * Description of which entities are being imported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return The entityFilter. + */ + @java.lang.Override + public com.google.datastore.admin.v1.EntityFilter getEntityFilter() { + return entityFilter_ == null + ? com.google.datastore.admin.v1.EntityFilter.getDefaultInstance() + : entityFilter_; + } + /** + * + * + *
+   * Description of which entities are being imported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + @java.lang.Override + public com.google.datastore.admin.v1.EntityFilterOrBuilder getEntityFilterOrBuilder() { + return getEntityFilter(); + } + + public static final int INPUT_URL_FIELD_NUMBER = 5; + private volatile java.lang.Object inputUrl_; + /** + * + * + *
+   * The location of the import metadata file. This will be the same value as
+   * the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field.
+   * 
+ * + * string input_url = 5; + * + * @return The inputUrl. + */ + @java.lang.Override + public java.lang.String getInputUrl() { + java.lang.Object ref = inputUrl_; + 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(); + inputUrl_ = s; + return s; + } + } + /** + * + * + *
+   * The location of the import metadata file. This will be the same value as
+   * the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field.
+   * 
+ * + * string input_url = 5; + * + * @return The bytes for inputUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInputUrlBytes() { + java.lang.Object ref = inputUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + inputUrl_ = 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 (common_ != null) { + output.writeMessage(1, getCommon()); + } + if (progressEntities_ != null) { + output.writeMessage(2, getProgressEntities()); + } + if (progressBytes_ != null) { + output.writeMessage(3, getProgressBytes()); + } + if (entityFilter_ != null) { + output.writeMessage(4, getEntityFilter()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(inputUrl_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, inputUrl_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (common_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommon()); + } + if (progressEntities_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProgressEntities()); + } + if (progressBytes_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getProgressBytes()); + } + if (entityFilter_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getEntityFilter()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(inputUrl_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, inputUrl_); + } + size += unknownFields.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.datastore.admin.v1.ImportEntitiesMetadata)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.ImportEntitiesMetadata other = + (com.google.datastore.admin.v1.ImportEntitiesMetadata) obj; + + if (hasCommon() != other.hasCommon()) return false; + if (hasCommon()) { + if (!getCommon().equals(other.getCommon())) return false; + } + if (hasProgressEntities() != other.hasProgressEntities()) return false; + if (hasProgressEntities()) { + if (!getProgressEntities().equals(other.getProgressEntities())) return false; + } + if (hasProgressBytes() != other.hasProgressBytes()) return false; + if (hasProgressBytes()) { + if (!getProgressBytes().equals(other.getProgressBytes())) return false; + } + if (hasEntityFilter() != other.hasEntityFilter()) return false; + if (hasEntityFilter()) { + if (!getEntityFilter().equals(other.getEntityFilter())) return false; + } + if (!getInputUrl().equals(other.getInputUrl())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCommon()) { + hash = (37 * hash) + COMMON_FIELD_NUMBER; + hash = (53 * hash) + getCommon().hashCode(); + } + if (hasProgressEntities()) { + hash = (37 * hash) + PROGRESS_ENTITIES_FIELD_NUMBER; + hash = (53 * hash) + getProgressEntities().hashCode(); + } + if (hasProgressBytes()) { + hash = (37 * hash) + PROGRESS_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getProgressBytes().hashCode(); + } + if (hasEntityFilter()) { + hash = (37 * hash) + ENTITY_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getEntityFilter().hashCode(); + } + hash = (37 * hash) + INPUT_URL_FIELD_NUMBER; + hash = (53 * hash) + getInputUrl().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.ImportEntitiesMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ImportEntitiesMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.ImportEntitiesMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ImportEntitiesMetadata 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.datastore.admin.v1.ImportEntitiesMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ImportEntitiesMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.ImportEntitiesMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ImportEntitiesMetadata 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.datastore.admin.v1.ImportEntitiesMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ImportEntitiesMetadata 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.datastore.admin.v1.ImportEntitiesMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ImportEntitiesMetadata 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.datastore.admin.v1.ImportEntitiesMetadata 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; + } + /** + * + * + *
+   * Metadata for ImportEntities operations.
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.ImportEntitiesMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.ImportEntitiesMetadata) + com.google.datastore.admin.v1.ImportEntitiesMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ImportEntitiesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ImportEntitiesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.ImportEntitiesMetadata.class, + com.google.datastore.admin.v1.ImportEntitiesMetadata.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.ImportEntitiesMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (commonBuilder_ == null) { + common_ = null; + } else { + common_ = null; + commonBuilder_ = null; + } + if (progressEntitiesBuilder_ == null) { + progressEntities_ = null; + } else { + progressEntities_ = null; + progressEntitiesBuilder_ = null; + } + if (progressBytesBuilder_ == null) { + progressBytes_ = null; + } else { + progressBytes_ = null; + progressBytesBuilder_ = null; + } + if (entityFilterBuilder_ == null) { + entityFilter_ = null; + } else { + entityFilter_ = null; + entityFilterBuilder_ = null; + } + inputUrl_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ImportEntitiesMetadata_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.ImportEntitiesMetadata getDefaultInstanceForType() { + return com.google.datastore.admin.v1.ImportEntitiesMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.ImportEntitiesMetadata build() { + com.google.datastore.admin.v1.ImportEntitiesMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.ImportEntitiesMetadata buildPartial() { + com.google.datastore.admin.v1.ImportEntitiesMetadata result = + new com.google.datastore.admin.v1.ImportEntitiesMetadata(this); + if (commonBuilder_ == null) { + result.common_ = common_; + } else { + result.common_ = commonBuilder_.build(); + } + if (progressEntitiesBuilder_ == null) { + result.progressEntities_ = progressEntities_; + } else { + result.progressEntities_ = progressEntitiesBuilder_.build(); + } + if (progressBytesBuilder_ == null) { + result.progressBytes_ = progressBytes_; + } else { + result.progressBytes_ = progressBytesBuilder_.build(); + } + if (entityFilterBuilder_ == null) { + result.entityFilter_ = entityFilter_; + } else { + result.entityFilter_ = entityFilterBuilder_.build(); + } + result.inputUrl_ = inputUrl_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.ImportEntitiesMetadata) { + return mergeFrom((com.google.datastore.admin.v1.ImportEntitiesMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.ImportEntitiesMetadata other) { + if (other == com.google.datastore.admin.v1.ImportEntitiesMetadata.getDefaultInstance()) + return this; + if (other.hasCommon()) { + mergeCommon(other.getCommon()); + } + if (other.hasProgressEntities()) { + mergeProgressEntities(other.getProgressEntities()); + } + if (other.hasProgressBytes()) { + mergeProgressBytes(other.getProgressBytes()); + } + if (other.hasEntityFilter()) { + mergeEntityFilter(other.getEntityFilter()); + } + if (!other.getInputUrl().isEmpty()) { + inputUrl_ = other.inputUrl_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.ImportEntitiesMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.datastore.admin.v1.ImportEntitiesMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.datastore.admin.v1.CommonMetadata common_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.CommonMetadata, + com.google.datastore.admin.v1.CommonMetadata.Builder, + com.google.datastore.admin.v1.CommonMetadataOrBuilder> + commonBuilder_; + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return Whether the common field is set. + */ + public boolean hasCommon() { + return commonBuilder_ != null || common_ != null; + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return The common. + */ + public com.google.datastore.admin.v1.CommonMetadata getCommon() { + if (commonBuilder_ == null) { + return common_ == null + ? com.google.datastore.admin.v1.CommonMetadata.getDefaultInstance() + : common_; + } else { + return commonBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public Builder setCommon(com.google.datastore.admin.v1.CommonMetadata value) { + if (commonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + common_ = value; + onChanged(); + } else { + commonBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public Builder setCommon(com.google.datastore.admin.v1.CommonMetadata.Builder builderForValue) { + if (commonBuilder_ == null) { + common_ = builderForValue.build(); + onChanged(); + } else { + commonBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public Builder mergeCommon(com.google.datastore.admin.v1.CommonMetadata value) { + if (commonBuilder_ == null) { + if (common_ != null) { + common_ = + com.google.datastore.admin.v1.CommonMetadata.newBuilder(common_) + .mergeFrom(value) + .buildPartial(); + } else { + common_ = value; + } + onChanged(); + } else { + commonBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public Builder clearCommon() { + if (commonBuilder_ == null) { + common_ = null; + onChanged(); + } else { + common_ = null; + commonBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public com.google.datastore.admin.v1.CommonMetadata.Builder getCommonBuilder() { + + onChanged(); + return getCommonFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public com.google.datastore.admin.v1.CommonMetadataOrBuilder getCommonOrBuilder() { + if (commonBuilder_ != null) { + return commonBuilder_.getMessageOrBuilder(); + } else { + return common_ == null + ? com.google.datastore.admin.v1.CommonMetadata.getDefaultInstance() + : common_; + } + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.CommonMetadata, + com.google.datastore.admin.v1.CommonMetadata.Builder, + com.google.datastore.admin.v1.CommonMetadataOrBuilder> + getCommonFieldBuilder() { + if (commonBuilder_ == null) { + commonBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.CommonMetadata, + com.google.datastore.admin.v1.CommonMetadata.Builder, + com.google.datastore.admin.v1.CommonMetadataOrBuilder>( + getCommon(), getParentForChildren(), isClean()); + common_ = null; + } + return commonBuilder_; + } + + private com.google.datastore.admin.v1.Progress progressEntities_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Progress, + com.google.datastore.admin.v1.Progress.Builder, + com.google.datastore.admin.v1.ProgressOrBuilder> + progressEntitiesBuilder_; + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return Whether the progressEntities field is set. + */ + public boolean hasProgressEntities() { + return progressEntitiesBuilder_ != null || progressEntities_ != null; + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return The progressEntities. + */ + public com.google.datastore.admin.v1.Progress getProgressEntities() { + if (progressEntitiesBuilder_ == null) { + return progressEntities_ == null + ? com.google.datastore.admin.v1.Progress.getDefaultInstance() + : progressEntities_; + } else { + return progressEntitiesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public Builder setProgressEntities(com.google.datastore.admin.v1.Progress value) { + if (progressEntitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progressEntities_ = value; + onChanged(); + } else { + progressEntitiesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public Builder setProgressEntities( + com.google.datastore.admin.v1.Progress.Builder builderForValue) { + if (progressEntitiesBuilder_ == null) { + progressEntities_ = builderForValue.build(); + onChanged(); + } else { + progressEntitiesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public Builder mergeProgressEntities(com.google.datastore.admin.v1.Progress value) { + if (progressEntitiesBuilder_ == null) { + if (progressEntities_ != null) { + progressEntities_ = + com.google.datastore.admin.v1.Progress.newBuilder(progressEntities_) + .mergeFrom(value) + .buildPartial(); + } else { + progressEntities_ = value; + } + onChanged(); + } else { + progressEntitiesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public Builder clearProgressEntities() { + if (progressEntitiesBuilder_ == null) { + progressEntities_ = null; + onChanged(); + } else { + progressEntities_ = null; + progressEntitiesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public com.google.datastore.admin.v1.Progress.Builder getProgressEntitiesBuilder() { + + onChanged(); + return getProgressEntitiesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public com.google.datastore.admin.v1.ProgressOrBuilder getProgressEntitiesOrBuilder() { + if (progressEntitiesBuilder_ != null) { + return progressEntitiesBuilder_.getMessageOrBuilder(); + } else { + return progressEntities_ == null + ? com.google.datastore.admin.v1.Progress.getDefaultInstance() + : progressEntities_; + } + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Progress, + com.google.datastore.admin.v1.Progress.Builder, + com.google.datastore.admin.v1.ProgressOrBuilder> + getProgressEntitiesFieldBuilder() { + if (progressEntitiesBuilder_ == null) { + progressEntitiesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Progress, + com.google.datastore.admin.v1.Progress.Builder, + com.google.datastore.admin.v1.ProgressOrBuilder>( + getProgressEntities(), getParentForChildren(), isClean()); + progressEntities_ = null; + } + return progressEntitiesBuilder_; + } + + private com.google.datastore.admin.v1.Progress progressBytes_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Progress, + com.google.datastore.admin.v1.Progress.Builder, + com.google.datastore.admin.v1.ProgressOrBuilder> + progressBytesBuilder_; + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + * + * @return Whether the progressBytes field is set. + */ + public boolean hasProgressBytes() { + return progressBytesBuilder_ != null || progressBytes_ != null; + } + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + * + * @return The progressBytes. + */ + public com.google.datastore.admin.v1.Progress getProgressBytes() { + if (progressBytesBuilder_ == null) { + return progressBytes_ == null + ? com.google.datastore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } else { + return progressBytesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + public Builder setProgressBytes(com.google.datastore.admin.v1.Progress value) { + if (progressBytesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progressBytes_ = value; + onChanged(); + } else { + progressBytesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + public Builder setProgressBytes( + com.google.datastore.admin.v1.Progress.Builder builderForValue) { + if (progressBytesBuilder_ == null) { + progressBytes_ = builderForValue.build(); + onChanged(); + } else { + progressBytesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + public Builder mergeProgressBytes(com.google.datastore.admin.v1.Progress value) { + if (progressBytesBuilder_ == null) { + if (progressBytes_ != null) { + progressBytes_ = + com.google.datastore.admin.v1.Progress.newBuilder(progressBytes_) + .mergeFrom(value) + .buildPartial(); + } else { + progressBytes_ = value; + } + onChanged(); + } else { + progressBytesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + public Builder clearProgressBytes() { + if (progressBytesBuilder_ == null) { + progressBytes_ = null; + onChanged(); + } else { + progressBytes_ = null; + progressBytesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + public com.google.datastore.admin.v1.Progress.Builder getProgressBytesBuilder() { + + onChanged(); + return getProgressBytesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + public com.google.datastore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder() { + if (progressBytesBuilder_ != null) { + return progressBytesBuilder_.getMessageOrBuilder(); + } else { + return progressBytes_ == null + ? com.google.datastore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } + } + /** + * + * + *
+     * An estimate of the number of bytes processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Progress, + com.google.datastore.admin.v1.Progress.Builder, + com.google.datastore.admin.v1.ProgressOrBuilder> + getProgressBytesFieldBuilder() { + if (progressBytesBuilder_ == null) { + progressBytesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Progress, + com.google.datastore.admin.v1.Progress.Builder, + com.google.datastore.admin.v1.ProgressOrBuilder>( + getProgressBytes(), getParentForChildren(), isClean()); + progressBytes_ = null; + } + return progressBytesBuilder_; + } + + private com.google.datastore.admin.v1.EntityFilter entityFilter_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.EntityFilter, + com.google.datastore.admin.v1.EntityFilter.Builder, + com.google.datastore.admin.v1.EntityFilterOrBuilder> + entityFilterBuilder_; + /** + * + * + *
+     * Description of which entities are being imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return Whether the entityFilter field is set. + */ + public boolean hasEntityFilter() { + return entityFilterBuilder_ != null || entityFilter_ != null; + } + /** + * + * + *
+     * Description of which entities are being imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return The entityFilter. + */ + public com.google.datastore.admin.v1.EntityFilter getEntityFilter() { + if (entityFilterBuilder_ == null) { + return entityFilter_ == null + ? com.google.datastore.admin.v1.EntityFilter.getDefaultInstance() + : entityFilter_; + } else { + return entityFilterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Description of which entities are being imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public Builder setEntityFilter(com.google.datastore.admin.v1.EntityFilter value) { + if (entityFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + entityFilter_ = value; + onChanged(); + } else { + entityFilterBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Description of which entities are being imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public Builder setEntityFilter( + com.google.datastore.admin.v1.EntityFilter.Builder builderForValue) { + if (entityFilterBuilder_ == null) { + entityFilter_ = builderForValue.build(); + onChanged(); + } else { + entityFilterBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Description of which entities are being imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public Builder mergeEntityFilter(com.google.datastore.admin.v1.EntityFilter value) { + if (entityFilterBuilder_ == null) { + if (entityFilter_ != null) { + entityFilter_ = + com.google.datastore.admin.v1.EntityFilter.newBuilder(entityFilter_) + .mergeFrom(value) + .buildPartial(); + } else { + entityFilter_ = value; + } + onChanged(); + } else { + entityFilterBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Description of which entities are being imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public Builder clearEntityFilter() { + if (entityFilterBuilder_ == null) { + entityFilter_ = null; + onChanged(); + } else { + entityFilter_ = null; + entityFilterBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Description of which entities are being imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public com.google.datastore.admin.v1.EntityFilter.Builder getEntityFilterBuilder() { + + onChanged(); + return getEntityFilterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Description of which entities are being imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public com.google.datastore.admin.v1.EntityFilterOrBuilder getEntityFilterOrBuilder() { + if (entityFilterBuilder_ != null) { + return entityFilterBuilder_.getMessageOrBuilder(); + } else { + return entityFilter_ == null + ? com.google.datastore.admin.v1.EntityFilter.getDefaultInstance() + : entityFilter_; + } + } + /** + * + * + *
+     * Description of which entities are being imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.EntityFilter, + com.google.datastore.admin.v1.EntityFilter.Builder, + com.google.datastore.admin.v1.EntityFilterOrBuilder> + getEntityFilterFieldBuilder() { + if (entityFilterBuilder_ == null) { + entityFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.EntityFilter, + com.google.datastore.admin.v1.EntityFilter.Builder, + com.google.datastore.admin.v1.EntityFilterOrBuilder>( + getEntityFilter(), getParentForChildren(), isClean()); + entityFilter_ = null; + } + return entityFilterBuilder_; + } + + private java.lang.Object inputUrl_ = ""; + /** + * + * + *
+     * The location of the import metadata file. This will be the same value as
+     * the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field.
+     * 
+ * + * string input_url = 5; + * + * @return The inputUrl. + */ + public java.lang.String getInputUrl() { + java.lang.Object ref = inputUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + inputUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The location of the import metadata file. This will be the same value as
+     * the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field.
+     * 
+ * + * string input_url = 5; + * + * @return The bytes for inputUrl. + */ + public com.google.protobuf.ByteString getInputUrlBytes() { + java.lang.Object ref = inputUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + inputUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The location of the import metadata file. This will be the same value as
+     * the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field.
+     * 
+ * + * string input_url = 5; + * + * @param value The inputUrl to set. + * @return This builder for chaining. + */ + public Builder setInputUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + inputUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The location of the import metadata file. This will be the same value as
+     * the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field.
+     * 
+ * + * string input_url = 5; + * + * @return This builder for chaining. + */ + public Builder clearInputUrl() { + + inputUrl_ = getDefaultInstance().getInputUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * The location of the import metadata file. This will be the same value as
+     * the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field.
+     * 
+ * + * string input_url = 5; + * + * @param value The bytes for inputUrl to set. + * @return This builder for chaining. + */ + public Builder setInputUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + inputUrl_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.datastore.admin.v1.ImportEntitiesMetadata) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.ImportEntitiesMetadata) + private static final com.google.datastore.admin.v1.ImportEntitiesMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.ImportEntitiesMetadata(); + } + + public static com.google.datastore.admin.v1.ImportEntitiesMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportEntitiesMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportEntitiesMetadata(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.ImportEntitiesMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ImportEntitiesMetadataOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ImportEntitiesMetadataOrBuilder.java new file mode 100644 index 000000000..6cfc8190a --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ImportEntitiesMetadataOrBuilder.java @@ -0,0 +1,192 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +public interface ImportEntitiesMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.ImportEntitiesMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return Whether the common field is set. + */ + boolean hasCommon(); + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return The common. + */ + com.google.datastore.admin.v1.CommonMetadata getCommon(); + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + com.google.datastore.admin.v1.CommonMetadataOrBuilder getCommonOrBuilder(); + + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return Whether the progressEntities field is set. + */ + boolean hasProgressEntities(); + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return The progressEntities. + */ + com.google.datastore.admin.v1.Progress getProgressEntities(); + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + com.google.datastore.admin.v1.ProgressOrBuilder getProgressEntitiesOrBuilder(); + + /** + * + * + *
+   * An estimate of the number of bytes processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + * + * @return Whether the progressBytes field is set. + */ + boolean hasProgressBytes(); + /** + * + * + *
+   * An estimate of the number of bytes processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + * + * @return The progressBytes. + */ + com.google.datastore.admin.v1.Progress getProgressBytes(); + /** + * + * + *
+   * An estimate of the number of bytes processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + com.google.datastore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder(); + + /** + * + * + *
+   * Description of which entities are being imported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return Whether the entityFilter field is set. + */ + boolean hasEntityFilter(); + /** + * + * + *
+   * Description of which entities are being imported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return The entityFilter. + */ + com.google.datastore.admin.v1.EntityFilter getEntityFilter(); + /** + * + * + *
+   * Description of which entities are being imported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + com.google.datastore.admin.v1.EntityFilterOrBuilder getEntityFilterOrBuilder(); + + /** + * + * + *
+   * The location of the import metadata file. This will be the same value as
+   * the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field.
+   * 
+ * + * string input_url = 5; + * + * @return The inputUrl. + */ + java.lang.String getInputUrl(); + /** + * + * + *
+   * The location of the import metadata file. This will be the same value as
+   * the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field.
+   * 
+ * + * string input_url = 5; + * + * @return The bytes for inputUrl. + */ + com.google.protobuf.ByteString getInputUrlBytes(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ImportEntitiesRequest.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ImportEntitiesRequest.java new file mode 100644 index 000000000..ecc1bcad7 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ImportEntitiesRequest.java @@ -0,0 +1,1532 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * The request for
+ * [google.datastore.admin.v1.DatastoreAdmin.ImportEntities][google.datastore.admin.v1.DatastoreAdmin.ImportEntities].
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.ImportEntitiesRequest} + */ +public final class ImportEntitiesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.ImportEntitiesRequest) + ImportEntitiesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportEntitiesRequest.newBuilder() to construct. + private ImportEntitiesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportEntitiesRequest() { + projectId_ = ""; + inputUrl_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ImportEntitiesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportEntitiesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + inputUrl_ = s; + break; + } + case 34: + { + com.google.datastore.admin.v1.EntityFilter.Builder subBuilder = null; + if (entityFilter_ != null) { + subBuilder = entityFilter_.toBuilder(); + } + entityFilter_ = + input.readMessage( + com.google.datastore.admin.v1.EntityFilter.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(entityFilter_); + entityFilter_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ImportEntitiesRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ImportEntitiesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.ImportEntitiesRequest.class, + com.google.datastore.admin.v1.ImportEntitiesRequest.Builder.class); + } + + public static final int PROJECT_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * Required. Project ID against which to make the request.
+   * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + 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(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Project ID against which to make the request.
+   * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABELS_FIELD_NUMBER = 2; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ImportEntitiesRequest_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int INPUT_URL_FIELD_NUMBER = 3; + private volatile java.lang.Object inputUrl_; + /** + * + * + *
+   * Required. The full resource URL of the external storage location. Currently, only
+   * Google Cloud Storage is supported. So input_url should be of the form:
+   * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where
+   * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is
+   * an optional Cloud Storage namespace path (this is not a Cloud Datastore
+   * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written
+   * by the ExportEntities operation. For more information about Cloud Storage
+   * namespace paths, see
+   * [Object name
+   * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+   * For more information, see
+   * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+   * 
+ * + * string input_url = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The inputUrl. + */ + @java.lang.Override + public java.lang.String getInputUrl() { + java.lang.Object ref = inputUrl_; + 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(); + inputUrl_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The full resource URL of the external storage location. Currently, only
+   * Google Cloud Storage is supported. So input_url should be of the form:
+   * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where
+   * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is
+   * an optional Cloud Storage namespace path (this is not a Cloud Datastore
+   * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written
+   * by the ExportEntities operation. For more information about Cloud Storage
+   * namespace paths, see
+   * [Object name
+   * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+   * For more information, see
+   * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+   * 
+ * + * string input_url = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for inputUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInputUrlBytes() { + java.lang.Object ref = inputUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + inputUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENTITY_FILTER_FIELD_NUMBER = 4; + private com.google.datastore.admin.v1.EntityFilter entityFilter_; + /** + * + * + *
+   * Optionally specify which kinds/namespaces are to be imported. If provided,
+   * the list must be a subset of the EntityFilter used in creating the export,
+   * otherwise a FAILED_PRECONDITION error will be returned. If no filter is
+   * specified then all entities from the export are imported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return Whether the entityFilter field is set. + */ + @java.lang.Override + public boolean hasEntityFilter() { + return entityFilter_ != null; + } + /** + * + * + *
+   * Optionally specify which kinds/namespaces are to be imported. If provided,
+   * the list must be a subset of the EntityFilter used in creating the export,
+   * otherwise a FAILED_PRECONDITION error will be returned. If no filter is
+   * specified then all entities from the export are imported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return The entityFilter. + */ + @java.lang.Override + public com.google.datastore.admin.v1.EntityFilter getEntityFilter() { + return entityFilter_ == null + ? com.google.datastore.admin.v1.EntityFilter.getDefaultInstance() + : entityFilter_; + } + /** + * + * + *
+   * Optionally specify which kinds/namespaces are to be imported. If provided,
+   * the list must be a subset of the EntityFilter used in creating the export,
+   * otherwise a FAILED_PRECONDITION error will be returned. If no filter is
+   * specified then all entities from the export are imported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + @java.lang.Override + public com.google.datastore.admin.v1.EntityFilterOrBuilder getEntityFilterOrBuilder() { + return getEntityFilter(); + } + + 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(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectId_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 2); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(inputUrl_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, inputUrl_); + } + if (entityFilter_ != null) { + output.writeMessage(4, getEntityFilter()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectId_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, labels__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(inputUrl_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, inputUrl_); + } + if (entityFilter_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getEntityFilter()); + } + size += unknownFields.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.datastore.admin.v1.ImportEntitiesRequest)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.ImportEntitiesRequest other = + (com.google.datastore.admin.v1.ImportEntitiesRequest) obj; + + if (!getProjectId().equals(other.getProjectId())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getInputUrl().equals(other.getInputUrl())) return false; + if (hasEntityFilter() != other.hasEntityFilter()) return false; + if (hasEntityFilter()) { + if (!getEntityFilter().equals(other.getEntityFilter())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + INPUT_URL_FIELD_NUMBER; + hash = (53 * hash) + getInputUrl().hashCode(); + if (hasEntityFilter()) { + hash = (37 * hash) + ENTITY_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getEntityFilter().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.ImportEntitiesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ImportEntitiesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.ImportEntitiesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ImportEntitiesRequest 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.datastore.admin.v1.ImportEntitiesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ImportEntitiesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.ImportEntitiesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ImportEntitiesRequest 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.datastore.admin.v1.ImportEntitiesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ImportEntitiesRequest 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.datastore.admin.v1.ImportEntitiesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ImportEntitiesRequest 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.datastore.admin.v1.ImportEntitiesRequest 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 request for
+   * [google.datastore.admin.v1.DatastoreAdmin.ImportEntities][google.datastore.admin.v1.DatastoreAdmin.ImportEntities].
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.ImportEntitiesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.ImportEntitiesRequest) + com.google.datastore.admin.v1.ImportEntitiesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ImportEntitiesRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ImportEntitiesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.ImportEntitiesRequest.class, + com.google.datastore.admin.v1.ImportEntitiesRequest.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.ImportEntitiesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + projectId_ = ""; + + internalGetMutableLabels().clear(); + inputUrl_ = ""; + + if (entityFilterBuilder_ == null) { + entityFilter_ = null; + } else { + entityFilter_ = null; + entityFilterBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ImportEntitiesRequest_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.ImportEntitiesRequest getDefaultInstanceForType() { + return com.google.datastore.admin.v1.ImportEntitiesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.ImportEntitiesRequest build() { + com.google.datastore.admin.v1.ImportEntitiesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.ImportEntitiesRequest buildPartial() { + com.google.datastore.admin.v1.ImportEntitiesRequest result = + new com.google.datastore.admin.v1.ImportEntitiesRequest(this); + int from_bitField0_ = bitField0_; + result.projectId_ = projectId_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.inputUrl_ = inputUrl_; + if (entityFilterBuilder_ == null) { + result.entityFilter_ = entityFilter_; + } else { + result.entityFilter_ = entityFilterBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.ImportEntitiesRequest) { + return mergeFrom((com.google.datastore.admin.v1.ImportEntitiesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.ImportEntitiesRequest other) { + if (other == com.google.datastore.admin.v1.ImportEntitiesRequest.getDefaultInstance()) + return this; + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (!other.getInputUrl().isEmpty()) { + inputUrl_ = other.inputUrl_; + onChanged(); + } + if (other.hasEntityFilter()) { + mergeEntityFilter(other.getEntityFilter()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.ImportEntitiesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.datastore.admin.v1.ImportEntitiesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Required. Project ID against which to make the request.
+     * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Project ID against which to make the request.
+     * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Project ID against which to make the request.
+     * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Project ID against which to make the request.
+     * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Project ID against which to make the request.
+     * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Client-assigned labels.
+     * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Client-assigned labels.
+     * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Client-assigned labels.
+     * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Client-assigned labels.
+     * 
+ * + * map<string, string> labels = 2; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Client-assigned labels.
+     * 
+ * + * map<string, string> labels = 2; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Client-assigned labels.
+     * 
+ * + * map<string, string> labels = 2; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Client-assigned labels.
+     * 
+ * + * map<string, string> labels = 2; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object inputUrl_ = ""; + /** + * + * + *
+     * Required. The full resource URL of the external storage location. Currently, only
+     * Google Cloud Storage is supported. So input_url should be of the form:
+     * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where
+     * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is
+     * an optional Cloud Storage namespace path (this is not a Cloud Datastore
+     * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written
+     * by the ExportEntities operation. For more information about Cloud Storage
+     * namespace paths, see
+     * [Object name
+     * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+     * For more information, see
+     * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+     * 
+ * + * string input_url = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The inputUrl. + */ + public java.lang.String getInputUrl() { + java.lang.Object ref = inputUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + inputUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The full resource URL of the external storage location. Currently, only
+     * Google Cloud Storage is supported. So input_url should be of the form:
+     * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where
+     * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is
+     * an optional Cloud Storage namespace path (this is not a Cloud Datastore
+     * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written
+     * by the ExportEntities operation. For more information about Cloud Storage
+     * namespace paths, see
+     * [Object name
+     * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+     * For more information, see
+     * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+     * 
+ * + * string input_url = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for inputUrl. + */ + public com.google.protobuf.ByteString getInputUrlBytes() { + java.lang.Object ref = inputUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + inputUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The full resource URL of the external storage location. Currently, only
+     * Google Cloud Storage is supported. So input_url should be of the form:
+     * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where
+     * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is
+     * an optional Cloud Storage namespace path (this is not a Cloud Datastore
+     * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written
+     * by the ExportEntities operation. For more information about Cloud Storage
+     * namespace paths, see
+     * [Object name
+     * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+     * For more information, see
+     * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+     * 
+ * + * string input_url = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The inputUrl to set. + * @return This builder for chaining. + */ + public Builder setInputUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + inputUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full resource URL of the external storage location. Currently, only
+     * Google Cloud Storage is supported. So input_url should be of the form:
+     * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where
+     * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is
+     * an optional Cloud Storage namespace path (this is not a Cloud Datastore
+     * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written
+     * by the ExportEntities operation. For more information about Cloud Storage
+     * namespace paths, see
+     * [Object name
+     * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+     * For more information, see
+     * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+     * 
+ * + * string input_url = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInputUrl() { + + inputUrl_ = getDefaultInstance().getInputUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full resource URL of the external storage location. Currently, only
+     * Google Cloud Storage is supported. So input_url should be of the form:
+     * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where
+     * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is
+     * an optional Cloud Storage namespace path (this is not a Cloud Datastore
+     * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written
+     * by the ExportEntities operation. For more information about Cloud Storage
+     * namespace paths, see
+     * [Object name
+     * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+     * For more information, see
+     * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+     * 
+ * + * string input_url = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for inputUrl to set. + * @return This builder for chaining. + */ + public Builder setInputUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + inputUrl_ = value; + onChanged(); + return this; + } + + private com.google.datastore.admin.v1.EntityFilter entityFilter_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.EntityFilter, + com.google.datastore.admin.v1.EntityFilter.Builder, + com.google.datastore.admin.v1.EntityFilterOrBuilder> + entityFilterBuilder_; + /** + * + * + *
+     * Optionally specify which kinds/namespaces are to be imported. If provided,
+     * the list must be a subset of the EntityFilter used in creating the export,
+     * otherwise a FAILED_PRECONDITION error will be returned. If no filter is
+     * specified then all entities from the export are imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return Whether the entityFilter field is set. + */ + public boolean hasEntityFilter() { + return entityFilterBuilder_ != null || entityFilter_ != null; + } + /** + * + * + *
+     * Optionally specify which kinds/namespaces are to be imported. If provided,
+     * the list must be a subset of the EntityFilter used in creating the export,
+     * otherwise a FAILED_PRECONDITION error will be returned. If no filter is
+     * specified then all entities from the export are imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return The entityFilter. + */ + public com.google.datastore.admin.v1.EntityFilter getEntityFilter() { + if (entityFilterBuilder_ == null) { + return entityFilter_ == null + ? com.google.datastore.admin.v1.EntityFilter.getDefaultInstance() + : entityFilter_; + } else { + return entityFilterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optionally specify which kinds/namespaces are to be imported. If provided,
+     * the list must be a subset of the EntityFilter used in creating the export,
+     * otherwise a FAILED_PRECONDITION error will be returned. If no filter is
+     * specified then all entities from the export are imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public Builder setEntityFilter(com.google.datastore.admin.v1.EntityFilter value) { + if (entityFilterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + entityFilter_ = value; + onChanged(); + } else { + entityFilterBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optionally specify which kinds/namespaces are to be imported. If provided,
+     * the list must be a subset of the EntityFilter used in creating the export,
+     * otherwise a FAILED_PRECONDITION error will be returned. If no filter is
+     * specified then all entities from the export are imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public Builder setEntityFilter( + com.google.datastore.admin.v1.EntityFilter.Builder builderForValue) { + if (entityFilterBuilder_ == null) { + entityFilter_ = builderForValue.build(); + onChanged(); + } else { + entityFilterBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optionally specify which kinds/namespaces are to be imported. If provided,
+     * the list must be a subset of the EntityFilter used in creating the export,
+     * otherwise a FAILED_PRECONDITION error will be returned. If no filter is
+     * specified then all entities from the export are imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public Builder mergeEntityFilter(com.google.datastore.admin.v1.EntityFilter value) { + if (entityFilterBuilder_ == null) { + if (entityFilter_ != null) { + entityFilter_ = + com.google.datastore.admin.v1.EntityFilter.newBuilder(entityFilter_) + .mergeFrom(value) + .buildPartial(); + } else { + entityFilter_ = value; + } + onChanged(); + } else { + entityFilterBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optionally specify which kinds/namespaces are to be imported. If provided,
+     * the list must be a subset of the EntityFilter used in creating the export,
+     * otherwise a FAILED_PRECONDITION error will be returned. If no filter is
+     * specified then all entities from the export are imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public Builder clearEntityFilter() { + if (entityFilterBuilder_ == null) { + entityFilter_ = null; + onChanged(); + } else { + entityFilter_ = null; + entityFilterBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optionally specify which kinds/namespaces are to be imported. If provided,
+     * the list must be a subset of the EntityFilter used in creating the export,
+     * otherwise a FAILED_PRECONDITION error will be returned. If no filter is
+     * specified then all entities from the export are imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public com.google.datastore.admin.v1.EntityFilter.Builder getEntityFilterBuilder() { + + onChanged(); + return getEntityFilterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optionally specify which kinds/namespaces are to be imported. If provided,
+     * the list must be a subset of the EntityFilter used in creating the export,
+     * otherwise a FAILED_PRECONDITION error will be returned. If no filter is
+     * specified then all entities from the export are imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + public com.google.datastore.admin.v1.EntityFilterOrBuilder getEntityFilterOrBuilder() { + if (entityFilterBuilder_ != null) { + return entityFilterBuilder_.getMessageOrBuilder(); + } else { + return entityFilter_ == null + ? com.google.datastore.admin.v1.EntityFilter.getDefaultInstance() + : entityFilter_; + } + } + /** + * + * + *
+     * Optionally specify which kinds/namespaces are to be imported. If provided,
+     * the list must be a subset of the EntityFilter used in creating the export,
+     * otherwise a FAILED_PRECONDITION error will be returned. If no filter is
+     * specified then all entities from the export are imported.
+     * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.EntityFilter, + com.google.datastore.admin.v1.EntityFilter.Builder, + com.google.datastore.admin.v1.EntityFilterOrBuilder> + getEntityFilterFieldBuilder() { + if (entityFilterBuilder_ == null) { + entityFilterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.EntityFilter, + com.google.datastore.admin.v1.EntityFilter.Builder, + com.google.datastore.admin.v1.EntityFilterOrBuilder>( + getEntityFilter(), getParentForChildren(), isClean()); + entityFilter_ = null; + } + return entityFilterBuilder_; + } + + @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.datastore.admin.v1.ImportEntitiesRequest) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.ImportEntitiesRequest) + private static final com.google.datastore.admin.v1.ImportEntitiesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.ImportEntitiesRequest(); + } + + public static com.google.datastore.admin.v1.ImportEntitiesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportEntitiesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportEntitiesRequest(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.ImportEntitiesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ImportEntitiesRequestOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ImportEntitiesRequestOrBuilder.java new file mode 100644 index 000000000..9d29365b4 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ImportEntitiesRequestOrBuilder.java @@ -0,0 +1,195 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +public interface ImportEntitiesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.ImportEntitiesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Project ID against which to make the request.
+   * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Required. Project ID against which to make the request.
+   * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + int getLabelsCount(); + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Client-assigned labels.
+   * 
+ * + * map<string, string> labels = 2; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Required. The full resource URL of the external storage location. Currently, only
+   * Google Cloud Storage is supported. So input_url should be of the form:
+   * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where
+   * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is
+   * an optional Cloud Storage namespace path (this is not a Cloud Datastore
+   * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written
+   * by the ExportEntities operation. For more information about Cloud Storage
+   * namespace paths, see
+   * [Object name
+   * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+   * For more information, see
+   * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+   * 
+ * + * string input_url = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The inputUrl. + */ + java.lang.String getInputUrl(); + /** + * + * + *
+   * Required. The full resource URL of the external storage location. Currently, only
+   * Google Cloud Storage is supported. So input_url should be of the form:
+   * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where
+   * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is
+   * an optional Cloud Storage namespace path (this is not a Cloud Datastore
+   * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written
+   * by the ExportEntities operation. For more information about Cloud Storage
+   * namespace paths, see
+   * [Object name
+   * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
+   * For more information, see
+   * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
+   * 
+ * + * string input_url = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for inputUrl. + */ + com.google.protobuf.ByteString getInputUrlBytes(); + + /** + * + * + *
+   * Optionally specify which kinds/namespaces are to be imported. If provided,
+   * the list must be a subset of the EntityFilter used in creating the export,
+   * otherwise a FAILED_PRECONDITION error will be returned. If no filter is
+   * specified then all entities from the export are imported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return Whether the entityFilter field is set. + */ + boolean hasEntityFilter(); + /** + * + * + *
+   * Optionally specify which kinds/namespaces are to be imported. If provided,
+   * the list must be a subset of the EntityFilter used in creating the export,
+   * otherwise a FAILED_PRECONDITION error will be returned. If no filter is
+   * specified then all entities from the export are imported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * + * @return The entityFilter. + */ + com.google.datastore.admin.v1.EntityFilter getEntityFilter(); + /** + * + * + *
+   * Optionally specify which kinds/namespaces are to be imported. If provided,
+   * the list must be a subset of the EntityFilter used in creating the export,
+   * otherwise a FAILED_PRECONDITION error will be returned. If no filter is
+   * specified then all entities from the export are imported.
+   * 
+ * + * .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + com.google.datastore.admin.v1.EntityFilterOrBuilder getEntityFilterOrBuilder(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/Index.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/Index.java new file mode 100644 index 000000000..582005f9e --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/Index.java @@ -0,0 +1,3265 @@ +/* + * 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/datastore/admin/v1/index.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * Datastore composite index definition.
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.Index} + */ +public final class Index extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.Index) + IndexOrBuilder { + private static final long serialVersionUID = 0L; + // Use Index.newBuilder() to construct. + private Index(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Index() { + projectId_ = ""; + indexId_ = ""; + kind_ = ""; + ancestor_ = 0; + properties_ = java.util.Collections.emptyList(); + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Index(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Index( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + indexId_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + kind_ = s; + break; + } + case 40: + { + int rawValue = input.readEnum(); + + ancestor_ = rawValue; + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + properties_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + properties_.add( + input.readMessage( + com.google.datastore.admin.v1.Index.IndexedProperty.parser(), + extensionRegistry)); + break; + } + case 56: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + properties_ = java.util.Collections.unmodifiableList(properties_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.IndexProto + .internal_static_google_datastore_admin_v1_Index_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.IndexProto + .internal_static_google_datastore_admin_v1_Index_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.Index.class, + com.google.datastore.admin.v1.Index.Builder.class); + } + + /** + * + * + *
+   * For an ordered index, specifies whether each of the entity's ancestors
+   * will be included.
+   * 
+ * + * Protobuf enum {@code google.datastore.admin.v1.Index.AncestorMode} + */ + public enum AncestorMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The ancestor mode is unspecified.
+     * 
+ * + * ANCESTOR_MODE_UNSPECIFIED = 0; + */ + ANCESTOR_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Do not include the entity's ancestors in the index.
+     * 
+ * + * NONE = 1; + */ + NONE(1), + /** + * + * + *
+     * Include all the entity's ancestors in the index.
+     * 
+ * + * ALL_ANCESTORS = 2; + */ + ALL_ANCESTORS(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The ancestor mode is unspecified.
+     * 
+ * + * ANCESTOR_MODE_UNSPECIFIED = 0; + */ + public static final int ANCESTOR_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Do not include the entity's ancestors in the index.
+     * 
+ * + * NONE = 1; + */ + public static final int NONE_VALUE = 1; + /** + * + * + *
+     * Include all the entity's ancestors in the index.
+     * 
+ * + * ALL_ANCESTORS = 2; + */ + public static final int ALL_ANCESTORS_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AncestorMode 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 AncestorMode forNumber(int value) { + switch (value) { + case 0: + return ANCESTOR_MODE_UNSPECIFIED; + case 1: + return NONE; + case 2: + return ALL_ANCESTORS; + 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 AncestorMode findValueByNumber(int number) { + return AncestorMode.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.datastore.admin.v1.Index.getDescriptor().getEnumTypes().get(0); + } + + private static final AncestorMode[] VALUES = values(); + + public static AncestorMode 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 AncestorMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.datastore.admin.v1.Index.AncestorMode) + } + + /** + * + * + *
+   * The direction determines how a property is indexed.
+   * 
+ * + * Protobuf enum {@code google.datastore.admin.v1.Index.Direction} + */ + public enum Direction implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The direction is unspecified.
+     * 
+ * + * DIRECTION_UNSPECIFIED = 0; + */ + DIRECTION_UNSPECIFIED(0), + /** + * + * + *
+     * The property's values are indexed so as to support sequencing in
+     * ascending order and also query by <, >, <=, >=, and =.
+     * 
+ * + * ASCENDING = 1; + */ + ASCENDING(1), + /** + * + * + *
+     * The property's values are indexed so as to support sequencing in
+     * descending order and also query by <, >, <=, >=, and =.
+     * 
+ * + * DESCENDING = 2; + */ + DESCENDING(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The direction is unspecified.
+     * 
+ * + * DIRECTION_UNSPECIFIED = 0; + */ + public static final int DIRECTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The property's values are indexed so as to support sequencing in
+     * ascending order and also query by <, >, <=, >=, and =.
+     * 
+ * + * ASCENDING = 1; + */ + public static final int ASCENDING_VALUE = 1; + /** + * + * + *
+     * The property's values are indexed so as to support sequencing in
+     * descending order and also query by <, >, <=, >=, and =.
+     * 
+ * + * DESCENDING = 2; + */ + public static final int DESCENDING_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Direction 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 Direction forNumber(int value) { + switch (value) { + case 0: + return DIRECTION_UNSPECIFIED; + case 1: + return ASCENDING; + case 2: + return DESCENDING; + 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 Direction findValueByNumber(int number) { + return Direction.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.datastore.admin.v1.Index.getDescriptor().getEnumTypes().get(1); + } + + private static final Direction[] VALUES = values(); + + public static Direction 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 Direction(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.datastore.admin.v1.Index.Direction) + } + + /** + * + * + *
+   * The possible set of states of an index.
+   * 
+ * + * Protobuf enum {@code google.datastore.admin.v1.Index.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The state is unspecified.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The index is being created, and cannot be used by queries.
+     * There is an active long-running operation for the index.
+     * The index is updated when writing an entity.
+     * Some index data may exist.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * The index is ready to be used.
+     * The index is updated when writing an entity.
+     * The index is fully populated from all stored entities it applies to.
+     * 
+ * + * READY = 2; + */ + READY(2), + /** + * + * + *
+     * The index is being deleted, and cannot be used by queries.
+     * There is an active long-running operation for the index.
+     * The index is not updated when writing an entity.
+     * Some index data may exist.
+     * 
+ * + * DELETING = 3; + */ + DELETING(3), + /** + * + * + *
+     * The index was being created or deleted, but something went wrong.
+     * The index cannot by used by queries.
+     * There is no active long-running operation for the index,
+     * and the most recently finished long-running operation failed.
+     * The index is not updated when writing an entity.
+     * Some index data may exist.
+     * 
+ * + * ERROR = 4; + */ + ERROR(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The state is unspecified.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The index is being created, and cannot be used by queries.
+     * There is an active long-running operation for the index.
+     * The index is updated when writing an entity.
+     * Some index data may exist.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * The index is ready to be used.
+     * The index is updated when writing an entity.
+     * The index is fully populated from all stored entities it applies to.
+     * 
+ * + * READY = 2; + */ + public static final int READY_VALUE = 2; + /** + * + * + *
+     * The index is being deleted, and cannot be used by queries.
+     * There is an active long-running operation for the index.
+     * The index is not updated when writing an entity.
+     * Some index data may exist.
+     * 
+ * + * DELETING = 3; + */ + public static final int DELETING_VALUE = 3; + /** + * + * + *
+     * The index was being created or deleted, but something went wrong.
+     * The index cannot by used by queries.
+     * There is no active long-running operation for the index,
+     * and the most recently finished long-running operation failed.
+     * The index is not updated when writing an entity.
+     * Some index data may exist.
+     * 
+ * + * ERROR = 4; + */ + public static final int ERROR_VALUE = 4; + + 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 CREATING; + case 2: + return READY; + case 3: + return DELETING; + case 4: + return ERROR; + 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.datastore.admin.v1.Index.getDescriptor().getEnumTypes().get(2); + } + + 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.datastore.admin.v1.Index.State) + } + + public interface IndexedPropertyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.Index.IndexedProperty) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The property name to index.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * Required. The property name to index.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * Required. The indexed property's direction.  Must not be DIRECTION_UNSPECIFIED.
+     * 
+ * + * + * .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for direction. + */ + int getDirectionValue(); + /** + * + * + *
+     * Required. The indexed property's direction.  Must not be DIRECTION_UNSPECIFIED.
+     * 
+ * + * + * .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The direction. + */ + com.google.datastore.admin.v1.Index.Direction getDirection(); + } + /** + * + * + *
+   * A property of an index.
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.Index.IndexedProperty} + */ + public static final class IndexedProperty extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.Index.IndexedProperty) + IndexedPropertyOrBuilder { + private static final long serialVersionUID = 0L; + // Use IndexedProperty.newBuilder() to construct. + private IndexedProperty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IndexedProperty() { + name_ = ""; + direction_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IndexedProperty(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private IndexedProperty( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + direction_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.IndexProto + .internal_static_google_datastore_admin_v1_Index_IndexedProperty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.IndexProto + .internal_static_google_datastore_admin_v1_Index_IndexedProperty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.Index.IndexedProperty.class, + com.google.datastore.admin.v1.Index.IndexedProperty.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+     * Required. The property name to index.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 property name to index.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 DIRECTION_FIELD_NUMBER = 2; + private int direction_; + /** + * + * + *
+     * Required. The indexed property's direction.  Must not be DIRECTION_UNSPECIFIED.
+     * 
+ * + * + * .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for direction. + */ + @java.lang.Override + public int getDirectionValue() { + return direction_; + } + /** + * + * + *
+     * Required. The indexed property's direction.  Must not be DIRECTION_UNSPECIFIED.
+     * 
+ * + * + * .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The direction. + */ + @java.lang.Override + public com.google.datastore.admin.v1.Index.Direction getDirection() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.Index.Direction result = + com.google.datastore.admin.v1.Index.Direction.valueOf(direction_); + return result == null ? com.google.datastore.admin.v1.Index.Direction.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 (direction_ + != com.google.datastore.admin.v1.Index.Direction.DIRECTION_UNSPECIFIED.getNumber()) { + output.writeEnum(2, direction_); + } + unknownFields.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 (direction_ + != com.google.datastore.admin.v1.Index.Direction.DIRECTION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, direction_); + } + size += unknownFields.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.datastore.admin.v1.Index.IndexedProperty)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.Index.IndexedProperty other = + (com.google.datastore.admin.v1.Index.IndexedProperty) obj; + + if (!getName().equals(other.getName())) return false; + if (direction_ != other.direction_) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + DIRECTION_FIELD_NUMBER; + hash = (53 * hash) + direction_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.Index.IndexedProperty parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.Index.IndexedProperty parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.Index.IndexedProperty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.Index.IndexedProperty 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.datastore.admin.v1.Index.IndexedProperty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.Index.IndexedProperty parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.Index.IndexedProperty parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.Index.IndexedProperty 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.datastore.admin.v1.Index.IndexedProperty parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.Index.IndexedProperty 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.datastore.admin.v1.Index.IndexedProperty parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.Index.IndexedProperty 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.datastore.admin.v1.Index.IndexedProperty 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 property of an index.
+     * 
+ * + * Protobuf type {@code google.datastore.admin.v1.Index.IndexedProperty} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.Index.IndexedProperty) + com.google.datastore.admin.v1.Index.IndexedPropertyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.IndexProto + .internal_static_google_datastore_admin_v1_Index_IndexedProperty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.IndexProto + .internal_static_google_datastore_admin_v1_Index_IndexedProperty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.Index.IndexedProperty.class, + com.google.datastore.admin.v1.Index.IndexedProperty.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.Index.IndexedProperty.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + direction_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.IndexProto + .internal_static_google_datastore_admin_v1_Index_IndexedProperty_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.Index.IndexedProperty getDefaultInstanceForType() { + return com.google.datastore.admin.v1.Index.IndexedProperty.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.Index.IndexedProperty build() { + com.google.datastore.admin.v1.Index.IndexedProperty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.Index.IndexedProperty buildPartial() { + com.google.datastore.admin.v1.Index.IndexedProperty result = + new com.google.datastore.admin.v1.Index.IndexedProperty(this); + result.name_ = name_; + result.direction_ = direction_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.Index.IndexedProperty) { + return mergeFrom((com.google.datastore.admin.v1.Index.IndexedProperty) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.Index.IndexedProperty other) { + if (other == com.google.datastore.admin.v1.Index.IndexedProperty.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.direction_ != 0) { + setDirectionValue(other.getDirectionValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.Index.IndexedProperty parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.datastore.admin.v1.Index.IndexedProperty) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * Required. The property name to index.
+       * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 property name to index.
+       * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 property name to index.
+       * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The property name to index.
+       * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The property name to index.
+       * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + onChanged(); + return this; + } + + private int direction_ = 0; + /** + * + * + *
+       * Required. The indexed property's direction.  Must not be DIRECTION_UNSPECIFIED.
+       * 
+ * + * + * .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for direction. + */ + @java.lang.Override + public int getDirectionValue() { + return direction_; + } + /** + * + * + *
+       * Required. The indexed property's direction.  Must not be DIRECTION_UNSPECIFIED.
+       * 
+ * + * + * .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for direction to set. + * @return This builder for chaining. + */ + public Builder setDirectionValue(int value) { + + direction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The indexed property's direction.  Must not be DIRECTION_UNSPECIFIED.
+       * 
+ * + * + * .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The direction. + */ + @java.lang.Override + public com.google.datastore.admin.v1.Index.Direction getDirection() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.Index.Direction result = + com.google.datastore.admin.v1.Index.Direction.valueOf(direction_); + return result == null ? com.google.datastore.admin.v1.Index.Direction.UNRECOGNIZED : result; + } + /** + * + * + *
+       * Required. The indexed property's direction.  Must not be DIRECTION_UNSPECIFIED.
+       * 
+ * + * + * .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The direction to set. + * @return This builder for chaining. + */ + public Builder setDirection(com.google.datastore.admin.v1.Index.Direction value) { + if (value == null) { + throw new NullPointerException(); + } + + direction_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The indexed property's direction.  Must not be DIRECTION_UNSPECIFIED.
+       * 
+ * + * + * .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearDirection() { + + direction_ = 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.datastore.admin.v1.Index.IndexedProperty) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.Index.IndexedProperty) + private static final com.google.datastore.admin.v1.Index.IndexedProperty DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.Index.IndexedProperty(); + } + + public static com.google.datastore.admin.v1.Index.IndexedProperty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IndexedProperty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IndexedProperty(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.Index.IndexedProperty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int PROJECT_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * Output only. Project ID.
+   * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + 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(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Project ID.
+   * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDEX_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object indexId_; + /** + * + * + *
+   * Output only. The resource ID of the index.
+   * 
+ * + * string index_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The indexId. + */ + @java.lang.Override + public java.lang.String getIndexId() { + java.lang.Object ref = indexId_; + 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(); + indexId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource ID of the index.
+   * 
+ * + * string index_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for indexId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIndexIdBytes() { + java.lang.Object ref = indexId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + indexId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 4; + private volatile java.lang.Object kind_; + /** + * + * + *
+   * Required. The entity kind to which this index applies.
+   * 
+ * + * string kind = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + 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(); + kind_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The entity kind to which this index applies.
+   * 
+ * + * string kind = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANCESTOR_FIELD_NUMBER = 5; + private int ancestor_; + /** + * + * + *
+   * Required. The index's ancestor mode.  Must not be ANCESTOR_MODE_UNSPECIFIED.
+   * 
+ * + * + * .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for ancestor. + */ + @java.lang.Override + public int getAncestorValue() { + return ancestor_; + } + /** + * + * + *
+   * Required. The index's ancestor mode.  Must not be ANCESTOR_MODE_UNSPECIFIED.
+   * 
+ * + * + * .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The ancestor. + */ + @java.lang.Override + public com.google.datastore.admin.v1.Index.AncestorMode getAncestor() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.Index.AncestorMode result = + com.google.datastore.admin.v1.Index.AncestorMode.valueOf(ancestor_); + return result == null ? com.google.datastore.admin.v1.Index.AncestorMode.UNRECOGNIZED : result; + } + + public static final int PROPERTIES_FIELD_NUMBER = 6; + private java.util.List properties_; + /** + * + * + *
+   * Required. An ordered sequence of property names and their index attributes.
+   * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getPropertiesList() { + return properties_; + } + /** + * + * + *
+   * Required. An ordered sequence of property names and their index attributes.
+   * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getPropertiesOrBuilderList() { + return properties_; + } + /** + * + * + *
+   * Required. An ordered sequence of property names and their index attributes.
+   * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getPropertiesCount() { + return properties_.size(); + } + /** + * + * + *
+   * Required. An ordered sequence of property names and their index attributes.
+   * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.datastore.admin.v1.Index.IndexedProperty getProperties(int index) { + return properties_.get(index); + } + /** + * + * + *
+   * Required. An ordered sequence of property names and their index attributes.
+   * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.datastore.admin.v1.Index.IndexedPropertyOrBuilder getPropertiesOrBuilder( + int index) { + return properties_.get(index); + } + + public static final int STATE_FIELD_NUMBER = 7; + private int state_; + /** + * + * + *
+   * Output only. The state of the index.
+   * 
+ * + * + * .google.datastore.admin.v1.Index.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The state of the index.
+   * 
+ * + * + * .google.datastore.admin.v1.Index.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.datastore.admin.v1.Index.State getState() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.Index.State result = + com.google.datastore.admin.v1.Index.State.valueOf(state_); + return result == null ? com.google.datastore.admin.v1.Index.State.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(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(indexId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, indexId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, kind_); + } + if (ancestor_ + != com.google.datastore.admin.v1.Index.AncestorMode.ANCESTOR_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, ancestor_); + } + for (int i = 0; i < properties_.size(); i++) { + output.writeMessage(6, properties_.get(i)); + } + if (state_ != com.google.datastore.admin.v1.Index.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(7, state_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(indexId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, indexId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, kind_); + } + if (ancestor_ + != com.google.datastore.admin.v1.Index.AncestorMode.ANCESTOR_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, ancestor_); + } + for (int i = 0; i < properties_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, properties_.get(i)); + } + if (state_ != com.google.datastore.admin.v1.Index.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, state_); + } + size += unknownFields.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.datastore.admin.v1.Index)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.Index other = (com.google.datastore.admin.v1.Index) obj; + + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getIndexId().equals(other.getIndexId())) return false; + if (!getKind().equals(other.getKind())) return false; + if (ancestor_ != other.ancestor_) return false; + if (!getPropertiesList().equals(other.getPropertiesList())) return false; + if (state_ != other.state_) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + INDEX_ID_FIELD_NUMBER; + hash = (53 * hash) + getIndexId().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + ANCESTOR_FIELD_NUMBER; + hash = (53 * hash) + ancestor_; + if (getPropertiesCount() > 0) { + hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + getPropertiesList().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.Index parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.Index parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.Index parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.Index 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.datastore.admin.v1.Index parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.Index parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.Index parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.Index 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.datastore.admin.v1.Index parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.Index 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.datastore.admin.v1.Index parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.Index 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.datastore.admin.v1.Index 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; + } + /** + * + * + *
+   * Datastore composite index definition.
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.Index} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.Index) + com.google.datastore.admin.v1.IndexOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.IndexProto + .internal_static_google_datastore_admin_v1_Index_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.IndexProto + .internal_static_google_datastore_admin_v1_Index_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.Index.class, + com.google.datastore.admin.v1.Index.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.Index.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPropertiesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + projectId_ = ""; + + indexId_ = ""; + + kind_ = ""; + + ancestor_ = 0; + + if (propertiesBuilder_ == null) { + properties_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + propertiesBuilder_.clear(); + } + state_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.IndexProto + .internal_static_google_datastore_admin_v1_Index_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.Index getDefaultInstanceForType() { + return com.google.datastore.admin.v1.Index.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.Index build() { + com.google.datastore.admin.v1.Index result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.Index buildPartial() { + com.google.datastore.admin.v1.Index result = new com.google.datastore.admin.v1.Index(this); + int from_bitField0_ = bitField0_; + result.projectId_ = projectId_; + result.indexId_ = indexId_; + result.kind_ = kind_; + result.ancestor_ = ancestor_; + if (propertiesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + properties_ = java.util.Collections.unmodifiableList(properties_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.properties_ = properties_; + } else { + result.properties_ = propertiesBuilder_.build(); + } + result.state_ = state_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.Index) { + return mergeFrom((com.google.datastore.admin.v1.Index) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.Index other) { + if (other == com.google.datastore.admin.v1.Index.getDefaultInstance()) return this; + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (!other.getIndexId().isEmpty()) { + indexId_ = other.indexId_; + onChanged(); + } + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + onChanged(); + } + if (other.ancestor_ != 0) { + setAncestorValue(other.getAncestorValue()); + } + if (propertiesBuilder_ == null) { + if (!other.properties_.isEmpty()) { + if (properties_.isEmpty()) { + properties_ = other.properties_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePropertiesIsMutable(); + properties_.addAll(other.properties_); + } + onChanged(); + } + } else { + if (!other.properties_.isEmpty()) { + if (propertiesBuilder_.isEmpty()) { + propertiesBuilder_.dispose(); + propertiesBuilder_ = null; + properties_ = other.properties_; + bitField0_ = (bitField0_ & ~0x00000001); + propertiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPropertiesFieldBuilder() + : null; + } else { + propertiesBuilder_.addAllMessages(other.properties_); + } + } + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.Index parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.datastore.admin.v1.Index) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Output only. Project ID.
+     * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Project ID.
+     * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Project ID.
+     * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Project ID.
+     * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Project ID.
+     * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.lang.Object indexId_ = ""; + /** + * + * + *
+     * Output only. The resource ID of the index.
+     * 
+ * + * string index_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The indexId. + */ + public java.lang.String getIndexId() { + java.lang.Object ref = indexId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + indexId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource ID of the index.
+     * 
+ * + * string index_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for indexId. + */ + public com.google.protobuf.ByteString getIndexIdBytes() { + java.lang.Object ref = indexId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + indexId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource ID of the index.
+     * 
+ * + * string index_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The indexId to set. + * @return This builder for chaining. + */ + public Builder setIndexId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + indexId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource ID of the index.
+     * 
+ * + * string index_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearIndexId() { + + indexId_ = getDefaultInstance().getIndexId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource ID of the index.
+     * 
+ * + * string index_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for indexId to set. + * @return This builder for chaining. + */ + public Builder setIndexIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + indexId_ = value; + onChanged(); + return this; + } + + private java.lang.Object kind_ = ""; + /** + * + * + *
+     * Required. The entity kind to which this index applies.
+     * 
+ * + * string kind = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The entity kind to which this index applies.
+     * 
+ * + * string kind = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The entity kind to which this index applies.
+     * 
+ * + * string kind = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kind_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The entity kind to which this index applies.
+     * 
+ * + * string kind = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearKind() { + + kind_ = getDefaultInstance().getKind(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The entity kind to which this index applies.
+     * 
+ * + * string kind = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kind_ = value; + onChanged(); + return this; + } + + private int ancestor_ = 0; + /** + * + * + *
+     * Required. The index's ancestor mode.  Must not be ANCESTOR_MODE_UNSPECIFIED.
+     * 
+ * + * + * .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for ancestor. + */ + @java.lang.Override + public int getAncestorValue() { + return ancestor_; + } + /** + * + * + *
+     * Required. The index's ancestor mode.  Must not be ANCESTOR_MODE_UNSPECIFIED.
+     * 
+ * + * + * .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for ancestor to set. + * @return This builder for chaining. + */ + public Builder setAncestorValue(int value) { + + ancestor_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The index's ancestor mode.  Must not be ANCESTOR_MODE_UNSPECIFIED.
+     * 
+ * + * + * .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The ancestor. + */ + @java.lang.Override + public com.google.datastore.admin.v1.Index.AncestorMode getAncestor() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.Index.AncestorMode result = + com.google.datastore.admin.v1.Index.AncestorMode.valueOf(ancestor_); + return result == null + ? com.google.datastore.admin.v1.Index.AncestorMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The index's ancestor mode.  Must not be ANCESTOR_MODE_UNSPECIFIED.
+     * 
+ * + * + * .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The ancestor to set. + * @return This builder for chaining. + */ + public Builder setAncestor(com.google.datastore.admin.v1.Index.AncestorMode value) { + if (value == null) { + throw new NullPointerException(); + } + + ancestor_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The index's ancestor mode.  Must not be ANCESTOR_MODE_UNSPECIFIED.
+     * 
+ * + * + * .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearAncestor() { + + ancestor_ = 0; + onChanged(); + return this; + } + + private java.util.List properties_ = + java.util.Collections.emptyList(); + + private void ensurePropertiesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + properties_ = + new java.util.ArrayList( + properties_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.datastore.admin.v1.Index.IndexedProperty, + com.google.datastore.admin.v1.Index.IndexedProperty.Builder, + com.google.datastore.admin.v1.Index.IndexedPropertyOrBuilder> + propertiesBuilder_; + + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getPropertiesList() { + if (propertiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(properties_); + } else { + return propertiesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getPropertiesCount() { + if (propertiesBuilder_ == null) { + return properties_.size(); + } else { + return propertiesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.datastore.admin.v1.Index.IndexedProperty getProperties(int index) { + if (propertiesBuilder_ == null) { + return properties_.get(index); + } else { + return propertiesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProperties( + int index, com.google.datastore.admin.v1.Index.IndexedProperty value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.set(index, value); + onChanged(); + } else { + propertiesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProperties( + int index, com.google.datastore.admin.v1.Index.IndexedProperty.Builder builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.set(index, builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addProperties(com.google.datastore.admin.v1.Index.IndexedProperty value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.add(value); + onChanged(); + } else { + propertiesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addProperties( + int index, com.google.datastore.admin.v1.Index.IndexedProperty value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.add(index, value); + onChanged(); + } else { + propertiesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addProperties( + com.google.datastore.admin.v1.Index.IndexedProperty.Builder builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addProperties( + int index, com.google.datastore.admin.v1.Index.IndexedProperty.Builder builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(index, builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllProperties( + java.lang.Iterable values) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, properties_); + onChanged(); + } else { + propertiesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearProperties() { + if (propertiesBuilder_ == null) { + properties_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + propertiesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeProperties(int index) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.remove(index); + onChanged(); + } else { + propertiesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.datastore.admin.v1.Index.IndexedProperty.Builder getPropertiesBuilder( + int index) { + return getPropertiesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.datastore.admin.v1.Index.IndexedPropertyOrBuilder getPropertiesOrBuilder( + int index) { + if (propertiesBuilder_ == null) { + return properties_.get(index); + } else { + return propertiesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPropertiesOrBuilderList() { + if (propertiesBuilder_ != null) { + return propertiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(properties_); + } + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.datastore.admin.v1.Index.IndexedProperty.Builder addPropertiesBuilder() { + return getPropertiesFieldBuilder() + .addBuilder(com.google.datastore.admin.v1.Index.IndexedProperty.getDefaultInstance()); + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.datastore.admin.v1.Index.IndexedProperty.Builder addPropertiesBuilder( + int index) { + return getPropertiesFieldBuilder() + .addBuilder( + index, com.google.datastore.admin.v1.Index.IndexedProperty.getDefaultInstance()); + } + /** + * + * + *
+     * Required. An ordered sequence of property names and their index attributes.
+     * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPropertiesBuilderList() { + return getPropertiesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.datastore.admin.v1.Index.IndexedProperty, + com.google.datastore.admin.v1.Index.IndexedProperty.Builder, + com.google.datastore.admin.v1.Index.IndexedPropertyOrBuilder> + getPropertiesFieldBuilder() { + if (propertiesBuilder_ == null) { + propertiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.datastore.admin.v1.Index.IndexedProperty, + com.google.datastore.admin.v1.Index.IndexedProperty.Builder, + com.google.datastore.admin.v1.Index.IndexedPropertyOrBuilder>( + properties_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + properties_ = null; + } + return propertiesBuilder_; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The state of the index.
+     * 
+ * + * + * .google.datastore.admin.v1.Index.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The state of the index.
+     * 
+ * + * + * .google.datastore.admin.v1.Index.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The state of the index.
+     * 
+ * + * + * .google.datastore.admin.v1.Index.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.datastore.admin.v1.Index.State getState() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.Index.State result = + com.google.datastore.admin.v1.Index.State.valueOf(state_); + return result == null ? com.google.datastore.admin.v1.Index.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The state of the index.
+     * 
+ * + * + * .google.datastore.admin.v1.Index.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.datastore.admin.v1.Index.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The state of the index.
+     * 
+ * + * + * .google.datastore.admin.v1.Index.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 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.datastore.admin.v1.Index) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.Index) + private static final com.google.datastore.admin.v1.Index DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.Index(); + } + + public static com.google.datastore.admin.v1.Index getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Index parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Index(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.Index getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/IndexOperationMetadata.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/IndexOperationMetadata.java new file mode 100644 index 000000000..3ec19e578 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/IndexOperationMetadata.java @@ -0,0 +1,1191 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * Metadata for Index operations.
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.IndexOperationMetadata} + */ +public final class IndexOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.IndexOperationMetadata) + IndexOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use IndexOperationMetadata.newBuilder() to construct. + private IndexOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IndexOperationMetadata() { + indexId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IndexOperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private IndexOperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.datastore.admin.v1.CommonMetadata.Builder subBuilder = null; + if (common_ != null) { + subBuilder = common_.toBuilder(); + } + common_ = + input.readMessage( + com.google.datastore.admin.v1.CommonMetadata.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(common_); + common_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.datastore.admin.v1.Progress.Builder subBuilder = null; + if (progressEntities_ != null) { + subBuilder = progressEntities_.toBuilder(); + } + progressEntities_ = + input.readMessage( + com.google.datastore.admin.v1.Progress.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progressEntities_); + progressEntities_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + indexId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_IndexOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_IndexOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.IndexOperationMetadata.class, + com.google.datastore.admin.v1.IndexOperationMetadata.Builder.class); + } + + public static final int COMMON_FIELD_NUMBER = 1; + private com.google.datastore.admin.v1.CommonMetadata common_; + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return Whether the common field is set. + */ + @java.lang.Override + public boolean hasCommon() { + return common_ != null; + } + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return The common. + */ + @java.lang.Override + public com.google.datastore.admin.v1.CommonMetadata getCommon() { + return common_ == null + ? com.google.datastore.admin.v1.CommonMetadata.getDefaultInstance() + : common_; + } + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + @java.lang.Override + public com.google.datastore.admin.v1.CommonMetadataOrBuilder getCommonOrBuilder() { + return getCommon(); + } + + public static final int PROGRESS_ENTITIES_FIELD_NUMBER = 2; + private com.google.datastore.admin.v1.Progress progressEntities_; + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return Whether the progressEntities field is set. + */ + @java.lang.Override + public boolean hasProgressEntities() { + return progressEntities_ != null; + } + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return The progressEntities. + */ + @java.lang.Override + public com.google.datastore.admin.v1.Progress getProgressEntities() { + return progressEntities_ == null + ? com.google.datastore.admin.v1.Progress.getDefaultInstance() + : progressEntities_; + } + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + @java.lang.Override + public com.google.datastore.admin.v1.ProgressOrBuilder getProgressEntitiesOrBuilder() { + return getProgressEntities(); + } + + public static final int INDEX_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object indexId_; + /** + * + * + *
+   * The index resource ID that this operation is acting on.
+   * 
+ * + * string index_id = 3; + * + * @return The indexId. + */ + @java.lang.Override + public java.lang.String getIndexId() { + java.lang.Object ref = indexId_; + 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(); + indexId_ = s; + return s; + } + } + /** + * + * + *
+   * The index resource ID that this operation is acting on.
+   * 
+ * + * string index_id = 3; + * + * @return The bytes for indexId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIndexIdBytes() { + java.lang.Object ref = indexId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + indexId_ = 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 (common_ != null) { + output.writeMessage(1, getCommon()); + } + if (progressEntities_ != null) { + output.writeMessage(2, getProgressEntities()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(indexId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, indexId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (common_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommon()); + } + if (progressEntities_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProgressEntities()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(indexId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, indexId_); + } + size += unknownFields.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.datastore.admin.v1.IndexOperationMetadata)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.IndexOperationMetadata other = + (com.google.datastore.admin.v1.IndexOperationMetadata) obj; + + if (hasCommon() != other.hasCommon()) return false; + if (hasCommon()) { + if (!getCommon().equals(other.getCommon())) return false; + } + if (hasProgressEntities() != other.hasProgressEntities()) return false; + if (hasProgressEntities()) { + if (!getProgressEntities().equals(other.getProgressEntities())) return false; + } + if (!getIndexId().equals(other.getIndexId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCommon()) { + hash = (37 * hash) + COMMON_FIELD_NUMBER; + hash = (53 * hash) + getCommon().hashCode(); + } + if (hasProgressEntities()) { + hash = (37 * hash) + PROGRESS_ENTITIES_FIELD_NUMBER; + hash = (53 * hash) + getProgressEntities().hashCode(); + } + hash = (37 * hash) + INDEX_ID_FIELD_NUMBER; + hash = (53 * hash) + getIndexId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.IndexOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.IndexOperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.IndexOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.IndexOperationMetadata 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.datastore.admin.v1.IndexOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.IndexOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.IndexOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.IndexOperationMetadata 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.datastore.admin.v1.IndexOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.IndexOperationMetadata 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.datastore.admin.v1.IndexOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.IndexOperationMetadata 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.datastore.admin.v1.IndexOperationMetadata 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; + } + /** + * + * + *
+   * Metadata for Index operations.
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.IndexOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.IndexOperationMetadata) + com.google.datastore.admin.v1.IndexOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_IndexOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_IndexOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.IndexOperationMetadata.class, + com.google.datastore.admin.v1.IndexOperationMetadata.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.IndexOperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (commonBuilder_ == null) { + common_ = null; + } else { + common_ = null; + commonBuilder_ = null; + } + if (progressEntitiesBuilder_ == null) { + progressEntities_ = null; + } else { + progressEntities_ = null; + progressEntitiesBuilder_ = null; + } + indexId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_IndexOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.IndexOperationMetadata getDefaultInstanceForType() { + return com.google.datastore.admin.v1.IndexOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.IndexOperationMetadata build() { + com.google.datastore.admin.v1.IndexOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.IndexOperationMetadata buildPartial() { + com.google.datastore.admin.v1.IndexOperationMetadata result = + new com.google.datastore.admin.v1.IndexOperationMetadata(this); + if (commonBuilder_ == null) { + result.common_ = common_; + } else { + result.common_ = commonBuilder_.build(); + } + if (progressEntitiesBuilder_ == null) { + result.progressEntities_ = progressEntities_; + } else { + result.progressEntities_ = progressEntitiesBuilder_.build(); + } + result.indexId_ = indexId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.IndexOperationMetadata) { + return mergeFrom((com.google.datastore.admin.v1.IndexOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.IndexOperationMetadata other) { + if (other == com.google.datastore.admin.v1.IndexOperationMetadata.getDefaultInstance()) + return this; + if (other.hasCommon()) { + mergeCommon(other.getCommon()); + } + if (other.hasProgressEntities()) { + mergeProgressEntities(other.getProgressEntities()); + } + if (!other.getIndexId().isEmpty()) { + indexId_ = other.indexId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.IndexOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.datastore.admin.v1.IndexOperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.datastore.admin.v1.CommonMetadata common_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.CommonMetadata, + com.google.datastore.admin.v1.CommonMetadata.Builder, + com.google.datastore.admin.v1.CommonMetadataOrBuilder> + commonBuilder_; + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return Whether the common field is set. + */ + public boolean hasCommon() { + return commonBuilder_ != null || common_ != null; + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return The common. + */ + public com.google.datastore.admin.v1.CommonMetadata getCommon() { + if (commonBuilder_ == null) { + return common_ == null + ? com.google.datastore.admin.v1.CommonMetadata.getDefaultInstance() + : common_; + } else { + return commonBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public Builder setCommon(com.google.datastore.admin.v1.CommonMetadata value) { + if (commonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + common_ = value; + onChanged(); + } else { + commonBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public Builder setCommon(com.google.datastore.admin.v1.CommonMetadata.Builder builderForValue) { + if (commonBuilder_ == null) { + common_ = builderForValue.build(); + onChanged(); + } else { + commonBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public Builder mergeCommon(com.google.datastore.admin.v1.CommonMetadata value) { + if (commonBuilder_ == null) { + if (common_ != null) { + common_ = + com.google.datastore.admin.v1.CommonMetadata.newBuilder(common_) + .mergeFrom(value) + .buildPartial(); + } else { + common_ = value; + } + onChanged(); + } else { + commonBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public Builder clearCommon() { + if (commonBuilder_ == null) { + common_ = null; + onChanged(); + } else { + common_ = null; + commonBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public com.google.datastore.admin.v1.CommonMetadata.Builder getCommonBuilder() { + + onChanged(); + return getCommonFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + public com.google.datastore.admin.v1.CommonMetadataOrBuilder getCommonOrBuilder() { + if (commonBuilder_ != null) { + return commonBuilder_.getMessageOrBuilder(); + } else { + return common_ == null + ? com.google.datastore.admin.v1.CommonMetadata.getDefaultInstance() + : common_; + } + } + /** + * + * + *
+     * Metadata common to all Datastore Admin operations.
+     * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.CommonMetadata, + com.google.datastore.admin.v1.CommonMetadata.Builder, + com.google.datastore.admin.v1.CommonMetadataOrBuilder> + getCommonFieldBuilder() { + if (commonBuilder_ == null) { + commonBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.CommonMetadata, + com.google.datastore.admin.v1.CommonMetadata.Builder, + com.google.datastore.admin.v1.CommonMetadataOrBuilder>( + getCommon(), getParentForChildren(), isClean()); + common_ = null; + } + return commonBuilder_; + } + + private com.google.datastore.admin.v1.Progress progressEntities_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Progress, + com.google.datastore.admin.v1.Progress.Builder, + com.google.datastore.admin.v1.ProgressOrBuilder> + progressEntitiesBuilder_; + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return Whether the progressEntities field is set. + */ + public boolean hasProgressEntities() { + return progressEntitiesBuilder_ != null || progressEntities_ != null; + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return The progressEntities. + */ + public com.google.datastore.admin.v1.Progress getProgressEntities() { + if (progressEntitiesBuilder_ == null) { + return progressEntities_ == null + ? com.google.datastore.admin.v1.Progress.getDefaultInstance() + : progressEntities_; + } else { + return progressEntitiesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public Builder setProgressEntities(com.google.datastore.admin.v1.Progress value) { + if (progressEntitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progressEntities_ = value; + onChanged(); + } else { + progressEntitiesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public Builder setProgressEntities( + com.google.datastore.admin.v1.Progress.Builder builderForValue) { + if (progressEntitiesBuilder_ == null) { + progressEntities_ = builderForValue.build(); + onChanged(); + } else { + progressEntitiesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public Builder mergeProgressEntities(com.google.datastore.admin.v1.Progress value) { + if (progressEntitiesBuilder_ == null) { + if (progressEntities_ != null) { + progressEntities_ = + com.google.datastore.admin.v1.Progress.newBuilder(progressEntities_) + .mergeFrom(value) + .buildPartial(); + } else { + progressEntities_ = value; + } + onChanged(); + } else { + progressEntitiesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public Builder clearProgressEntities() { + if (progressEntitiesBuilder_ == null) { + progressEntities_ = null; + onChanged(); + } else { + progressEntities_ = null; + progressEntitiesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public com.google.datastore.admin.v1.Progress.Builder getProgressEntitiesBuilder() { + + onChanged(); + return getProgressEntitiesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + public com.google.datastore.admin.v1.ProgressOrBuilder getProgressEntitiesOrBuilder() { + if (progressEntitiesBuilder_ != null) { + return progressEntitiesBuilder_.getMessageOrBuilder(); + } else { + return progressEntities_ == null + ? com.google.datastore.admin.v1.Progress.getDefaultInstance() + : progressEntities_; + } + } + /** + * + * + *
+     * An estimate of the number of entities processed.
+     * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Progress, + com.google.datastore.admin.v1.Progress.Builder, + com.google.datastore.admin.v1.ProgressOrBuilder> + getProgressEntitiesFieldBuilder() { + if (progressEntitiesBuilder_ == null) { + progressEntitiesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.Progress, + com.google.datastore.admin.v1.Progress.Builder, + com.google.datastore.admin.v1.ProgressOrBuilder>( + getProgressEntities(), getParentForChildren(), isClean()); + progressEntities_ = null; + } + return progressEntitiesBuilder_; + } + + private java.lang.Object indexId_ = ""; + /** + * + * + *
+     * The index resource ID that this operation is acting on.
+     * 
+ * + * string index_id = 3; + * + * @return The indexId. + */ + public java.lang.String getIndexId() { + java.lang.Object ref = indexId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + indexId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The index resource ID that this operation is acting on.
+     * 
+ * + * string index_id = 3; + * + * @return The bytes for indexId. + */ + public com.google.protobuf.ByteString getIndexIdBytes() { + java.lang.Object ref = indexId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + indexId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The index resource ID that this operation is acting on.
+     * 
+ * + * string index_id = 3; + * + * @param value The indexId to set. + * @return This builder for chaining. + */ + public Builder setIndexId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + indexId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The index resource ID that this operation is acting on.
+     * 
+ * + * string index_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearIndexId() { + + indexId_ = getDefaultInstance().getIndexId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The index resource ID that this operation is acting on.
+     * 
+ * + * string index_id = 3; + * + * @param value The bytes for indexId to set. + * @return This builder for chaining. + */ + public Builder setIndexIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + indexId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.datastore.admin.v1.IndexOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.IndexOperationMetadata) + private static final com.google.datastore.admin.v1.IndexOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.IndexOperationMetadata(); + } + + public static com.google.datastore.admin.v1.IndexOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IndexOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IndexOperationMetadata(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.IndexOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/IndexOperationMetadataOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/IndexOperationMetadataOrBuilder.java new file mode 100644 index 000000000..9d655f967 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/IndexOperationMetadataOrBuilder.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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +public interface IndexOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.IndexOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return Whether the common field is set. + */ + boolean hasCommon(); + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + * + * @return The common. + */ + com.google.datastore.admin.v1.CommonMetadata getCommon(); + /** + * + * + *
+   * Metadata common to all Datastore Admin operations.
+   * 
+ * + * .google.datastore.admin.v1.CommonMetadata common = 1; + */ + com.google.datastore.admin.v1.CommonMetadataOrBuilder getCommonOrBuilder(); + + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return Whether the progressEntities field is set. + */ + boolean hasProgressEntities(); + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + * + * @return The progressEntities. + */ + com.google.datastore.admin.v1.Progress getProgressEntities(); + /** + * + * + *
+   * An estimate of the number of entities processed.
+   * 
+ * + * .google.datastore.admin.v1.Progress progress_entities = 2; + */ + com.google.datastore.admin.v1.ProgressOrBuilder getProgressEntitiesOrBuilder(); + + /** + * + * + *
+   * The index resource ID that this operation is acting on.
+   * 
+ * + * string index_id = 3; + * + * @return The indexId. + */ + java.lang.String getIndexId(); + /** + * + * + *
+   * The index resource ID that this operation is acting on.
+   * 
+ * + * string index_id = 3; + * + * @return The bytes for indexId. + */ + com.google.protobuf.ByteString getIndexIdBytes(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/IndexOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/IndexOrBuilder.java new file mode 100644 index 000000000..37fca791f --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/IndexOrBuilder.java @@ -0,0 +1,220 @@ +/* + * 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/datastore/admin/v1/index.proto + +package com.google.datastore.admin.v1; + +public interface IndexOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.Index) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Project ID.
+   * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Output only. Project ID.
+   * 
+ * + * string project_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Output only. The resource ID of the index.
+   * 
+ * + * string index_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The indexId. + */ + java.lang.String getIndexId(); + /** + * + * + *
+   * Output only. The resource ID of the index.
+   * 
+ * + * string index_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for indexId. + */ + com.google.protobuf.ByteString getIndexIdBytes(); + + /** + * + * + *
+   * Required. The entity kind to which this index applies.
+   * 
+ * + * string kind = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The kind. + */ + java.lang.String getKind(); + /** + * + * + *
+   * Required. The entity kind to which this index applies.
+   * 
+ * + * string kind = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for kind. + */ + com.google.protobuf.ByteString getKindBytes(); + + /** + * + * + *
+   * Required. The index's ancestor mode.  Must not be ANCESTOR_MODE_UNSPECIFIED.
+   * 
+ * + * + * .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for ancestor. + */ + int getAncestorValue(); + /** + * + * + *
+   * Required. The index's ancestor mode.  Must not be ANCESTOR_MODE_UNSPECIFIED.
+   * 
+ * + * + * .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The ancestor. + */ + com.google.datastore.admin.v1.Index.AncestorMode getAncestor(); + + /** + * + * + *
+   * Required. An ordered sequence of property names and their index attributes.
+   * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getPropertiesList(); + /** + * + * + *
+   * Required. An ordered sequence of property names and their index attributes.
+   * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.datastore.admin.v1.Index.IndexedProperty getProperties(int index); + /** + * + * + *
+   * Required. An ordered sequence of property names and their index attributes.
+   * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getPropertiesCount(); + /** + * + * + *
+   * Required. An ordered sequence of property names and their index attributes.
+   * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getPropertiesOrBuilderList(); + /** + * + * + *
+   * Required. An ordered sequence of property names and their index attributes.
+   * 
+ * + * + * repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.datastore.admin.v1.Index.IndexedPropertyOrBuilder getPropertiesOrBuilder(int index); + + /** + * + * + *
+   * Output only. The state of the index.
+   * 
+ * + * + * .google.datastore.admin.v1.Index.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The state of the index.
+   * 
+ * + * + * .google.datastore.admin.v1.Index.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.datastore.admin.v1.Index.State getState(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/IndexProto.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/IndexProto.java new file mode 100644 index 000000000..da3e67c5c --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/IndexProto.java @@ -0,0 +1,106 @@ +/* + * 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/datastore/admin/v1/index.proto + +package com.google.datastore.admin.v1; + +public final class IndexProto { + private IndexProto() {} + + 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_datastore_admin_v1_Index_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_Index_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_Index_IndexedProperty_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_Index_IndexedProperty_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/datastore/admin/v1/index.proto\022" + + "\031google.datastore.admin.v1\032\037google/api/f" + + "ield_behavior.proto\032\034google/api/annotati" + + "ons.proto\"\346\004\n\005Index\022\027\n\nproject_id\030\001 \001(\tB" + + "\003\340A\003\022\025\n\010index_id\030\003 \001(\tB\003\340A\003\022\021\n\004kind\030\004 \001(" + + "\tB\003\340A\002\022D\n\010ancestor\030\005 \001(\0162-.google.datast" + + "ore.admin.v1.Index.AncestorModeB\003\340A\002\022I\n\n" + + "properties\030\006 \003(\01320.google.datastore.admi" + + "n.v1.Index.IndexedPropertyB\003\340A\002\022:\n\005state" + + "\030\007 \001(\0162&.google.datastore.admin.v1.Index" + + ".StateB\003\340A\003\032h\n\017IndexedProperty\022\021\n\004name\030\001" + + " \001(\tB\003\340A\002\022B\n\tdirection\030\002 \001(\0162*.google.da" + + "tastore.admin.v1.Index.DirectionB\003\340A\002\"J\n" + + "\014AncestorMode\022\035\n\031ANCESTOR_MODE_UNSPECIFI" + + "ED\020\000\022\010\n\004NONE\020\001\022\021\n\rALL_ANCESTORS\020\002\"E\n\tDir" + + "ection\022\031\n\025DIRECTION_UNSPECIFIED\020\000\022\r\n\tASC" + + "ENDING\020\001\022\016\n\nDESCENDING\020\002\"P\n\005State\022\025\n\021STA" + + "TE_UNSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020" + + "\002\022\014\n\010DELETING\020\003\022\t\n\005ERROR\020\004B\327\001\n\035com.googl" + + "e.datastore.admin.v1B\nIndexProtoP\001Z>goog" + + "le.golang.org/genproto/googleapis/datast" + + "ore/admin/v1;admin\252\002\037Google.Cloud.Datast" + + "ore.Admin.V1\312\002\037Google\\Cloud\\Datastore\\Ad" + + "min\\V1\352\002#Google::Cloud::Datastore::Admin" + + "::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_datastore_admin_v1_Index_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_datastore_admin_v1_Index_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_Index_descriptor, + new java.lang.String[] { + "ProjectId", "IndexId", "Kind", "Ancestor", "Properties", "State", + }); + internal_static_google_datastore_admin_v1_Index_IndexedProperty_descriptor = + internal_static_google_datastore_admin_v1_Index_descriptor.getNestedTypes().get(0); + internal_static_google_datastore_admin_v1_Index_IndexedProperty_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_Index_IndexedProperty_descriptor, + new java.lang.String[] { + "Name", "Direction", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ListIndexesRequest.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ListIndexesRequest.java new file mode 100644 index 000000000..e9cb9a2fa --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ListIndexesRequest.java @@ -0,0 +1,1047 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * The request for
+ * [google.datastore.admin.v1.DatastoreAdmin.ListIndexes][google.datastore.admin.v1.DatastoreAdmin.ListIndexes].
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.ListIndexesRequest} + */ +public final class ListIndexesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.ListIndexesRequest) + ListIndexesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListIndexesRequest.newBuilder() to construct. + private ListIndexesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListIndexesRequest() { + projectId_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListIndexesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListIndexesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 32: + { + pageSize_ = input.readInt32(); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ListIndexesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ListIndexesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.ListIndexesRequest.class, + com.google.datastore.admin.v1.ListIndexesRequest.Builder.class); + } + + public static final int PROJECT_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * Project ID against which to make the request.
+   * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + 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(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * Project ID against which to make the request.
+   * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 3; + private volatile java.lang.Object filter_; + /** + * string filter = 3; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * string filter = 3; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_; + /** + * + * + *
+   * The maximum number of items to return.  If zero, then all results will be
+   * returned.
+   * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 5; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 5; + * + * @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 next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 5; + * + * @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(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pageToken_); + } + size += unknownFields.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.datastore.admin.v1.ListIndexesRequest)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.ListIndexesRequest other = + (com.google.datastore.admin.v1.ListIndexesRequest) obj; + + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.ListIndexesRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ListIndexesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.ListIndexesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ListIndexesRequest 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.datastore.admin.v1.ListIndexesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ListIndexesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.ListIndexesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ListIndexesRequest 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.datastore.admin.v1.ListIndexesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ListIndexesRequest 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.datastore.admin.v1.ListIndexesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ListIndexesRequest 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.datastore.admin.v1.ListIndexesRequest 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 request for
+   * [google.datastore.admin.v1.DatastoreAdmin.ListIndexes][google.datastore.admin.v1.DatastoreAdmin.ListIndexes].
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.ListIndexesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.ListIndexesRequest) + com.google.datastore.admin.v1.ListIndexesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ListIndexesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ListIndexesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.ListIndexesRequest.class, + com.google.datastore.admin.v1.ListIndexesRequest.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.ListIndexesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + projectId_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ListIndexesRequest_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.ListIndexesRequest getDefaultInstanceForType() { + return com.google.datastore.admin.v1.ListIndexesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.ListIndexesRequest build() { + com.google.datastore.admin.v1.ListIndexesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.ListIndexesRequest buildPartial() { + com.google.datastore.admin.v1.ListIndexesRequest result = + new com.google.datastore.admin.v1.ListIndexesRequest(this); + result.projectId_ = projectId_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.ListIndexesRequest) { + return mergeFrom((com.google.datastore.admin.v1.ListIndexesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.ListIndexesRequest other) { + if (other == com.google.datastore.admin.v1.ListIndexesRequest.getDefaultInstance()) + return this; + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.ListIndexesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.datastore.admin.v1.ListIndexesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Project ID against which to make the request.
+     * 
+ * + * string project_id = 1; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * string filter = 3; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string filter = 3; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string filter = 3; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * string filter = 3; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * string filter = 3; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of items to return.  If zero, then all results will be
+     * returned.
+     * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return.  If zero, then all results will be
+     * returned.
+     * 
+ * + * int32 page_size = 4; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of items to return.  If zero, then all results will be
+     * returned.
+     * 
+ * + * int32 page_size = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 5; + * + * @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 next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 5; + * + * @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 next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 5; + * + * @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; + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 5; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 5; + * + * @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; + 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.datastore.admin.v1.ListIndexesRequest) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.ListIndexesRequest) + private static final com.google.datastore.admin.v1.ListIndexesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.ListIndexesRequest(); + } + + public static com.google.datastore.admin.v1.ListIndexesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListIndexesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListIndexesRequest(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.ListIndexesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ListIndexesRequestOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ListIndexesRequestOrBuilder.java new file mode 100644 index 000000000..4fe56656a --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ListIndexesRequestOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +public interface ListIndexesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.ListIndexesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Project ID against which to make the request.
+   * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Project ID against which to make the request.
+   * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * string filter = 3; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * string filter = 3; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The maximum number of items to return.  If zero, then all results will be
+   * returned.
+   * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 5; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 5; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ListIndexesResponse.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ListIndexesResponse.java new file mode 100644 index 000000000..acf63df2c --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ListIndexesResponse.java @@ -0,0 +1,1129 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * The response for
+ * [google.datastore.admin.v1.DatastoreAdmin.ListIndexes][google.datastore.admin.v1.DatastoreAdmin.ListIndexes].
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.ListIndexesResponse} + */ +public final class ListIndexesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.ListIndexesResponse) + ListIndexesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListIndexesResponse.newBuilder() to construct. + private ListIndexesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListIndexesResponse() { + indexes_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListIndexesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListIndexesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + indexes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + indexes_.add( + input.readMessage( + com.google.datastore.admin.v1.Index.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + indexes_ = java.util.Collections.unmodifiableList(indexes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ListIndexesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ListIndexesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.ListIndexesResponse.class, + com.google.datastore.admin.v1.ListIndexesResponse.Builder.class); + } + + public static final int INDEXES_FIELD_NUMBER = 1; + private java.util.List indexes_; + /** + * + * + *
+   * The indexes.
+   * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + @java.lang.Override + public java.util.List getIndexesList() { + return indexes_; + } + /** + * + * + *
+   * The indexes.
+   * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + @java.lang.Override + public java.util.List + getIndexesOrBuilderList() { + return indexes_; + } + /** + * + * + *
+   * The indexes.
+   * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + @java.lang.Override + public int getIndexesCount() { + return indexes_.size(); + } + /** + * + * + *
+   * The indexes.
+   * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + @java.lang.Override + public com.google.datastore.admin.v1.Index getIndexes(int index) { + return indexes_.get(index); + } + /** + * + * + *
+   * The indexes.
+   * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + @java.lang.Override + public com.google.datastore.admin.v1.IndexOrBuilder getIndexesOrBuilder(int index) { + return indexes_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The standard List next-page token.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * The standard List next-page token.
+   * 
+ * + * 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 < indexes_.size(); i++) { + output.writeMessage(1, indexes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < indexes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, indexes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.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.datastore.admin.v1.ListIndexesResponse)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.ListIndexesResponse other = + (com.google.datastore.admin.v1.ListIndexesResponse) obj; + + if (!getIndexesList().equals(other.getIndexesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getIndexesCount() > 0) { + hash = (37 * hash) + INDEXES_FIELD_NUMBER; + hash = (53 * hash) + getIndexesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.ListIndexesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ListIndexesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.ListIndexesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ListIndexesResponse 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.datastore.admin.v1.ListIndexesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.ListIndexesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.ListIndexesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ListIndexesResponse 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.datastore.admin.v1.ListIndexesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ListIndexesResponse 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.datastore.admin.v1.ListIndexesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.ListIndexesResponse 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.datastore.admin.v1.ListIndexesResponse 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 response for
+   * [google.datastore.admin.v1.DatastoreAdmin.ListIndexes][google.datastore.admin.v1.DatastoreAdmin.ListIndexes].
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.ListIndexesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.ListIndexesResponse) + com.google.datastore.admin.v1.ListIndexesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ListIndexesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ListIndexesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.ListIndexesResponse.class, + com.google.datastore.admin.v1.ListIndexesResponse.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.ListIndexesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getIndexesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (indexesBuilder_ == null) { + indexes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + indexesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_ListIndexesResponse_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.ListIndexesResponse getDefaultInstanceForType() { + return com.google.datastore.admin.v1.ListIndexesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.ListIndexesResponse build() { + com.google.datastore.admin.v1.ListIndexesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.ListIndexesResponse buildPartial() { + com.google.datastore.admin.v1.ListIndexesResponse result = + new com.google.datastore.admin.v1.ListIndexesResponse(this); + int from_bitField0_ = bitField0_; + if (indexesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + indexes_ = java.util.Collections.unmodifiableList(indexes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.indexes_ = indexes_; + } else { + result.indexes_ = indexesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.ListIndexesResponse) { + return mergeFrom((com.google.datastore.admin.v1.ListIndexesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.ListIndexesResponse other) { + if (other == com.google.datastore.admin.v1.ListIndexesResponse.getDefaultInstance()) + return this; + if (indexesBuilder_ == null) { + if (!other.indexes_.isEmpty()) { + if (indexes_.isEmpty()) { + indexes_ = other.indexes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIndexesIsMutable(); + indexes_.addAll(other.indexes_); + } + onChanged(); + } + } else { + if (!other.indexes_.isEmpty()) { + if (indexesBuilder_.isEmpty()) { + indexesBuilder_.dispose(); + indexesBuilder_ = null; + indexes_ = other.indexes_; + bitField0_ = (bitField0_ & ~0x00000001); + indexesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIndexesFieldBuilder() + : null; + } else { + indexesBuilder_.addAllMessages(other.indexes_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.ListIndexesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.datastore.admin.v1.ListIndexesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List indexes_ = + java.util.Collections.emptyList(); + + private void ensureIndexesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + indexes_ = new java.util.ArrayList(indexes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.datastore.admin.v1.Index, + com.google.datastore.admin.v1.Index.Builder, + com.google.datastore.admin.v1.IndexOrBuilder> + indexesBuilder_; + + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public java.util.List getIndexesList() { + if (indexesBuilder_ == null) { + return java.util.Collections.unmodifiableList(indexes_); + } else { + return indexesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public int getIndexesCount() { + if (indexesBuilder_ == null) { + return indexes_.size(); + } else { + return indexesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public com.google.datastore.admin.v1.Index getIndexes(int index) { + if (indexesBuilder_ == null) { + return indexes_.get(index); + } else { + return indexesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public Builder setIndexes(int index, com.google.datastore.admin.v1.Index value) { + if (indexesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexesIsMutable(); + indexes_.set(index, value); + onChanged(); + } else { + indexesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public Builder setIndexes( + int index, com.google.datastore.admin.v1.Index.Builder builderForValue) { + if (indexesBuilder_ == null) { + ensureIndexesIsMutable(); + indexes_.set(index, builderForValue.build()); + onChanged(); + } else { + indexesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public Builder addIndexes(com.google.datastore.admin.v1.Index value) { + if (indexesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexesIsMutable(); + indexes_.add(value); + onChanged(); + } else { + indexesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public Builder addIndexes(int index, com.google.datastore.admin.v1.Index value) { + if (indexesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexesIsMutable(); + indexes_.add(index, value); + onChanged(); + } else { + indexesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public Builder addIndexes(com.google.datastore.admin.v1.Index.Builder builderForValue) { + if (indexesBuilder_ == null) { + ensureIndexesIsMutable(); + indexes_.add(builderForValue.build()); + onChanged(); + } else { + indexesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public Builder addIndexes( + int index, com.google.datastore.admin.v1.Index.Builder builderForValue) { + if (indexesBuilder_ == null) { + ensureIndexesIsMutable(); + indexes_.add(index, builderForValue.build()); + onChanged(); + } else { + indexesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public Builder addAllIndexes( + java.lang.Iterable values) { + if (indexesBuilder_ == null) { + ensureIndexesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, indexes_); + onChanged(); + } else { + indexesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public Builder clearIndexes() { + if (indexesBuilder_ == null) { + indexes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + indexesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public Builder removeIndexes(int index) { + if (indexesBuilder_ == null) { + ensureIndexesIsMutable(); + indexes_.remove(index); + onChanged(); + } else { + indexesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public com.google.datastore.admin.v1.Index.Builder getIndexesBuilder(int index) { + return getIndexesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public com.google.datastore.admin.v1.IndexOrBuilder getIndexesOrBuilder(int index) { + if (indexesBuilder_ == null) { + return indexes_.get(index); + } else { + return indexesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public java.util.List + getIndexesOrBuilderList() { + if (indexesBuilder_ != null) { + return indexesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(indexes_); + } + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public com.google.datastore.admin.v1.Index.Builder addIndexesBuilder() { + return getIndexesFieldBuilder() + .addBuilder(com.google.datastore.admin.v1.Index.getDefaultInstance()); + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public com.google.datastore.admin.v1.Index.Builder addIndexesBuilder(int index) { + return getIndexesFieldBuilder() + .addBuilder(index, com.google.datastore.admin.v1.Index.getDefaultInstance()); + } + /** + * + * + *
+     * The indexes.
+     * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + public java.util.List getIndexesBuilderList() { + return getIndexesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.datastore.admin.v1.Index, + com.google.datastore.admin.v1.Index.Builder, + com.google.datastore.admin.v1.IndexOrBuilder> + getIndexesFieldBuilder() { + if (indexesBuilder_ == null) { + indexesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.datastore.admin.v1.Index, + com.google.datastore.admin.v1.Index.Builder, + com.google.datastore.admin.v1.IndexOrBuilder>( + indexes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + indexes_ = null; + } + return indexesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The standard List next-page token.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The standard List next-page token.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The standard List next-page token.
+     * 
+ * + * 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; + onChanged(); + return this; + } + /** + * + * + *
+     * The standard List next-page token.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard List next-page token.
+     * 
+ * + * 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; + 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.datastore.admin.v1.ListIndexesResponse) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.ListIndexesResponse) + private static final com.google.datastore.admin.v1.ListIndexesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.ListIndexesResponse(); + } + + public static com.google.datastore.admin.v1.ListIndexesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListIndexesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListIndexesResponse(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.ListIndexesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ListIndexesResponseOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ListIndexesResponseOrBuilder.java new file mode 100644 index 000000000..e3fb1989e --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ListIndexesResponseOrBuilder.java @@ -0,0 +1,101 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +public interface ListIndexesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.ListIndexesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The indexes.
+   * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + java.util.List getIndexesList(); + /** + * + * + *
+   * The indexes.
+   * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + com.google.datastore.admin.v1.Index getIndexes(int index); + /** + * + * + *
+   * The indexes.
+   * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + int getIndexesCount(); + /** + * + * + *
+   * The indexes.
+   * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + java.util.List getIndexesOrBuilderList(); + /** + * + * + *
+   * The indexes.
+   * 
+ * + * repeated .google.datastore.admin.v1.Index indexes = 1; + */ + com.google.datastore.admin.v1.IndexOrBuilder getIndexesOrBuilder(int index); + + /** + * + * + *
+   * The standard List next-page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The standard List next-page token.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationProgressEvent.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationProgressEvent.java new file mode 100644 index 000000000..1dc1db1f8 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationProgressEvent.java @@ -0,0 +1,2963 @@ +/* + * 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/datastore/admin/v1/migration.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * An event signifying the start of a new step in a [migration from Cloud
+ * Datastore to Cloud Firestore in Datastore
+ * mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore).
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.MigrationProgressEvent} + */ +public final class MigrationProgressEvent extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.MigrationProgressEvent) + MigrationProgressEventOrBuilder { + private static final long serialVersionUID = 0L; + // Use MigrationProgressEvent.newBuilder() to construct. + private MigrationProgressEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MigrationProgressEvent() { + step_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MigrationProgressEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MigrationProgressEvent( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + step_ = rawValue; + break; + } + case 18: + { + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.Builder + subBuilder = null; + if (stepDetailsCase_ == 2) { + subBuilder = + ((com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) + stepDetails_) + .toBuilder(); + } + stepDetails_ = + input.readMessage( + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) + stepDetails_); + stepDetails_ = subBuilder.buildPartial(); + } + stepDetailsCase_ = 2; + break; + } + case 26: + { + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.Builder + subBuilder = null; + if (stepDetailsCase_ == 3) { + subBuilder = + ((com.google.datastore.admin.v1.MigrationProgressEvent + .RedirectWritesStepDetails) + stepDetails_) + .toBuilder(); + } + stepDetails_ = + input.readMessage( + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + stepDetails_); + stepDetails_ = subBuilder.buildPartial(); + } + stepDetailsCase_ = 3; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationProgressEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationProgressEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.MigrationProgressEvent.class, + com.google.datastore.admin.v1.MigrationProgressEvent.Builder.class); + } + + /** + * + * + *
+   * Concurrency modes for transactions in Cloud Firestore.
+   * 
+ * + * Protobuf enum {@code google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode} + */ + public enum ConcurrencyMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * CONCURRENCY_MODE_UNSPECIFIED = 0; + */ + CONCURRENCY_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Pessimistic concurrency.
+     * 
+ * + * PESSIMISTIC = 1; + */ + PESSIMISTIC(1), + /** + * + * + *
+     * Optimistic concurrency.
+     * 
+ * + * OPTIMISTIC = 2; + */ + OPTIMISTIC(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * CONCURRENCY_MODE_UNSPECIFIED = 0; + */ + public static final int CONCURRENCY_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Pessimistic concurrency.
+     * 
+ * + * PESSIMISTIC = 1; + */ + public static final int PESSIMISTIC_VALUE = 1; + /** + * + * + *
+     * Optimistic concurrency.
+     * 
+ * + * OPTIMISTIC = 2; + */ + public static final int OPTIMISTIC_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConcurrencyMode 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 ConcurrencyMode forNumber(int value) { + switch (value) { + case 0: + return CONCURRENCY_MODE_UNSPECIFIED; + case 1: + return PESSIMISTIC; + case 2: + return OPTIMISTIC; + 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 ConcurrencyMode findValueByNumber(int number) { + return ConcurrencyMode.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.datastore.admin.v1.MigrationProgressEvent.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ConcurrencyMode[] VALUES = values(); + + public static ConcurrencyMode 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 ConcurrencyMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode) + } + + public interface PrepareStepDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The concurrency mode this database will use when it reaches the
+     * `REDIRECT_WRITES` step.
+     * 
+ * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @return The enum numeric value on the wire for concurrencyMode. + */ + int getConcurrencyModeValue(); + /** + * + * + *
+     * The concurrency mode this database will use when it reaches the
+     * `REDIRECT_WRITES` step.
+     * 
+ * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @return The concurrencyMode. + */ + com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode getConcurrencyMode(); + } + /** + * + * + *
+   * Details for the `PREPARE` step.
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} + */ + public static final class PrepareStepDetails extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) + PrepareStepDetailsOrBuilder { + private static final long serialVersionUID = 0L; + // Use PrepareStepDetails.newBuilder() to construct. + private PrepareStepDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PrepareStepDetails() { + concurrencyMode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PrepareStepDetails(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PrepareStepDetails( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + concurrencyMode_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationProgressEvent_PrepareStepDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationProgressEvent_PrepareStepDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.class, + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.Builder + .class); + } + + public static final int CONCURRENCY_MODE_FIELD_NUMBER = 1; + private int concurrencyMode_; + /** + * + * + *
+     * The concurrency mode this database will use when it reaches the
+     * `REDIRECT_WRITES` step.
+     * 
+ * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @return The enum numeric value on the wire for concurrencyMode. + */ + @java.lang.Override + public int getConcurrencyModeValue() { + return concurrencyMode_; + } + /** + * + * + *
+     * The concurrency mode this database will use when it reaches the
+     * `REDIRECT_WRITES` step.
+     * 
+ * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @return The concurrencyMode. + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode + getConcurrencyMode() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode result = + com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode.valueOf( + concurrencyMode_); + return result == null + ? com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode.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 (concurrencyMode_ + != com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode + .CONCURRENCY_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, concurrencyMode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (concurrencyMode_ + != com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode + .CONCURRENCY_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, concurrencyMode_); + } + size += unknownFields.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.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails other = + (com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) obj; + + if (concurrencyMode_ != other.concurrencyMode_) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + CONCURRENCY_MODE_FIELD_NUMBER; + hash = (53 * hash) + concurrencyMode_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails 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.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails 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.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + 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.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails 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.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails 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; + } + /** + * + * + *
+     * Details for the `PREPARE` step.
+     * 
+ * + * Protobuf type {@code google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationProgressEvent_PrepareStepDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationProgressEvent_PrepareStepDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.class, + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.Builder + .class); + } + + // Construct using + // com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + concurrencyMode_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationProgressEvent_PrepareStepDetails_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + getDefaultInstanceForType() { + return com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails build() { + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + buildPartial() { + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails result = + new com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails(this); + result.concurrencyMode_ = concurrencyMode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) { + return mergeFrom( + (com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails other) { + if (other + == com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + .getDefaultInstance()) return this; + if (other.concurrencyMode_ != 0) { + setConcurrencyModeValue(other.getConcurrencyModeValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int concurrencyMode_ = 0; + /** + * + * + *
+       * The concurrency mode this database will use when it reaches the
+       * `REDIRECT_WRITES` step.
+       * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @return The enum numeric value on the wire for concurrencyMode. + */ + @java.lang.Override + public int getConcurrencyModeValue() { + return concurrencyMode_; + } + /** + * + * + *
+       * The concurrency mode this database will use when it reaches the
+       * `REDIRECT_WRITES` step.
+       * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @param value The enum numeric value on the wire for concurrencyMode to set. + * @return This builder for chaining. + */ + public Builder setConcurrencyModeValue(int value) { + + concurrencyMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The concurrency mode this database will use when it reaches the
+       * `REDIRECT_WRITES` step.
+       * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @return The concurrencyMode. + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode + getConcurrencyMode() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode result = + com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode.valueOf( + concurrencyMode_); + return result == null + ? com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The concurrency mode this database will use when it reaches the
+       * `REDIRECT_WRITES` step.
+       * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @param value The concurrencyMode to set. + * @return This builder for chaining. + */ + public Builder setConcurrencyMode( + com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode value) { + if (value == null) { + throw new NullPointerException(); + } + + concurrencyMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The concurrency mode this database will use when it reaches the
+       * `REDIRECT_WRITES` step.
+       * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearConcurrencyMode() { + + concurrencyMode_ = 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.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) + private static final com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails(); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PrepareStepDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PrepareStepDetails(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface RedirectWritesStepDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Ths concurrency mode for this database.
+     * 
+ * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @return The enum numeric value on the wire for concurrencyMode. + */ + int getConcurrencyModeValue(); + /** + * + * + *
+     * Ths concurrency mode for this database.
+     * 
+ * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @return The concurrencyMode. + */ + com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode getConcurrencyMode(); + } + /** + * + * + *
+   * Details for the `REDIRECT_WRITES` step.
+   * 
+ * + * Protobuf type {@code + * google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} + */ + public static final class RedirectWritesStepDetails extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + RedirectWritesStepDetailsOrBuilder { + private static final long serialVersionUID = 0L; + // Use RedirectWritesStepDetails.newBuilder() to construct. + private RedirectWritesStepDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RedirectWritesStepDetails() { + concurrencyMode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RedirectWritesStepDetails(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RedirectWritesStepDetails( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + concurrencyMode_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationProgressEvent_RedirectWritesStepDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationProgressEvent_RedirectWritesStepDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.class, + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.Builder + .class); + } + + public static final int CONCURRENCY_MODE_FIELD_NUMBER = 1; + private int concurrencyMode_; + /** + * + * + *
+     * Ths concurrency mode for this database.
+     * 
+ * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @return The enum numeric value on the wire for concurrencyMode. + */ + @java.lang.Override + public int getConcurrencyModeValue() { + return concurrencyMode_; + } + /** + * + * + *
+     * Ths concurrency mode for this database.
+     * 
+ * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @return The concurrencyMode. + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode + getConcurrencyMode() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode result = + com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode.valueOf( + concurrencyMode_); + return result == null + ? com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode.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 (concurrencyMode_ + != com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode + .CONCURRENCY_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, concurrencyMode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (concurrencyMode_ + != com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode + .CONCURRENCY_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, concurrencyMode_); + } + size += unknownFields.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.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails other = + (com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) obj; + + if (concurrencyMode_ != other.concurrencyMode_) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + CONCURRENCY_MODE_FIELD_NUMBER; + hash = (53 * hash) + concurrencyMode_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + 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.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + 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.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + 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.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + 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.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails 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; + } + /** + * + * + *
+     * Details for the `REDIRECT_WRITES` step.
+     * 
+ * + * Protobuf type {@code + * google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationProgressEvent_RedirectWritesStepDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationProgressEvent_RedirectWritesStepDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + .class, + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + .Builder.class); + } + + // Construct using + // com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + concurrencyMode_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationProgressEvent_RedirectWritesStepDetails_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + getDefaultInstanceForType() { + return com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + build() { + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + buildPartial() { + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails result = + new com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails( + this); + result.concurrencyMode_ = concurrencyMode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) { + return mergeFrom( + (com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails other) { + if (other + == com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + .getDefaultInstance()) return this; + if (other.concurrencyMode_ != 0) { + setConcurrencyModeValue(other.getConcurrencyModeValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int concurrencyMode_ = 0; + /** + * + * + *
+       * Ths concurrency mode for this database.
+       * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @return The enum numeric value on the wire for concurrencyMode. + */ + @java.lang.Override + public int getConcurrencyModeValue() { + return concurrencyMode_; + } + /** + * + * + *
+       * Ths concurrency mode for this database.
+       * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @param value The enum numeric value on the wire for concurrencyMode to set. + * @return This builder for chaining. + */ + public Builder setConcurrencyModeValue(int value) { + + concurrencyMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Ths concurrency mode for this database.
+       * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @return The concurrencyMode. + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode + getConcurrencyMode() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode result = + com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode.valueOf( + concurrencyMode_); + return result == null + ? com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Ths concurrency mode for this database.
+       * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @param value The concurrencyMode to set. + * @return This builder for chaining. + */ + public Builder setConcurrencyMode( + com.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode value) { + if (value == null) { + throw new NullPointerException(); + } + + concurrencyMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Ths concurrency mode for this database.
+       * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearConcurrencyMode() { + + concurrencyMode_ = 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.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + private static final com.google.datastore.admin.v1.MigrationProgressEvent + .RedirectWritesStepDetails + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails(); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RedirectWritesStepDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RedirectWritesStepDetails(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int stepDetailsCase_ = 0; + private java.lang.Object stepDetails_; + + public enum StepDetailsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PREPARE_STEP_DETAILS(2), + REDIRECT_WRITES_STEP_DETAILS(3), + STEPDETAILS_NOT_SET(0); + private final int value; + + private StepDetailsCase(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 StepDetailsCase valueOf(int value) { + return forNumber(value); + } + + public static StepDetailsCase forNumber(int value) { + switch (value) { + case 2: + return PREPARE_STEP_DETAILS; + case 3: + return REDIRECT_WRITES_STEP_DETAILS; + case 0: + return STEPDETAILS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public StepDetailsCase getStepDetailsCase() { + return StepDetailsCase.forNumber(stepDetailsCase_); + } + + public static final int STEP_FIELD_NUMBER = 1; + private int step_; + /** + * + * + *
+   * The step that is starting.
+   * An event with step set to `START` indicates that the migration
+   * has been reverted back to the initial pre-migration state.
+   * 
+ * + * .google.datastore.admin.v1.MigrationStep step = 1; + * + * @return The enum numeric value on the wire for step. + */ + @java.lang.Override + public int getStepValue() { + return step_; + } + /** + * + * + *
+   * The step that is starting.
+   * An event with step set to `START` indicates that the migration
+   * has been reverted back to the initial pre-migration state.
+   * 
+ * + * .google.datastore.admin.v1.MigrationStep step = 1; + * + * @return The step. + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationStep getStep() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.MigrationStep result = + com.google.datastore.admin.v1.MigrationStep.valueOf(step_); + return result == null ? com.google.datastore.admin.v1.MigrationStep.UNRECOGNIZED : result; + } + + public static final int PREPARE_STEP_DETAILS_FIELD_NUMBER = 2; + /** + * + * + *
+   * Details for the `PREPARE` step.
+   * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * + * + * @return Whether the prepareStepDetails field is set. + */ + @java.lang.Override + public boolean hasPrepareStepDetails() { + return stepDetailsCase_ == 2; + } + /** + * + * + *
+   * Details for the `PREPARE` step.
+   * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * + * + * @return The prepareStepDetails. + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + getPrepareStepDetails() { + if (stepDetailsCase_ == 2) { + return (com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) stepDetails_; + } + return com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + .getDefaultInstance(); + } + /** + * + * + *
+   * Details for the `PREPARE` step.
+   * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetailsOrBuilder + getPrepareStepDetailsOrBuilder() { + if (stepDetailsCase_ == 2) { + return (com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) stepDetails_; + } + return com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + .getDefaultInstance(); + } + + public static final int REDIRECT_WRITES_STEP_DETAILS_FIELD_NUMBER = 3; + /** + * + * + *
+   * Details for the `REDIRECT_WRITES` step.
+   * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * + * + * @return Whether the redirectWritesStepDetails field is set. + */ + @java.lang.Override + public boolean hasRedirectWritesStepDetails() { + return stepDetailsCase_ == 3; + } + /** + * + * + *
+   * Details for the `REDIRECT_WRITES` step.
+   * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * + * + * @return The redirectWritesStepDetails. + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + getRedirectWritesStepDetails() { + if (stepDetailsCase_ == 3) { + return (com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + stepDetails_; + } + return com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + .getDefaultInstance(); + } + /** + * + * + *
+   * Details for the `REDIRECT_WRITES` step.
+   * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetailsOrBuilder + getRedirectWritesStepDetailsOrBuilder() { + if (stepDetailsCase_ == 3) { + return (com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + stepDetails_; + } + return com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + .getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (step_ + != com.google.datastore.admin.v1.MigrationStep.MIGRATION_STEP_UNSPECIFIED.getNumber()) { + output.writeEnum(1, step_); + } + if (stepDetailsCase_ == 2) { + output.writeMessage( + 2, + (com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) stepDetails_); + } + if (stepDetailsCase_ == 3) { + output.writeMessage( + 3, + (com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + stepDetails_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (step_ + != com.google.datastore.admin.v1.MigrationStep.MIGRATION_STEP_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, step_); + } + if (stepDetailsCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, + (com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) + stepDetails_); + } + if (stepDetailsCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, + (com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + stepDetails_); + } + size += unknownFields.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.datastore.admin.v1.MigrationProgressEvent)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.MigrationProgressEvent other = + (com.google.datastore.admin.v1.MigrationProgressEvent) obj; + + if (step_ != other.step_) return false; + if (!getStepDetailsCase().equals(other.getStepDetailsCase())) return false; + switch (stepDetailsCase_) { + case 2: + if (!getPrepareStepDetails().equals(other.getPrepareStepDetails())) return false; + break; + case 3: + if (!getRedirectWritesStepDetails().equals(other.getRedirectWritesStepDetails())) + return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) 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) + STEP_FIELD_NUMBER; + hash = (53 * hash) + step_; + switch (stepDetailsCase_) { + case 2: + hash = (37 * hash) + PREPARE_STEP_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getPrepareStepDetails().hashCode(); + break; + case 3: + hash = (37 * hash) + REDIRECT_WRITES_STEP_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getRedirectWritesStepDetails().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent 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.datastore.admin.v1.MigrationProgressEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent 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.datastore.admin.v1.MigrationProgressEvent parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent 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.datastore.admin.v1.MigrationProgressEvent parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent 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.datastore.admin.v1.MigrationProgressEvent 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; + } + /** + * + * + *
+   * An event signifying the start of a new step in a [migration from Cloud
+   * Datastore to Cloud Firestore in Datastore
+   * mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore).
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.MigrationProgressEvent} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.MigrationProgressEvent) + com.google.datastore.admin.v1.MigrationProgressEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationProgressEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationProgressEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.MigrationProgressEvent.class, + com.google.datastore.admin.v1.MigrationProgressEvent.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.MigrationProgressEvent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + step_ = 0; + + stepDetailsCase_ = 0; + stepDetails_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationProgressEvent_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent getDefaultInstanceForType() { + return com.google.datastore.admin.v1.MigrationProgressEvent.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent build() { + com.google.datastore.admin.v1.MigrationProgressEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent buildPartial() { + com.google.datastore.admin.v1.MigrationProgressEvent result = + new com.google.datastore.admin.v1.MigrationProgressEvent(this); + result.step_ = step_; + if (stepDetailsCase_ == 2) { + if (prepareStepDetailsBuilder_ == null) { + result.stepDetails_ = stepDetails_; + } else { + result.stepDetails_ = prepareStepDetailsBuilder_.build(); + } + } + if (stepDetailsCase_ == 3) { + if (redirectWritesStepDetailsBuilder_ == null) { + result.stepDetails_ = stepDetails_; + } else { + result.stepDetails_ = redirectWritesStepDetailsBuilder_.build(); + } + } + result.stepDetailsCase_ = stepDetailsCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.MigrationProgressEvent) { + return mergeFrom((com.google.datastore.admin.v1.MigrationProgressEvent) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.MigrationProgressEvent other) { + if (other == com.google.datastore.admin.v1.MigrationProgressEvent.getDefaultInstance()) + return this; + if (other.step_ != 0) { + setStepValue(other.getStepValue()); + } + switch (other.getStepDetailsCase()) { + case PREPARE_STEP_DETAILS: + { + mergePrepareStepDetails(other.getPrepareStepDetails()); + break; + } + case REDIRECT_WRITES_STEP_DETAILS: + { + mergeRedirectWritesStepDetails(other.getRedirectWritesStepDetails()); + break; + } + case STEPDETAILS_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.MigrationProgressEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.datastore.admin.v1.MigrationProgressEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int stepDetailsCase_ = 0; + private java.lang.Object stepDetails_; + + public StepDetailsCase getStepDetailsCase() { + return StepDetailsCase.forNumber(stepDetailsCase_); + } + + public Builder clearStepDetails() { + stepDetailsCase_ = 0; + stepDetails_ = null; + onChanged(); + return this; + } + + private int step_ = 0; + /** + * + * + *
+     * The step that is starting.
+     * An event with step set to `START` indicates that the migration
+     * has been reverted back to the initial pre-migration state.
+     * 
+ * + * .google.datastore.admin.v1.MigrationStep step = 1; + * + * @return The enum numeric value on the wire for step. + */ + @java.lang.Override + public int getStepValue() { + return step_; + } + /** + * + * + *
+     * The step that is starting.
+     * An event with step set to `START` indicates that the migration
+     * has been reverted back to the initial pre-migration state.
+     * 
+ * + * .google.datastore.admin.v1.MigrationStep step = 1; + * + * @param value The enum numeric value on the wire for step to set. + * @return This builder for chaining. + */ + public Builder setStepValue(int value) { + + step_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The step that is starting.
+     * An event with step set to `START` indicates that the migration
+     * has been reverted back to the initial pre-migration state.
+     * 
+ * + * .google.datastore.admin.v1.MigrationStep step = 1; + * + * @return The step. + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationStep getStep() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.MigrationStep result = + com.google.datastore.admin.v1.MigrationStep.valueOf(step_); + return result == null ? com.google.datastore.admin.v1.MigrationStep.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The step that is starting.
+     * An event with step set to `START` indicates that the migration
+     * has been reverted back to the initial pre-migration state.
+     * 
+ * + * .google.datastore.admin.v1.MigrationStep step = 1; + * + * @param value The step to set. + * @return This builder for chaining. + */ + public Builder setStep(com.google.datastore.admin.v1.MigrationStep value) { + if (value == null) { + throw new NullPointerException(); + } + + step_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The step that is starting.
+     * An event with step set to `START` indicates that the migration
+     * has been reverted back to the initial pre-migration state.
+     * 
+ * + * .google.datastore.admin.v1.MigrationStep step = 1; + * + * @return This builder for chaining. + */ + public Builder clearStep() { + + step_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails, + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.Builder, + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetailsOrBuilder> + prepareStepDetailsBuilder_; + /** + * + * + *
+     * Details for the `PREPARE` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * + * + * @return Whether the prepareStepDetails field is set. + */ + @java.lang.Override + public boolean hasPrepareStepDetails() { + return stepDetailsCase_ == 2; + } + /** + * + * + *
+     * Details for the `PREPARE` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * + * + * @return The prepareStepDetails. + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + getPrepareStepDetails() { + if (prepareStepDetailsBuilder_ == null) { + if (stepDetailsCase_ == 2) { + return (com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) + stepDetails_; + } + return com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + .getDefaultInstance(); + } else { + if (stepDetailsCase_ == 2) { + return prepareStepDetailsBuilder_.getMessage(); + } + return com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Details for the `PREPARE` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * + */ + public Builder setPrepareStepDetails( + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails value) { + if (prepareStepDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stepDetails_ = value; + onChanged(); + } else { + prepareStepDetailsBuilder_.setMessage(value); + } + stepDetailsCase_ = 2; + return this; + } + /** + * + * + *
+     * Details for the `PREPARE` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * + */ + public Builder setPrepareStepDetails( + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.Builder + builderForValue) { + if (prepareStepDetailsBuilder_ == null) { + stepDetails_ = builderForValue.build(); + onChanged(); + } else { + prepareStepDetailsBuilder_.setMessage(builderForValue.build()); + } + stepDetailsCase_ = 2; + return this; + } + /** + * + * + *
+     * Details for the `PREPARE` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * + */ + public Builder mergePrepareStepDetails( + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails value) { + if (prepareStepDetailsBuilder_ == null) { + if (stepDetailsCase_ == 2 + && stepDetails_ + != com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + .getDefaultInstance()) { + stepDetails_ = + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.newBuilder( + (com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) + stepDetails_) + .mergeFrom(value) + .buildPartial(); + } else { + stepDetails_ = value; + } + onChanged(); + } else { + if (stepDetailsCase_ == 2) { + prepareStepDetailsBuilder_.mergeFrom(value); + } + prepareStepDetailsBuilder_.setMessage(value); + } + stepDetailsCase_ = 2; + return this; + } + /** + * + * + *
+     * Details for the `PREPARE` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * + */ + public Builder clearPrepareStepDetails() { + if (prepareStepDetailsBuilder_ == null) { + if (stepDetailsCase_ == 2) { + stepDetailsCase_ = 0; + stepDetails_ = null; + onChanged(); + } + } else { + if (stepDetailsCase_ == 2) { + stepDetailsCase_ = 0; + stepDetails_ = null; + } + prepareStepDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Details for the `PREPARE` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * + */ + public com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.Builder + getPrepareStepDetailsBuilder() { + return getPrepareStepDetailsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Details for the `PREPARE` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetailsOrBuilder + getPrepareStepDetailsOrBuilder() { + if ((stepDetailsCase_ == 2) && (prepareStepDetailsBuilder_ != null)) { + return prepareStepDetailsBuilder_.getMessageOrBuilder(); + } else { + if (stepDetailsCase_ == 2) { + return (com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) + stepDetails_; + } + return com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Details for the `PREPARE` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails, + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.Builder, + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetailsOrBuilder> + getPrepareStepDetailsFieldBuilder() { + if (prepareStepDetailsBuilder_ == null) { + if (!(stepDetailsCase_ == 2)) { + stepDetails_ = + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + .getDefaultInstance(); + } + prepareStepDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails, + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.Builder, + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetailsOrBuilder>( + (com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) + stepDetails_, + getParentForChildren(), + isClean()); + stepDetails_ = null; + } + stepDetailsCase_ = 2; + onChanged(); + ; + return prepareStepDetailsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails, + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.Builder, + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetailsOrBuilder> + redirectWritesStepDetailsBuilder_; + /** + * + * + *
+     * Details for the `REDIRECT_WRITES` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * + * + * @return Whether the redirectWritesStepDetails field is set. + */ + @java.lang.Override + public boolean hasRedirectWritesStepDetails() { + return stepDetailsCase_ == 3; + } + /** + * + * + *
+     * Details for the `REDIRECT_WRITES` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * + * + * @return The redirectWritesStepDetails. + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + getRedirectWritesStepDetails() { + if (redirectWritesStepDetailsBuilder_ == null) { + if (stepDetailsCase_ == 3) { + return (com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + stepDetails_; + } + return com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + .getDefaultInstance(); + } else { + if (stepDetailsCase_ == 3) { + return redirectWritesStepDetailsBuilder_.getMessage(); + } + return com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Details for the `REDIRECT_WRITES` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * + */ + public Builder setRedirectWritesStepDetails( + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails value) { + if (redirectWritesStepDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stepDetails_ = value; + onChanged(); + } else { + redirectWritesStepDetailsBuilder_.setMessage(value); + } + stepDetailsCase_ = 3; + return this; + } + /** + * + * + *
+     * Details for the `REDIRECT_WRITES` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * + */ + public Builder setRedirectWritesStepDetails( + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.Builder + builderForValue) { + if (redirectWritesStepDetailsBuilder_ == null) { + stepDetails_ = builderForValue.build(); + onChanged(); + } else { + redirectWritesStepDetailsBuilder_.setMessage(builderForValue.build()); + } + stepDetailsCase_ = 3; + return this; + } + /** + * + * + *
+     * Details for the `REDIRECT_WRITES` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * + */ + public Builder mergeRedirectWritesStepDetails( + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails value) { + if (redirectWritesStepDetailsBuilder_ == null) { + if (stepDetailsCase_ == 3 + && stepDetails_ + != com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + .getDefaultInstance()) { + stepDetails_ = + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + .newBuilder( + (com.google.datastore.admin.v1.MigrationProgressEvent + .RedirectWritesStepDetails) + stepDetails_) + .mergeFrom(value) + .buildPartial(); + } else { + stepDetails_ = value; + } + onChanged(); + } else { + if (stepDetailsCase_ == 3) { + redirectWritesStepDetailsBuilder_.mergeFrom(value); + } + redirectWritesStepDetailsBuilder_.setMessage(value); + } + stepDetailsCase_ = 3; + return this; + } + /** + * + * + *
+     * Details for the `REDIRECT_WRITES` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * + */ + public Builder clearRedirectWritesStepDetails() { + if (redirectWritesStepDetailsBuilder_ == null) { + if (stepDetailsCase_ == 3) { + stepDetailsCase_ = 0; + stepDetails_ = null; + onChanged(); + } + } else { + if (stepDetailsCase_ == 3) { + stepDetailsCase_ = 0; + stepDetails_ = null; + } + redirectWritesStepDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Details for the `REDIRECT_WRITES` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * + */ + public com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.Builder + getRedirectWritesStepDetailsBuilder() { + return getRedirectWritesStepDetailsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Details for the `REDIRECT_WRITES` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetailsOrBuilder + getRedirectWritesStepDetailsOrBuilder() { + if ((stepDetailsCase_ == 3) && (redirectWritesStepDetailsBuilder_ != null)) { + return redirectWritesStepDetailsBuilder_.getMessageOrBuilder(); + } else { + if (stepDetailsCase_ == 3) { + return (com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + stepDetails_; + } + return com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Details for the `REDIRECT_WRITES` step.
+     * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails, + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.Builder, + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetailsOrBuilder> + getRedirectWritesStepDetailsFieldBuilder() { + if (redirectWritesStepDetailsBuilder_ == null) { + if (!(stepDetailsCase_ == 3)) { + stepDetails_ = + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + .getDefaultInstance(); + } + redirectWritesStepDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails, + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + .Builder, + com.google.datastore.admin.v1.MigrationProgressEvent + .RedirectWritesStepDetailsOrBuilder>( + (com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + stepDetails_, + getParentForChildren(), + isClean()); + stepDetails_ = null; + } + stepDetailsCase_ = 3; + onChanged(); + ; + return redirectWritesStepDetailsBuilder_; + } + + @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.datastore.admin.v1.MigrationProgressEvent) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.MigrationProgressEvent) + private static final com.google.datastore.admin.v1.MigrationProgressEvent DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.MigrationProgressEvent(); + } + + public static com.google.datastore.admin.v1.MigrationProgressEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MigrationProgressEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MigrationProgressEvent(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.MigrationProgressEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationProgressEventOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationProgressEventOrBuilder.java new file mode 100644 index 000000000..4660304ea --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationProgressEventOrBuilder.java @@ -0,0 +1,141 @@ +/* + * 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/datastore/admin/v1/migration.proto + +package com.google.datastore.admin.v1; + +public interface MigrationProgressEventOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.MigrationProgressEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The step that is starting.
+   * An event with step set to `START` indicates that the migration
+   * has been reverted back to the initial pre-migration state.
+   * 
+ * + * .google.datastore.admin.v1.MigrationStep step = 1; + * + * @return The enum numeric value on the wire for step. + */ + int getStepValue(); + /** + * + * + *
+   * The step that is starting.
+   * An event with step set to `START` indicates that the migration
+   * has been reverted back to the initial pre-migration state.
+   * 
+ * + * .google.datastore.admin.v1.MigrationStep step = 1; + * + * @return The step. + */ + com.google.datastore.admin.v1.MigrationStep getStep(); + + /** + * + * + *
+   * Details for the `PREPARE` step.
+   * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * + * + * @return Whether the prepareStepDetails field is set. + */ + boolean hasPrepareStepDetails(); + /** + * + * + *
+   * Details for the `PREPARE` step.
+   * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * + * + * @return The prepareStepDetails. + */ + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails getPrepareStepDetails(); + /** + * + * + *
+   * Details for the `PREPARE` step.
+   * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * + */ + com.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetailsOrBuilder + getPrepareStepDetailsOrBuilder(); + + /** + * + * + *
+   * Details for the `REDIRECT_WRITES` step.
+   * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * + * + * @return Whether the redirectWritesStepDetails field is set. + */ + boolean hasRedirectWritesStepDetails(); + /** + * + * + *
+   * Details for the `REDIRECT_WRITES` step.
+   * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * + * + * @return The redirectWritesStepDetails. + */ + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + getRedirectWritesStepDetails(); + /** + * + * + *
+   * Details for the `REDIRECT_WRITES` step.
+   * 
+ * + * + * .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * + */ + com.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetailsOrBuilder + getRedirectWritesStepDetailsOrBuilder(); + + public com.google.datastore.admin.v1.MigrationProgressEvent.StepDetailsCase getStepDetailsCase(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationProto.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationProto.java new file mode 100644 index 000000000..b78108447 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationProto.java @@ -0,0 +1,137 @@ +/* + * 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/datastore/admin/v1/migration.proto + +package com.google.datastore.admin.v1; + +public final class MigrationProto { + private MigrationProto() {} + + 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_datastore_admin_v1_MigrationStateEvent_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_MigrationStateEvent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_MigrationProgressEvent_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_MigrationProgressEvent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_MigrationProgressEvent_PrepareStepDetails_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_MigrationProgressEvent_PrepareStepDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_admin_v1_MigrationProgressEvent_RedirectWritesStepDetails_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_admin_v1_MigrationProgressEvent_RedirectWritesStepDetails_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/datastore/admin/v1/migration.pr" + + "oto\022\031google.datastore.admin.v1\032\034google/a" + + "pi/annotations.proto\"O\n\023MigrationStateEv" + + "ent\0228\n\005state\030\001 \001(\0162).google.datastore.ad" + + "min.v1.MigrationState\"\376\004\n\026MigrationProgr" + + "essEvent\0226\n\004step\030\001 \001(\0162(.google.datastor" + + "e.admin.v1.MigrationStep\022d\n\024prepare_step" + + "_details\030\002 \001(\0132D.google.datastore.admin." + + "v1.MigrationProgressEvent.PrepareStepDet" + + "ailsH\000\022s\n\034redirect_writes_step_details\030\003" + + " \001(\0132K.google.datastore.admin.v1.Migrati" + + "onProgressEvent.RedirectWritesStepDetail" + + "sH\000\032q\n\022PrepareStepDetails\022[\n\020concurrency" + + "_mode\030\001 \001(\0162A.google.datastore.admin.v1." + + "MigrationProgressEvent.ConcurrencyMode\032x" + + "\n\031RedirectWritesStepDetails\022[\n\020concurren" + + "cy_mode\030\001 \001(\0162A.google.datastore.admin.v" + + "1.MigrationProgressEvent.ConcurrencyMode" + + "\"T\n\017ConcurrencyMode\022 \n\034CONCURRENCY_MODE_" + + "UNSPECIFIED\020\000\022\017\n\013PESSIMISTIC\020\001\022\016\n\nOPTIMI" + + "STIC\020\002B\016\n\014step_details*X\n\016MigrationState" + + "\022\037\n\033MIGRATION_STATE_UNSPECIFIED\020\000\022\013\n\007RUN" + + "NING\020\001\022\n\n\006PAUSED\020\002\022\014\n\010COMPLETE\020\003*\343\001\n\rMig" + + "rationStep\022\036\n\032MIGRATION_STEP_UNSPECIFIED" + + "\020\000\022\013\n\007PREPARE\020\006\022\t\n\005START\020\001\022\036\n\032APPLY_WRIT" + + "ES_SYNCHRONOUSLY\020\007\022\023\n\017COPY_AND_VERIFY\020\002\022" + + "(\n$REDIRECT_EVENTUALLY_CONSISTENT_READS\020" + + "\003\022&\n\"REDIRECT_STRONGLY_CONSISTENT_READS\020" + + "\004\022\023\n\017REDIRECT_WRITES\020\005B\333\001\n\035com.google.da" + + "tastore.admin.v1B\016MigrationProtoP\001Z>goog" + + "le.golang.org/genproto/googleapis/datast" + + "ore/admin/v1;admin\252\002\037Google.Cloud.Datast" + + "ore.Admin.V1\312\002\037Google\\Cloud\\Datastore\\Ad" + + "min\\V1\352\002#Google::Cloud::Datastore::Admin" + + "::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_datastore_admin_v1_MigrationStateEvent_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_datastore_admin_v1_MigrationStateEvent_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_MigrationStateEvent_descriptor, + new java.lang.String[] { + "State", + }); + internal_static_google_datastore_admin_v1_MigrationProgressEvent_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_datastore_admin_v1_MigrationProgressEvent_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_MigrationProgressEvent_descriptor, + new java.lang.String[] { + "Step", "PrepareStepDetails", "RedirectWritesStepDetails", "StepDetails", + }); + internal_static_google_datastore_admin_v1_MigrationProgressEvent_PrepareStepDetails_descriptor = + internal_static_google_datastore_admin_v1_MigrationProgressEvent_descriptor + .getNestedTypes() + .get(0); + internal_static_google_datastore_admin_v1_MigrationProgressEvent_PrepareStepDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_MigrationProgressEvent_PrepareStepDetails_descriptor, + new java.lang.String[] { + "ConcurrencyMode", + }); + internal_static_google_datastore_admin_v1_MigrationProgressEvent_RedirectWritesStepDetails_descriptor = + internal_static_google_datastore_admin_v1_MigrationProgressEvent_descriptor + .getNestedTypes() + .get(1); + internal_static_google_datastore_admin_v1_MigrationProgressEvent_RedirectWritesStepDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_datastore_admin_v1_MigrationProgressEvent_RedirectWritesStepDetails_descriptor, + new java.lang.String[] { + "ConcurrencyMode", + }); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationState.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationState.java new file mode 100644 index 000000000..40a2f72db --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationState.java @@ -0,0 +1,198 @@ +/* + * 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/datastore/admin/v1/migration.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * States for a migration.
+ * 
+ * + * Protobuf enum {@code google.datastore.admin.v1.MigrationState} + */ +public enum MigrationState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified.
+   * 
+ * + * MIGRATION_STATE_UNSPECIFIED = 0; + */ + MIGRATION_STATE_UNSPECIFIED(0), + /** + * + * + *
+   * The migration is running.
+   * 
+ * + * RUNNING = 1; + */ + RUNNING(1), + /** + * + * + *
+   * The migration is paused.
+   * 
+ * + * PAUSED = 2; + */ + PAUSED(2), + /** + * + * + *
+   * The migration is complete.
+   * 
+ * + * COMPLETE = 3; + */ + COMPLETE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified.
+   * 
+ * + * MIGRATION_STATE_UNSPECIFIED = 0; + */ + public static final int MIGRATION_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * The migration is running.
+   * 
+ * + * RUNNING = 1; + */ + public static final int RUNNING_VALUE = 1; + /** + * + * + *
+   * The migration is paused.
+   * 
+ * + * PAUSED = 2; + */ + public static final int PAUSED_VALUE = 2; + /** + * + * + *
+   * The migration is complete.
+   * 
+ * + * COMPLETE = 3; + */ + public static final int COMPLETE_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 MigrationState 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 MigrationState forNumber(int value) { + switch (value) { + case 0: + return MIGRATION_STATE_UNSPECIFIED; + case 1: + return RUNNING; + case 2: + return PAUSED; + case 3: + return COMPLETE; + 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 MigrationState findValueByNumber(int number) { + return MigrationState.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.datastore.admin.v1.MigrationProto.getDescriptor().getEnumTypes().get(0); + } + + private static final MigrationState[] VALUES = values(); + + public static MigrationState 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 MigrationState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.datastore.admin.v1.MigrationState) +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationStateEvent.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationStateEvent.java new file mode 100644 index 000000000..942135272 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationStateEvent.java @@ -0,0 +1,613 @@ +/* + * 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/datastore/admin/v1/migration.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * An event signifying a change in state of a [migration from Cloud Datastore to
+ * Cloud Firestore in Datastore
+ * mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore).
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.MigrationStateEvent} + */ +public final class MigrationStateEvent extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.MigrationStateEvent) + MigrationStateEventOrBuilder { + private static final long serialVersionUID = 0L; + // Use MigrationStateEvent.newBuilder() to construct. + private MigrationStateEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MigrationStateEvent() { + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MigrationStateEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MigrationStateEvent( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationStateEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationStateEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.MigrationStateEvent.class, + com.google.datastore.admin.v1.MigrationStateEvent.Builder.class); + } + + public static final int STATE_FIELD_NUMBER = 1; + private int state_; + /** + * + * + *
+   * The new state of the migration.
+   * 
+ * + * .google.datastore.admin.v1.MigrationState state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The new state of the migration.
+   * 
+ * + * .google.datastore.admin.v1.MigrationState state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationState getState() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.MigrationState result = + com.google.datastore.admin.v1.MigrationState.valueOf(state_); + return result == null ? com.google.datastore.admin.v1.MigrationState.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 (state_ + != com.google.datastore.admin.v1.MigrationState.MIGRATION_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, state_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ + != com.google.datastore.admin.v1.MigrationState.MIGRATION_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, state_); + } + size += unknownFields.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.datastore.admin.v1.MigrationStateEvent)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.MigrationStateEvent other = + (com.google.datastore.admin.v1.MigrationStateEvent) obj; + + if (state_ != other.state_) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.MigrationStateEvent parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.MigrationStateEvent parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.MigrationStateEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.MigrationStateEvent 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.datastore.admin.v1.MigrationStateEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.MigrationStateEvent parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.MigrationStateEvent parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.MigrationStateEvent 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.datastore.admin.v1.MigrationStateEvent parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.MigrationStateEvent 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.datastore.admin.v1.MigrationStateEvent parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.MigrationStateEvent 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.datastore.admin.v1.MigrationStateEvent 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; + } + /** + * + * + *
+   * An event signifying a change in state of a [migration from Cloud Datastore to
+   * Cloud Firestore in Datastore
+   * mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore).
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.MigrationStateEvent} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.MigrationStateEvent) + com.google.datastore.admin.v1.MigrationStateEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationStateEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationStateEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.MigrationStateEvent.class, + com.google.datastore.admin.v1.MigrationStateEvent.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.MigrationStateEvent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + state_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.MigrationProto + .internal_static_google_datastore_admin_v1_MigrationStateEvent_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.MigrationStateEvent getDefaultInstanceForType() { + return com.google.datastore.admin.v1.MigrationStateEvent.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.MigrationStateEvent build() { + com.google.datastore.admin.v1.MigrationStateEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.MigrationStateEvent buildPartial() { + com.google.datastore.admin.v1.MigrationStateEvent result = + new com.google.datastore.admin.v1.MigrationStateEvent(this); + result.state_ = state_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.MigrationStateEvent) { + return mergeFrom((com.google.datastore.admin.v1.MigrationStateEvent) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.MigrationStateEvent other) { + if (other == com.google.datastore.admin.v1.MigrationStateEvent.getDefaultInstance()) + return this; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.MigrationStateEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.datastore.admin.v1.MigrationStateEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * The new state of the migration.
+     * 
+ * + * .google.datastore.admin.v1.MigrationState state = 1; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The new state of the migration.
+     * 
+ * + * .google.datastore.admin.v1.MigrationState state = 1; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The new state of the migration.
+     * 
+ * + * .google.datastore.admin.v1.MigrationState state = 1; + * + * @return The state. + */ + @java.lang.Override + public com.google.datastore.admin.v1.MigrationState getState() { + @SuppressWarnings("deprecation") + com.google.datastore.admin.v1.MigrationState result = + com.google.datastore.admin.v1.MigrationState.valueOf(state_); + return result == null ? com.google.datastore.admin.v1.MigrationState.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The new state of the migration.
+     * 
+ * + * .google.datastore.admin.v1.MigrationState state = 1; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.datastore.admin.v1.MigrationState value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The new state of the migration.
+     * 
+ * + * .google.datastore.admin.v1.MigrationState state = 1; + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 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.datastore.admin.v1.MigrationStateEvent) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.MigrationStateEvent) + private static final com.google.datastore.admin.v1.MigrationStateEvent DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.MigrationStateEvent(); + } + + public static com.google.datastore.admin.v1.MigrationStateEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MigrationStateEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MigrationStateEvent(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.MigrationStateEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationStateEventOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationStateEventOrBuilder.java new file mode 100644 index 000000000..99444401b --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationStateEventOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/datastore/admin/v1/migration.proto + +package com.google.datastore.admin.v1; + +public interface MigrationStateEventOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.MigrationStateEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The new state of the migration.
+   * 
+ * + * .google.datastore.admin.v1.MigrationState state = 1; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * The new state of the migration.
+   * 
+ * + * .google.datastore.admin.v1.MigrationState state = 1; + * + * @return The state. + */ + com.google.datastore.admin.v1.MigrationState getState(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationStep.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationStep.java new file mode 100644 index 000000000..86f6eaed8 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/MigrationStep.java @@ -0,0 +1,288 @@ +/* + * 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/datastore/admin/v1/migration.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * Steps in a migration.
+ * 
+ * + * Protobuf enum {@code google.datastore.admin.v1.MigrationStep} + */ +public enum MigrationStep implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified.
+   * 
+ * + * MIGRATION_STEP_UNSPECIFIED = 0; + */ + MIGRATION_STEP_UNSPECIFIED(0), + /** + * + * + *
+   * Pre-migration: the database is prepared for migration.
+   * 
+ * + * PREPARE = 6; + */ + PREPARE(6), + /** + * + * + *
+   * Start of migration.
+   * 
+ * + * START = 1; + */ + START(1), + /** + * + * + *
+   * Writes are applied synchronously to at least one replica.
+   * 
+ * + * APPLY_WRITES_SYNCHRONOUSLY = 7; + */ + APPLY_WRITES_SYNCHRONOUSLY(7), + /** + * + * + *
+   * Data is copied to Cloud Firestore and then verified to match the data in
+   * Cloud Datastore.
+   * 
+ * + * COPY_AND_VERIFY = 2; + */ + COPY_AND_VERIFY(2), + /** + * + * + *
+   * Eventually-consistent reads are redirected to Cloud Firestore.
+   * 
+ * + * REDIRECT_EVENTUALLY_CONSISTENT_READS = 3; + */ + REDIRECT_EVENTUALLY_CONSISTENT_READS(3), + /** + * + * + *
+   * Strongly-consistent reads are redirected to Cloud Firestore.
+   * 
+ * + * REDIRECT_STRONGLY_CONSISTENT_READS = 4; + */ + REDIRECT_STRONGLY_CONSISTENT_READS(4), + /** + * + * + *
+   * Writes are redirected to Cloud Firestore.
+   * 
+ * + * REDIRECT_WRITES = 5; + */ + REDIRECT_WRITES(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified.
+   * 
+ * + * MIGRATION_STEP_UNSPECIFIED = 0; + */ + public static final int MIGRATION_STEP_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Pre-migration: the database is prepared for migration.
+   * 
+ * + * PREPARE = 6; + */ + public static final int PREPARE_VALUE = 6; + /** + * + * + *
+   * Start of migration.
+   * 
+ * + * START = 1; + */ + public static final int START_VALUE = 1; + /** + * + * + *
+   * Writes are applied synchronously to at least one replica.
+   * 
+ * + * APPLY_WRITES_SYNCHRONOUSLY = 7; + */ + public static final int APPLY_WRITES_SYNCHRONOUSLY_VALUE = 7; + /** + * + * + *
+   * Data is copied to Cloud Firestore and then verified to match the data in
+   * Cloud Datastore.
+   * 
+ * + * COPY_AND_VERIFY = 2; + */ + public static final int COPY_AND_VERIFY_VALUE = 2; + /** + * + * + *
+   * Eventually-consistent reads are redirected to Cloud Firestore.
+   * 
+ * + * REDIRECT_EVENTUALLY_CONSISTENT_READS = 3; + */ + public static final int REDIRECT_EVENTUALLY_CONSISTENT_READS_VALUE = 3; + /** + * + * + *
+   * Strongly-consistent reads are redirected to Cloud Firestore.
+   * 
+ * + * REDIRECT_STRONGLY_CONSISTENT_READS = 4; + */ + public static final int REDIRECT_STRONGLY_CONSISTENT_READS_VALUE = 4; + /** + * + * + *
+   * Writes are redirected to Cloud Firestore.
+   * 
+ * + * REDIRECT_WRITES = 5; + */ + public static final int REDIRECT_WRITES_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 MigrationStep 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 MigrationStep forNumber(int value) { + switch (value) { + case 0: + return MIGRATION_STEP_UNSPECIFIED; + case 6: + return PREPARE; + case 1: + return START; + case 7: + return APPLY_WRITES_SYNCHRONOUSLY; + case 2: + return COPY_AND_VERIFY; + case 3: + return REDIRECT_EVENTUALLY_CONSISTENT_READS; + case 4: + return REDIRECT_STRONGLY_CONSISTENT_READS; + case 5: + return REDIRECT_WRITES; + 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 MigrationStep findValueByNumber(int number) { + return MigrationStep.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.datastore.admin.v1.MigrationProto.getDescriptor().getEnumTypes().get(1); + } + + private static final MigrationStep[] VALUES = values(); + + public static MigrationStep 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 MigrationStep(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.datastore.admin.v1.MigrationStep) +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/OperationType.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/OperationType.java new file mode 100644 index 000000000..d1ab497e0 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/OperationType.java @@ -0,0 +1,220 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * Operation types.
+ * 
+ * + * Protobuf enum {@code google.datastore.admin.v1.OperationType} + */ +public enum OperationType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified.
+   * 
+ * + * OPERATION_TYPE_UNSPECIFIED = 0; + */ + OPERATION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * ExportEntities.
+   * 
+ * + * EXPORT_ENTITIES = 1; + */ + EXPORT_ENTITIES(1), + /** + * + * + *
+   * ImportEntities.
+   * 
+ * + * IMPORT_ENTITIES = 2; + */ + IMPORT_ENTITIES(2), + /** + * + * + *
+   * CreateIndex.
+   * 
+ * + * CREATE_INDEX = 3; + */ + CREATE_INDEX(3), + /** + * + * + *
+   * DeleteIndex.
+   * 
+ * + * DELETE_INDEX = 4; + */ + DELETE_INDEX(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified.
+   * 
+ * + * OPERATION_TYPE_UNSPECIFIED = 0; + */ + public static final int OPERATION_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * ExportEntities.
+   * 
+ * + * EXPORT_ENTITIES = 1; + */ + public static final int EXPORT_ENTITIES_VALUE = 1; + /** + * + * + *
+   * ImportEntities.
+   * 
+ * + * IMPORT_ENTITIES = 2; + */ + public static final int IMPORT_ENTITIES_VALUE = 2; + /** + * + * + *
+   * CreateIndex.
+   * 
+ * + * CREATE_INDEX = 3; + */ + public static final int CREATE_INDEX_VALUE = 3; + /** + * + * + *
+   * DeleteIndex.
+   * 
+ * + * DELETE_INDEX = 4; + */ + public static final int DELETE_INDEX_VALUE = 4; + + 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 OperationType 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 OperationType forNumber(int value) { + switch (value) { + case 0: + return OPERATION_TYPE_UNSPECIFIED; + case 1: + return EXPORT_ENTITIES; + case 2: + return IMPORT_ENTITIES; + case 3: + return CREATE_INDEX; + case 4: + return DELETE_INDEX; + 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 OperationType findValueByNumber(int number) { + return OperationType.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.datastore.admin.v1.DatastoreAdminProto.getDescriptor().getEnumTypes().get(0); + } + + private static final OperationType[] VALUES = values(); + + public static OperationType 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 OperationType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.datastore.admin.v1.OperationType) +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/Progress.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/Progress.java new file mode 100644 index 000000000..84b235e20 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/Progress.java @@ -0,0 +1,641 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +/** + * + * + *
+ * Measures the progress of a particular metric.
+ * 
+ * + * Protobuf type {@code google.datastore.admin.v1.Progress} + */ +public final class Progress extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.admin.v1.Progress) + ProgressOrBuilder { + private static final long serialVersionUID = 0L; + // Use Progress.newBuilder() to construct. + private Progress(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Progress() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Progress(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Progress( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + workCompleted_ = input.readInt64(); + break; + } + case 16: + { + workEstimated_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_Progress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_Progress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.Progress.class, + com.google.datastore.admin.v1.Progress.Builder.class); + } + + public static final int WORK_COMPLETED_FIELD_NUMBER = 1; + private long workCompleted_; + /** + * + * + *
+   * The amount of work that has been completed. Note that this may be greater
+   * than work_estimated.
+   * 
+ * + * int64 work_completed = 1; + * + * @return The workCompleted. + */ + @java.lang.Override + public long getWorkCompleted() { + return workCompleted_; + } + + public static final int WORK_ESTIMATED_FIELD_NUMBER = 2; + private long workEstimated_; + /** + * + * + *
+   * An estimate of how much work needs to be performed. May be zero if the
+   * work estimate is unavailable.
+   * 
+ * + * int64 work_estimated = 2; + * + * @return The workEstimated. + */ + @java.lang.Override + public long getWorkEstimated() { + return workEstimated_; + } + + 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 (workCompleted_ != 0L) { + output.writeInt64(1, workCompleted_); + } + if (workEstimated_ != 0L) { + output.writeInt64(2, workEstimated_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (workCompleted_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, workCompleted_); + } + if (workEstimated_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, workEstimated_); + } + size += unknownFields.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.datastore.admin.v1.Progress)) { + return super.equals(obj); + } + com.google.datastore.admin.v1.Progress other = (com.google.datastore.admin.v1.Progress) obj; + + if (getWorkCompleted() != other.getWorkCompleted()) return false; + if (getWorkEstimated() != other.getWorkEstimated()) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + WORK_COMPLETED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getWorkCompleted()); + hash = (37 * hash) + WORK_ESTIMATED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getWorkEstimated()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.admin.v1.Progress parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.Progress parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.Progress parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.Progress 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.datastore.admin.v1.Progress parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.admin.v1.Progress parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.admin.v1.Progress parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.Progress 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.datastore.admin.v1.Progress parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.Progress 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.datastore.admin.v1.Progress parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.admin.v1.Progress 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.datastore.admin.v1.Progress 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; + } + /** + * + * + *
+   * Measures the progress of a particular metric.
+   * 
+ * + * Protobuf type {@code google.datastore.admin.v1.Progress} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.admin.v1.Progress) + com.google.datastore.admin.v1.ProgressOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_Progress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_Progress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.admin.v1.Progress.class, + com.google.datastore.admin.v1.Progress.Builder.class); + } + + // Construct using com.google.datastore.admin.v1.Progress.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + workCompleted_ = 0L; + + workEstimated_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.admin.v1.DatastoreAdminProto + .internal_static_google_datastore_admin_v1_Progress_descriptor; + } + + @java.lang.Override + public com.google.datastore.admin.v1.Progress getDefaultInstanceForType() { + return com.google.datastore.admin.v1.Progress.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.admin.v1.Progress build() { + com.google.datastore.admin.v1.Progress result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.admin.v1.Progress buildPartial() { + com.google.datastore.admin.v1.Progress result = + new com.google.datastore.admin.v1.Progress(this); + result.workCompleted_ = workCompleted_; + result.workEstimated_ = workEstimated_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.admin.v1.Progress) { + return mergeFrom((com.google.datastore.admin.v1.Progress) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.admin.v1.Progress other) { + if (other == com.google.datastore.admin.v1.Progress.getDefaultInstance()) return this; + if (other.getWorkCompleted() != 0L) { + setWorkCompleted(other.getWorkCompleted()); + } + if (other.getWorkEstimated() != 0L) { + setWorkEstimated(other.getWorkEstimated()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.datastore.admin.v1.Progress parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.datastore.admin.v1.Progress) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long workCompleted_; + /** + * + * + *
+     * The amount of work that has been completed. Note that this may be greater
+     * than work_estimated.
+     * 
+ * + * int64 work_completed = 1; + * + * @return The workCompleted. + */ + @java.lang.Override + public long getWorkCompleted() { + return workCompleted_; + } + /** + * + * + *
+     * The amount of work that has been completed. Note that this may be greater
+     * than work_estimated.
+     * 
+ * + * int64 work_completed = 1; + * + * @param value The workCompleted to set. + * @return This builder for chaining. + */ + public Builder setWorkCompleted(long value) { + + workCompleted_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The amount of work that has been completed. Note that this may be greater
+     * than work_estimated.
+     * 
+ * + * int64 work_completed = 1; + * + * @return This builder for chaining. + */ + public Builder clearWorkCompleted() { + + workCompleted_ = 0L; + onChanged(); + return this; + } + + private long workEstimated_; + /** + * + * + *
+     * An estimate of how much work needs to be performed. May be zero if the
+     * work estimate is unavailable.
+     * 
+ * + * int64 work_estimated = 2; + * + * @return The workEstimated. + */ + @java.lang.Override + public long getWorkEstimated() { + return workEstimated_; + } + /** + * + * + *
+     * An estimate of how much work needs to be performed. May be zero if the
+     * work estimate is unavailable.
+     * 
+ * + * int64 work_estimated = 2; + * + * @param value The workEstimated to set. + * @return This builder for chaining. + */ + public Builder setWorkEstimated(long value) { + + workEstimated_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An estimate of how much work needs to be performed. May be zero if the
+     * work estimate is unavailable.
+     * 
+ * + * int64 work_estimated = 2; + * + * @return This builder for chaining. + */ + public Builder clearWorkEstimated() { + + workEstimated_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.datastore.admin.v1.Progress) + } + + // @@protoc_insertion_point(class_scope:google.datastore.admin.v1.Progress) + private static final com.google.datastore.admin.v1.Progress DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.admin.v1.Progress(); + } + + public static com.google.datastore.admin.v1.Progress getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Progress parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Progress(input, extensionRegistry); + } + }; + + 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.datastore.admin.v1.Progress getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ProgressOrBuilder.java b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ProgressOrBuilder.java new file mode 100644 index 000000000..68343d04f --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/java/com/google/datastore/admin/v1/ProgressOrBuilder.java @@ -0,0 +1,53 @@ +/* + * 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/datastore/admin/v1/datastore_admin.proto + +package com.google.datastore.admin.v1; + +public interface ProgressOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.admin.v1.Progress) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The amount of work that has been completed. Note that this may be greater
+   * than work_estimated.
+   * 
+ * + * int64 work_completed = 1; + * + * @return The workCompleted. + */ + long getWorkCompleted(); + + /** + * + * + *
+   * An estimate of how much work needs to be performed. May be zero if the
+   * work estimate is unavailable.
+   * 
+ * + * int64 work_estimated = 2; + * + * @return The workEstimated. + */ + long getWorkEstimated(); +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/proto/google/datastore/admin/v1/datastore_admin.proto b/proto-google-cloud-datastore-admin-v1/src/main/proto/google/datastore/admin/v1/datastore_admin.proto new file mode 100644 index 000000000..3bd4f4c72 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/proto/google/datastore/admin/v1/datastore_admin.proto @@ -0,0 +1,511 @@ +// 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 +// +// 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.datastore.admin.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/datastore/admin/v1/index.proto"; +import "google/datastore/admin/v1/migration.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Datastore.Admin.V1"; +option go_package = "google.golang.org/genproto/googleapis/datastore/admin/v1;admin"; +option java_multiple_files = true; +option java_outer_classname = "DatastoreAdminProto"; +option java_package = "com.google.datastore.admin.v1"; +option php_namespace = "Google\\Cloud\\Datastore\\Admin\\V1"; +option ruby_package = "Google::Cloud::Datastore::Admin::V1"; + +// Google Cloud Datastore Admin API +// +// +// The Datastore Admin API provides several admin services for Cloud Datastore. +// +// ----------------------------------------------------------------------------- +// ## Concepts +// +// Project, namespace, kind, and entity as defined in the Google Cloud Datastore +// API. +// +// Operation: An Operation represents work being performed in the background. +// +// EntityFilter: Allows specifying a subset of entities in a project. This is +// specified as a combination of kinds and namespaces (either or both of which +// may be all). +// +// ----------------------------------------------------------------------------- +// ## Services +// +// # Export/Import +// +// The Export/Import service provides the ability to copy all or a subset of +// entities to/from Google Cloud Storage. +// +// Exported data may be imported into Cloud Datastore for any Google Cloud +// Platform project. It is not restricted to the export source project. It is +// possible to export from one project and then import into another. +// +// Exported data can also be loaded into Google BigQuery for analysis. +// +// Exports and imports are performed asynchronously. An Operation resource is +// created for each export/import. The state (including any errors encountered) +// of the export/import may be queried via the Operation resource. +// +// # Index +// +// The index service manages Cloud Datastore composite indexes. +// +// Index creation and deletion are performed asynchronously. +// An Operation resource is created for each such asynchronous operation. +// The state of the operation (including any errors encountered) +// may be queried via the Operation resource. +// +// # Operation +// +// The Operations collection provides a record of actions performed for the +// specified project (including any operations in progress). Operations are not +// created directly but through calls on other collections or resources. +// +// An operation that is not yet done may be cancelled. The request to cancel is +// asynchronous and the operation may continue to run for some time after the +// request to cancel is made. +// +// An operation that is done may be deleted so that it is no longer listed as +// part of the Operation collection. +// +// ListOperations returns all pending operations, but not completed operations. +// +// Operations are created by service DatastoreAdmin, +// but are accessed via service google.longrunning.Operations. +service DatastoreAdmin { + option (google.api.default_host) = "datastore.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/datastore"; + + // Exports a copy of all or a subset of entities from Google Cloud Datastore + // to another storage system, such as Google Cloud Storage. Recent updates to + // entities may not be reflected in the export. The export occurs in the + // background and its progress can be monitored and managed via the + // Operation resource that is created. The output of an export may only be + // used once the associated operation is done. If an export operation is + // cancelled before completion it may leave partial data behind in Google + // Cloud Storage. + rpc ExportEntities(ExportEntitiesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/projects/{project_id}:export" + body: "*" + }; + option (google.api.method_signature) = "project_id,labels,entity_filter,output_url_prefix"; + option (google.longrunning.operation_info) = { + response_type: "ExportEntitiesResponse" + metadata_type: "ExportEntitiesMetadata" + }; + } + + // Imports entities into Google Cloud Datastore. Existing entities with the + // same key are overwritten. The import occurs in the background and its + // progress can be monitored and managed via the Operation resource that is + // created. If an ImportEntities operation is cancelled, it is possible + // that a subset of the data has already been imported to Cloud Datastore. + rpc ImportEntities(ImportEntitiesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/projects/{project_id}:import" + body: "*" + }; + option (google.api.method_signature) = "project_id,labels,input_url,entity_filter"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "ImportEntitiesMetadata" + }; + } + + // Creates the specified index. + // A newly created index's initial state is `CREATING`. On completion of the + // returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`. + // If the index already exists, the call will return an `ALREADY_EXISTS` + // status. + // + // During index creation, the process could result in an error, in which + // case the index will move to the `ERROR` state. The process can be recovered + // by fixing the data that caused the error, removing the index with + // [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then + // re-creating the index with [create] + // [google.datastore.admin.v1.DatastoreAdmin.CreateIndex]. + // + // Indexes with a single property cannot be created. + rpc CreateIndex(CreateIndexRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/projects/{project_id}/indexes" + body: "index" + }; + option (google.longrunning.operation_info) = { + response_type: "Index" + metadata_type: "IndexOperationMetadata" + }; + } + + // Deletes an existing index. + // An index can only be deleted if it is in a `READY` or `ERROR` state. On + // successful execution of the request, the index will be in a `DELETING` + // [state][google.datastore.admin.v1.Index.State]. And on completion of the + // returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed. + // + // During index deletion, the process could result in an error, in which + // case the index will move to the `ERROR` state. The process can be recovered + // by fixing the data that caused the error, followed by calling + // [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again. + rpc DeleteIndex(DeleteIndexRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/projects/{project_id}/indexes/{index_id}" + }; + option (google.longrunning.operation_info) = { + response_type: "Index" + metadata_type: "IndexOperationMetadata" + }; + } + + // Gets an index. + rpc GetIndex(GetIndexRequest) returns (Index) { + option (google.api.http) = { + get: "/v1/projects/{project_id}/indexes/{index_id}" + }; + } + + // Lists the indexes that match the specified filters. Datastore uses an + // eventually consistent query to fetch the list of indexes and may + // occasionally return stale results. + rpc ListIndexes(ListIndexesRequest) returns (ListIndexesResponse) { + option (google.api.http) = { + get: "/v1/projects/{project_id}/indexes" + }; + } +} + +// Metadata common to all Datastore Admin operations. +message CommonMetadata { + // The various possible states for an ongoing Operation. + enum State { + // Unspecified. + STATE_UNSPECIFIED = 0; + + // Request is being prepared for processing. + INITIALIZING = 1; + + // Request is actively being processed. + PROCESSING = 2; + + // Request is in the process of being cancelled after user called + // google.longrunning.Operations.CancelOperation on the operation. + CANCELLING = 3; + + // Request has been processed and is in its finalization stage. + FINALIZING = 4; + + // Request has completed successfully. + SUCCESSFUL = 5; + + // Request has finished being processed, but encountered an error. + FAILED = 6; + + // Request has finished being cancelled after user called + // google.longrunning.Operations.CancelOperation. + CANCELLED = 7; + } + + // The time that work began on the operation. + google.protobuf.Timestamp start_time = 1; + + // The time the operation ended, either successfully or otherwise. + google.protobuf.Timestamp end_time = 2; + + // The type of the operation. Can be used as a filter in + // ListOperationsRequest. + OperationType operation_type = 3; + + // The client-assigned labels which were provided when the operation was + // created. May also include additional labels. + map labels = 4; + + // The current state of the Operation. + State state = 5; +} + +// Measures the progress of a particular metric. +message Progress { + // The amount of work that has been completed. Note that this may be greater + // than work_estimated. + int64 work_completed = 1; + + // An estimate of how much work needs to be performed. May be zero if the + // work estimate is unavailable. + int64 work_estimated = 2; +} + +// The request for +// [google.datastore.admin.v1.DatastoreAdmin.ExportEntities][google.datastore.admin.v1.DatastoreAdmin.ExportEntities]. +message ExportEntitiesRequest { + // Required. Project ID against which to make the request. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Client-assigned labels. + map labels = 2; + + // Description of what data from the project is included in the export. + EntityFilter entity_filter = 3; + + // Required. Location for the export metadata and data files. + // + // The full resource URL of the external storage location. Currently, only + // Google Cloud Storage is supported. So output_url_prefix should be of the + // form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the + // name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud + // Storage namespace path (this is not a Cloud Datastore namespace). For more + // information about Cloud Storage namespace paths, see + // [Object name + // considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + // + // The resulting files will be nested deeper than the specified URL prefix. + // The final output URL will be provided in the + // [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That + // value should be used for subsequent ImportEntities operations. + // + // By nesting the data files deeper, the same Cloud Storage bucket can be used + // in multiple ExportEntities operations without conflict. + string output_url_prefix = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [google.datastore.admin.v1.DatastoreAdmin.ImportEntities][google.datastore.admin.v1.DatastoreAdmin.ImportEntities]. +message ImportEntitiesRequest { + // Required. Project ID against which to make the request. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Client-assigned labels. + map labels = 2; + + // Required. The full resource URL of the external storage location. Currently, only + // Google Cloud Storage is supported. So input_url should be of the form: + // `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where + // `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is + // an optional Cloud Storage namespace path (this is not a Cloud Datastore + // namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written + // by the ExportEntities operation. For more information about Cloud Storage + // namespace paths, see + // [Object name + // considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + // + // For more information, see + // [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. + string input_url = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optionally specify which kinds/namespaces are to be imported. If provided, + // the list must be a subset of the EntityFilter used in creating the export, + // otherwise a FAILED_PRECONDITION error will be returned. If no filter is + // specified then all entities from the export are imported. + EntityFilter entity_filter = 4; +} + +// The response for +// [google.datastore.admin.v1.DatastoreAdmin.ExportEntities][google.datastore.admin.v1.DatastoreAdmin.ExportEntities]. +message ExportEntitiesResponse { + // Location of the output metadata file. This can be used to begin an import + // into Cloud Datastore (this project or another project). See + // [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url]. + // Only present if the operation completed successfully. + string output_url = 1; +} + +// Metadata for ExportEntities operations. +message ExportEntitiesMetadata { + // Metadata common to all Datastore Admin operations. + CommonMetadata common = 1; + + // An estimate of the number of entities processed. + Progress progress_entities = 2; + + // An estimate of the number of bytes processed. + Progress progress_bytes = 3; + + // Description of which entities are being exported. + EntityFilter entity_filter = 4; + + // Location for the export metadata and data files. This will be the same + // value as the + // [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix] + // field. The final output location is provided in + // [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. + string output_url_prefix = 5; +} + +// Metadata for ImportEntities operations. +message ImportEntitiesMetadata { + // Metadata common to all Datastore Admin operations. + CommonMetadata common = 1; + + // An estimate of the number of entities processed. + Progress progress_entities = 2; + + // An estimate of the number of bytes processed. + Progress progress_bytes = 3; + + // Description of which entities are being imported. + EntityFilter entity_filter = 4; + + // The location of the import metadata file. This will be the same value as + // the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. + string input_url = 5; +} + +// Identifies a subset of entities in a project. This is specified as +// combinations of kinds and namespaces (either or both of which may be all, as +// described in the following examples). +// Example usage: +// +// Entire project: +// kinds=[], namespace_ids=[] +// +// Kinds Foo and Bar in all namespaces: +// kinds=['Foo', 'Bar'], namespace_ids=[] +// +// Kinds Foo and Bar only in the default namespace: +// kinds=['Foo', 'Bar'], namespace_ids=[''] +// +// Kinds Foo and Bar in both the default and Baz namespaces: +// kinds=['Foo', 'Bar'], namespace_ids=['', 'Baz'] +// +// The entire Baz namespace: +// kinds=[], namespace_ids=['Baz'] +message EntityFilter { + // If empty, then this represents all kinds. + repeated string kinds = 1; + + // An empty list represents all namespaces. This is the preferred + // usage for projects that don't use namespaces. + // + // An empty string element represents the default namespace. This should be + // used if the project has data in non-default namespaces, but doesn't want to + // include them. + // Each namespace in this list must be unique. + repeated string namespace_ids = 2; +} + +// The request for +// [google.datastore.admin.v1.DatastoreAdmin.CreateIndex][google.datastore.admin.v1.DatastoreAdmin.CreateIndex]. +message CreateIndexRequest { + // Project ID against which to make the request. + string project_id = 1; + + // The index to create. The name and state fields are output only and will be + // ignored. Single property indexes cannot be created or deleted. + Index index = 3; +} + +// The request for +// [google.datastore.admin.v1.DatastoreAdmin.DeleteIndex][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex]. +message DeleteIndexRequest { + // Project ID against which to make the request. + string project_id = 1; + + // The resource ID of the index to delete. + string index_id = 3; +} + +// The request for [google.datastore.admin.v1.DatastoreAdmin.GetIndex][google.datastore.admin.v1.DatastoreAdmin.GetIndex]. +message GetIndexRequest { + // Project ID against which to make the request. + string project_id = 1; + + // The resource ID of the index to get. + string index_id = 3; +} + +// The request for +// [google.datastore.admin.v1.DatastoreAdmin.ListIndexes][google.datastore.admin.v1.DatastoreAdmin.ListIndexes]. +message ListIndexesRequest { + // Project ID against which to make the request. + string project_id = 1; + + string filter = 3; + + // The maximum number of items to return. If zero, then all results will be + // returned. + int32 page_size = 4; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 5; +} + +// The response for +// [google.datastore.admin.v1.DatastoreAdmin.ListIndexes][google.datastore.admin.v1.DatastoreAdmin.ListIndexes]. +message ListIndexesResponse { + // The indexes. + repeated Index indexes = 1; + + // The standard List next-page token. + string next_page_token = 2; +} + +// Metadata for Index operations. +message IndexOperationMetadata { + // Metadata common to all Datastore Admin operations. + CommonMetadata common = 1; + + // An estimate of the number of entities processed. + Progress progress_entities = 2; + + // The index resource ID that this operation is acting on. + string index_id = 3; +} + +// Metadata for Datastore to Firestore migration operations. +// +// The DatastoreFirestoreMigration operation is not started by the end-user via +// an explicit "creation" method. This is an intentional deviation from the LRO +// design pattern. +// +// This singleton resource can be accessed at: +// `projects/{project_id}/datastore-firestore-migration` +message DatastoreFirestoreMigrationMetadata { + // The current state of migration from Cloud Datastore to Cloud Firestore in + // Datastore mode. + MigrationState migration_state = 1; + + // The current step of migration from Cloud Datastore to Cloud Firestore in + // Datastore mode. + MigrationStep migration_step = 2; +} + +// Operation types. +enum OperationType { + // Unspecified. + OPERATION_TYPE_UNSPECIFIED = 0; + + // ExportEntities. + EXPORT_ENTITIES = 1; + + // ImportEntities. + IMPORT_ENTITIES = 2; + + // CreateIndex. + CREATE_INDEX = 3; + + // DeleteIndex. + DELETE_INDEX = 4; +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/proto/google/datastore/admin/v1/index.proto b/proto-google-cloud-datastore-admin-v1/src/main/proto/google/datastore/admin/v1/index.proto new file mode 100644 index 000000000..a211e7c97 --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/proto/google/datastore/admin/v1/index.proto @@ -0,0 +1,116 @@ +// 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 +// +// 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.datastore.admin.v1; + +import "google/api/field_behavior.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.Datastore.Admin.V1"; +option go_package = "google.golang.org/genproto/googleapis/datastore/admin/v1;admin"; +option java_multiple_files = true; +option java_outer_classname = "IndexProto"; +option java_package = "com.google.datastore.admin.v1"; +option php_namespace = "Google\\Cloud\\Datastore\\Admin\\V1"; +option ruby_package = "Google::Cloud::Datastore::Admin::V1"; + +// Datastore composite index definition. +message Index { + // A property of an index. + message IndexedProperty { + // Required. The property name to index. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The indexed property's direction. Must not be DIRECTION_UNSPECIFIED. + Direction direction = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // For an ordered index, specifies whether each of the entity's ancestors + // will be included. + enum AncestorMode { + // The ancestor mode is unspecified. + ANCESTOR_MODE_UNSPECIFIED = 0; + + // Do not include the entity's ancestors in the index. + NONE = 1; + + // Include all the entity's ancestors in the index. + ALL_ANCESTORS = 2; + } + + // The direction determines how a property is indexed. + enum Direction { + // The direction is unspecified. + DIRECTION_UNSPECIFIED = 0; + + // The property's values are indexed so as to support sequencing in + // ascending order and also query by <, >, <=, >=, and =. + ASCENDING = 1; + + // The property's values are indexed so as to support sequencing in + // descending order and also query by <, >, <=, >=, and =. + DESCENDING = 2; + } + + // The possible set of states of an index. + enum State { + // The state is unspecified. + STATE_UNSPECIFIED = 0; + + // The index is being created, and cannot be used by queries. + // There is an active long-running operation for the index. + // The index is updated when writing an entity. + // Some index data may exist. + CREATING = 1; + + // The index is ready to be used. + // The index is updated when writing an entity. + // The index is fully populated from all stored entities it applies to. + READY = 2; + + // The index is being deleted, and cannot be used by queries. + // There is an active long-running operation for the index. + // The index is not updated when writing an entity. + // Some index data may exist. + DELETING = 3; + + // The index was being created or deleted, but something went wrong. + // The index cannot by used by queries. + // There is no active long-running operation for the index, + // and the most recently finished long-running operation failed. + // The index is not updated when writing an entity. + // Some index data may exist. + ERROR = 4; + } + + // Output only. Project ID. + string project_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource ID of the index. + string index_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The entity kind to which this index applies. + string kind = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The index's ancestor mode. Must not be ANCESTOR_MODE_UNSPECIFIED. + AncestorMode ancestor = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. An ordered sequence of property names and their index attributes. + repeated IndexedProperty properties = 6 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The state of the index. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/proto-google-cloud-datastore-admin-v1/src/main/proto/google/datastore/admin/v1/migration.proto b/proto-google-cloud-datastore-admin-v1/src/main/proto/google/datastore/admin/v1/migration.proto new file mode 100644 index 000000000..aab41706f --- /dev/null +++ b/proto-google-cloud-datastore-admin-v1/src/main/proto/google/datastore/admin/v1/migration.proto @@ -0,0 +1,123 @@ +// 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 +// +// 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.datastore.admin.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.Datastore.Admin.V1"; +option go_package = "google.golang.org/genproto/googleapis/datastore/admin/v1;admin"; +option java_multiple_files = true; +option java_outer_classname = "MigrationProto"; +option java_package = "com.google.datastore.admin.v1"; +option php_namespace = "Google\\Cloud\\Datastore\\Admin\\V1"; +option ruby_package = "Google::Cloud::Datastore::Admin::V1"; + +// An event signifying a change in state of a [migration from Cloud Datastore to +// Cloud Firestore in Datastore +// mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore). +message MigrationStateEvent { + // The new state of the migration. + MigrationState state = 1; +} + +// An event signifying the start of a new step in a [migration from Cloud +// Datastore to Cloud Firestore in Datastore +// mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore). +message MigrationProgressEvent { + // Details for the `PREPARE` step. + message PrepareStepDetails { + // The concurrency mode this database will use when it reaches the + // `REDIRECT_WRITES` step. + ConcurrencyMode concurrency_mode = 1; + } + + // Details for the `REDIRECT_WRITES` step. + message RedirectWritesStepDetails { + // Ths concurrency mode for this database. + ConcurrencyMode concurrency_mode = 1; + } + + // Concurrency modes for transactions in Cloud Firestore. + enum ConcurrencyMode { + // Unspecified. + CONCURRENCY_MODE_UNSPECIFIED = 0; + + // Pessimistic concurrency. + PESSIMISTIC = 1; + + // Optimistic concurrency. + OPTIMISTIC = 2; + } + + // The step that is starting. + // + // An event with step set to `START` indicates that the migration + // has been reverted back to the initial pre-migration state. + MigrationStep step = 1; + + // Details about this step. + oneof step_details { + // Details for the `PREPARE` step. + PrepareStepDetails prepare_step_details = 2; + + // Details for the `REDIRECT_WRITES` step. + RedirectWritesStepDetails redirect_writes_step_details = 3; + } +} + +// States for a migration. +enum MigrationState { + // Unspecified. + MIGRATION_STATE_UNSPECIFIED = 0; + + // The migration is running. + RUNNING = 1; + + // The migration is paused. + PAUSED = 2; + + // The migration is complete. + COMPLETE = 3; +} + +// Steps in a migration. +enum MigrationStep { + // Unspecified. + MIGRATION_STEP_UNSPECIFIED = 0; + + // Pre-migration: the database is prepared for migration. + PREPARE = 6; + + // Start of migration. + START = 1; + + // Writes are applied synchronously to at least one replica. + APPLY_WRITES_SYNCHRONOUSLY = 7; + + // Data is copied to Cloud Firestore and then verified to match the data in + // Cloud Datastore. + COPY_AND_VERIFY = 2; + + // Eventually-consistent reads are redirected to Cloud Firestore. + REDIRECT_EVENTUALLY_CONSISTENT_READS = 3; + + // Strongly-consistent reads are redirected to Cloud Firestore. + REDIRECT_STRONGLY_CONSISTENT_READS = 4; + + // Writes are redirected to Cloud Firestore. + REDIRECT_WRITES = 5; +} diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Key.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Key.java index f992eec2b..54a39945f 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Key.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Key.java @@ -151,6 +151,9 @@ public interface PathElementOrBuilder * A kind matching regex `__.*__` is reserved/read-only. * A kind must not contain more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string kind = 1; @@ -166,6 +169,9 @@ public interface PathElementOrBuilder * A kind matching regex `__.*__` is reserved/read-only. * A kind must not contain more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string kind = 1; @@ -211,6 +217,9 @@ public interface PathElementOrBuilder * A name matching regex `__.*__` is reserved/read-only. * A name must not be more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string name = 3; @@ -226,6 +235,9 @@ public interface PathElementOrBuilder * A name matching regex `__.*__` is reserved/read-only. * A name must not be more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string name = 3; @@ -241,6 +253,9 @@ public interface PathElementOrBuilder * A name matching regex `__.*__` is reserved/read-only. * A name must not be more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string name = 3; @@ -418,6 +433,9 @@ public IdTypeCase getIdTypeCase() { * A kind matching regex `__.*__` is reserved/read-only. * A kind must not contain more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string kind = 1; @@ -444,6 +462,9 @@ public java.lang.String getKind() { * A kind matching regex `__.*__` is reserved/read-only. * A kind must not contain more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string kind = 1; @@ -511,6 +532,9 @@ public long getId() { * A name matching regex `__.*__` is reserved/read-only. * A name must not be more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string name = 3; @@ -528,6 +552,9 @@ public boolean hasName() { * A name matching regex `__.*__` is reserved/read-only. * A name must not be more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string name = 3; @@ -558,6 +585,9 @@ public java.lang.String getName() { * A name matching regex `__.*__` is reserved/read-only. * A name must not be more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string name = 3; @@ -989,6 +1019,9 @@ public Builder clearIdType() { * A kind matching regex `__.*__` is reserved/read-only. * A kind must not contain more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string kind = 1; @@ -1014,6 +1047,9 @@ public java.lang.String getKind() { * A kind matching regex `__.*__` is reserved/read-only. * A kind must not contain more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string kind = 1; @@ -1039,6 +1075,9 @@ public com.google.protobuf.ByteString getKindBytes() { * A kind matching regex `__.*__` is reserved/read-only. * A kind must not contain more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string kind = 1; @@ -1063,6 +1102,9 @@ public Builder setKind(java.lang.String value) { * A kind matching regex `__.*__` is reserved/read-only. * A kind must not contain more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string kind = 1; @@ -1083,6 +1125,9 @@ public Builder clearKind() { * A kind matching regex `__.*__` is reserved/read-only. * A kind must not contain more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string kind = 1; @@ -1186,6 +1231,9 @@ public Builder clearId() { * A name matching regex `__.*__` is reserved/read-only. * A name must not be more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string name = 3; @@ -1204,6 +1252,9 @@ public boolean hasName() { * A name matching regex `__.*__` is reserved/read-only. * A name must not be more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string name = 3; @@ -1235,6 +1286,9 @@ public java.lang.String getName() { * A name matching regex `__.*__` is reserved/read-only. * A name must not be more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string name = 3; @@ -1266,6 +1320,9 @@ public com.google.protobuf.ByteString getNameBytes() { * A name matching regex `__.*__` is reserved/read-only. * A name must not be more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string name = 3; @@ -1290,6 +1347,9 @@ public Builder setName(java.lang.String value) { * A name matching regex `__.*__` is reserved/read-only. * A name must not be more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string name = 3; @@ -1312,6 +1372,9 @@ public Builder clearName() { * A name matching regex `__.*__` is reserved/read-only. * A name must not be more than 1500 bytes when UTF-8 encoded. * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the + * bytes. * * * string name = 3; diff --git a/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/entity.proto b/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/entity.proto index befbcd7b6..55d7b64fe 100644 --- a/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/entity.proto +++ b/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/entity.proto @@ -66,22 +66,33 @@ message Key { // If neither is set, the element is incomplete. message PathElement { // The kind of the entity. + // // A kind matching regex `__.*__` is reserved/read-only. // A kind must not contain more than 1500 bytes when UTF-8 encoded. // Cannot be `""`. + // + // Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + // encoded as `__bytes__` where `` is the base-64 encoding of the + // bytes. string kind = 1; // The type of ID. oneof id_type { // The auto-allocated ID of the entity. + // // Never equal to zero. Values less than zero are discouraged and may not // be supported in the future. int64 id = 2; // The name of the entity. + // // A name matching regex `__.*__` is reserved/read-only. // A name must not be more than 1500 bytes when UTF-8 encoded. // Cannot be `""`. + // + // Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + // encoded as `__bytes__` where `` is the base-64 encoding of the + // bytes. string name = 3; } } diff --git a/versions.txt b/versions.txt index 5896f28c0..1588aaced 100644 --- a/versions.txt +++ b/versions.txt @@ -5,3 +5,5 @@ google-cloud-datastore:2.5.1:2.5.2-SNAPSHOT google-cloud-datastore-bom:2.5.1:2.5.2-SNAPSHOT proto-google-cloud-datastore-v1:0.96.1:0.96.2-SNAPSHOT datastore-v1-proto-client:2.5.1:2.5.2-SNAPSHOT +proto-google-cloud-datastore-admin-v1:2.5.1:2.5.2-SNAPSHOT +grpc-google-cloud-datastore-admin-v1:2.5.1:2.5.2-SNAPSHOT