diff --git a/google-api-grpc/grpc-google-cloud-firestore-admin-v1/pom.xml b/google-api-grpc/grpc-google-cloud-firestore-admin-v1/pom.xml new file mode 100644 index 000000000000..cc078bb90bd8 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-firestore-admin-v1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + grpc-google-cloud-firestore-admin-v1 + 0.49.1-SNAPSHOT + grpc-google-cloud-firestore-admin-v1 + GRPC library for grpc-google-cloud-firestore-admin-v1 + + com.google.api.grpc + google-api-grpc + 0.49.1-SNAPSHOT + + + + io.grpc + grpc-stub + compile + + + io.grpc + grpc-protobuf + compile + + + com.google.api.grpc + proto-google-cloud-firestore-admin-v1 + compile + + + diff --git a/google-api-grpc/grpc-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminGrpc.java b/google-api-grpc/grpc-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminGrpc.java new file mode 100644 index 000000000000..00fe8b48559d --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminGrpc.java @@ -0,0 +1,1434 @@ +package com.google.firestore.admin.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * Operations are created by service `FirestoreAdmin`, but are accessed via
+ * service `google.longrunning.Operations`.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/firestore/admin/v1/firestore_admin.proto") +public final class FirestoreAdminGrpc { + + private FirestoreAdminGrpc() {} + + public static final String SERVICE_NAME = "google.firestore.admin.v1.FirestoreAdmin"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateIndexMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.CreateIndexRequest, com.google.longrunning.Operation> + METHOD_CREATE_INDEX = getCreateIndexMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.CreateIndexRequest, com.google.longrunning.Operation> + getCreateIndexMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.CreateIndexRequest, com.google.longrunning.Operation> + getCreateIndexMethod() { + return getCreateIndexMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.CreateIndexRequest, com.google.longrunning.Operation> + getCreateIndexMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.CreateIndexRequest, com.google.longrunning.Operation> + getCreateIndexMethod; + if ((getCreateIndexMethod = FirestoreAdminGrpc.getCreateIndexMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getCreateIndexMethod = FirestoreAdminGrpc.getCreateIndexMethod) == null) { + FirestoreAdminGrpc.getCreateIndexMethod = + getCreateIndexMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.firestore.admin.v1.FirestoreAdmin", "CreateIndex")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.CreateIndexRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreAdminMethodDescriptorSupplier("CreateIndex")) + .build(); + } + } + } + return getCreateIndexMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListIndexesMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ListIndexesRequest, + com.google.firestore.admin.v1.ListIndexesResponse> + METHOD_LIST_INDEXES = getListIndexesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ListIndexesRequest, + com.google.firestore.admin.v1.ListIndexesResponse> + getListIndexesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ListIndexesRequest, + com.google.firestore.admin.v1.ListIndexesResponse> + getListIndexesMethod() { + return getListIndexesMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ListIndexesRequest, + com.google.firestore.admin.v1.ListIndexesResponse> + getListIndexesMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ListIndexesRequest, + com.google.firestore.admin.v1.ListIndexesResponse> + getListIndexesMethod; + if ((getListIndexesMethod = FirestoreAdminGrpc.getListIndexesMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getListIndexesMethod = FirestoreAdminGrpc.getListIndexesMethod) == null) { + FirestoreAdminGrpc.getListIndexesMethod = + getListIndexesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.firestore.admin.v1.FirestoreAdmin", "ListIndexes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.ListIndexesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.ListIndexesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreAdminMethodDescriptorSupplier("ListIndexes")) + .build(); + } + } + } + return getListIndexesMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetIndexMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.GetIndexRequest, com.google.firestore.admin.v1.Index> + METHOD_GET_INDEX = getGetIndexMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.GetIndexRequest, com.google.firestore.admin.v1.Index> + getGetIndexMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.GetIndexRequest, com.google.firestore.admin.v1.Index> + getGetIndexMethod() { + return getGetIndexMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.GetIndexRequest, com.google.firestore.admin.v1.Index> + getGetIndexMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.GetIndexRequest, com.google.firestore.admin.v1.Index> + getGetIndexMethod; + if ((getGetIndexMethod = FirestoreAdminGrpc.getGetIndexMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getGetIndexMethod = FirestoreAdminGrpc.getGetIndexMethod) == null) { + FirestoreAdminGrpc.getGetIndexMethod = + getGetIndexMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.firestore.admin.v1.FirestoreAdmin", "GetIndex")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.GetIndexRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.Index.getDefaultInstance())) + .setSchemaDescriptor(new FirestoreAdminMethodDescriptorSupplier("GetIndex")) + .build(); + } + } + } + return getGetIndexMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteIndexMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.DeleteIndexRequest, com.google.protobuf.Empty> + METHOD_DELETE_INDEX = getDeleteIndexMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.DeleteIndexRequest, com.google.protobuf.Empty> + getDeleteIndexMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.DeleteIndexRequest, com.google.protobuf.Empty> + getDeleteIndexMethod() { + return getDeleteIndexMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.DeleteIndexRequest, com.google.protobuf.Empty> + getDeleteIndexMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.DeleteIndexRequest, com.google.protobuf.Empty> + getDeleteIndexMethod; + if ((getDeleteIndexMethod = FirestoreAdminGrpc.getDeleteIndexMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getDeleteIndexMethod = FirestoreAdminGrpc.getDeleteIndexMethod) == null) { + FirestoreAdminGrpc.getDeleteIndexMethod = + getDeleteIndexMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.firestore.admin.v1.FirestoreAdmin", "DeleteIndex")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.DeleteIndexRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreAdminMethodDescriptorSupplier("DeleteIndex")) + .build(); + } + } + } + return getDeleteIndexMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetFieldMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.GetFieldRequest, com.google.firestore.admin.v1.Field> + METHOD_GET_FIELD = getGetFieldMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.GetFieldRequest, com.google.firestore.admin.v1.Field> + getGetFieldMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.GetFieldRequest, com.google.firestore.admin.v1.Field> + getGetFieldMethod() { + return getGetFieldMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.GetFieldRequest, com.google.firestore.admin.v1.Field> + getGetFieldMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.GetFieldRequest, com.google.firestore.admin.v1.Field> + getGetFieldMethod; + if ((getGetFieldMethod = FirestoreAdminGrpc.getGetFieldMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getGetFieldMethod = FirestoreAdminGrpc.getGetFieldMethod) == null) { + FirestoreAdminGrpc.getGetFieldMethod = + getGetFieldMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.firestore.admin.v1.FirestoreAdmin", "GetField")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.GetFieldRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.Field.getDefaultInstance())) + .setSchemaDescriptor(new FirestoreAdminMethodDescriptorSupplier("GetField")) + .build(); + } + } + } + return getGetFieldMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateFieldMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.UpdateFieldRequest, com.google.longrunning.Operation> + METHOD_UPDATE_FIELD = getUpdateFieldMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.UpdateFieldRequest, com.google.longrunning.Operation> + getUpdateFieldMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.UpdateFieldRequest, com.google.longrunning.Operation> + getUpdateFieldMethod() { + return getUpdateFieldMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.UpdateFieldRequest, com.google.longrunning.Operation> + getUpdateFieldMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.UpdateFieldRequest, com.google.longrunning.Operation> + getUpdateFieldMethod; + if ((getUpdateFieldMethod = FirestoreAdminGrpc.getUpdateFieldMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getUpdateFieldMethod = FirestoreAdminGrpc.getUpdateFieldMethod) == null) { + FirestoreAdminGrpc.getUpdateFieldMethod = + getUpdateFieldMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.firestore.admin.v1.FirestoreAdmin", "UpdateField")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.UpdateFieldRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreAdminMethodDescriptorSupplier("UpdateField")) + .build(); + } + } + } + return getUpdateFieldMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListFieldsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ListFieldsRequest, + com.google.firestore.admin.v1.ListFieldsResponse> + METHOD_LIST_FIELDS = getListFieldsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ListFieldsRequest, + com.google.firestore.admin.v1.ListFieldsResponse> + getListFieldsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ListFieldsRequest, + com.google.firestore.admin.v1.ListFieldsResponse> + getListFieldsMethod() { + return getListFieldsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ListFieldsRequest, + com.google.firestore.admin.v1.ListFieldsResponse> + getListFieldsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ListFieldsRequest, + com.google.firestore.admin.v1.ListFieldsResponse> + getListFieldsMethod; + if ((getListFieldsMethod = FirestoreAdminGrpc.getListFieldsMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getListFieldsMethod = FirestoreAdminGrpc.getListFieldsMethod) == null) { + FirestoreAdminGrpc.getListFieldsMethod = + getListFieldsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.firestore.admin.v1.FirestoreAdmin", "ListFields")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.ListFieldsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.ListFieldsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new FirestoreAdminMethodDescriptorSupplier("ListFields")) + .build(); + } + } + } + return getListFieldsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getExportDocumentsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ExportDocumentsRequest, com.google.longrunning.Operation> + METHOD_EXPORT_DOCUMENTS = getExportDocumentsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ExportDocumentsRequest, com.google.longrunning.Operation> + getExportDocumentsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ExportDocumentsRequest, com.google.longrunning.Operation> + getExportDocumentsMethod() { + return getExportDocumentsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ExportDocumentsRequest, com.google.longrunning.Operation> + getExportDocumentsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ExportDocumentsRequest, com.google.longrunning.Operation> + getExportDocumentsMethod; + if ((getExportDocumentsMethod = FirestoreAdminGrpc.getExportDocumentsMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getExportDocumentsMethod = FirestoreAdminGrpc.getExportDocumentsMethod) == null) { + FirestoreAdminGrpc.getExportDocumentsMethod = + getExportDocumentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.firestore.admin.v1.FirestoreAdmin", "ExportDocuments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.ExportDocumentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreAdminMethodDescriptorSupplier("ExportDocuments")) + .build(); + } + } + } + return getExportDocumentsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getImportDocumentsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ImportDocumentsRequest, com.google.longrunning.Operation> + METHOD_IMPORT_DOCUMENTS = getImportDocumentsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ImportDocumentsRequest, com.google.longrunning.Operation> + getImportDocumentsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ImportDocumentsRequest, com.google.longrunning.Operation> + getImportDocumentsMethod() { + return getImportDocumentsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ImportDocumentsRequest, com.google.longrunning.Operation> + getImportDocumentsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.ImportDocumentsRequest, com.google.longrunning.Operation> + getImportDocumentsMethod; + if ((getImportDocumentsMethod = FirestoreAdminGrpc.getImportDocumentsMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getImportDocumentsMethod = FirestoreAdminGrpc.getImportDocumentsMethod) == null) { + FirestoreAdminGrpc.getImportDocumentsMethod = + getImportDocumentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.firestore.admin.v1.FirestoreAdmin", "ImportDocuments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.ImportDocumentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreAdminMethodDescriptorSupplier("ImportDocuments")) + .build(); + } + } + } + return getImportDocumentsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static FirestoreAdminStub newStub(io.grpc.Channel channel) { + return new FirestoreAdminStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static FirestoreAdminBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new FirestoreAdminBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static FirestoreAdminFutureStub newFutureStub(io.grpc.Channel channel) { + return new FirestoreAdminFutureStub(channel); + } + + /** + * + * + *
+   * Operations are created by service `FirestoreAdmin`, but are accessed via
+   * service `google.longrunning.Operations`.
+   * 
+ */ + public abstract static class FirestoreAdminImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation]
+     * which may be used to track the status of the creation. The metadata for
+     * the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].
+     * 
+ */ + public void createIndex( + com.google.firestore.admin.v1.CreateIndexRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateIndexMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Lists composite indexes.
+     * 
+ */ + public void listIndexes( + com.google.firestore.admin.v1.ListIndexesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListIndexesMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets a composite index.
+     * 
+ */ + public void getIndex( + com.google.firestore.admin.v1.GetIndexRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetIndexMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Deletes a composite index.
+     * 
+ */ + public void deleteIndex( + com.google.firestore.admin.v1.DeleteIndexRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteIndexMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets the metadata and configuration for a Field.
+     * 
+ */ + public void getField( + com.google.firestore.admin.v1.GetFieldRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetFieldMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Updates a field configuration. Currently, field updates apply only to
+     * single field index configuration. However, calls to
+     * [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] should provide a field mask to avoid
+     * changing any configuration that the caller isn't aware of. The field mask
+     * should be specified as: `{ paths: "index_config" }`.
+     * This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to
+     * track the status of the field update. The metadata for
+     * the operation will be the type [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata].
+     * To configure the default field settings for the database, use
+     * the special `Field` with resource name:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.
+     * 
+ */ + public void updateField( + com.google.firestore.admin.v1.UpdateFieldRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateFieldMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Lists the field configuration and metadata for this database.
+     * Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields
+     * that have been explicitly overridden. To issue this query, call
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to
+     * `indexConfig.usesAncestorConfig:false`.
+     * 
+ */ + public void listFields( + com.google.firestore.admin.v1.ListFieldsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListFieldsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Exports a copy of all or a subset of documents from Google Cloud Firestore
+     * to another storage system, such as Google Cloud Storage. Recent updates to
+     * documents 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 exportDocuments( + com.google.firestore.admin.v1.ExportDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getExportDocumentsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Imports documents into Google Cloud Firestore. Existing documents with the
+     * same name 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 ImportDocuments operation is cancelled, it is possible
+     * that a subset of the data has already been imported to Cloud Firestore.
+     * 
+ */ + public void importDocuments( + com.google.firestore.admin.v1.ImportDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getImportDocumentsMethodHelper(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateIndexMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.CreateIndexRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_INDEX))) + .addMethod( + getListIndexesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.ListIndexesRequest, + com.google.firestore.admin.v1.ListIndexesResponse>( + this, METHODID_LIST_INDEXES))) + .addMethod( + getGetIndexMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.GetIndexRequest, + com.google.firestore.admin.v1.Index>(this, METHODID_GET_INDEX))) + .addMethod( + getDeleteIndexMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.DeleteIndexRequest, com.google.protobuf.Empty>( + this, METHODID_DELETE_INDEX))) + .addMethod( + getGetFieldMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.GetFieldRequest, + com.google.firestore.admin.v1.Field>(this, METHODID_GET_FIELD))) + .addMethod( + getUpdateFieldMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.UpdateFieldRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_FIELD))) + .addMethod( + getListFieldsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.ListFieldsRequest, + com.google.firestore.admin.v1.ListFieldsResponse>( + this, METHODID_LIST_FIELDS))) + .addMethod( + getExportDocumentsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.ExportDocumentsRequest, + com.google.longrunning.Operation>(this, METHODID_EXPORT_DOCUMENTS))) + .addMethod( + getImportDocumentsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.ImportDocumentsRequest, + com.google.longrunning.Operation>(this, METHODID_IMPORT_DOCUMENTS))) + .build(); + } + } + + /** + * + * + *
+   * Operations are created by service `FirestoreAdmin`, but are accessed via
+   * service `google.longrunning.Operations`.
+   * 
+ */ + public static final class FirestoreAdminStub + extends io.grpc.stub.AbstractStub { + private FirestoreAdminStub(io.grpc.Channel channel) { + super(channel); + } + + private FirestoreAdminStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FirestoreAdminStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FirestoreAdminStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation]
+     * which may be used to track the status of the creation. The metadata for
+     * the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].
+     * 
+ */ + public void createIndex( + com.google.firestore.admin.v1.CreateIndexRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateIndexMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists composite indexes.
+     * 
+ */ + public void listIndexes( + com.google.firestore.admin.v1.ListIndexesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListIndexesMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a composite index.
+     * 
+ */ + public void getIndex( + com.google.firestore.admin.v1.GetIndexRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetIndexMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a composite index.
+     * 
+ */ + public void deleteIndex( + com.google.firestore.admin.v1.DeleteIndexRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteIndexMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the metadata and configuration for a Field.
+     * 
+ */ + public void getField( + com.google.firestore.admin.v1.GetFieldRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetFieldMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a field configuration. Currently, field updates apply only to
+     * single field index configuration. However, calls to
+     * [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] should provide a field mask to avoid
+     * changing any configuration that the caller isn't aware of. The field mask
+     * should be specified as: `{ paths: "index_config" }`.
+     * This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to
+     * track the status of the field update. The metadata for
+     * the operation will be the type [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata].
+     * To configure the default field settings for the database, use
+     * the special `Field` with resource name:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.
+     * 
+ */ + public void updateField( + com.google.firestore.admin.v1.UpdateFieldRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateFieldMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists the field configuration and metadata for this database.
+     * Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields
+     * that have been explicitly overridden. To issue this query, call
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to
+     * `indexConfig.usesAncestorConfig:false`.
+     * 
+ */ + public void listFields( + com.google.firestore.admin.v1.ListFieldsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListFieldsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Exports a copy of all or a subset of documents from Google Cloud Firestore
+     * to another storage system, such as Google Cloud Storage. Recent updates to
+     * documents 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 exportDocuments( + com.google.firestore.admin.v1.ExportDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getExportDocumentsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Imports documents into Google Cloud Firestore. Existing documents with the
+     * same name 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 ImportDocuments operation is cancelled, it is possible
+     * that a subset of the data has already been imported to Cloud Firestore.
+     * 
+ */ + public void importDocuments( + com.google.firestore.admin.v1.ImportDocumentsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getImportDocumentsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Operations are created by service `FirestoreAdmin`, but are accessed via
+   * service `google.longrunning.Operations`.
+   * 
+ */ + public static final class FirestoreAdminBlockingStub + extends io.grpc.stub.AbstractStub { + private FirestoreAdminBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private FirestoreAdminBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FirestoreAdminBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FirestoreAdminBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation]
+     * which may be used to track the status of the creation. The metadata for
+     * the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].
+     * 
+ */ + public com.google.longrunning.Operation createIndex( + com.google.firestore.admin.v1.CreateIndexRequest request) { + return blockingUnaryCall( + getChannel(), getCreateIndexMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists composite indexes.
+     * 
+ */ + public com.google.firestore.admin.v1.ListIndexesResponse listIndexes( + com.google.firestore.admin.v1.ListIndexesRequest request) { + return blockingUnaryCall( + getChannel(), getListIndexesMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a composite index.
+     * 
+ */ + public com.google.firestore.admin.v1.Index getIndex( + com.google.firestore.admin.v1.GetIndexRequest request) { + return blockingUnaryCall(getChannel(), getGetIndexMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a composite index.
+     * 
+ */ + public com.google.protobuf.Empty deleteIndex( + com.google.firestore.admin.v1.DeleteIndexRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteIndexMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the metadata and configuration for a Field.
+     * 
+ */ + public com.google.firestore.admin.v1.Field getField( + com.google.firestore.admin.v1.GetFieldRequest request) { + return blockingUnaryCall(getChannel(), getGetFieldMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a field configuration. Currently, field updates apply only to
+     * single field index configuration. However, calls to
+     * [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] should provide a field mask to avoid
+     * changing any configuration that the caller isn't aware of. The field mask
+     * should be specified as: `{ paths: "index_config" }`.
+     * This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to
+     * track the status of the field update. The metadata for
+     * the operation will be the type [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata].
+     * To configure the default field settings for the database, use
+     * the special `Field` with resource name:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.
+     * 
+ */ + public com.google.longrunning.Operation updateField( + com.google.firestore.admin.v1.UpdateFieldRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateFieldMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the field configuration and metadata for this database.
+     * Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields
+     * that have been explicitly overridden. To issue this query, call
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to
+     * `indexConfig.usesAncestorConfig:false`.
+     * 
+ */ + public com.google.firestore.admin.v1.ListFieldsResponse listFields( + com.google.firestore.admin.v1.ListFieldsRequest request) { + return blockingUnaryCall( + getChannel(), getListFieldsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Exports a copy of all or a subset of documents from Google Cloud Firestore
+     * to another storage system, such as Google Cloud Storage. Recent updates to
+     * documents 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 exportDocuments( + com.google.firestore.admin.v1.ExportDocumentsRequest request) { + return blockingUnaryCall( + getChannel(), getExportDocumentsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Imports documents into Google Cloud Firestore. Existing documents with the
+     * same name 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 ImportDocuments operation is cancelled, it is possible
+     * that a subset of the data has already been imported to Cloud Firestore.
+     * 
+ */ + public com.google.longrunning.Operation importDocuments( + com.google.firestore.admin.v1.ImportDocumentsRequest request) { + return blockingUnaryCall( + getChannel(), getImportDocumentsMethodHelper(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Operations are created by service `FirestoreAdmin`, but are accessed via
+   * service `google.longrunning.Operations`.
+   * 
+ */ + public static final class FirestoreAdminFutureStub + extends io.grpc.stub.AbstractStub { + private FirestoreAdminFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private FirestoreAdminFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FirestoreAdminFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FirestoreAdminFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation]
+     * which may be used to track the status of the creation. The metadata for
+     * the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createIndex(com.google.firestore.admin.v1.CreateIndexRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateIndexMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists composite indexes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.firestore.admin.v1.ListIndexesResponse> + listIndexes(com.google.firestore.admin.v1.ListIndexesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListIndexesMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a composite index.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getIndex(com.google.firestore.admin.v1.GetIndexRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetIndexMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a composite index.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteIndex(com.google.firestore.admin.v1.DeleteIndexRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteIndexMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the metadata and configuration for a Field.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getField(com.google.firestore.admin.v1.GetFieldRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetFieldMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a field configuration. Currently, field updates apply only to
+     * single field index configuration. However, calls to
+     * [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] should provide a field mask to avoid
+     * changing any configuration that the caller isn't aware of. The field mask
+     * should be specified as: `{ paths: "index_config" }`.
+     * This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to
+     * track the status of the field update. The metadata for
+     * the operation will be the type [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata].
+     * To configure the default field settings for the database, use
+     * the special `Field` with resource name:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateField(com.google.firestore.admin.v1.UpdateFieldRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateFieldMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists the field configuration and metadata for this database.
+     * Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields
+     * that have been explicitly overridden. To issue this query, call
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to
+     * `indexConfig.usesAncestorConfig:false`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.firestore.admin.v1.ListFieldsResponse> + listFields(com.google.firestore.admin.v1.ListFieldsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListFieldsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Exports a copy of all or a subset of documents from Google Cloud Firestore
+     * to another storage system, such as Google Cloud Storage. Recent updates to
+     * documents 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 + exportDocuments(com.google.firestore.admin.v1.ExportDocumentsRequest request) { + return futureUnaryCall( + getChannel().newCall(getExportDocumentsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Imports documents into Google Cloud Firestore. Existing documents with the
+     * same name 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 ImportDocuments operation is cancelled, it is possible
+     * that a subset of the data has already been imported to Cloud Firestore.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + importDocuments(com.google.firestore.admin.v1.ImportDocumentsRequest request) { + return futureUnaryCall( + getChannel().newCall(getImportDocumentsMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_INDEX = 0; + private static final int METHODID_LIST_INDEXES = 1; + private static final int METHODID_GET_INDEX = 2; + private static final int METHODID_DELETE_INDEX = 3; + private static final int METHODID_GET_FIELD = 4; + private static final int METHODID_UPDATE_FIELD = 5; + private static final int METHODID_LIST_FIELDS = 6; + private static final int METHODID_EXPORT_DOCUMENTS = 7; + private static final int METHODID_IMPORT_DOCUMENTS = 8; + + 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 FirestoreAdminImplBase serviceImpl; + private final int methodId; + + MethodHandlers(FirestoreAdminImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_INDEX: + serviceImpl.createIndex( + (com.google.firestore.admin.v1.CreateIndexRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_INDEXES: + serviceImpl.listIndexes( + (com.google.firestore.admin.v1.ListIndexesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_INDEX: + serviceImpl.getIndex( + (com.google.firestore.admin.v1.GetIndexRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_INDEX: + serviceImpl.deleteIndex( + (com.google.firestore.admin.v1.DeleteIndexRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_FIELD: + serviceImpl.getField( + (com.google.firestore.admin.v1.GetFieldRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_FIELD: + serviceImpl.updateField( + (com.google.firestore.admin.v1.UpdateFieldRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_FIELDS: + serviceImpl.listFields( + (com.google.firestore.admin.v1.ListFieldsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_EXPORT_DOCUMENTS: + serviceImpl.exportDocuments( + (com.google.firestore.admin.v1.ExportDocumentsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_IMPORT_DOCUMENTS: + serviceImpl.importDocuments( + (com.google.firestore.admin.v1.ImportDocumentsRequest) 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 FirestoreAdminBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + FirestoreAdminBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("FirestoreAdmin"); + } + } + + private static final class FirestoreAdminFileDescriptorSupplier + extends FirestoreAdminBaseDescriptorSupplier { + FirestoreAdminFileDescriptorSupplier() {} + } + + private static final class FirestoreAdminMethodDescriptorSupplier + extends FirestoreAdminBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + FirestoreAdminMethodDescriptorSupplier(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 (FirestoreAdminGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new FirestoreAdminFileDescriptorSupplier()) + .addMethod(getCreateIndexMethodHelper()) + .addMethod(getListIndexesMethodHelper()) + .addMethod(getGetIndexMethodHelper()) + .addMethod(getDeleteIndexMethodHelper()) + .addMethod(getGetFieldMethodHelper()) + .addMethod(getUpdateFieldMethodHelper()) + .addMethod(getListFieldsMethodHelper()) + .addMethod(getExportDocumentsMethodHelper()) + .addMethod(getImportDocumentsMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/pom.xml b/google-api-grpc/pom.xml index 2ac2ac3f61fe..4d5fed40072c 100644 --- a/google-api-grpc/pom.xml +++ b/google-api-grpc/pom.xml @@ -284,6 +284,11 @@ grpc-google-cloud-error-reporting-v1beta1 0.49.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-firestore-admin-v1 + 0.49.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-firestore-v1 @@ -294,6 +299,11 @@ proto-google-cloud-firestore-v1beta1 0.49.1-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-firestore-admin-v1 + 0.49.1-SNAPSHOT + com.google.api.grpc grpc-google-cloud-firestore-v1 @@ -722,6 +732,7 @@ grpc-google-cloud-dialogflow-v2beta1 grpc-google-cloud-dlp-v2 grpc-google-cloud-error-reporting-v1beta1 + grpc-google-cloud-firestore-admin-v1 grpc-google-cloud-firestore-v1 grpc-google-cloud-firestore-v1beta1 grpc-google-cloud-iamcredentials-v1 @@ -780,6 +791,7 @@ proto-google-cloud-dialogflow-v2beta1 proto-google-cloud-dlp-v2 proto-google-cloud-error-reporting-v1beta1 + proto-google-cloud-firestore-admin-v1 proto-google-cloud-firestore-v1 proto-google-cloud-firestore-v1beta1 proto-google-cloud-iamcredentials-v1 diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/pom.xml b/google-api-grpc/proto-google-cloud-firestore-admin-v1/pom.xml new file mode 100644 index 000000000000..db348ae25bec --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + proto-google-cloud-firestore-admin-v1 + 0.49.1-SNAPSHOT + proto-google-cloud-firestore-admin-v1 + PROTO library for proto-google-cloud-firestore-admin-v1 + + com.google.api.grpc + google-api-grpc + 0.49.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + compile + + + com.google.api + api-common + compile + + + com.google.api.grpc + proto-google-common-protos + compile + + + diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateIndexRequest.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateIndexRequest.java new file mode 100644 index 000000000000..6ec27cf4b34b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateIndexRequest.java @@ -0,0 +1,865 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.CreateIndexRequest} + */ +public final class CreateIndexRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.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() { + parent_ = ""; + } + + @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(); + } + 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(); + + parent_ = s; + break; + } + case 18: + { + com.google.firestore.admin.v1.Index.Builder subBuilder = null; + if (index_ != null) { + subBuilder = index_.toBuilder(); + } + index_ = + input.readMessage( + com.google.firestore.admin.v1.Index.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(index_); + index_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(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.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_CreateIndexRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_CreateIndexRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.CreateIndexRequest.class, + com.google.firestore.admin.v1.CreateIndexRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * A parent name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * A parent name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDEX_FIELD_NUMBER = 2; + private com.google.firestore.admin.v1.Index index_; + /** + * + * + *
+   * The composite index to create.
+   * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public boolean hasIndex() { + return index_ != null; + } + /** + * + * + *
+   * The composite index to create.
+   * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public com.google.firestore.admin.v1.Index getIndex() { + return index_ == null ? com.google.firestore.admin.v1.Index.getDefaultInstance() : index_; + } + /** + * + * + *
+   * The composite index to create.
+   * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public com.google.firestore.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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (index_ != null) { + output.writeMessage(2, getIndex()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (index_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, 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.firestore.admin.v1.CreateIndexRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.CreateIndexRequest other = + (com.google.firestore.admin.v1.CreateIndexRequest) obj; + + boolean result = true; + result = result && getParent().equals(other.getParent()); + result = result && (hasIndex() == other.hasIndex()); + if (hasIndex()) { + result = result && getIndex().equals(other.getIndex()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (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.firestore.admin.v1.CreateIndexRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.CreateIndexRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.CreateIndexRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.CreateIndexRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.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.firestore.admin.v1.CreateIndexRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.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.firestore.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.firestore.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.firestore.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 [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.CreateIndexRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.CreateIndexRequest) + com.google.firestore.admin.v1.CreateIndexRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_CreateIndexRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_CreateIndexRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.CreateIndexRequest.class, + com.google.firestore.admin.v1.CreateIndexRequest.Builder.class); + } + + // Construct using com.google.firestore.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(); + parent_ = ""; + + 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.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_CreateIndexRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.CreateIndexRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.CreateIndexRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.CreateIndexRequest build() { + com.google.firestore.admin.v1.CreateIndexRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.CreateIndexRequest buildPartial() { + com.google.firestore.admin.v1.CreateIndexRequest result = + new com.google.firestore.admin.v1.CreateIndexRequest(this); + result.parent_ = parent_; + if (indexBuilder_ == null) { + result.index_ = index_; + } else { + result.index_ = indexBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.CreateIndexRequest) { + return mergeFrom((com.google.firestore.admin.v1.CreateIndexRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.CreateIndexRequest other) { + if (other == com.google.firestore.admin.v1.CreateIndexRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + 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.firestore.admin.v1.CreateIndexRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.admin.v1.CreateIndexRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * A parent name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A parent name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A parent name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A parent name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * A parent name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.firestore.admin.v1.Index index_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Index, + com.google.firestore.admin.v1.Index.Builder, + com.google.firestore.admin.v1.IndexOrBuilder> + indexBuilder_; + /** + * + * + *
+     * The composite index to create.
+     * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public boolean hasIndex() { + return indexBuilder_ != null || index_ != null; + } + /** + * + * + *
+     * The composite index to create.
+     * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public com.google.firestore.admin.v1.Index getIndex() { + if (indexBuilder_ == null) { + return index_ == null ? com.google.firestore.admin.v1.Index.getDefaultInstance() : index_; + } else { + return indexBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The composite index to create.
+     * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public Builder setIndex(com.google.firestore.admin.v1.Index value) { + if (indexBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + index_ = value; + onChanged(); + } else { + indexBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The composite index to create.
+     * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public Builder setIndex(com.google.firestore.admin.v1.Index.Builder builderForValue) { + if (indexBuilder_ == null) { + index_ = builderForValue.build(); + onChanged(); + } else { + indexBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The composite index to create.
+     * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public Builder mergeIndex(com.google.firestore.admin.v1.Index value) { + if (indexBuilder_ == null) { + if (index_ != null) { + index_ = + com.google.firestore.admin.v1.Index.newBuilder(index_) + .mergeFrom(value) + .buildPartial(); + } else { + index_ = value; + } + onChanged(); + } else { + indexBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The composite index to create.
+     * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public Builder clearIndex() { + if (indexBuilder_ == null) { + index_ = null; + onChanged(); + } else { + index_ = null; + indexBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The composite index to create.
+     * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public com.google.firestore.admin.v1.Index.Builder getIndexBuilder() { + + onChanged(); + return getIndexFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The composite index to create.
+     * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public com.google.firestore.admin.v1.IndexOrBuilder getIndexOrBuilder() { + if (indexBuilder_ != null) { + return indexBuilder_.getMessageOrBuilder(); + } else { + return index_ == null ? com.google.firestore.admin.v1.Index.getDefaultInstance() : index_; + } + } + /** + * + * + *
+     * The composite index to create.
+     * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Index, + com.google.firestore.admin.v1.Index.Builder, + com.google.firestore.admin.v1.IndexOrBuilder> + getIndexFieldBuilder() { + if (indexBuilder_ == null) { + indexBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Index, + com.google.firestore.admin.v1.Index.Builder, + com.google.firestore.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.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.CreateIndexRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.CreateIndexRequest) + private static final com.google.firestore.admin.v1.CreateIndexRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.CreateIndexRequest(); + } + + public static com.google.firestore.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.firestore.admin.v1.CreateIndexRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateIndexRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateIndexRequestOrBuilder.java new file mode 100644 index 000000000000..55ea0848e1e2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateIndexRequestOrBuilder.java @@ -0,0 +1,64 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +public interface CreateIndexRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.CreateIndexRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A parent name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * A parent name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The composite index to create.
+   * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + boolean hasIndex(); + /** + * + * + *
+   * The composite index to create.
+   * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + com.google.firestore.admin.v1.Index getIndex(); + /** + * + * + *
+   * The composite index to create.
+   * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + com.google.firestore.admin.v1.IndexOrBuilder getIndexOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DatabaseName.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DatabaseName.java new file mode 100644 index 000000000000..ba472b0b6ce4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DatabaseName.java @@ -0,0 +1,180 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.google.firestore.admin.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class DatabaseName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/databases/{database}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String database; + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private DatabaseName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + database = Preconditions.checkNotNull(builder.getDatabase()); + } + + public static DatabaseName of(String project, String database) { + return newBuilder().setProject(project).setDatabase(database).build(); + } + + public static String format(String project, String database) { + return newBuilder().setProject(project).setDatabase(database).build().toString(); + } + + public static DatabaseName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "DatabaseName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("database")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (DatabaseName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("database", database); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "database", database); + } + + /** Builder for DatabaseName. */ + public static class Builder { + + private String project; + private String database; + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setDatabase(String database) { + this.database = database; + return this; + } + + private Builder() {} + + private Builder(DatabaseName databaseName) { + project = databaseName.project; + database = databaseName.database; + } + + public DatabaseName build() { + return new DatabaseName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof DatabaseName) { + DatabaseName that = (DatabaseName) o; + return (this.project.equals(that.project)) && (this.database.equals(that.database)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= database.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteIndexRequest.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteIndexRequest.java new file mode 100644 index 000000000000..1d887567c0b7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteIndexRequest.java @@ -0,0 +1,605 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for [FirestoreAdmin.DeleteIndex][google.firestore.admin.v1.FirestoreAdmin.DeleteIndex].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.DeleteIndexRequest} + */ +public final class DeleteIndexRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.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() { + name_ = ""; + } + + @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(); + } + 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(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteIndexRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteIndexRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.DeleteIndexRequest.class, + com.google.firestore.admin.v1.DeleteIndexRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * A name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+   * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+   * A name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.firestore.admin.v1.DeleteIndexRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.DeleteIndexRequest other = + (com.google.firestore.admin.v1.DeleteIndexRequest) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.DeleteIndexRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.DeleteIndexRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.DeleteIndexRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.DeleteIndexRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.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.firestore.admin.v1.DeleteIndexRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.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.firestore.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.firestore.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.firestore.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 [FirestoreAdmin.DeleteIndex][google.firestore.admin.v1.FirestoreAdmin.DeleteIndex].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.DeleteIndexRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.DeleteIndexRequest) + com.google.firestore.admin.v1.DeleteIndexRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteIndexRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteIndexRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.DeleteIndexRequest.class, + com.google.firestore.admin.v1.DeleteIndexRequest.Builder.class); + } + + // Construct using com.google.firestore.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(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteIndexRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteIndexRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.DeleteIndexRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteIndexRequest build() { + com.google.firestore.admin.v1.DeleteIndexRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteIndexRequest buildPartial() { + com.google.firestore.admin.v1.DeleteIndexRequest result = + new com.google.firestore.admin.v1.DeleteIndexRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.DeleteIndexRequest) { + return mergeFrom((com.google.firestore.admin.v1.DeleteIndexRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.DeleteIndexRequest other) { + if (other == com.google.firestore.admin.v1.DeleteIndexRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.firestore.admin.v1.DeleteIndexRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.admin.v1.DeleteIndexRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * A name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * A name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * A name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * A name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.DeleteIndexRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.DeleteIndexRequest) + private static final com.google.firestore.admin.v1.DeleteIndexRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.DeleteIndexRequest(); + } + + public static com.google.firestore.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.firestore.admin.v1.DeleteIndexRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteIndexRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteIndexRequestOrBuilder.java new file mode 100644 index 000000000000..348bd12c3dce --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteIndexRequestOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +public interface DeleteIndexRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.DeleteIndexRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * A name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsMetadata.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsMetadata.java new file mode 100644 index 000000000000..7ddc080e3095 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsMetadata.java @@ -0,0 +1,2040 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/operation.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
+ * [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ExportDocumentsMetadata} + */ +public final class ExportDocumentsMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.ExportDocumentsMetadata) + ExportDocumentsMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportDocumentsMetadata.newBuilder() to construct. + private ExportDocumentsMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportDocumentsMetadata() { + operationState_ = 0; + collectionIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + outputUriPrefix_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportDocumentsMetadata( + 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(); + + operationState_ = rawValue; + break; + } + case 34: + { + com.google.firestore.admin.v1.Progress.Builder subBuilder = null; + if (progressDocuments_ != null) { + subBuilder = progressDocuments_.toBuilder(); + } + progressDocuments_ = + input.readMessage( + com.google.firestore.admin.v1.Progress.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progressDocuments_); + progressDocuments_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.firestore.admin.v1.Progress.Builder subBuilder = null; + if (progressBytes_ != null) { + subBuilder = progressBytes_.toBuilder(); + } + progressBytes_ = + input.readMessage( + com.google.firestore.admin.v1.Progress.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progressBytes_); + progressBytes_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + collectionIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000020; + } + collectionIds_.add(s); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + outputUriPrefix_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(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_ & 0x00000020) == 0x00000020)) { + collectionIds_ = collectionIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_ExportDocumentsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_ExportDocumentsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ExportDocumentsMetadata.class, + com.google.firestore.admin.v1.ExportDocumentsMetadata.Builder.class); + } + + private int bitField0_; + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + 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 this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int OPERATION_STATE_FIELD_NUMBER = 3; + private int operationState_; + /** + * + * + *
+   * The state of the export operation.
+   * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + public int getOperationStateValue() { + return operationState_; + } + /** + * + * + *
+   * The state of the export operation.
+   * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + public com.google.firestore.admin.v1.OperationState getOperationState() { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.OperationState result = + com.google.firestore.admin.v1.OperationState.valueOf(operationState_); + return result == null ? com.google.firestore.admin.v1.OperationState.UNRECOGNIZED : result; + } + + public static final int PROGRESS_DOCUMENTS_FIELD_NUMBER = 4; + private com.google.firestore.admin.v1.Progress progressDocuments_; + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public boolean hasProgressDocuments() { + return progressDocuments_ != null; + } + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public com.google.firestore.admin.v1.Progress getProgressDocuments() { + return progressDocuments_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressDocuments_; + } + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressDocumentsOrBuilder() { + return getProgressDocuments(); + } + + public static final int PROGRESS_BYTES_FIELD_NUMBER = 5; + private com.google.firestore.admin.v1.Progress progressBytes_; + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public boolean hasProgressBytes() { + return progressBytes_ != null; + } + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public com.google.firestore.admin.v1.Progress getProgressBytes() { + return progressBytes_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder() { + return getProgressBytes(); + } + + public static final int COLLECTION_IDS_FIELD_NUMBER = 6; + private com.google.protobuf.LazyStringList collectionIds_; + /** + * + * + *
+   * Which collection ids are being exported.
+   * 
+ * + * repeated string collection_ids = 6; + */ + public com.google.protobuf.ProtocolStringList getCollectionIdsList() { + return collectionIds_; + } + /** + * + * + *
+   * Which collection ids are being exported.
+   * 
+ * + * repeated string collection_ids = 6; + */ + public int getCollectionIdsCount() { + return collectionIds_.size(); + } + /** + * + * + *
+   * Which collection ids are being exported.
+   * 
+ * + * repeated string collection_ids = 6; + */ + public java.lang.String getCollectionIds(int index) { + return collectionIds_.get(index); + } + /** + * + * + *
+   * Which collection ids are being exported.
+   * 
+ * + * repeated string collection_ids = 6; + */ + public com.google.protobuf.ByteString getCollectionIdsBytes(int index) { + return collectionIds_.getByteString(index); + } + + public static final int OUTPUT_URI_PREFIX_FIELD_NUMBER = 7; + private volatile java.lang.Object outputUriPrefix_; + /** + * + * + *
+   * Where the entities are being exported to.
+   * 
+ * + * string output_uri_prefix = 7; + */ + public java.lang.String getOutputUriPrefix() { + java.lang.Object ref = outputUriPrefix_; + 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(); + outputUriPrefix_ = s; + return s; + } + } + /** + * + * + *
+   * Where the entities are being exported to.
+   * 
+ * + * string output_uri_prefix = 7; + */ + public com.google.protobuf.ByteString getOutputUriPrefixBytes() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUriPrefix_ = 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 (startTime_ != null) { + output.writeMessage(1, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (operationState_ + != com.google.firestore.admin.v1.OperationState.OPERATION_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, operationState_); + } + if (progressDocuments_ != null) { + output.writeMessage(4, getProgressDocuments()); + } + if (progressBytes_ != null) { + output.writeMessage(5, getProgressBytes()); + } + for (int i = 0; i < collectionIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, collectionIds_.getRaw(i)); + } + if (!getOutputUriPrefixBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, outputUriPrefix_); + } + 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 (operationState_ + != com.google.firestore.admin.v1.OperationState.OPERATION_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, operationState_); + } + if (progressDocuments_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getProgressDocuments()); + } + if (progressBytes_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getProgressBytes()); + } + { + int dataSize = 0; + for (int i = 0; i < collectionIds_.size(); i++) { + dataSize += computeStringSizeNoTag(collectionIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getCollectionIdsList().size(); + } + if (!getOutputUriPrefixBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, outputUriPrefix_); + } + 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.firestore.admin.v1.ExportDocumentsMetadata)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.ExportDocumentsMetadata other = + (com.google.firestore.admin.v1.ExportDocumentsMetadata) obj; + + boolean result = true; + result = result && (hasStartTime() == other.hasStartTime()); + if (hasStartTime()) { + result = result && getStartTime().equals(other.getStartTime()); + } + result = result && (hasEndTime() == other.hasEndTime()); + if (hasEndTime()) { + result = result && getEndTime().equals(other.getEndTime()); + } + result = result && operationState_ == other.operationState_; + result = result && (hasProgressDocuments() == other.hasProgressDocuments()); + if (hasProgressDocuments()) { + result = result && getProgressDocuments().equals(other.getProgressDocuments()); + } + result = result && (hasProgressBytes() == other.hasProgressBytes()); + if (hasProgressBytes()) { + result = result && getProgressBytes().equals(other.getProgressBytes()); + } + result = result && getCollectionIdsList().equals(other.getCollectionIdsList()); + result = result && getOutputUriPrefix().equals(other.getOutputUriPrefix()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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_STATE_FIELD_NUMBER; + hash = (53 * hash) + operationState_; + if (hasProgressDocuments()) { + hash = (37 * hash) + PROGRESS_DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getProgressDocuments().hashCode(); + } + if (hasProgressBytes()) { + hash = (37 * hash) + PROGRESS_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getProgressBytes().hashCode(); + } + if (getCollectionIdsCount() > 0) { + hash = (37 * hash) + COLLECTION_IDS_FIELD_NUMBER; + hash = (53 * hash) + getCollectionIdsList().hashCode(); + } + hash = (37 * hash) + OUTPUT_URI_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getOutputUriPrefix().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.ExportDocumentsMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ExportDocumentsMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ExportDocumentsMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ExportDocumentsMetadata 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.firestore.admin.v1.ExportDocumentsMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ExportDocumentsMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ExportDocumentsMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ExportDocumentsMetadata 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.firestore.admin.v1.ExportDocumentsMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ExportDocumentsMetadata 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.firestore.admin.v1.ExportDocumentsMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ExportDocumentsMetadata 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.firestore.admin.v1.ExportDocumentsMetadata 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 [google.longrunning.Operation][google.longrunning.Operation] results from
+   * [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ExportDocumentsMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.ExportDocumentsMetadata) + com.google.firestore.admin.v1.ExportDocumentsMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_ExportDocumentsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_ExportDocumentsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ExportDocumentsMetadata.class, + com.google.firestore.admin.v1.ExportDocumentsMetadata.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.ExportDocumentsMetadata.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; + } + operationState_ = 0; + + if (progressDocumentsBuilder_ == null) { + progressDocuments_ = null; + } else { + progressDocuments_ = null; + progressDocumentsBuilder_ = null; + } + if (progressBytesBuilder_ == null) { + progressBytes_ = null; + } else { + progressBytes_ = null; + progressBytesBuilder_ = null; + } + collectionIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000020); + outputUriPrefix_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_ExportDocumentsMetadata_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ExportDocumentsMetadata getDefaultInstanceForType() { + return com.google.firestore.admin.v1.ExportDocumentsMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.ExportDocumentsMetadata build() { + com.google.firestore.admin.v1.ExportDocumentsMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ExportDocumentsMetadata buildPartial() { + com.google.firestore.admin.v1.ExportDocumentsMetadata result = + new com.google.firestore.admin.v1.ExportDocumentsMetadata(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.operationState_ = operationState_; + if (progressDocumentsBuilder_ == null) { + result.progressDocuments_ = progressDocuments_; + } else { + result.progressDocuments_ = progressDocumentsBuilder_.build(); + } + if (progressBytesBuilder_ == null) { + result.progressBytes_ = progressBytes_; + } else { + result.progressBytes_ = progressBytesBuilder_.build(); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + collectionIds_ = collectionIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.collectionIds_ = collectionIds_; + result.outputUriPrefix_ = outputUriPrefix_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.ExportDocumentsMetadata) { + return mergeFrom((com.google.firestore.admin.v1.ExportDocumentsMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.ExportDocumentsMetadata other) { + if (other == com.google.firestore.admin.v1.ExportDocumentsMetadata.getDefaultInstance()) + return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.operationState_ != 0) { + setOperationStateValue(other.getOperationStateValue()); + } + if (other.hasProgressDocuments()) { + mergeProgressDocuments(other.getProgressDocuments()); + } + if (other.hasProgressBytes()) { + mergeProgressBytes(other.getProgressBytes()); + } + if (!other.collectionIds_.isEmpty()) { + if (collectionIds_.isEmpty()) { + collectionIds_ = other.collectionIds_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureCollectionIdsIsMutable(); + collectionIds_.addAll(other.collectionIds_); + } + onChanged(); + } + if (!other.getOutputUriPrefix().isEmpty()) { + outputUriPrefix_ = other.outputUriPrefix_; + 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.firestore.admin.v1.ExportDocumentsMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.admin.v1.ExportDocumentsMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.Timestamp startTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .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 this operation started.
+     * 
+ * + * .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 this operation started.
+     * 
+ * + * .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 this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .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 this operation started.
+     * 
+ * + * .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_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 operationState_ = 0; + /** + * + * + *
+     * The state of the export operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + public int getOperationStateValue() { + return operationState_; + } + /** + * + * + *
+     * The state of the export operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + public Builder setOperationStateValue(int value) { + operationState_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the export operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + public com.google.firestore.admin.v1.OperationState getOperationState() { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.OperationState result = + com.google.firestore.admin.v1.OperationState.valueOf(operationState_); + return result == null ? com.google.firestore.admin.v1.OperationState.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The state of the export operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + public Builder setOperationState(com.google.firestore.admin.v1.OperationState value) { + if (value == null) { + throw new NullPointerException(); + } + + operationState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the export operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + public Builder clearOperationState() { + + operationState_ = 0; + onChanged(); + return this; + } + + private com.google.firestore.admin.v1.Progress progressDocuments_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + progressDocumentsBuilder_; + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public boolean hasProgressDocuments() { + return progressDocumentsBuilder_ != null || progressDocuments_ != null; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public com.google.firestore.admin.v1.Progress getProgressDocuments() { + if (progressDocumentsBuilder_ == null) { + return progressDocuments_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressDocuments_; + } else { + return progressDocumentsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public Builder setProgressDocuments(com.google.firestore.admin.v1.Progress value) { + if (progressDocumentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progressDocuments_ = value; + onChanged(); + } else { + progressDocumentsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public Builder setProgressDocuments( + com.google.firestore.admin.v1.Progress.Builder builderForValue) { + if (progressDocumentsBuilder_ == null) { + progressDocuments_ = builderForValue.build(); + onChanged(); + } else { + progressDocumentsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public Builder mergeProgressDocuments(com.google.firestore.admin.v1.Progress value) { + if (progressDocumentsBuilder_ == null) { + if (progressDocuments_ != null) { + progressDocuments_ = + com.google.firestore.admin.v1.Progress.newBuilder(progressDocuments_) + .mergeFrom(value) + .buildPartial(); + } else { + progressDocuments_ = value; + } + onChanged(); + } else { + progressDocumentsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public Builder clearProgressDocuments() { + if (progressDocumentsBuilder_ == null) { + progressDocuments_ = null; + onChanged(); + } else { + progressDocuments_ = null; + progressDocumentsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public com.google.firestore.admin.v1.Progress.Builder getProgressDocumentsBuilder() { + + onChanged(); + return getProgressDocumentsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressDocumentsOrBuilder() { + if (progressDocumentsBuilder_ != null) { + return progressDocumentsBuilder_.getMessageOrBuilder(); + } else { + return progressDocuments_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressDocuments_; + } + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + getProgressDocumentsFieldBuilder() { + if (progressDocumentsBuilder_ == null) { + progressDocumentsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder>( + getProgressDocuments(), getParentForChildren(), isClean()); + progressDocuments_ = null; + } + return progressDocumentsBuilder_; + } + + private com.google.firestore.admin.v1.Progress progressBytes_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + progressBytesBuilder_; + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public boolean hasProgressBytes() { + return progressBytesBuilder_ != null || progressBytes_ != null; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public com.google.firestore.admin.v1.Progress getProgressBytes() { + if (progressBytesBuilder_ == null) { + return progressBytes_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } else { + return progressBytesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public Builder setProgressBytes(com.google.firestore.admin.v1.Progress value) { + if (progressBytesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progressBytes_ = value; + onChanged(); + } else { + progressBytesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public Builder setProgressBytes( + com.google.firestore.admin.v1.Progress.Builder builderForValue) { + if (progressBytesBuilder_ == null) { + progressBytes_ = builderForValue.build(); + onChanged(); + } else { + progressBytesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public Builder mergeProgressBytes(com.google.firestore.admin.v1.Progress value) { + if (progressBytesBuilder_ == null) { + if (progressBytes_ != null) { + progressBytes_ = + com.google.firestore.admin.v1.Progress.newBuilder(progressBytes_) + .mergeFrom(value) + .buildPartial(); + } else { + progressBytes_ = value; + } + onChanged(); + } else { + progressBytesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public Builder clearProgressBytes() { + if (progressBytesBuilder_ == null) { + progressBytes_ = null; + onChanged(); + } else { + progressBytes_ = null; + progressBytesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public com.google.firestore.admin.v1.Progress.Builder getProgressBytesBuilder() { + + onChanged(); + return getProgressBytesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder() { + if (progressBytesBuilder_ != null) { + return progressBytesBuilder_.getMessageOrBuilder(); + } else { + return progressBytes_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + getProgressBytesFieldBuilder() { + if (progressBytesBuilder_ == null) { + progressBytesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder>( + getProgressBytes(), getParentForChildren(), isClean()); + progressBytes_ = null; + } + return progressBytesBuilder_; + } + + private com.google.protobuf.LazyStringList collectionIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCollectionIdsIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + collectionIds_ = new com.google.protobuf.LazyStringArrayList(collectionIds_); + bitField0_ |= 0x00000020; + } + } + /** + * + * + *
+     * Which collection ids are being exported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public com.google.protobuf.ProtocolStringList getCollectionIdsList() { + return collectionIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Which collection ids are being exported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public int getCollectionIdsCount() { + return collectionIds_.size(); + } + /** + * + * + *
+     * Which collection ids are being exported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public java.lang.String getCollectionIds(int index) { + return collectionIds_.get(index); + } + /** + * + * + *
+     * Which collection ids are being exported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public com.google.protobuf.ByteString getCollectionIdsBytes(int index) { + return collectionIds_.getByteString(index); + } + /** + * + * + *
+     * Which collection ids are being exported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public Builder setCollectionIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectionIdsIsMutable(); + collectionIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Which collection ids are being exported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public Builder addCollectionIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectionIdsIsMutable(); + collectionIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Which collection ids are being exported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public Builder addAllCollectionIds(java.lang.Iterable values) { + ensureCollectionIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, collectionIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Which collection ids are being exported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public Builder clearCollectionIds() { + collectionIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Which collection ids are being exported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public Builder addCollectionIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCollectionIdsIsMutable(); + collectionIds_.add(value); + onChanged(); + return this; + } + + private java.lang.Object outputUriPrefix_ = ""; + /** + * + * + *
+     * Where the entities are being exported to.
+     * 
+ * + * string output_uri_prefix = 7; + */ + public java.lang.String getOutputUriPrefix() { + java.lang.Object ref = outputUriPrefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUriPrefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Where the entities are being exported to.
+     * 
+ * + * string output_uri_prefix = 7; + */ + public com.google.protobuf.ByteString getOutputUriPrefixBytes() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUriPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Where the entities are being exported to.
+     * 
+ * + * string output_uri_prefix = 7; + */ + public Builder setOutputUriPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + outputUriPrefix_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Where the entities are being exported to.
+     * 
+ * + * string output_uri_prefix = 7; + */ + public Builder clearOutputUriPrefix() { + + outputUriPrefix_ = getDefaultInstance().getOutputUriPrefix(); + onChanged(); + return this; + } + /** + * + * + *
+     * Where the entities are being exported to.
+     * 
+ * + * string output_uri_prefix = 7; + */ + public Builder setOutputUriPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + outputUriPrefix_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.ExportDocumentsMetadata) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ExportDocumentsMetadata) + private static final com.google.firestore.admin.v1.ExportDocumentsMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.ExportDocumentsMetadata(); + } + + public static com.google.firestore.admin.v1.ExportDocumentsMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportDocumentsMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportDocumentsMetadata(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.firestore.admin.v1.ExportDocumentsMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsMetadataOrBuilder.java new file mode 100644 index 000000000000..f97a258621f3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsMetadataOrBuilder.java @@ -0,0 +1,220 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/operation.proto + +package com.google.firestore.admin.v1; + +public interface ExportDocumentsMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.ExportDocumentsMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + boolean hasStartTime(); + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + boolean hasEndTime(); + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * The state of the export operation.
+   * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + int getOperationStateValue(); + /** + * + * + *
+   * The state of the export operation.
+   * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + com.google.firestore.admin.v1.OperationState getOperationState(); + + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + boolean hasProgressDocuments(); + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + com.google.firestore.admin.v1.Progress getProgressDocuments(); + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + com.google.firestore.admin.v1.ProgressOrBuilder getProgressDocumentsOrBuilder(); + + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + boolean hasProgressBytes(); + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + com.google.firestore.admin.v1.Progress getProgressBytes(); + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + com.google.firestore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder(); + + /** + * + * + *
+   * Which collection ids are being exported.
+   * 
+ * + * repeated string collection_ids = 6; + */ + java.util.List getCollectionIdsList(); + /** + * + * + *
+   * Which collection ids are being exported.
+   * 
+ * + * repeated string collection_ids = 6; + */ + int getCollectionIdsCount(); + /** + * + * + *
+   * Which collection ids are being exported.
+   * 
+ * + * repeated string collection_ids = 6; + */ + java.lang.String getCollectionIds(int index); + /** + * + * + *
+   * Which collection ids are being exported.
+   * 
+ * + * repeated string collection_ids = 6; + */ + com.google.protobuf.ByteString getCollectionIdsBytes(int index); + + /** + * + * + *
+   * Where the entities are being exported to.
+   * 
+ * + * string output_uri_prefix = 7; + */ + java.lang.String getOutputUriPrefix(); + /** + * + * + *
+   * Where the entities are being exported to.
+   * 
+ * + * string output_uri_prefix = 7; + */ + com.google.protobuf.ByteString getOutputUriPrefixBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsRequest.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsRequest.java new file mode 100644 index 000000000000..a0e6235d075d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsRequest.java @@ -0,0 +1,1063 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ExportDocumentsRequest} + */ +public final class ExportDocumentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.ExportDocumentsRequest) + ExportDocumentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportDocumentsRequest.newBuilder() to construct. + private ExportDocumentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportDocumentsRequest() { + name_ = ""; + collectionIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + outputUriPrefix_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportDocumentsRequest( + 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(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + collectionIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + collectionIds_.add(s); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + outputUriPrefix_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(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_ & 0x00000002) == 0x00000002)) { + collectionIds_ = collectionIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ExportDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ExportDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ExportDocumentsRequest.class, + com.google.firestore.admin.v1.ExportDocumentsRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Database to export. Should be of the form:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+   * Database to export. Should be of the form:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string name = 1; + */ + 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 COLLECTION_IDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList collectionIds_; + /** + * + * + *
+   * Which collection ids to export. Unspecified means all collections.
+   * 
+ * + * repeated string collection_ids = 2; + */ + public com.google.protobuf.ProtocolStringList getCollectionIdsList() { + return collectionIds_; + } + /** + * + * + *
+   * Which collection ids to export. Unspecified means all collections.
+   * 
+ * + * repeated string collection_ids = 2; + */ + public int getCollectionIdsCount() { + return collectionIds_.size(); + } + /** + * + * + *
+   * Which collection ids to export. Unspecified means all collections.
+   * 
+ * + * repeated string collection_ids = 2; + */ + public java.lang.String getCollectionIds(int index) { + return collectionIds_.get(index); + } + /** + * + * + *
+   * Which collection ids to export. Unspecified means all collections.
+   * 
+ * + * repeated string collection_ids = 2; + */ + public com.google.protobuf.ByteString getCollectionIdsBytes(int index) { + return collectionIds_.getByteString(index); + } + + public static final int OUTPUT_URI_PREFIX_FIELD_NUMBER = 3; + private volatile java.lang.Object outputUriPrefix_; + /** + * + * + *
+   * The output URI. Currently only supports Google Cloud Storage URIs of the
+   * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
+   * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
+   * Google Cloud Storage namespace path. When
+   * choosing a name, be sure to consider Google Cloud Storage naming
+   * guidelines: https://cloud.google.com/storage/docs/naming.
+   * If the URI is a bucket (without a namespace path), a prefix will be
+   * generated based on the start time.
+   * 
+ * + * string output_uri_prefix = 3; + */ + public java.lang.String getOutputUriPrefix() { + java.lang.Object ref = outputUriPrefix_; + 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(); + outputUriPrefix_ = s; + return s; + } + } + /** + * + * + *
+   * The output URI. Currently only supports Google Cloud Storage URIs of the
+   * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
+   * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
+   * Google Cloud Storage namespace path. When
+   * choosing a name, be sure to consider Google Cloud Storage naming
+   * guidelines: https://cloud.google.com/storage/docs/naming.
+   * If the URI is a bucket (without a namespace path), a prefix will be
+   * generated based on the start time.
+   * 
+ * + * string output_uri_prefix = 3; + */ + public com.google.protobuf.ByteString getOutputUriPrefixBytes() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUriPrefix_ = 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < collectionIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, collectionIds_.getRaw(i)); + } + if (!getOutputUriPrefixBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, outputUriPrefix_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + { + int dataSize = 0; + for (int i = 0; i < collectionIds_.size(); i++) { + dataSize += computeStringSizeNoTag(collectionIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getCollectionIdsList().size(); + } + if (!getOutputUriPrefixBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, outputUriPrefix_); + } + 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.firestore.admin.v1.ExportDocumentsRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.ExportDocumentsRequest other = + (com.google.firestore.admin.v1.ExportDocumentsRequest) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && getCollectionIdsList().equals(other.getCollectionIdsList()); + result = result && getOutputUriPrefix().equals(other.getOutputUriPrefix()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getCollectionIdsCount() > 0) { + hash = (37 * hash) + COLLECTION_IDS_FIELD_NUMBER; + hash = (53 * hash) + getCollectionIdsList().hashCode(); + } + hash = (37 * hash) + OUTPUT_URI_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getOutputUriPrefix().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.ExportDocumentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ExportDocumentsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ExportDocumentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ExportDocumentsRequest 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.firestore.admin.v1.ExportDocumentsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ExportDocumentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ExportDocumentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ExportDocumentsRequest 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.firestore.admin.v1.ExportDocumentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ExportDocumentsRequest 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.firestore.admin.v1.ExportDocumentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ExportDocumentsRequest 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.firestore.admin.v1.ExportDocumentsRequest 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 [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ExportDocumentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.ExportDocumentsRequest) + com.google.firestore.admin.v1.ExportDocumentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ExportDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ExportDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ExportDocumentsRequest.class, + com.google.firestore.admin.v1.ExportDocumentsRequest.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.ExportDocumentsRequest.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_ = ""; + + collectionIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + outputUriPrefix_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ExportDocumentsRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ExportDocumentsRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.ExportDocumentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.ExportDocumentsRequest build() { + com.google.firestore.admin.v1.ExportDocumentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ExportDocumentsRequest buildPartial() { + com.google.firestore.admin.v1.ExportDocumentsRequest result = + new com.google.firestore.admin.v1.ExportDocumentsRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + collectionIds_ = collectionIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.collectionIds_ = collectionIds_; + result.outputUriPrefix_ = outputUriPrefix_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.ExportDocumentsRequest) { + return mergeFrom((com.google.firestore.admin.v1.ExportDocumentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.ExportDocumentsRequest other) { + if (other == com.google.firestore.admin.v1.ExportDocumentsRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.collectionIds_.isEmpty()) { + if (collectionIds_.isEmpty()) { + collectionIds_ = other.collectionIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureCollectionIdsIsMutable(); + collectionIds_.addAll(other.collectionIds_); + } + onChanged(); + } + if (!other.getOutputUriPrefix().isEmpty()) { + outputUriPrefix_ = other.outputUriPrefix_; + 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.firestore.admin.v1.ExportDocumentsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.admin.v1.ExportDocumentsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Database to export. Should be of the form:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * Database to export. Should be of the form:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * Database to export. Should be of the form:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Database to export. Should be of the form:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Database to export. Should be of the form:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList collectionIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCollectionIdsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + collectionIds_ = new com.google.protobuf.LazyStringArrayList(collectionIds_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Which collection ids to export. Unspecified means all collections.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public com.google.protobuf.ProtocolStringList getCollectionIdsList() { + return collectionIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Which collection ids to export. Unspecified means all collections.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public int getCollectionIdsCount() { + return collectionIds_.size(); + } + /** + * + * + *
+     * Which collection ids to export. Unspecified means all collections.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public java.lang.String getCollectionIds(int index) { + return collectionIds_.get(index); + } + /** + * + * + *
+     * Which collection ids to export. Unspecified means all collections.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public com.google.protobuf.ByteString getCollectionIdsBytes(int index) { + return collectionIds_.getByteString(index); + } + /** + * + * + *
+     * Which collection ids to export. Unspecified means all collections.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public Builder setCollectionIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectionIdsIsMutable(); + collectionIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Which collection ids to export. Unspecified means all collections.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public Builder addCollectionIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectionIdsIsMutable(); + collectionIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Which collection ids to export. Unspecified means all collections.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public Builder addAllCollectionIds(java.lang.Iterable values) { + ensureCollectionIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, collectionIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Which collection ids to export. Unspecified means all collections.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public Builder clearCollectionIds() { + collectionIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Which collection ids to export. Unspecified means all collections.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public Builder addCollectionIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCollectionIdsIsMutable(); + collectionIds_.add(value); + onChanged(); + return this; + } + + private java.lang.Object outputUriPrefix_ = ""; + /** + * + * + *
+     * The output URI. Currently only supports Google Cloud Storage URIs of the
+     * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
+     * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
+     * Google Cloud Storage namespace path. When
+     * choosing a name, be sure to consider Google Cloud Storage naming
+     * guidelines: https://cloud.google.com/storage/docs/naming.
+     * If the URI is a bucket (without a namespace path), a prefix will be
+     * generated based on the start time.
+     * 
+ * + * string output_uri_prefix = 3; + */ + public java.lang.String getOutputUriPrefix() { + java.lang.Object ref = outputUriPrefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUriPrefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The output URI. Currently only supports Google Cloud Storage URIs of the
+     * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
+     * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
+     * Google Cloud Storage namespace path. When
+     * choosing a name, be sure to consider Google Cloud Storage naming
+     * guidelines: https://cloud.google.com/storage/docs/naming.
+     * If the URI is a bucket (without a namespace path), a prefix will be
+     * generated based on the start time.
+     * 
+ * + * string output_uri_prefix = 3; + */ + public com.google.protobuf.ByteString getOutputUriPrefixBytes() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUriPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The output URI. Currently only supports Google Cloud Storage URIs of the
+     * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
+     * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
+     * Google Cloud Storage namespace path. When
+     * choosing a name, be sure to consider Google Cloud Storage naming
+     * guidelines: https://cloud.google.com/storage/docs/naming.
+     * If the URI is a bucket (without a namespace path), a prefix will be
+     * generated based on the start time.
+     * 
+ * + * string output_uri_prefix = 3; + */ + public Builder setOutputUriPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + outputUriPrefix_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The output URI. Currently only supports Google Cloud Storage URIs of the
+     * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
+     * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
+     * Google Cloud Storage namespace path. When
+     * choosing a name, be sure to consider Google Cloud Storage naming
+     * guidelines: https://cloud.google.com/storage/docs/naming.
+     * If the URI is a bucket (without a namespace path), a prefix will be
+     * generated based on the start time.
+     * 
+ * + * string output_uri_prefix = 3; + */ + public Builder clearOutputUriPrefix() { + + outputUriPrefix_ = getDefaultInstance().getOutputUriPrefix(); + onChanged(); + return this; + } + /** + * + * + *
+     * The output URI. Currently only supports Google Cloud Storage URIs of the
+     * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
+     * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
+     * Google Cloud Storage namespace path. When
+     * choosing a name, be sure to consider Google Cloud Storage naming
+     * guidelines: https://cloud.google.com/storage/docs/naming.
+     * If the URI is a bucket (without a namespace path), a prefix will be
+     * generated based on the start time.
+     * 
+ * + * string output_uri_prefix = 3; + */ + public Builder setOutputUriPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + outputUriPrefix_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.ExportDocumentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ExportDocumentsRequest) + private static final com.google.firestore.admin.v1.ExportDocumentsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.ExportDocumentsRequest(); + } + + public static com.google.firestore.admin.v1.ExportDocumentsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportDocumentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportDocumentsRequest(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.firestore.admin.v1.ExportDocumentsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsRequestOrBuilder.java new file mode 100644 index 000000000000..180b898ffc62 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsRequestOrBuilder.java @@ -0,0 +1,109 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +public interface ExportDocumentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.ExportDocumentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Database to export. Should be of the form:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Database to export. Should be of the form:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Which collection ids to export. Unspecified means all collections.
+   * 
+ * + * repeated string collection_ids = 2; + */ + java.util.List getCollectionIdsList(); + /** + * + * + *
+   * Which collection ids to export. Unspecified means all collections.
+   * 
+ * + * repeated string collection_ids = 2; + */ + int getCollectionIdsCount(); + /** + * + * + *
+   * Which collection ids to export. Unspecified means all collections.
+   * 
+ * + * repeated string collection_ids = 2; + */ + java.lang.String getCollectionIds(int index); + /** + * + * + *
+   * Which collection ids to export. Unspecified means all collections.
+   * 
+ * + * repeated string collection_ids = 2; + */ + com.google.protobuf.ByteString getCollectionIdsBytes(int index); + + /** + * + * + *
+   * The output URI. Currently only supports Google Cloud Storage URIs of the
+   * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
+   * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
+   * Google Cloud Storage namespace path. When
+   * choosing a name, be sure to consider Google Cloud Storage naming
+   * guidelines: https://cloud.google.com/storage/docs/naming.
+   * If the URI is a bucket (without a namespace path), a prefix will be
+   * generated based on the start time.
+   * 
+ * + * string output_uri_prefix = 3; + */ + java.lang.String getOutputUriPrefix(); + /** + * + * + *
+   * The output URI. Currently only supports Google Cloud Storage URIs of the
+   * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
+   * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
+   * Google Cloud Storage namespace path. When
+   * choosing a name, be sure to consider Google Cloud Storage naming
+   * guidelines: https://cloud.google.com/storage/docs/naming.
+   * If the URI is a bucket (without a namespace path), a prefix will be
+   * generated based on the start time.
+   * 
+ * + * string output_uri_prefix = 3; + */ + com.google.protobuf.ByteString getOutputUriPrefixBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsResponse.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsResponse.java new file mode 100644 index 000000000000..6fe726211a8d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsResponse.java @@ -0,0 +1,614 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/operation.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * Returned in the [google.longrunning.Operation][google.longrunning.Operation] response field.
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ExportDocumentsResponse} + */ +public final class ExportDocumentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.ExportDocumentsResponse) + ExportDocumentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportDocumentsResponse.newBuilder() to construct. + private ExportDocumentsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportDocumentsResponse() { + outputUriPrefix_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportDocumentsResponse( + 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(); + + outputUriPrefix_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_ExportDocumentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_ExportDocumentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ExportDocumentsResponse.class, + com.google.firestore.admin.v1.ExportDocumentsResponse.Builder.class); + } + + public static final int OUTPUT_URI_PREFIX_FIELD_NUMBER = 1; + private volatile java.lang.Object outputUriPrefix_; + /** + * + * + *
+   * Location of the output files. This can be used to begin an import
+   * into Cloud Firestore (this project or another project) after the operation
+   * completes successfully.
+   * 
+ * + * string output_uri_prefix = 1; + */ + public java.lang.String getOutputUriPrefix() { + java.lang.Object ref = outputUriPrefix_; + 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(); + outputUriPrefix_ = s; + return s; + } + } + /** + * + * + *
+   * Location of the output files. This can be used to begin an import
+   * into Cloud Firestore (this project or another project) after the operation
+   * completes successfully.
+   * 
+ * + * string output_uri_prefix = 1; + */ + public com.google.protobuf.ByteString getOutputUriPrefixBytes() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUriPrefix_ = 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 (!getOutputUriPrefixBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, outputUriPrefix_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getOutputUriPrefixBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, outputUriPrefix_); + } + 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.firestore.admin.v1.ExportDocumentsResponse)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.ExportDocumentsResponse other = + (com.google.firestore.admin.v1.ExportDocumentsResponse) obj; + + boolean result = true; + result = result && getOutputUriPrefix().equals(other.getOutputUriPrefix()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OUTPUT_URI_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getOutputUriPrefix().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.ExportDocumentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ExportDocumentsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ExportDocumentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ExportDocumentsResponse 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.firestore.admin.v1.ExportDocumentsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ExportDocumentsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ExportDocumentsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ExportDocumentsResponse 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.firestore.admin.v1.ExportDocumentsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ExportDocumentsResponse 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.firestore.admin.v1.ExportDocumentsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ExportDocumentsResponse 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.firestore.admin.v1.ExportDocumentsResponse 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; + } + /** + * + * + *
+   * Returned in the [google.longrunning.Operation][google.longrunning.Operation] response field.
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ExportDocumentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.ExportDocumentsResponse) + com.google.firestore.admin.v1.ExportDocumentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_ExportDocumentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_ExportDocumentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ExportDocumentsResponse.class, + com.google.firestore.admin.v1.ExportDocumentsResponse.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.ExportDocumentsResponse.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(); + outputUriPrefix_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_ExportDocumentsResponse_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ExportDocumentsResponse getDefaultInstanceForType() { + return com.google.firestore.admin.v1.ExportDocumentsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.ExportDocumentsResponse build() { + com.google.firestore.admin.v1.ExportDocumentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ExportDocumentsResponse buildPartial() { + com.google.firestore.admin.v1.ExportDocumentsResponse result = + new com.google.firestore.admin.v1.ExportDocumentsResponse(this); + result.outputUriPrefix_ = outputUriPrefix_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.ExportDocumentsResponse) { + return mergeFrom((com.google.firestore.admin.v1.ExportDocumentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.ExportDocumentsResponse other) { + if (other == com.google.firestore.admin.v1.ExportDocumentsResponse.getDefaultInstance()) + return this; + if (!other.getOutputUriPrefix().isEmpty()) { + outputUriPrefix_ = other.outputUriPrefix_; + 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.firestore.admin.v1.ExportDocumentsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.admin.v1.ExportDocumentsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object outputUriPrefix_ = ""; + /** + * + * + *
+     * Location of the output files. This can be used to begin an import
+     * into Cloud Firestore (this project or another project) after the operation
+     * completes successfully.
+     * 
+ * + * string output_uri_prefix = 1; + */ + public java.lang.String getOutputUriPrefix() { + java.lang.Object ref = outputUriPrefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUriPrefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Location of the output files. This can be used to begin an import
+     * into Cloud Firestore (this project or another project) after the operation
+     * completes successfully.
+     * 
+ * + * string output_uri_prefix = 1; + */ + public com.google.protobuf.ByteString getOutputUriPrefixBytes() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUriPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Location of the output files. This can be used to begin an import
+     * into Cloud Firestore (this project or another project) after the operation
+     * completes successfully.
+     * 
+ * + * string output_uri_prefix = 1; + */ + public Builder setOutputUriPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + outputUriPrefix_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Location of the output files. This can be used to begin an import
+     * into Cloud Firestore (this project or another project) after the operation
+     * completes successfully.
+     * 
+ * + * string output_uri_prefix = 1; + */ + public Builder clearOutputUriPrefix() { + + outputUriPrefix_ = getDefaultInstance().getOutputUriPrefix(); + onChanged(); + return this; + } + /** + * + * + *
+     * Location of the output files. This can be used to begin an import
+     * into Cloud Firestore (this project or another project) after the operation
+     * completes successfully.
+     * 
+ * + * string output_uri_prefix = 1; + */ + public Builder setOutputUriPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + outputUriPrefix_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.ExportDocumentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ExportDocumentsResponse) + private static final com.google.firestore.admin.v1.ExportDocumentsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.ExportDocumentsResponse(); + } + + public static com.google.firestore.admin.v1.ExportDocumentsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportDocumentsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportDocumentsResponse(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.firestore.admin.v1.ExportDocumentsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsResponseOrBuilder.java new file mode 100644 index 000000000000..fa2fabdedb07 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsResponseOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/operation.proto + +package com.google.firestore.admin.v1; + +public interface ExportDocumentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.ExportDocumentsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Location of the output files. This can be used to begin an import
+   * into Cloud Firestore (this project or another project) after the operation
+   * completes successfully.
+   * 
+ * + * string output_uri_prefix = 1; + */ + java.lang.String getOutputUriPrefix(); + /** + * + * + *
+   * Location of the output files. This can be used to begin an import
+   * into Cloud Firestore (this project or another project) after the operation
+   * completes successfully.
+   * 
+ * + * string output_uri_prefix = 1; + */ + com.google.protobuf.ByteString getOutputUriPrefixBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Field.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Field.java new file mode 100644 index 000000000000..cd4f1f7afcc2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Field.java @@ -0,0 +1,2470 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/field.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * Represents a single field in the database.
+ * Fields are grouped by their "Collection Group", which represent all
+ * collections in the database with the same id.
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.Field} + */ +public final class Field extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.Field) + FieldOrBuilder { + private static final long serialVersionUID = 0L; + // Use Field.newBuilder() to construct. + private Field(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Field() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Field( + 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(); + + name_ = s; + break; + } + case 18: + { + com.google.firestore.admin.v1.Field.IndexConfig.Builder subBuilder = null; + if (indexConfig_ != null) { + subBuilder = indexConfig_.toBuilder(); + } + indexConfig_ = + input.readMessage( + com.google.firestore.admin.v1.Field.IndexConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(indexConfig_); + indexConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(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.firestore.admin.v1.FieldProto + .internal_static_google_firestore_admin_v1_Field_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FieldProto + .internal_static_google_firestore_admin_v1_Field_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.Field.class, + com.google.firestore.admin.v1.Field.Builder.class); + } + + public interface IndexConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.Field.IndexConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The indexes supported for this field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + java.util.List getIndexesList(); + /** + * + * + *
+     * The indexes supported for this field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + com.google.firestore.admin.v1.Index getIndexes(int index); + /** + * + * + *
+     * The indexes supported for this field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + int getIndexesCount(); + /** + * + * + *
+     * The indexes supported for this field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + java.util.List + getIndexesOrBuilderList(); + /** + * + * + *
+     * The indexes supported for this field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + com.google.firestore.admin.v1.IndexOrBuilder getIndexesOrBuilder(int index); + + /** + * + * + *
+     * Output only.
+     * When true, the `Field`'s index configuration is set from the
+     * configuration specified by the `ancestor_field`.
+     * When false, the `Field`'s index configuration is defined explicitly.
+     * 
+ * + * bool uses_ancestor_config = 2; + */ + boolean getUsesAncestorConfig(); + + /** + * + * + *
+     * Output only.
+     * Specifies the resource name of the `Field` from which this field's
+     * index configuration is set (when `uses_ancestor_config` is true),
+     * or from which it *would* be set if this field had no index configuration
+     * (when `uses_ancestor_config` is false).
+     * 
+ * + * string ancestor_field = 3; + */ + java.lang.String getAncestorField(); + /** + * + * + *
+     * Output only.
+     * Specifies the resource name of the `Field` from which this field's
+     * index configuration is set (when `uses_ancestor_config` is true),
+     * or from which it *would* be set if this field had no index configuration
+     * (when `uses_ancestor_config` is false).
+     * 
+ * + * string ancestor_field = 3; + */ + com.google.protobuf.ByteString getAncestorFieldBytes(); + + /** + * + * + *
+     * Output only
+     * When true, the `Field`'s index configuration is in the process of being
+     * reverted. Once complete, the index config will transition to the same
+     * state as the field specified by `ancestor_field`, at which point
+     * `uses_ancestor_config` will be `true` and `reverting` will be `false`.
+     * 
+ * + * bool reverting = 4; + */ + boolean getReverting(); + } + /** + * + * + *
+   * The index configuration for this field.
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.Field.IndexConfig} + */ + public static final class IndexConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.Field.IndexConfig) + IndexConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use IndexConfig.newBuilder() to construct. + private IndexConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IndexConfig() { + indexes_ = java.util.Collections.emptyList(); + usesAncestorConfig_ = false; + ancestorField_ = ""; + reverting_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private IndexConfig( + 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) == 0x00000001)) { + indexes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + indexes_.add( + input.readMessage( + com.google.firestore.admin.v1.Index.parser(), extensionRegistry)); + break; + } + case 16: + { + usesAncestorConfig_ = input.readBool(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + ancestorField_ = s; + break; + } + case 32: + { + reverting_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownFieldProto3(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) == 0x00000001)) { + indexes_ = java.util.Collections.unmodifiableList(indexes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FieldProto + .internal_static_google_firestore_admin_v1_Field_IndexConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FieldProto + .internal_static_google_firestore_admin_v1_Field_IndexConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.Field.IndexConfig.class, + com.google.firestore.admin.v1.Field.IndexConfig.Builder.class); + } + + private int bitField0_; + public static final int INDEXES_FIELD_NUMBER = 1; + private java.util.List indexes_; + /** + * + * + *
+     * The indexes supported for this field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public java.util.List getIndexesList() { + return indexes_; + } + /** + * + * + *
+     * The indexes supported for this field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public java.util.List + getIndexesOrBuilderList() { + return indexes_; + } + /** + * + * + *
+     * The indexes supported for this field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public int getIndexesCount() { + return indexes_.size(); + } + /** + * + * + *
+     * The indexes supported for this field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public com.google.firestore.admin.v1.Index getIndexes(int index) { + return indexes_.get(index); + } + /** + * + * + *
+     * The indexes supported for this field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public com.google.firestore.admin.v1.IndexOrBuilder getIndexesOrBuilder(int index) { + return indexes_.get(index); + } + + public static final int USES_ANCESTOR_CONFIG_FIELD_NUMBER = 2; + private boolean usesAncestorConfig_; + /** + * + * + *
+     * Output only.
+     * When true, the `Field`'s index configuration is set from the
+     * configuration specified by the `ancestor_field`.
+     * When false, the `Field`'s index configuration is defined explicitly.
+     * 
+ * + * bool uses_ancestor_config = 2; + */ + public boolean getUsesAncestorConfig() { + return usesAncestorConfig_; + } + + public static final int ANCESTOR_FIELD_FIELD_NUMBER = 3; + private volatile java.lang.Object ancestorField_; + /** + * + * + *
+     * Output only.
+     * Specifies the resource name of the `Field` from which this field's
+     * index configuration is set (when `uses_ancestor_config` is true),
+     * or from which it *would* be set if this field had no index configuration
+     * (when `uses_ancestor_config` is false).
+     * 
+ * + * string ancestor_field = 3; + */ + public java.lang.String getAncestorField() { + java.lang.Object ref = ancestorField_; + 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(); + ancestorField_ = s; + return s; + } + } + /** + * + * + *
+     * Output only.
+     * Specifies the resource name of the `Field` from which this field's
+     * index configuration is set (when `uses_ancestor_config` is true),
+     * or from which it *would* be set if this field had no index configuration
+     * (when `uses_ancestor_config` is false).
+     * 
+ * + * string ancestor_field = 3; + */ + public com.google.protobuf.ByteString getAncestorFieldBytes() { + java.lang.Object ref = ancestorField_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ancestorField_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REVERTING_FIELD_NUMBER = 4; + private boolean reverting_; + /** + * + * + *
+     * Output only
+     * When true, the `Field`'s index configuration is in the process of being
+     * reverted. Once complete, the index config will transition to the same
+     * state as the field specified by `ancestor_field`, at which point
+     * `uses_ancestor_config` will be `true` and `reverting` will be `false`.
+     * 
+ * + * bool reverting = 4; + */ + public boolean getReverting() { + return reverting_; + } + + 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 (usesAncestorConfig_ != false) { + output.writeBool(2, usesAncestorConfig_); + } + if (!getAncestorFieldBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, ancestorField_); + } + if (reverting_ != false) { + output.writeBool(4, reverting_); + } + 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 (usesAncestorConfig_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, usesAncestorConfig_); + } + if (!getAncestorFieldBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, ancestorField_); + } + if (reverting_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, reverting_); + } + 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.firestore.admin.v1.Field.IndexConfig)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.Field.IndexConfig other = + (com.google.firestore.admin.v1.Field.IndexConfig) obj; + + boolean result = true; + result = result && getIndexesList().equals(other.getIndexesList()); + result = result && (getUsesAncestorConfig() == other.getUsesAncestorConfig()); + result = result && getAncestorField().equals(other.getAncestorField()); + result = result && (getReverting() == other.getReverting()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + USES_ANCESTOR_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUsesAncestorConfig()); + hash = (37 * hash) + ANCESTOR_FIELD_FIELD_NUMBER; + hash = (53 * hash) + getAncestorField().hashCode(); + hash = (37 * hash) + REVERTING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReverting()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.Field.IndexConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.Field.IndexConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.Field.IndexConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.Field.IndexConfig 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.firestore.admin.v1.Field.IndexConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.Field.IndexConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.Field.IndexConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.Field.IndexConfig 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.firestore.admin.v1.Field.IndexConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.Field.IndexConfig 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.firestore.admin.v1.Field.IndexConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.Field.IndexConfig 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.firestore.admin.v1.Field.IndexConfig 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 index configuration for this field.
+     * 
+ * + * Protobuf type {@code google.firestore.admin.v1.Field.IndexConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.Field.IndexConfig) + com.google.firestore.admin.v1.Field.IndexConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FieldProto + .internal_static_google_firestore_admin_v1_Field_IndexConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FieldProto + .internal_static_google_firestore_admin_v1_Field_IndexConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.Field.IndexConfig.class, + com.google.firestore.admin.v1.Field.IndexConfig.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.Field.IndexConfig.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(); + } + usesAncestorConfig_ = false; + + ancestorField_ = ""; + + reverting_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FieldProto + .internal_static_google_firestore_admin_v1_Field_IndexConfig_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.Field.IndexConfig getDefaultInstanceForType() { + return com.google.firestore.admin.v1.Field.IndexConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.Field.IndexConfig build() { + com.google.firestore.admin.v1.Field.IndexConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.Field.IndexConfig buildPartial() { + com.google.firestore.admin.v1.Field.IndexConfig result = + new com.google.firestore.admin.v1.Field.IndexConfig(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (indexesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + indexes_ = java.util.Collections.unmodifiableList(indexes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.indexes_ = indexes_; + } else { + result.indexes_ = indexesBuilder_.build(); + } + result.usesAncestorConfig_ = usesAncestorConfig_; + result.ancestorField_ = ancestorField_; + result.reverting_ = reverting_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.Field.IndexConfig) { + return mergeFrom((com.google.firestore.admin.v1.Field.IndexConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.Field.IndexConfig other) { + if (other == com.google.firestore.admin.v1.Field.IndexConfig.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.getUsesAncestorConfig() != false) { + setUsesAncestorConfig(other.getUsesAncestorConfig()); + } + if (!other.getAncestorField().isEmpty()) { + ancestorField_ = other.ancestorField_; + onChanged(); + } + if (other.getReverting() != false) { + setReverting(other.getReverting()); + } + 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.firestore.admin.v1.Field.IndexConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.admin.v1.Field.IndexConfig) 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) == 0x00000001)) { + indexes_ = new java.util.ArrayList(indexes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.Index, + com.google.firestore.admin.v1.Index.Builder, + com.google.firestore.admin.v1.IndexOrBuilder> + indexesBuilder_; + + /** + * + * + *
+       * The indexes supported for this field.
+       * 
+ * + * repeated .google.firestore.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 supported for this field.
+       * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public int getIndexesCount() { + if (indexesBuilder_ == null) { + return indexes_.size(); + } else { + return indexesBuilder_.getCount(); + } + } + /** + * + * + *
+       * The indexes supported for this field.
+       * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public com.google.firestore.admin.v1.Index getIndexes(int index) { + if (indexesBuilder_ == null) { + return indexes_.get(index); + } else { + return indexesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * The indexes supported for this field.
+       * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public Builder setIndexes(int index, com.google.firestore.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 supported for this field.
+       * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public Builder setIndexes( + int index, com.google.firestore.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 supported for this field.
+       * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public Builder addIndexes(com.google.firestore.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 supported for this field.
+       * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public Builder addIndexes(int index, com.google.firestore.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 supported for this field.
+       * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public Builder addIndexes(com.google.firestore.admin.v1.Index.Builder builderForValue) { + if (indexesBuilder_ == null) { + ensureIndexesIsMutable(); + indexes_.add(builderForValue.build()); + onChanged(); + } else { + indexesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The indexes supported for this field.
+       * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public Builder addIndexes( + int index, com.google.firestore.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 supported for this field.
+       * 
+ * + * repeated .google.firestore.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 supported for this field.
+       * 
+ * + * repeated .google.firestore.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 supported for this field.
+       * 
+ * + * repeated .google.firestore.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 supported for this field.
+       * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public com.google.firestore.admin.v1.Index.Builder getIndexesBuilder(int index) { + return getIndexesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * The indexes supported for this field.
+       * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public com.google.firestore.admin.v1.IndexOrBuilder getIndexesOrBuilder(int index) { + if (indexesBuilder_ == null) { + return indexes_.get(index); + } else { + return indexesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * The indexes supported for this field.
+       * 
+ * + * repeated .google.firestore.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 supported for this field.
+       * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public com.google.firestore.admin.v1.Index.Builder addIndexesBuilder() { + return getIndexesFieldBuilder() + .addBuilder(com.google.firestore.admin.v1.Index.getDefaultInstance()); + } + /** + * + * + *
+       * The indexes supported for this field.
+       * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public com.google.firestore.admin.v1.Index.Builder addIndexesBuilder(int index) { + return getIndexesFieldBuilder() + .addBuilder(index, com.google.firestore.admin.v1.Index.getDefaultInstance()); + } + /** + * + * + *
+       * The indexes supported for this field.
+       * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public java.util.List getIndexesBuilderList() { + return getIndexesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.Index, + com.google.firestore.admin.v1.Index.Builder, + com.google.firestore.admin.v1.IndexOrBuilder> + getIndexesFieldBuilder() { + if (indexesBuilder_ == null) { + indexesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.Index, + com.google.firestore.admin.v1.Index.Builder, + com.google.firestore.admin.v1.IndexOrBuilder>( + indexes_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + indexes_ = null; + } + return indexesBuilder_; + } + + private boolean usesAncestorConfig_; + /** + * + * + *
+       * Output only.
+       * When true, the `Field`'s index configuration is set from the
+       * configuration specified by the `ancestor_field`.
+       * When false, the `Field`'s index configuration is defined explicitly.
+       * 
+ * + * bool uses_ancestor_config = 2; + */ + public boolean getUsesAncestorConfig() { + return usesAncestorConfig_; + } + /** + * + * + *
+       * Output only.
+       * When true, the `Field`'s index configuration is set from the
+       * configuration specified by the `ancestor_field`.
+       * When false, the `Field`'s index configuration is defined explicitly.
+       * 
+ * + * bool uses_ancestor_config = 2; + */ + public Builder setUsesAncestorConfig(boolean value) { + + usesAncestorConfig_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only.
+       * When true, the `Field`'s index configuration is set from the
+       * configuration specified by the `ancestor_field`.
+       * When false, the `Field`'s index configuration is defined explicitly.
+       * 
+ * + * bool uses_ancestor_config = 2; + */ + public Builder clearUsesAncestorConfig() { + + usesAncestorConfig_ = false; + onChanged(); + return this; + } + + private java.lang.Object ancestorField_ = ""; + /** + * + * + *
+       * Output only.
+       * Specifies the resource name of the `Field` from which this field's
+       * index configuration is set (when `uses_ancestor_config` is true),
+       * or from which it *would* be set if this field had no index configuration
+       * (when `uses_ancestor_config` is false).
+       * 
+ * + * string ancestor_field = 3; + */ + public java.lang.String getAncestorField() { + java.lang.Object ref = ancestorField_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ancestorField_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Output only.
+       * Specifies the resource name of the `Field` from which this field's
+       * index configuration is set (when `uses_ancestor_config` is true),
+       * or from which it *would* be set if this field had no index configuration
+       * (when `uses_ancestor_config` is false).
+       * 
+ * + * string ancestor_field = 3; + */ + public com.google.protobuf.ByteString getAncestorFieldBytes() { + java.lang.Object ref = ancestorField_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ancestorField_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Output only.
+       * Specifies the resource name of the `Field` from which this field's
+       * index configuration is set (when `uses_ancestor_config` is true),
+       * or from which it *would* be set if this field had no index configuration
+       * (when `uses_ancestor_config` is false).
+       * 
+ * + * string ancestor_field = 3; + */ + public Builder setAncestorField(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ancestorField_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only.
+       * Specifies the resource name of the `Field` from which this field's
+       * index configuration is set (when `uses_ancestor_config` is true),
+       * or from which it *would* be set if this field had no index configuration
+       * (when `uses_ancestor_config` is false).
+       * 
+ * + * string ancestor_field = 3; + */ + public Builder clearAncestorField() { + + ancestorField_ = getDefaultInstance().getAncestorField(); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only.
+       * Specifies the resource name of the `Field` from which this field's
+       * index configuration is set (when `uses_ancestor_config` is true),
+       * or from which it *would* be set if this field had no index configuration
+       * (when `uses_ancestor_config` is false).
+       * 
+ * + * string ancestor_field = 3; + */ + public Builder setAncestorFieldBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ancestorField_ = value; + onChanged(); + return this; + } + + private boolean reverting_; + /** + * + * + *
+       * Output only
+       * When true, the `Field`'s index configuration is in the process of being
+       * reverted. Once complete, the index config will transition to the same
+       * state as the field specified by `ancestor_field`, at which point
+       * `uses_ancestor_config` will be `true` and `reverting` will be `false`.
+       * 
+ * + * bool reverting = 4; + */ + public boolean getReverting() { + return reverting_; + } + /** + * + * + *
+       * Output only
+       * When true, the `Field`'s index configuration is in the process of being
+       * reverted. Once complete, the index config will transition to the same
+       * state as the field specified by `ancestor_field`, at which point
+       * `uses_ancestor_config` will be `true` and `reverting` will be `false`.
+       * 
+ * + * bool reverting = 4; + */ + public Builder setReverting(boolean value) { + + reverting_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only
+       * When true, the `Field`'s index configuration is in the process of being
+       * reverted. Once complete, the index config will transition to the same
+       * state as the field specified by `ancestor_field`, at which point
+       * `uses_ancestor_config` will be `true` and `reverting` will be `false`.
+       * 
+ * + * bool reverting = 4; + */ + public Builder clearReverting() { + + reverting_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.Field.IndexConfig) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.Field.IndexConfig) + private static final com.google.firestore.admin.v1.Field.IndexConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.Field.IndexConfig(); + } + + public static com.google.firestore.admin.v1.Field.IndexConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IndexConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IndexConfig(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.firestore.admin.v1.Field.IndexConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * A field name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+   * A field path may be a simple field name, e.g. `address` or a path to fields
+   * within map_value , e.g. `address.city`,
+   * or a special field path. The only valid special field is `*`, which
+   * represents any field.
+   * Field paths may be quoted using ` (backtick). The only character that needs
+   * to be escaped within a quoted field path is the backtick character itself,
+   * escaped using a backslash. Special characters in field paths that
+   * must be quoted include: `*`, `.`,
+   * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters.
+   * Examples:
+   * (Note: Comments here are written in markdown syntax, so there is an
+   *  additional layer of backticks to represent a code block)
+   * `\`address.city\`` represents a field named `address.city`, not the map key
+   * `city` in the field `address`.
+   * `\`*\`` represents a field named `*`, not any field.
+   * A special `Field` contains the default indexing settings for all fields.
+   * This field's resource name is:
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
+   * Indexes defined on this `Field` will be applied to all fields which do not
+   * have their own `Field` index configuration.
+   * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+   * A field name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+   * A field path may be a simple field name, e.g. `address` or a path to fields
+   * within map_value , e.g. `address.city`,
+   * or a special field path. The only valid special field is `*`, which
+   * represents any field.
+   * Field paths may be quoted using ` (backtick). The only character that needs
+   * to be escaped within a quoted field path is the backtick character itself,
+   * escaped using a backslash. Special characters in field paths that
+   * must be quoted include: `*`, `.`,
+   * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters.
+   * Examples:
+   * (Note: Comments here are written in markdown syntax, so there is an
+   *  additional layer of backticks to represent a code block)
+   * `\`address.city\`` represents a field named `address.city`, not the map key
+   * `city` in the field `address`.
+   * `\`*\`` represents a field named `*`, not any field.
+   * A special `Field` contains the default indexing settings for all fields.
+   * This field's resource name is:
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
+   * Indexes defined on this `Field` will be applied to all fields which do not
+   * have their own `Field` index configuration.
+   * 
+ * + * string name = 1; + */ + 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 INDEX_CONFIG_FIELD_NUMBER = 2; + private com.google.firestore.admin.v1.Field.IndexConfig indexConfig_; + /** + * + * + *
+   * The index configuration for this field. If unset, field indexing will
+   * revert to the configuration defined by the `ancestor_field`. To
+   * explicitly remove all indexes for this field, specify an index config
+   * with an empty list of indexes.
+   * 
+ * + * .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + */ + public boolean hasIndexConfig() { + return indexConfig_ != null; + } + /** + * + * + *
+   * The index configuration for this field. If unset, field indexing will
+   * revert to the configuration defined by the `ancestor_field`. To
+   * explicitly remove all indexes for this field, specify an index config
+   * with an empty list of indexes.
+   * 
+ * + * .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + */ + public com.google.firestore.admin.v1.Field.IndexConfig getIndexConfig() { + return indexConfig_ == null + ? com.google.firestore.admin.v1.Field.IndexConfig.getDefaultInstance() + : indexConfig_; + } + /** + * + * + *
+   * The index configuration for this field. If unset, field indexing will
+   * revert to the configuration defined by the `ancestor_field`. To
+   * explicitly remove all indexes for this field, specify an index config
+   * with an empty list of indexes.
+   * 
+ * + * .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + */ + public com.google.firestore.admin.v1.Field.IndexConfigOrBuilder getIndexConfigOrBuilder() { + return getIndexConfig(); + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (indexConfig_ != null) { + output.writeMessage(2, getIndexConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (indexConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getIndexConfig()); + } + 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.firestore.admin.v1.Field)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.Field other = (com.google.firestore.admin.v1.Field) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && (hasIndexConfig() == other.hasIndexConfig()); + if (hasIndexConfig()) { + result = result && getIndexConfig().equals(other.getIndexConfig()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasIndexConfig()) { + hash = (37 * hash) + INDEX_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getIndexConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.Field parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.Field parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.Field parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.Field 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.firestore.admin.v1.Field parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.Field parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.Field parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.Field 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.firestore.admin.v1.Field parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.Field 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.firestore.admin.v1.Field parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.Field 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.firestore.admin.v1.Field prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents a single field in the database.
+   * Fields are grouped by their "Collection Group", which represent all
+   * collections in the database with the same id.
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.Field} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.Field) + com.google.firestore.admin.v1.FieldOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FieldProto + .internal_static_google_firestore_admin_v1_Field_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FieldProto + .internal_static_google_firestore_admin_v1_Field_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.Field.class, + com.google.firestore.admin.v1.Field.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.Field.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_ = ""; + + if (indexConfigBuilder_ == null) { + indexConfig_ = null; + } else { + indexConfig_ = null; + indexConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FieldProto + .internal_static_google_firestore_admin_v1_Field_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.Field getDefaultInstanceForType() { + return com.google.firestore.admin.v1.Field.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.Field build() { + com.google.firestore.admin.v1.Field result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.Field buildPartial() { + com.google.firestore.admin.v1.Field result = new com.google.firestore.admin.v1.Field(this); + result.name_ = name_; + if (indexConfigBuilder_ == null) { + result.indexConfig_ = indexConfig_; + } else { + result.indexConfig_ = indexConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.Field) { + return mergeFrom((com.google.firestore.admin.v1.Field) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.Field other) { + if (other == com.google.firestore.admin.v1.Field.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasIndexConfig()) { + mergeIndexConfig(other.getIndexConfig()); + } + 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.firestore.admin.v1.Field parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.admin.v1.Field) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * A field name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+     * A field path may be a simple field name, e.g. `address` or a path to fields
+     * within map_value , e.g. `address.city`,
+     * or a special field path. The only valid special field is `*`, which
+     * represents any field.
+     * Field paths may be quoted using ` (backtick). The only character that needs
+     * to be escaped within a quoted field path is the backtick character itself,
+     * escaped using a backslash. Special characters in field paths that
+     * must be quoted include: `*`, `.`,
+     * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters.
+     * Examples:
+     * (Note: Comments here are written in markdown syntax, so there is an
+     *  additional layer of backticks to represent a code block)
+     * `\`address.city\`` represents a field named `address.city`, not the map key
+     * `city` in the field `address`.
+     * `\`*\`` represents a field named `*`, not any field.
+     * A special `Field` contains the default indexing settings for all fields.
+     * This field's resource name is:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
+     * Indexes defined on this `Field` will be applied to all fields which do not
+     * have their own `Field` index configuration.
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * A field name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+     * A field path may be a simple field name, e.g. `address` or a path to fields
+     * within map_value , e.g. `address.city`,
+     * or a special field path. The only valid special field is `*`, which
+     * represents any field.
+     * Field paths may be quoted using ` (backtick). The only character that needs
+     * to be escaped within a quoted field path is the backtick character itself,
+     * escaped using a backslash. Special characters in field paths that
+     * must be quoted include: `*`, `.`,
+     * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters.
+     * Examples:
+     * (Note: Comments here are written in markdown syntax, so there is an
+     *  additional layer of backticks to represent a code block)
+     * `\`address.city\`` represents a field named `address.city`, not the map key
+     * `city` in the field `address`.
+     * `\`*\`` represents a field named `*`, not any field.
+     * A special `Field` contains the default indexing settings for all fields.
+     * This field's resource name is:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
+     * Indexes defined on this `Field` will be applied to all fields which do not
+     * have their own `Field` index configuration.
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * A field name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+     * A field path may be a simple field name, e.g. `address` or a path to fields
+     * within map_value , e.g. `address.city`,
+     * or a special field path. The only valid special field is `*`, which
+     * represents any field.
+     * Field paths may be quoted using ` (backtick). The only character that needs
+     * to be escaped within a quoted field path is the backtick character itself,
+     * escaped using a backslash. Special characters in field paths that
+     * must be quoted include: `*`, `.`,
+     * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters.
+     * Examples:
+     * (Note: Comments here are written in markdown syntax, so there is an
+     *  additional layer of backticks to represent a code block)
+     * `\`address.city\`` represents a field named `address.city`, not the map key
+     * `city` in the field `address`.
+     * `\`*\`` represents a field named `*`, not any field.
+     * A special `Field` contains the default indexing settings for all fields.
+     * This field's resource name is:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
+     * Indexes defined on this `Field` will be applied to all fields which do not
+     * have their own `Field` index configuration.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A field name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+     * A field path may be a simple field name, e.g. `address` or a path to fields
+     * within map_value , e.g. `address.city`,
+     * or a special field path. The only valid special field is `*`, which
+     * represents any field.
+     * Field paths may be quoted using ` (backtick). The only character that needs
+     * to be escaped within a quoted field path is the backtick character itself,
+     * escaped using a backslash. Special characters in field paths that
+     * must be quoted include: `*`, `.`,
+     * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters.
+     * Examples:
+     * (Note: Comments here are written in markdown syntax, so there is an
+     *  additional layer of backticks to represent a code block)
+     * `\`address.city\`` represents a field named `address.city`, not the map key
+     * `city` in the field `address`.
+     * `\`*\`` represents a field named `*`, not any field.
+     * A special `Field` contains the default indexing settings for all fields.
+     * This field's resource name is:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
+     * Indexes defined on this `Field` will be applied to all fields which do not
+     * have their own `Field` index configuration.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * A field name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+     * A field path may be a simple field name, e.g. `address` or a path to fields
+     * within map_value , e.g. `address.city`,
+     * or a special field path. The only valid special field is `*`, which
+     * represents any field.
+     * Field paths may be quoted using ` (backtick). The only character that needs
+     * to be escaped within a quoted field path is the backtick character itself,
+     * escaped using a backslash. Special characters in field paths that
+     * must be quoted include: `*`, `.`,
+     * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters.
+     * Examples:
+     * (Note: Comments here are written in markdown syntax, so there is an
+     *  additional layer of backticks to represent a code block)
+     * `\`address.city\`` represents a field named `address.city`, not the map key
+     * `city` in the field `address`.
+     * `\`*\`` represents a field named `*`, not any field.
+     * A special `Field` contains the default indexing settings for all fields.
+     * This field's resource name is:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
+     * Indexes defined on this `Field` will be applied to all fields which do not
+     * have their own `Field` index configuration.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.firestore.admin.v1.Field.IndexConfig indexConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Field.IndexConfig, + com.google.firestore.admin.v1.Field.IndexConfig.Builder, + com.google.firestore.admin.v1.Field.IndexConfigOrBuilder> + indexConfigBuilder_; + /** + * + * + *
+     * The index configuration for this field. If unset, field indexing will
+     * revert to the configuration defined by the `ancestor_field`. To
+     * explicitly remove all indexes for this field, specify an index config
+     * with an empty list of indexes.
+     * 
+ * + * .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + */ + public boolean hasIndexConfig() { + return indexConfigBuilder_ != null || indexConfig_ != null; + } + /** + * + * + *
+     * The index configuration for this field. If unset, field indexing will
+     * revert to the configuration defined by the `ancestor_field`. To
+     * explicitly remove all indexes for this field, specify an index config
+     * with an empty list of indexes.
+     * 
+ * + * .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + */ + public com.google.firestore.admin.v1.Field.IndexConfig getIndexConfig() { + if (indexConfigBuilder_ == null) { + return indexConfig_ == null + ? com.google.firestore.admin.v1.Field.IndexConfig.getDefaultInstance() + : indexConfig_; + } else { + return indexConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The index configuration for this field. If unset, field indexing will
+     * revert to the configuration defined by the `ancestor_field`. To
+     * explicitly remove all indexes for this field, specify an index config
+     * with an empty list of indexes.
+     * 
+ * + * .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + */ + public Builder setIndexConfig(com.google.firestore.admin.v1.Field.IndexConfig value) { + if (indexConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + indexConfig_ = value; + onChanged(); + } else { + indexConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The index configuration for this field. If unset, field indexing will
+     * revert to the configuration defined by the `ancestor_field`. To
+     * explicitly remove all indexes for this field, specify an index config
+     * with an empty list of indexes.
+     * 
+ * + * .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + */ + public Builder setIndexConfig( + com.google.firestore.admin.v1.Field.IndexConfig.Builder builderForValue) { + if (indexConfigBuilder_ == null) { + indexConfig_ = builderForValue.build(); + onChanged(); + } else { + indexConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The index configuration for this field. If unset, field indexing will
+     * revert to the configuration defined by the `ancestor_field`. To
+     * explicitly remove all indexes for this field, specify an index config
+     * with an empty list of indexes.
+     * 
+ * + * .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + */ + public Builder mergeIndexConfig(com.google.firestore.admin.v1.Field.IndexConfig value) { + if (indexConfigBuilder_ == null) { + if (indexConfig_ != null) { + indexConfig_ = + com.google.firestore.admin.v1.Field.IndexConfig.newBuilder(indexConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + indexConfig_ = value; + } + onChanged(); + } else { + indexConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The index configuration for this field. If unset, field indexing will
+     * revert to the configuration defined by the `ancestor_field`. To
+     * explicitly remove all indexes for this field, specify an index config
+     * with an empty list of indexes.
+     * 
+ * + * .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + */ + public Builder clearIndexConfig() { + if (indexConfigBuilder_ == null) { + indexConfig_ = null; + onChanged(); + } else { + indexConfig_ = null; + indexConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The index configuration for this field. If unset, field indexing will
+     * revert to the configuration defined by the `ancestor_field`. To
+     * explicitly remove all indexes for this field, specify an index config
+     * with an empty list of indexes.
+     * 
+ * + * .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + */ + public com.google.firestore.admin.v1.Field.IndexConfig.Builder getIndexConfigBuilder() { + + onChanged(); + return getIndexConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The index configuration for this field. If unset, field indexing will
+     * revert to the configuration defined by the `ancestor_field`. To
+     * explicitly remove all indexes for this field, specify an index config
+     * with an empty list of indexes.
+     * 
+ * + * .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + */ + public com.google.firestore.admin.v1.Field.IndexConfigOrBuilder getIndexConfigOrBuilder() { + if (indexConfigBuilder_ != null) { + return indexConfigBuilder_.getMessageOrBuilder(); + } else { + return indexConfig_ == null + ? com.google.firestore.admin.v1.Field.IndexConfig.getDefaultInstance() + : indexConfig_; + } + } + /** + * + * + *
+     * The index configuration for this field. If unset, field indexing will
+     * revert to the configuration defined by the `ancestor_field`. To
+     * explicitly remove all indexes for this field, specify an index config
+     * with an empty list of indexes.
+     * 
+ * + * .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Field.IndexConfig, + com.google.firestore.admin.v1.Field.IndexConfig.Builder, + com.google.firestore.admin.v1.Field.IndexConfigOrBuilder> + getIndexConfigFieldBuilder() { + if (indexConfigBuilder_ == null) { + indexConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Field.IndexConfig, + com.google.firestore.admin.v1.Field.IndexConfig.Builder, + com.google.firestore.admin.v1.Field.IndexConfigOrBuilder>( + getIndexConfig(), getParentForChildren(), isClean()); + indexConfig_ = null; + } + return indexConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.Field) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.Field) + private static final com.google.firestore.admin.v1.Field DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.Field(); + } + + public static com.google.firestore.admin.v1.Field getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Field parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Field(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.firestore.admin.v1.Field getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldName.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldName.java new file mode 100644 index 000000000000..dd2b2e9f7d58 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldName.java @@ -0,0 +1,248 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.google.firestore.admin.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class FieldName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/databases/{database}/collectionGroups/{collection_id}/fields/{field_id}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String database; + private final String collectionId; + private final String fieldId; + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public String getCollectionId() { + return collectionId; + } + + public String getFieldId() { + return fieldId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private FieldName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + database = Preconditions.checkNotNull(builder.getDatabase()); + collectionId = Preconditions.checkNotNull(builder.getCollectionId()); + fieldId = Preconditions.checkNotNull(builder.getFieldId()); + } + + public static FieldName of(String project, String database, String collectionId, String fieldId) { + return newBuilder() + .setProject(project) + .setDatabase(database) + .setCollectionId(collectionId) + .setFieldId(fieldId) + .build(); + } + + public static String format( + String project, String database, String collectionId, String fieldId) { + return newBuilder() + .setProject(project) + .setDatabase(database) + .setCollectionId(collectionId) + .setFieldId(fieldId) + .build() + .toString(); + } + + public static FieldName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "FieldName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("database"), + matchMap.get("collection_id"), + matchMap.get("field_id")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (FieldName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("database", database); + fieldMapBuilder.put("collectionId", collectionId); + fieldMapBuilder.put("fieldId", fieldId); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", + project, + "database", + database, + "collection_id", + collectionId, + "field_id", + fieldId); + } + + /** Builder for FieldName. */ + public static class Builder { + + private String project; + private String database; + private String collectionId; + private String fieldId; + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public String getCollectionId() { + return collectionId; + } + + public String getFieldId() { + return fieldId; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setDatabase(String database) { + this.database = database; + return this; + } + + public Builder setCollectionId(String collectionId) { + this.collectionId = collectionId; + return this; + } + + public Builder setFieldId(String fieldId) { + this.fieldId = fieldId; + return this; + } + + private Builder() {} + + private Builder(FieldName fieldName) { + project = fieldName.project; + database = fieldName.database; + collectionId = fieldName.collectionId; + fieldId = fieldName.fieldId; + } + + public FieldName build() { + return new FieldName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof FieldName) { + FieldName that = (FieldName) o; + return (this.project.equals(that.project)) + && (this.database.equals(that.database)) + && (this.collectionId.equals(that.collectionId)) + && (this.fieldId.equals(that.fieldId)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= database.hashCode(); + h *= 1000003; + h ^= collectionId.hashCode(); + h *= 1000003; + h ^= fieldId.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOperationMetadata.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOperationMetadata.java new file mode 100644 index 000000000000..1f1237648846 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOperationMetadata.java @@ -0,0 +1,3483 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/operation.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
+ * [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.FieldOperationMetadata} + */ +public final class FieldOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.FieldOperationMetadata) + FieldOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use FieldOperationMetadata.newBuilder() to construct. + private FieldOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FieldOperationMetadata() { + field_ = ""; + indexConfigDeltas_ = java.util.Collections.emptyList(); + state_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FieldOperationMetadata( + 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 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + field_ = s; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + indexConfigDeltas_ = + new java.util.ArrayList< + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta>(); + mutable_bitField0_ |= 0x00000008; + } + indexConfigDeltas_.add( + input.readMessage( + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + .parser(), + extensionRegistry)); + break; + } + case 40: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 50: + { + com.google.firestore.admin.v1.Progress.Builder subBuilder = null; + if (progressDocuments_ != null) { + subBuilder = progressDocuments_.toBuilder(); + } + progressDocuments_ = + input.readMessage( + com.google.firestore.admin.v1.Progress.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progressDocuments_); + progressDocuments_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + com.google.firestore.admin.v1.Progress.Builder subBuilder = null; + if (progressBytes_ != null) { + subBuilder = progressBytes_.toBuilder(); + } + progressBytes_ = + input.readMessage( + com.google.firestore.admin.v1.Progress.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progressBytes_); + progressBytes_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(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_ & 0x00000008) == 0x00000008)) { + indexConfigDeltas_ = java.util.Collections.unmodifiableList(indexConfigDeltas_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_FieldOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_FieldOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.FieldOperationMetadata.class, + com.google.firestore.admin.v1.FieldOperationMetadata.Builder.class); + } + + public interface IndexConfigDeltaOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Specifies how the index is changing.
+     * 
+ * + * + * .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType change_type = 1; + * + */ + int getChangeTypeValue(); + /** + * + * + *
+     * Specifies how the index is changing.
+     * 
+ * + * + * .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType change_type = 1; + * + */ + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType + getChangeType(); + + /** + * + * + *
+     * The index being changed.
+     * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + boolean hasIndex(); + /** + * + * + *
+     * The index being changed.
+     * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + com.google.firestore.admin.v1.Index getIndex(); + /** + * + * + *
+     * The index being changed.
+     * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + com.google.firestore.admin.v1.IndexOrBuilder getIndexOrBuilder(); + } + /** + * + * + *
+   * Information about an index configuration change.
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta} + */ + public static final class IndexConfigDelta extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta) + IndexConfigDeltaOrBuilder { + private static final long serialVersionUID = 0L; + // Use IndexConfigDelta.newBuilder() to construct. + private IndexConfigDelta(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IndexConfigDelta() { + changeType_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private IndexConfigDelta( + 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 8: + { + int rawValue = input.readEnum(); + + changeType_ = rawValue; + break; + } + case 18: + { + com.google.firestore.admin.v1.Index.Builder subBuilder = null; + if (index_ != null) { + subBuilder = index_.toBuilder(); + } + index_ = + input.readMessage( + com.google.firestore.admin.v1.Index.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(index_); + index_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(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.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_FieldOperationMetadata_IndexConfigDelta_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_FieldOperationMetadata_IndexConfigDelta_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.class, + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.Builder.class); + } + + /** + * + * + *
+     * Specifies how the index is changing.
+     * 
+ * + * Protobuf enum {@code + * google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType} + */ + public enum ChangeType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * The type of change is not specified or known.
+       * 
+ * + * CHANGE_TYPE_UNSPECIFIED = 0; + */ + CHANGE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+       * The single field index is being added.
+       * 
+ * + * ADD = 1; + */ + ADD(1), + /** + * + * + *
+       * The single field index is being removed.
+       * 
+ * + * REMOVE = 2; + */ + REMOVE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * The type of change is not specified or known.
+       * 
+ * + * CHANGE_TYPE_UNSPECIFIED = 0; + */ + public static final int CHANGE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * The single field index is being added.
+       * 
+ * + * ADD = 1; + */ + public static final int ADD_VALUE = 1; + /** + * + * + *
+       * The single field index is being removed.
+       * 
+ * + * REMOVE = 2; + */ + public static final int REMOVE_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; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ChangeType valueOf(int value) { + return forNumber(value); + } + + public static ChangeType forNumber(int value) { + switch (value) { + case 0: + return CHANGE_TYPE_UNSPECIFIED; + case 1: + return ADD; + case 2: + return REMOVE; + 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 ChangeType findValueByNumber(int number) { + return ChangeType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ChangeType[] VALUES = values(); + + public static ChangeType 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 ChangeType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType) + } + + public static final int CHANGE_TYPE_FIELD_NUMBER = 1; + private int changeType_; + /** + * + * + *
+     * Specifies how the index is changing.
+     * 
+ * + * + * .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType change_type = 1; + * + */ + public int getChangeTypeValue() { + return changeType_; + } + /** + * + * + *
+     * Specifies how the index is changing.
+     * 
+ * + * + * .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType change_type = 1; + * + */ + public com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType + getChangeType() { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType result = + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType.valueOf( + changeType_); + return result == null + ? com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType + .UNRECOGNIZED + : result; + } + + public static final int INDEX_FIELD_NUMBER = 2; + private com.google.firestore.admin.v1.Index index_; + /** + * + * + *
+     * The index being changed.
+     * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public boolean hasIndex() { + return index_ != null; + } + /** + * + * + *
+     * The index being changed.
+     * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public com.google.firestore.admin.v1.Index getIndex() { + return index_ == null ? com.google.firestore.admin.v1.Index.getDefaultInstance() : index_; + } + /** + * + * + *
+     * The index being changed.
+     * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public com.google.firestore.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 (changeType_ + != com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType + .CHANGE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, changeType_); + } + if (index_ != null) { + output.writeMessage(2, getIndex()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (changeType_ + != com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType + .CHANGE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, changeType_); + } + if (index_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, 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.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta other = + (com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta) obj; + + boolean result = true; + result = result && changeType_ == other.changeType_; + result = result && (hasIndex() == other.hasIndex()); + if (hasIndex()) { + result = result && getIndex().equals(other.getIndex()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CHANGE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + changeType_; + 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.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta 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.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta 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.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + 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.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta 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.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta 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; + } + /** + * + * + *
+     * Information about an index configuration change.
+     * 
+ * + * Protobuf type {@code google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta) + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDeltaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_FieldOperationMetadata_IndexConfigDelta_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_FieldOperationMetadata_IndexConfigDelta_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.class, + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.Builder + .class); + } + + // Construct using + // com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.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(); + changeType_ = 0; + + 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.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_FieldOperationMetadata_IndexConfigDelta_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + getDefaultInstanceForType() { + return com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta build() { + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta buildPartial() { + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta result = + new com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta(this); + result.changeType_ = changeType_; + if (indexBuilder_ == null) { + result.index_ = index_; + } else { + result.index_ = indexBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta) { + return mergeFrom( + (com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta other) { + if (other + == com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + .getDefaultInstance()) return this; + if (other.changeType_ != 0) { + setChangeTypeValue(other.getChangeTypeValue()); + } + 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.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int changeType_ = 0; + /** + * + * + *
+       * Specifies how the index is changing.
+       * 
+ * + * + * .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType change_type = 1; + * + */ + public int getChangeTypeValue() { + return changeType_; + } + /** + * + * + *
+       * Specifies how the index is changing.
+       * 
+ * + * + * .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType change_type = 1; + * + */ + public Builder setChangeTypeValue(int value) { + changeType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies how the index is changing.
+       * 
+ * + * + * .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType change_type = 1; + * + */ + public com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType + getChangeType() { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType result = + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType + .valueOf(changeType_); + return result == null + ? com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Specifies how the index is changing.
+       * 
+ * + * + * .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType change_type = 1; + * + */ + public Builder setChangeType( + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType value) { + if (value == null) { + throw new NullPointerException(); + } + + changeType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies how the index is changing.
+       * 
+ * + * + * .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType change_type = 1; + * + */ + public Builder clearChangeType() { + + changeType_ = 0; + onChanged(); + return this; + } + + private com.google.firestore.admin.v1.Index index_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Index, + com.google.firestore.admin.v1.Index.Builder, + com.google.firestore.admin.v1.IndexOrBuilder> + indexBuilder_; + /** + * + * + *
+       * The index being changed.
+       * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public boolean hasIndex() { + return indexBuilder_ != null || index_ != null; + } + /** + * + * + *
+       * The index being changed.
+       * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public com.google.firestore.admin.v1.Index getIndex() { + if (indexBuilder_ == null) { + return index_ == null ? com.google.firestore.admin.v1.Index.getDefaultInstance() : index_; + } else { + return indexBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The index being changed.
+       * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public Builder setIndex(com.google.firestore.admin.v1.Index value) { + if (indexBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + index_ = value; + onChanged(); + } else { + indexBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The index being changed.
+       * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public Builder setIndex(com.google.firestore.admin.v1.Index.Builder builderForValue) { + if (indexBuilder_ == null) { + index_ = builderForValue.build(); + onChanged(); + } else { + indexBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The index being changed.
+       * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public Builder mergeIndex(com.google.firestore.admin.v1.Index value) { + if (indexBuilder_ == null) { + if (index_ != null) { + index_ = + com.google.firestore.admin.v1.Index.newBuilder(index_) + .mergeFrom(value) + .buildPartial(); + } else { + index_ = value; + } + onChanged(); + } else { + indexBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The index being changed.
+       * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public Builder clearIndex() { + if (indexBuilder_ == null) { + index_ = null; + onChanged(); + } else { + index_ = null; + indexBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The index being changed.
+       * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public com.google.firestore.admin.v1.Index.Builder getIndexBuilder() { + + onChanged(); + return getIndexFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The index being changed.
+       * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + public com.google.firestore.admin.v1.IndexOrBuilder getIndexOrBuilder() { + if (indexBuilder_ != null) { + return indexBuilder_.getMessageOrBuilder(); + } else { + return index_ == null ? com.google.firestore.admin.v1.Index.getDefaultInstance() : index_; + } + } + /** + * + * + *
+       * The index being changed.
+       * 
+ * + * .google.firestore.admin.v1.Index index = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Index, + com.google.firestore.admin.v1.Index.Builder, + com.google.firestore.admin.v1.IndexOrBuilder> + getIndexFieldBuilder() { + if (indexBuilder_ == null) { + indexBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Index, + com.google.firestore.admin.v1.Index.Builder, + com.google.firestore.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.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta) + private static final com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta(); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IndexConfigDelta parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IndexConfigDelta(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.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + 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 this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int FIELD_FIELD_NUMBER = 3; + private volatile java.lang.Object field_; + /** + * + * + *
+   * The field resource that this operation is acting on. For example:
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+   * 
+ * + * string field = 3; + */ + public java.lang.String getField() { + java.lang.Object ref = field_; + 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(); + field_ = s; + return s; + } + } + /** + * + * + *
+   * The field resource that this operation is acting on. For example:
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+   * 
+ * + * string field = 3; + */ + public com.google.protobuf.ByteString getFieldBytes() { + java.lang.Object ref = field_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + field_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDEX_CONFIG_DELTAS_FIELD_NUMBER = 4; + private java.util.List + indexConfigDeltas_; + /** + * + * + *
+   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+   * operation.
+   * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public java.util.List + getIndexConfigDeltasList() { + return indexConfigDeltas_; + } + /** + * + * + *
+   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+   * operation.
+   * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public java.util.List< + ? extends com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDeltaOrBuilder> + getIndexConfigDeltasOrBuilderList() { + return indexConfigDeltas_; + } + /** + * + * + *
+   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+   * operation.
+   * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public int getIndexConfigDeltasCount() { + return indexConfigDeltas_.size(); + } + /** + * + * + *
+   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+   * operation.
+   * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta getIndexConfigDeltas( + int index) { + return indexConfigDeltas_.get(index); + } + /** + * + * + *
+   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+   * operation.
+   * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDeltaOrBuilder + getIndexConfigDeltasOrBuilder(int index) { + return indexConfigDeltas_.get(index); + } + + public static final int STATE_FIELD_NUMBER = 5; + private int state_; + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.firestore.admin.v1.OperationState state = 5; + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.firestore.admin.v1.OperationState state = 5; + */ + public com.google.firestore.admin.v1.OperationState getState() { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.OperationState result = + com.google.firestore.admin.v1.OperationState.valueOf(state_); + return result == null ? com.google.firestore.admin.v1.OperationState.UNRECOGNIZED : result; + } + + public static final int PROGRESS_DOCUMENTS_FIELD_NUMBER = 6; + private com.google.firestore.admin.v1.Progress progressDocuments_; + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 6; + */ + public boolean hasProgressDocuments() { + return progressDocuments_ != null; + } + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 6; + */ + public com.google.firestore.admin.v1.Progress getProgressDocuments() { + return progressDocuments_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressDocuments_; + } + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 6; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressDocumentsOrBuilder() { + return getProgressDocuments(); + } + + public static final int PROGRESS_BYTES_FIELD_NUMBER = 7; + private com.google.firestore.admin.v1.Progress progressBytes_; + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 7; + */ + public boolean hasProgressBytes() { + return progressBytes_ != null; + } + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 7; + */ + public com.google.firestore.admin.v1.Progress getProgressBytes() { + return progressBytes_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 7; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder() { + return getProgressBytes(); + } + + 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 (!getFieldBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, field_); + } + for (int i = 0; i < indexConfigDeltas_.size(); i++) { + output.writeMessage(4, indexConfigDeltas_.get(i)); + } + if (state_ + != com.google.firestore.admin.v1.OperationState.OPERATION_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, state_); + } + if (progressDocuments_ != null) { + output.writeMessage(6, getProgressDocuments()); + } + if (progressBytes_ != null) { + output.writeMessage(7, getProgressBytes()); + } + 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 (!getFieldBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, field_); + } + for (int i = 0; i < indexConfigDeltas_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, indexConfigDeltas_.get(i)); + } + if (state_ + != com.google.firestore.admin.v1.OperationState.OPERATION_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_); + } + if (progressDocuments_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getProgressDocuments()); + } + if (progressBytes_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getProgressBytes()); + } + 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.firestore.admin.v1.FieldOperationMetadata)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.FieldOperationMetadata other = + (com.google.firestore.admin.v1.FieldOperationMetadata) obj; + + boolean result = true; + result = result && (hasStartTime() == other.hasStartTime()); + if (hasStartTime()) { + result = result && getStartTime().equals(other.getStartTime()); + } + result = result && (hasEndTime() == other.hasEndTime()); + if (hasEndTime()) { + result = result && getEndTime().equals(other.getEndTime()); + } + result = result && getField().equals(other.getField()); + result = result && getIndexConfigDeltasList().equals(other.getIndexConfigDeltasList()); + result = result && state_ == other.state_; + result = result && (hasProgressDocuments() == other.hasProgressDocuments()); + if (hasProgressDocuments()) { + result = result && getProgressDocuments().equals(other.getProgressDocuments()); + } + result = result && (hasProgressBytes() == other.hasProgressBytes()); + if (hasProgressBytes()) { + result = result && getProgressBytes().equals(other.getProgressBytes()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + FIELD_FIELD_NUMBER; + hash = (53 * hash) + getField().hashCode(); + if (getIndexConfigDeltasCount() > 0) { + hash = (37 * hash) + INDEX_CONFIG_DELTAS_FIELD_NUMBER; + hash = (53 * hash) + getIndexConfigDeltasList().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasProgressDocuments()) { + hash = (37 * hash) + PROGRESS_DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getProgressDocuments().hashCode(); + } + if (hasProgressBytes()) { + hash = (37 * hash) + PROGRESS_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getProgressBytes().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata 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.firestore.admin.v1.FieldOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata 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.firestore.admin.v1.FieldOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata 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.firestore.admin.v1.FieldOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata 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.firestore.admin.v1.FieldOperationMetadata 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 [google.longrunning.Operation][google.longrunning.Operation] results from
+   * [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.FieldOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.FieldOperationMetadata) + com.google.firestore.admin.v1.FieldOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_FieldOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_FieldOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.FieldOperationMetadata.class, + com.google.firestore.admin.v1.FieldOperationMetadata.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.FieldOperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getIndexConfigDeltasFieldBuilder(); + } + } + + @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; + } + field_ = ""; + + if (indexConfigDeltasBuilder_ == null) { + indexConfigDeltas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + indexConfigDeltasBuilder_.clear(); + } + state_ = 0; + + if (progressDocumentsBuilder_ == null) { + progressDocuments_ = null; + } else { + progressDocuments_ = null; + progressDocumentsBuilder_ = null; + } + if (progressBytesBuilder_ == null) { + progressBytes_ = null; + } else { + progressBytes_ = null; + progressBytesBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_FieldOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.FieldOperationMetadata getDefaultInstanceForType() { + return com.google.firestore.admin.v1.FieldOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.FieldOperationMetadata build() { + com.google.firestore.admin.v1.FieldOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.FieldOperationMetadata buildPartial() { + com.google.firestore.admin.v1.FieldOperationMetadata result = + new com.google.firestore.admin.v1.FieldOperationMetadata(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.field_ = field_; + if (indexConfigDeltasBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + indexConfigDeltas_ = java.util.Collections.unmodifiableList(indexConfigDeltas_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.indexConfigDeltas_ = indexConfigDeltas_; + } else { + result.indexConfigDeltas_ = indexConfigDeltasBuilder_.build(); + } + result.state_ = state_; + if (progressDocumentsBuilder_ == null) { + result.progressDocuments_ = progressDocuments_; + } else { + result.progressDocuments_ = progressDocumentsBuilder_.build(); + } + if (progressBytesBuilder_ == null) { + result.progressBytes_ = progressBytes_; + } else { + result.progressBytes_ = progressBytesBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.FieldOperationMetadata) { + return mergeFrom((com.google.firestore.admin.v1.FieldOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.FieldOperationMetadata other) { + if (other == com.google.firestore.admin.v1.FieldOperationMetadata.getDefaultInstance()) + return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getField().isEmpty()) { + field_ = other.field_; + onChanged(); + } + if (indexConfigDeltasBuilder_ == null) { + if (!other.indexConfigDeltas_.isEmpty()) { + if (indexConfigDeltas_.isEmpty()) { + indexConfigDeltas_ = other.indexConfigDeltas_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureIndexConfigDeltasIsMutable(); + indexConfigDeltas_.addAll(other.indexConfigDeltas_); + } + onChanged(); + } + } else { + if (!other.indexConfigDeltas_.isEmpty()) { + if (indexConfigDeltasBuilder_.isEmpty()) { + indexConfigDeltasBuilder_.dispose(); + indexConfigDeltasBuilder_ = null; + indexConfigDeltas_ = other.indexConfigDeltas_; + bitField0_ = (bitField0_ & ~0x00000008); + indexConfigDeltasBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIndexConfigDeltasFieldBuilder() + : null; + } else { + indexConfigDeltasBuilder_.addAllMessages(other.indexConfigDeltas_); + } + } + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasProgressDocuments()) { + mergeProgressDocuments(other.getProgressDocuments()); + } + if (other.hasProgressBytes()) { + mergeProgressBytes(other.getProgressBytes()); + } + 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.firestore.admin.v1.FieldOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.admin.v1.FieldOperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.Timestamp startTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .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 this operation started.
+     * 
+ * + * .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 this operation started.
+     * 
+ * + * .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 this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .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 this operation started.
+     * 
+ * + * .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_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 java.lang.Object field_ = ""; + /** + * + * + *
+     * The field resource that this operation is acting on. For example:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+     * 
+ * + * string field = 3; + */ + public java.lang.String getField() { + java.lang.Object ref = field_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + field_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The field resource that this operation is acting on. For example:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+     * 
+ * + * string field = 3; + */ + public com.google.protobuf.ByteString getFieldBytes() { + java.lang.Object ref = field_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + field_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The field resource that this operation is acting on. For example:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+     * 
+ * + * string field = 3; + */ + public Builder setField(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + field_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The field resource that this operation is acting on. For example:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+     * 
+ * + * string field = 3; + */ + public Builder clearField() { + + field_ = getDefaultInstance().getField(); + onChanged(); + return this; + } + /** + * + * + *
+     * The field resource that this operation is acting on. For example:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+     * 
+ * + * string field = 3; + */ + public Builder setFieldBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + field_ = value; + onChanged(); + return this; + } + + private java.util.List + indexConfigDeltas_ = java.util.Collections.emptyList(); + + private void ensureIndexConfigDeltasIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + indexConfigDeltas_ = + new java.util.ArrayList< + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta>( + indexConfigDeltas_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta, + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.Builder, + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDeltaOrBuilder> + indexConfigDeltasBuilder_; + + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public java.util.List + getIndexConfigDeltasList() { + if (indexConfigDeltasBuilder_ == null) { + return java.util.Collections.unmodifiableList(indexConfigDeltas_); + } else { + return indexConfigDeltasBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public int getIndexConfigDeltasCount() { + if (indexConfigDeltasBuilder_ == null) { + return indexConfigDeltas_.size(); + } else { + return indexConfigDeltasBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + getIndexConfigDeltas(int index) { + if (indexConfigDeltasBuilder_ == null) { + return indexConfigDeltas_.get(index); + } else { + return indexConfigDeltasBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public Builder setIndexConfigDeltas( + int index, com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta value) { + if (indexConfigDeltasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexConfigDeltasIsMutable(); + indexConfigDeltas_.set(index, value); + onChanged(); + } else { + indexConfigDeltasBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public Builder setIndexConfigDeltas( + int index, + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.Builder + builderForValue) { + if (indexConfigDeltasBuilder_ == null) { + ensureIndexConfigDeltasIsMutable(); + indexConfigDeltas_.set(index, builderForValue.build()); + onChanged(); + } else { + indexConfigDeltasBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public Builder addIndexConfigDeltas( + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta value) { + if (indexConfigDeltasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexConfigDeltasIsMutable(); + indexConfigDeltas_.add(value); + onChanged(); + } else { + indexConfigDeltasBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public Builder addIndexConfigDeltas( + int index, com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta value) { + if (indexConfigDeltasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexConfigDeltasIsMutable(); + indexConfigDeltas_.add(index, value); + onChanged(); + } else { + indexConfigDeltasBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public Builder addIndexConfigDeltas( + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.Builder + builderForValue) { + if (indexConfigDeltasBuilder_ == null) { + ensureIndexConfigDeltasIsMutable(); + indexConfigDeltas_.add(builderForValue.build()); + onChanged(); + } else { + indexConfigDeltasBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public Builder addIndexConfigDeltas( + int index, + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.Builder + builderForValue) { + if (indexConfigDeltasBuilder_ == null) { + ensureIndexConfigDeltasIsMutable(); + indexConfigDeltas_.add(index, builderForValue.build()); + onChanged(); + } else { + indexConfigDeltasBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public Builder addAllIndexConfigDeltas( + java.lang.Iterable< + ? extends com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta> + values) { + if (indexConfigDeltasBuilder_ == null) { + ensureIndexConfigDeltasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, indexConfigDeltas_); + onChanged(); + } else { + indexConfigDeltasBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public Builder clearIndexConfigDeltas() { + if (indexConfigDeltasBuilder_ == null) { + indexConfigDeltas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + indexConfigDeltasBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public Builder removeIndexConfigDeltas(int index) { + if (indexConfigDeltasBuilder_ == null) { + ensureIndexConfigDeltasIsMutable(); + indexConfigDeltas_.remove(index); + onChanged(); + } else { + indexConfigDeltasBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.Builder + getIndexConfigDeltasBuilder(int index) { + return getIndexConfigDeltasFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDeltaOrBuilder + getIndexConfigDeltasOrBuilder(int index) { + if (indexConfigDeltasBuilder_ == null) { + return indexConfigDeltas_.get(index); + } else { + return indexConfigDeltasBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public java.util.List< + ? extends + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDeltaOrBuilder> + getIndexConfigDeltasOrBuilderList() { + if (indexConfigDeltasBuilder_ != null) { + return indexConfigDeltasBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(indexConfigDeltas_); + } + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.Builder + addIndexConfigDeltasBuilder() { + return getIndexConfigDeltasFieldBuilder() + .addBuilder( + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + .getDefaultInstance()); + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.Builder + addIndexConfigDeltasBuilder(int index) { + return getIndexConfigDeltasFieldBuilder() + .addBuilder( + index, + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + .getDefaultInstance()); + } + /** + * + * + *
+     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+     * operation.
+     * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + public java.util.List< + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.Builder> + getIndexConfigDeltasBuilderList() { + return getIndexConfigDeltasFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta, + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.Builder, + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDeltaOrBuilder> + getIndexConfigDeltasFieldBuilder() { + if (indexConfigDeltasBuilder_ == null) { + indexConfigDeltasBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta, + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.Builder, + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDeltaOrBuilder>( + indexConfigDeltas_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + indexConfigDeltas_ = null; + } + return indexConfigDeltasBuilder_; + } + + private int state_ = 0; + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState state = 5; + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState state = 5; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState state = 5; + */ + public com.google.firestore.admin.v1.OperationState getState() { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.OperationState result = + com.google.firestore.admin.v1.OperationState.valueOf(state_); + return result == null ? com.google.firestore.admin.v1.OperationState.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState state = 5; + */ + public Builder setState(com.google.firestore.admin.v1.OperationState value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState state = 5; + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.firestore.admin.v1.Progress progressDocuments_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + progressDocumentsBuilder_; + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 6; + */ + public boolean hasProgressDocuments() { + return progressDocumentsBuilder_ != null || progressDocuments_ != null; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 6; + */ + public com.google.firestore.admin.v1.Progress getProgressDocuments() { + if (progressDocumentsBuilder_ == null) { + return progressDocuments_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressDocuments_; + } else { + return progressDocumentsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 6; + */ + public Builder setProgressDocuments(com.google.firestore.admin.v1.Progress value) { + if (progressDocumentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progressDocuments_ = value; + onChanged(); + } else { + progressDocumentsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 6; + */ + public Builder setProgressDocuments( + com.google.firestore.admin.v1.Progress.Builder builderForValue) { + if (progressDocumentsBuilder_ == null) { + progressDocuments_ = builderForValue.build(); + onChanged(); + } else { + progressDocumentsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 6; + */ + public Builder mergeProgressDocuments(com.google.firestore.admin.v1.Progress value) { + if (progressDocumentsBuilder_ == null) { + if (progressDocuments_ != null) { + progressDocuments_ = + com.google.firestore.admin.v1.Progress.newBuilder(progressDocuments_) + .mergeFrom(value) + .buildPartial(); + } else { + progressDocuments_ = value; + } + onChanged(); + } else { + progressDocumentsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 6; + */ + public Builder clearProgressDocuments() { + if (progressDocumentsBuilder_ == null) { + progressDocuments_ = null; + onChanged(); + } else { + progressDocuments_ = null; + progressDocumentsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 6; + */ + public com.google.firestore.admin.v1.Progress.Builder getProgressDocumentsBuilder() { + + onChanged(); + return getProgressDocumentsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 6; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressDocumentsOrBuilder() { + if (progressDocumentsBuilder_ != null) { + return progressDocumentsBuilder_.getMessageOrBuilder(); + } else { + return progressDocuments_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressDocuments_; + } + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + getProgressDocumentsFieldBuilder() { + if (progressDocumentsBuilder_ == null) { + progressDocumentsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder>( + getProgressDocuments(), getParentForChildren(), isClean()); + progressDocuments_ = null; + } + return progressDocumentsBuilder_; + } + + private com.google.firestore.admin.v1.Progress progressBytes_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + progressBytesBuilder_; + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 7; + */ + public boolean hasProgressBytes() { + return progressBytesBuilder_ != null || progressBytes_ != null; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 7; + */ + public com.google.firestore.admin.v1.Progress getProgressBytes() { + if (progressBytesBuilder_ == null) { + return progressBytes_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } else { + return progressBytesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 7; + */ + public Builder setProgressBytes(com.google.firestore.admin.v1.Progress value) { + if (progressBytesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progressBytes_ = value; + onChanged(); + } else { + progressBytesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 7; + */ + public Builder setProgressBytes( + com.google.firestore.admin.v1.Progress.Builder builderForValue) { + if (progressBytesBuilder_ == null) { + progressBytes_ = builderForValue.build(); + onChanged(); + } else { + progressBytesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 7; + */ + public Builder mergeProgressBytes(com.google.firestore.admin.v1.Progress value) { + if (progressBytesBuilder_ == null) { + if (progressBytes_ != null) { + progressBytes_ = + com.google.firestore.admin.v1.Progress.newBuilder(progressBytes_) + .mergeFrom(value) + .buildPartial(); + } else { + progressBytes_ = value; + } + onChanged(); + } else { + progressBytesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 7; + */ + public Builder clearProgressBytes() { + if (progressBytesBuilder_ == null) { + progressBytes_ = null; + onChanged(); + } else { + progressBytes_ = null; + progressBytesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 7; + */ + public com.google.firestore.admin.v1.Progress.Builder getProgressBytesBuilder() { + + onChanged(); + return getProgressBytesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 7; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder() { + if (progressBytesBuilder_ != null) { + return progressBytesBuilder_.getMessageOrBuilder(); + } else { + return progressBytes_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + getProgressBytesFieldBuilder() { + if (progressBytesBuilder_ == null) { + progressBytesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder>( + getProgressBytes(), getParentForChildren(), isClean()); + progressBytes_ = null; + } + return progressBytesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.FieldOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.FieldOperationMetadata) + private static final com.google.firestore.admin.v1.FieldOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.FieldOperationMetadata(); + } + + public static com.google.firestore.admin.v1.FieldOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FieldOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FieldOperationMetadata(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.firestore.admin.v1.FieldOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOperationMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..3221c865649e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOperationMetadataOrBuilder.java @@ -0,0 +1,252 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/operation.proto + +package com.google.firestore.admin.v1; + +public interface FieldOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.FieldOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + boolean hasStartTime(); + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + boolean hasEndTime(); + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * The field resource that this operation is acting on. For example:
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+   * 
+ * + * string field = 3; + */ + java.lang.String getField(); + /** + * + * + *
+   * The field resource that this operation is acting on. For example:
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+   * 
+ * + * string field = 3; + */ + com.google.protobuf.ByteString getFieldBytes(); + + /** + * + * + *
+   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+   * operation.
+   * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + java.util.List + getIndexConfigDeltasList(); + /** + * + * + *
+   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+   * operation.
+   * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta getIndexConfigDeltas( + int index); + /** + * + * + *
+   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+   * operation.
+   * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + int getIndexConfigDeltasCount(); + /** + * + * + *
+   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+   * operation.
+   * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + java.util.List< + ? extends com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDeltaOrBuilder> + getIndexConfigDeltasOrBuilderList(); + /** + * + * + *
+   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
+   * operation.
+   * 
+ * + * + * repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * + */ + com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDeltaOrBuilder + getIndexConfigDeltasOrBuilder(int index); + + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.firestore.admin.v1.OperationState state = 5; + */ + int getStateValue(); + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.firestore.admin.v1.OperationState state = 5; + */ + com.google.firestore.admin.v1.OperationState getState(); + + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 6; + */ + boolean hasProgressDocuments(); + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 6; + */ + com.google.firestore.admin.v1.Progress getProgressDocuments(); + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 6; + */ + com.google.firestore.admin.v1.ProgressOrBuilder getProgressDocumentsOrBuilder(); + + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 7; + */ + boolean hasProgressBytes(); + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 7; + */ + com.google.firestore.admin.v1.Progress getProgressBytes(); + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 7; + */ + com.google.firestore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOrBuilder.java new file mode 100644 index 000000000000..117cfa5a0db1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOrBuilder.java @@ -0,0 +1,113 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/field.proto + +package com.google.firestore.admin.v1; + +public interface FieldOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.Field) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A field name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+   * A field path may be a simple field name, e.g. `address` or a path to fields
+   * within map_value , e.g. `address.city`,
+   * or a special field path. The only valid special field is `*`, which
+   * represents any field.
+   * Field paths may be quoted using ` (backtick). The only character that needs
+   * to be escaped within a quoted field path is the backtick character itself,
+   * escaped using a backslash. Special characters in field paths that
+   * must be quoted include: `*`, `.`,
+   * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters.
+   * Examples:
+   * (Note: Comments here are written in markdown syntax, so there is an
+   *  additional layer of backticks to represent a code block)
+   * `\`address.city\`` represents a field named `address.city`, not the map key
+   * `city` in the field `address`.
+   * `\`*\`` represents a field named `*`, not any field.
+   * A special `Field` contains the default indexing settings for all fields.
+   * This field's resource name is:
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
+   * Indexes defined on this `Field` will be applied to all fields which do not
+   * have their own `Field` index configuration.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * A field name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
+   * A field path may be a simple field name, e.g. `address` or a path to fields
+   * within map_value , e.g. `address.city`,
+   * or a special field path. The only valid special field is `*`, which
+   * represents any field.
+   * Field paths may be quoted using ` (backtick). The only character that needs
+   * to be escaped within a quoted field path is the backtick character itself,
+   * escaped using a backslash. Special characters in field paths that
+   * must be quoted include: `*`, `.`,
+   * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters.
+   * Examples:
+   * (Note: Comments here are written in markdown syntax, so there is an
+   *  additional layer of backticks to represent a code block)
+   * `\`address.city\`` represents a field named `address.city`, not the map key
+   * `city` in the field `address`.
+   * `\`*\`` represents a field named `*`, not any field.
+   * A special `Field` contains the default indexing settings for all fields.
+   * This field's resource name is:
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
+   * Indexes defined on this `Field` will be applied to all fields which do not
+   * have their own `Field` index configuration.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The index configuration for this field. If unset, field indexing will
+   * revert to the configuration defined by the `ancestor_field`. To
+   * explicitly remove all indexes for this field, specify an index config
+   * with an empty list of indexes.
+   * 
+ * + * .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + */ + boolean hasIndexConfig(); + /** + * + * + *
+   * The index configuration for this field. If unset, field indexing will
+   * revert to the configuration defined by the `ancestor_field`. To
+   * explicitly remove all indexes for this field, specify an index config
+   * with an empty list of indexes.
+   * 
+ * + * .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + */ + com.google.firestore.admin.v1.Field.IndexConfig getIndexConfig(); + /** + * + * + *
+   * The index configuration for this field. If unset, field indexing will
+   * revert to the configuration defined by the `ancestor_field`. To
+   * explicitly remove all indexes for this field, specify an index config
+   * with an empty list of indexes.
+   * 
+ * + * .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + */ + com.google.firestore.admin.v1.Field.IndexConfigOrBuilder getIndexConfigOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldProto.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldProto.java new file mode 100644 index 000000000000..bb1d6c386ef6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldProto.java @@ -0,0 +1,84 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/field.proto + +package com.google.firestore.admin.v1; + +public final class FieldProto { + private FieldProto() {} + + 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_firestore_admin_v1_Field_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_Field_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_Field_IndexConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_Field_IndexConfig_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/firestore/admin/v1/field.proto\022" + + "\031google.firestore.admin.v1\032%google/fires" + + "tore/admin/v1/index.proto\032\034google/api/an" + + "notations.proto\"\345\001\n\005Field\022\014\n\004name\030\001 \001(\t\022" + + "B\n\014index_config\030\002 \001(\0132,.google.firestore" + + ".admin.v1.Field.IndexConfig\032\211\001\n\013IndexCon" + + "fig\0221\n\007indexes\030\001 \003(\0132 .google.firestore." + + "admin.v1.Index\022\034\n\024uses_ancestor_config\030\002" + + " \001(\010\022\026\n\016ancestor_field\030\003 \001(\t\022\021\n\trevertin" + + "g\030\004 \001(\010B\270\001\n\035com.google.firestore.admin.v" + + "1B\nFieldProtoP\001Z>google.golang.org/genpr" + + "oto/googleapis/firestore/admin/v1;admin\242" + + "\002\004GCFS\252\002\037Google.Cloud.Firestore.Admin.V1" + + "\312\002\037Google\\Cloud\\Firestore\\Admin\\V1b\006prot" + + "o3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.firestore.admin.v1.IndexProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }, + assigner); + internal_static_google_firestore_admin_v1_Field_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_firestore_admin_v1_Field_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_Field_descriptor, + new java.lang.String[] { + "Name", "IndexConfig", + }); + internal_static_google_firestore_admin_v1_Field_IndexConfig_descriptor = + internal_static_google_firestore_admin_v1_Field_descriptor.getNestedTypes().get(0); + internal_static_google_firestore_admin_v1_Field_IndexConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_Field_IndexConfig_descriptor, + new java.lang.String[] { + "Indexes", "UsesAncestorConfig", "AncestorField", "Reverting", + }); + com.google.firestore.admin.v1.IndexProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminProto.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminProto.java new file mode 100644 index 000000000000..c058711f5eda --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminProto.java @@ -0,0 +1,263 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +public final class FirestoreAdminProto { + private FirestoreAdminProto() {} + + 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_firestore_admin_v1_CreateIndexRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_CreateIndexRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_ListIndexesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_ListIndexesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_ListIndexesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_ListIndexesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_GetIndexRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_GetIndexRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_DeleteIndexRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_DeleteIndexRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_UpdateFieldRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_UpdateFieldRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_GetFieldRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_GetFieldRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_ListFieldsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_ListFieldsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_ListFieldsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_ListFieldsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_ExportDocumentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_ExportDocumentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_ImportDocumentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_ImportDocumentsRequest_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/firestore/admin/v1/firestore_ad" + + "min.proto\022\031google.firestore.admin.v1\032\034go" + + "ogle/api/annotations.proto\032%google/fires" + + "tore/admin/v1/field.proto\032%google/firest" + + "ore/admin/v1/index.proto\032#google/longrun" + + "ning/operations.proto\032\033google/protobuf/e" + + "mpty.proto\032 google/protobuf/field_mask.p" + + "roto\"U\n\022CreateIndexRequest\022\016\n\006parent\030\001 \001" + + "(\t\022/\n\005index\030\002 \001(\0132 .google.firestore.adm" + + "in.v1.Index\"[\n\022ListIndexesRequest\022\016\n\006par" + + "ent\030\001 \001(\t\022\016\n\006filter\030\002 \001(\t\022\021\n\tpage_size\030\003" + + " \001(\005\022\022\n\npage_token\030\004 \001(\t\"a\n\023ListIndexesR" + + "esponse\0221\n\007indexes\030\001 \003(\0132 .google.firest" + + "ore.admin.v1.Index\022\027\n\017next_page_token\030\002 " + + "\001(\t\"\037\n\017GetIndexRequest\022\014\n\004name\030\001 \001(\t\"\"\n\022" + + "DeleteIndexRequest\022\014\n\004name\030\001 \001(\t\"v\n\022Upda" + + "teFieldRequest\022/\n\005field\030\001 \001(\0132 .google.f" + + "irestore.admin.v1.Field\022/\n\013update_mask\030\002" + + " \001(\0132\032.google.protobuf.FieldMask\"\037\n\017GetF" + + "ieldRequest\022\014\n\004name\030\001 \001(\t\"Z\n\021ListFieldsR" + + "equest\022\016\n\006parent\030\001 \001(\t\022\016\n\006filter\030\002 \001(\t\022\021" + + "\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"_\n" + + "\022ListFieldsResponse\0220\n\006fields\030\001 \003(\0132 .go" + + "ogle.firestore.admin.v1.Field\022\027\n\017next_pa" + + "ge_token\030\002 \001(\t\"Y\n\026ExportDocumentsRequest" + + "\022\014\n\004name\030\001 \001(\t\022\026\n\016collection_ids\030\002 \003(\t\022\031" + + "\n\021output_uri_prefix\030\003 \001(\t\"X\n\026ImportDocum" + + "entsRequest\022\014\n\004name\030\001 \001(\t\022\026\n\016collection_" + + "ids\030\002 \003(\t\022\030\n\020input_uri_prefix\030\003 \001(\t2\205\014\n\016" + + "FirestoreAdmin\022\252\001\n\013CreateIndex\022-.google." + + "firestore.admin.v1.CreateIndexRequest\032\035." + + "google.longrunning.Operation\"M\202\323\344\223\002G\">/v" + + "1/{parent=projects/*/databases/*/collect" + + "ionGroups/*}/indexes:\005index\022\264\001\n\013ListInde" + + "xes\022-.google.firestore.admin.v1.ListInde" + + "xesRequest\032..google.firestore.admin.v1.L" + + "istIndexesResponse\"F\202\323\344\223\002@\022>/v1/{parent=" + + "projects/*/databases/*/collectionGroups/" + + "*}/indexes\022\240\001\n\010GetIndex\022*.google.firesto" + + "re.admin.v1.GetIndexRequest\032 .google.fir" + + "estore.admin.v1.Index\"F\202\323\344\223\002@\022>/v1/{name" + + "=projects/*/databases/*/collectionGroups" + + "/*/indexes/*}\022\234\001\n\013DeleteIndex\022-.google.f" + + "irestore.admin.v1.DeleteIndexRequest\032\026.g" + + "oogle.protobuf.Empty\"F\202\323\344\223\002@*>/v1/{name=" + + "projects/*/databases/*/collectionGroups/" + + "*/indexes/*}\022\237\001\n\010GetField\022*.google.fires" + + "tore.admin.v1.GetFieldRequest\032 .google.f" + + "irestore.admin.v1.Field\"E\202\323\344\223\002?\022=/v1/{na" + + "me=projects/*/databases/*/collectionGrou" + + "ps/*/fields/*}\022\257\001\n\013UpdateField\022-.google." + + "firestore.admin.v1.UpdateFieldRequest\032\035." + + "google.longrunning.Operation\"R\202\323\344\223\002L2C/v" + + "1/{field.name=projects/*/databases/*/col" + + "lectionGroups/*/fields/*}:\005field\022\260\001\n\nLis" + + "tFields\022,.google.firestore.admin.v1.List" + + "FieldsRequest\032-.google.firestore.admin.v" + + "1.ListFieldsResponse\"E\202\323\344\223\002?\022=/v1/{paren" + + "t=projects/*/databases/*/collectionGroup" + + "s/*}/fields\022\241\001\n\017ExportDocuments\0221.google" + + ".firestore.admin.v1.ExportDocumentsReque" + + "st\032\035.google.longrunning.Operation\"<\202\323\344\223\002" + + "6\"1/v1/{name=projects/*/databases/*}:exp" + + "ortDocuments:\001*\022\241\001\n\017ImportDocuments\0221.go" + + "ogle.firestore.admin.v1.ImportDocumentsR" + + "equest\032\035.google.longrunning.Operation\"<\202" + + "\323\344\223\0026\"1/v1/{name=projects/*/databases/*}" + + ":importDocuments:\001*B\301\001\n\035com.google.fires" + + "tore.admin.v1B\023FirestoreAdminProtoP\001Z>go" + + "ogle.golang.org/genproto/googleapis/fire" + + "store/admin/v1;admin\242\002\004GCFS\252\002\037Google.Clo" + + "ud.Firestore.Admin.V1\312\002\037Google\\Cloud\\Fir" + + "estore\\Admin\\V1b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.firestore.admin.v1.FieldProto.getDescriptor(), + com.google.firestore.admin.v1.IndexProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }, + assigner); + internal_static_google_firestore_admin_v1_CreateIndexRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_firestore_admin_v1_CreateIndexRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_CreateIndexRequest_descriptor, + new java.lang.String[] { + "Parent", "Index", + }); + internal_static_google_firestore_admin_v1_ListIndexesRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_firestore_admin_v1_ListIndexesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_ListIndexesRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", + }); + internal_static_google_firestore_admin_v1_ListIndexesResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_firestore_admin_v1_ListIndexesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_ListIndexesResponse_descriptor, + new java.lang.String[] { + "Indexes", "NextPageToken", + }); + internal_static_google_firestore_admin_v1_GetIndexRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_firestore_admin_v1_GetIndexRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_GetIndexRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_firestore_admin_v1_DeleteIndexRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_firestore_admin_v1_DeleteIndexRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_DeleteIndexRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_firestore_admin_v1_UpdateFieldRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_firestore_admin_v1_UpdateFieldRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_UpdateFieldRequest_descriptor, + new java.lang.String[] { + "Field", "UpdateMask", + }); + internal_static_google_firestore_admin_v1_GetFieldRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_firestore_admin_v1_GetFieldRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_GetFieldRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_firestore_admin_v1_ListFieldsRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_firestore_admin_v1_ListFieldsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_ListFieldsRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", "PageSize", "PageToken", + }); + internal_static_google_firestore_admin_v1_ListFieldsResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_firestore_admin_v1_ListFieldsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_ListFieldsResponse_descriptor, + new java.lang.String[] { + "Fields", "NextPageToken", + }); + internal_static_google_firestore_admin_v1_ExportDocumentsRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_firestore_admin_v1_ExportDocumentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_ExportDocumentsRequest_descriptor, + new java.lang.String[] { + "Name", "CollectionIds", "OutputUriPrefix", + }); + internal_static_google_firestore_admin_v1_ImportDocumentsRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_firestore_admin_v1_ImportDocumentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_ImportDocumentsRequest_descriptor, + new java.lang.String[] { + "Name", "CollectionIds", "InputUriPrefix", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.firestore.admin.v1.FieldProto.getDescriptor(); + com.google.firestore.admin.v1.IndexProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetFieldRequest.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetFieldRequest.java new file mode 100644 index 000000000000..22c24383e2b6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetFieldRequest.java @@ -0,0 +1,604 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for [FirestoreAdmin.GetField][google.firestore.admin.v1.FirestoreAdmin.GetField].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.GetFieldRequest} + */ +public final class GetFieldRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.GetFieldRequest) + GetFieldRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetFieldRequest.newBuilder() to construct. + private GetFieldRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetFieldRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetFieldRequest( + 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(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetFieldRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetFieldRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.GetFieldRequest.class, + com.google.firestore.admin.v1.GetFieldRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * A name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
+   * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+   * A name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.firestore.admin.v1.GetFieldRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.GetFieldRequest other = + (com.google.firestore.admin.v1.GetFieldRequest) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.GetFieldRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.GetFieldRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.GetFieldRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.GetFieldRequest 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.firestore.admin.v1.GetFieldRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.GetFieldRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.GetFieldRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.GetFieldRequest 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.firestore.admin.v1.GetFieldRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.GetFieldRequest 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.firestore.admin.v1.GetFieldRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.GetFieldRequest 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.firestore.admin.v1.GetFieldRequest 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 [FirestoreAdmin.GetField][google.firestore.admin.v1.FirestoreAdmin.GetField].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.GetFieldRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.GetFieldRequest) + com.google.firestore.admin.v1.GetFieldRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetFieldRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetFieldRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.GetFieldRequest.class, + com.google.firestore.admin.v1.GetFieldRequest.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.GetFieldRequest.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_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetFieldRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.GetFieldRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.GetFieldRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.GetFieldRequest build() { + com.google.firestore.admin.v1.GetFieldRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.GetFieldRequest buildPartial() { + com.google.firestore.admin.v1.GetFieldRequest result = + new com.google.firestore.admin.v1.GetFieldRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.GetFieldRequest) { + return mergeFrom((com.google.firestore.admin.v1.GetFieldRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.GetFieldRequest other) { + if (other == com.google.firestore.admin.v1.GetFieldRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.firestore.admin.v1.GetFieldRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.admin.v1.GetFieldRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * A name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * A name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * A name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * A name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.GetFieldRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.GetFieldRequest) + private static final com.google.firestore.admin.v1.GetFieldRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.GetFieldRequest(); + } + + public static com.google.firestore.admin.v1.GetFieldRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetFieldRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetFieldRequest(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.firestore.admin.v1.GetFieldRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetFieldRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetFieldRequestOrBuilder.java new file mode 100644 index 000000000000..0f49e1030980 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetFieldRequestOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +public interface GetFieldRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.GetFieldRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * A name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetIndexRequest.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetIndexRequest.java new file mode 100644 index 000000000000..2e318046789e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetIndexRequest.java @@ -0,0 +1,604 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for [FirestoreAdmin.GetIndex][google.firestore.admin.v1.FirestoreAdmin.GetIndex].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.GetIndexRequest} + */ +public final class GetIndexRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.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() { + name_ = ""; + } + + @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(); + } + 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(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetIndexRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetIndexRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.GetIndexRequest.class, + com.google.firestore.admin.v1.GetIndexRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * A name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+   * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+   * A name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.firestore.admin.v1.GetIndexRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.GetIndexRequest other = + (com.google.firestore.admin.v1.GetIndexRequest) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.GetIndexRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.GetIndexRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.GetIndexRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.GetIndexRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.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.firestore.admin.v1.GetIndexRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.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.firestore.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.firestore.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.firestore.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 [FirestoreAdmin.GetIndex][google.firestore.admin.v1.FirestoreAdmin.GetIndex].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.GetIndexRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.GetIndexRequest) + com.google.firestore.admin.v1.GetIndexRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetIndexRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetIndexRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.GetIndexRequest.class, + com.google.firestore.admin.v1.GetIndexRequest.Builder.class); + } + + // Construct using com.google.firestore.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(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_GetIndexRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.GetIndexRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.GetIndexRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.GetIndexRequest build() { + com.google.firestore.admin.v1.GetIndexRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.GetIndexRequest buildPartial() { + com.google.firestore.admin.v1.GetIndexRequest result = + new com.google.firestore.admin.v1.GetIndexRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.GetIndexRequest) { + return mergeFrom((com.google.firestore.admin.v1.GetIndexRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.GetIndexRequest other) { + if (other == com.google.firestore.admin.v1.GetIndexRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.firestore.admin.v1.GetIndexRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.admin.v1.GetIndexRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * A name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * A name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * A name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * A name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.GetIndexRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.GetIndexRequest) + private static final com.google.firestore.admin.v1.GetIndexRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.GetIndexRequest(); + } + + public static com.google.firestore.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.firestore.admin.v1.GetIndexRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetIndexRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetIndexRequestOrBuilder.java new file mode 100644 index 000000000000..b01fc7cce544 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/GetIndexRequestOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +public interface GetIndexRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.GetIndexRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * A name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsMetadata.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsMetadata.java new file mode 100644 index 000000000000..9df25955c345 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsMetadata.java @@ -0,0 +1,2040 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/operation.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
+ * [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ImportDocumentsMetadata} + */ +public final class ImportDocumentsMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.ImportDocumentsMetadata) + ImportDocumentsMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportDocumentsMetadata.newBuilder() to construct. + private ImportDocumentsMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportDocumentsMetadata() { + operationState_ = 0; + collectionIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + inputUriPrefix_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportDocumentsMetadata( + 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(); + + operationState_ = rawValue; + break; + } + case 34: + { + com.google.firestore.admin.v1.Progress.Builder subBuilder = null; + if (progressDocuments_ != null) { + subBuilder = progressDocuments_.toBuilder(); + } + progressDocuments_ = + input.readMessage( + com.google.firestore.admin.v1.Progress.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progressDocuments_); + progressDocuments_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.firestore.admin.v1.Progress.Builder subBuilder = null; + if (progressBytes_ != null) { + subBuilder = progressBytes_.toBuilder(); + } + progressBytes_ = + input.readMessage( + com.google.firestore.admin.v1.Progress.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progressBytes_); + progressBytes_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + collectionIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000020; + } + collectionIds_.add(s); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + inputUriPrefix_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(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_ & 0x00000020) == 0x00000020)) { + collectionIds_ = collectionIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_ImportDocumentsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_ImportDocumentsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ImportDocumentsMetadata.class, + com.google.firestore.admin.v1.ImportDocumentsMetadata.Builder.class); + } + + private int bitField0_; + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + 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 this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int OPERATION_STATE_FIELD_NUMBER = 3; + private int operationState_; + /** + * + * + *
+   * The state of the import operation.
+   * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + public int getOperationStateValue() { + return operationState_; + } + /** + * + * + *
+   * The state of the import operation.
+   * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + public com.google.firestore.admin.v1.OperationState getOperationState() { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.OperationState result = + com.google.firestore.admin.v1.OperationState.valueOf(operationState_); + return result == null ? com.google.firestore.admin.v1.OperationState.UNRECOGNIZED : result; + } + + public static final int PROGRESS_DOCUMENTS_FIELD_NUMBER = 4; + private com.google.firestore.admin.v1.Progress progressDocuments_; + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public boolean hasProgressDocuments() { + return progressDocuments_ != null; + } + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public com.google.firestore.admin.v1.Progress getProgressDocuments() { + return progressDocuments_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressDocuments_; + } + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressDocumentsOrBuilder() { + return getProgressDocuments(); + } + + public static final int PROGRESS_BYTES_FIELD_NUMBER = 5; + private com.google.firestore.admin.v1.Progress progressBytes_; + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public boolean hasProgressBytes() { + return progressBytes_ != null; + } + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public com.google.firestore.admin.v1.Progress getProgressBytes() { + return progressBytes_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder() { + return getProgressBytes(); + } + + public static final int COLLECTION_IDS_FIELD_NUMBER = 6; + private com.google.protobuf.LazyStringList collectionIds_; + /** + * + * + *
+   * Which collection ids are being imported.
+   * 
+ * + * repeated string collection_ids = 6; + */ + public com.google.protobuf.ProtocolStringList getCollectionIdsList() { + return collectionIds_; + } + /** + * + * + *
+   * Which collection ids are being imported.
+   * 
+ * + * repeated string collection_ids = 6; + */ + public int getCollectionIdsCount() { + return collectionIds_.size(); + } + /** + * + * + *
+   * Which collection ids are being imported.
+   * 
+ * + * repeated string collection_ids = 6; + */ + public java.lang.String getCollectionIds(int index) { + return collectionIds_.get(index); + } + /** + * + * + *
+   * Which collection ids are being imported.
+   * 
+ * + * repeated string collection_ids = 6; + */ + public com.google.protobuf.ByteString getCollectionIdsBytes(int index) { + return collectionIds_.getByteString(index); + } + + public static final int INPUT_URI_PREFIX_FIELD_NUMBER = 7; + private volatile java.lang.Object inputUriPrefix_; + /** + * + * + *
+   * The location of the documents being imported.
+   * 
+ * + * string input_uri_prefix = 7; + */ + public java.lang.String getInputUriPrefix() { + java.lang.Object ref = inputUriPrefix_; + 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(); + inputUriPrefix_ = s; + return s; + } + } + /** + * + * + *
+   * The location of the documents being imported.
+   * 
+ * + * string input_uri_prefix = 7; + */ + public com.google.protobuf.ByteString getInputUriPrefixBytes() { + java.lang.Object ref = inputUriPrefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + inputUriPrefix_ = 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 (startTime_ != null) { + output.writeMessage(1, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (operationState_ + != com.google.firestore.admin.v1.OperationState.OPERATION_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, operationState_); + } + if (progressDocuments_ != null) { + output.writeMessage(4, getProgressDocuments()); + } + if (progressBytes_ != null) { + output.writeMessage(5, getProgressBytes()); + } + for (int i = 0; i < collectionIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, collectionIds_.getRaw(i)); + } + if (!getInputUriPrefixBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, inputUriPrefix_); + } + 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 (operationState_ + != com.google.firestore.admin.v1.OperationState.OPERATION_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, operationState_); + } + if (progressDocuments_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getProgressDocuments()); + } + if (progressBytes_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getProgressBytes()); + } + { + int dataSize = 0; + for (int i = 0; i < collectionIds_.size(); i++) { + dataSize += computeStringSizeNoTag(collectionIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getCollectionIdsList().size(); + } + if (!getInputUriPrefixBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, inputUriPrefix_); + } + 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.firestore.admin.v1.ImportDocumentsMetadata)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.ImportDocumentsMetadata other = + (com.google.firestore.admin.v1.ImportDocumentsMetadata) obj; + + boolean result = true; + result = result && (hasStartTime() == other.hasStartTime()); + if (hasStartTime()) { + result = result && getStartTime().equals(other.getStartTime()); + } + result = result && (hasEndTime() == other.hasEndTime()); + if (hasEndTime()) { + result = result && getEndTime().equals(other.getEndTime()); + } + result = result && operationState_ == other.operationState_; + result = result && (hasProgressDocuments() == other.hasProgressDocuments()); + if (hasProgressDocuments()) { + result = result && getProgressDocuments().equals(other.getProgressDocuments()); + } + result = result && (hasProgressBytes() == other.hasProgressBytes()); + if (hasProgressBytes()) { + result = result && getProgressBytes().equals(other.getProgressBytes()); + } + result = result && getCollectionIdsList().equals(other.getCollectionIdsList()); + result = result && getInputUriPrefix().equals(other.getInputUriPrefix()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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_STATE_FIELD_NUMBER; + hash = (53 * hash) + operationState_; + if (hasProgressDocuments()) { + hash = (37 * hash) + PROGRESS_DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getProgressDocuments().hashCode(); + } + if (hasProgressBytes()) { + hash = (37 * hash) + PROGRESS_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getProgressBytes().hashCode(); + } + if (getCollectionIdsCount() > 0) { + hash = (37 * hash) + COLLECTION_IDS_FIELD_NUMBER; + hash = (53 * hash) + getCollectionIdsList().hashCode(); + } + hash = (37 * hash) + INPUT_URI_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getInputUriPrefix().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.ImportDocumentsMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ImportDocumentsMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ImportDocumentsMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ImportDocumentsMetadata 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.firestore.admin.v1.ImportDocumentsMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ImportDocumentsMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ImportDocumentsMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ImportDocumentsMetadata 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.firestore.admin.v1.ImportDocumentsMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ImportDocumentsMetadata 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.firestore.admin.v1.ImportDocumentsMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ImportDocumentsMetadata 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.firestore.admin.v1.ImportDocumentsMetadata 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 [google.longrunning.Operation][google.longrunning.Operation] results from
+   * [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ImportDocumentsMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.ImportDocumentsMetadata) + com.google.firestore.admin.v1.ImportDocumentsMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_ImportDocumentsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_ImportDocumentsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ImportDocumentsMetadata.class, + com.google.firestore.admin.v1.ImportDocumentsMetadata.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.ImportDocumentsMetadata.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; + } + operationState_ = 0; + + if (progressDocumentsBuilder_ == null) { + progressDocuments_ = null; + } else { + progressDocuments_ = null; + progressDocumentsBuilder_ = null; + } + if (progressBytesBuilder_ == null) { + progressBytes_ = null; + } else { + progressBytes_ = null; + progressBytesBuilder_ = null; + } + collectionIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000020); + inputUriPrefix_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_ImportDocumentsMetadata_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ImportDocumentsMetadata getDefaultInstanceForType() { + return com.google.firestore.admin.v1.ImportDocumentsMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.ImportDocumentsMetadata build() { + com.google.firestore.admin.v1.ImportDocumentsMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ImportDocumentsMetadata buildPartial() { + com.google.firestore.admin.v1.ImportDocumentsMetadata result = + new com.google.firestore.admin.v1.ImportDocumentsMetadata(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.operationState_ = operationState_; + if (progressDocumentsBuilder_ == null) { + result.progressDocuments_ = progressDocuments_; + } else { + result.progressDocuments_ = progressDocumentsBuilder_.build(); + } + if (progressBytesBuilder_ == null) { + result.progressBytes_ = progressBytes_; + } else { + result.progressBytes_ = progressBytesBuilder_.build(); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + collectionIds_ = collectionIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.collectionIds_ = collectionIds_; + result.inputUriPrefix_ = inputUriPrefix_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.ImportDocumentsMetadata) { + return mergeFrom((com.google.firestore.admin.v1.ImportDocumentsMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.ImportDocumentsMetadata other) { + if (other == com.google.firestore.admin.v1.ImportDocumentsMetadata.getDefaultInstance()) + return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.operationState_ != 0) { + setOperationStateValue(other.getOperationStateValue()); + } + if (other.hasProgressDocuments()) { + mergeProgressDocuments(other.getProgressDocuments()); + } + if (other.hasProgressBytes()) { + mergeProgressBytes(other.getProgressBytes()); + } + if (!other.collectionIds_.isEmpty()) { + if (collectionIds_.isEmpty()) { + collectionIds_ = other.collectionIds_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureCollectionIdsIsMutable(); + collectionIds_.addAll(other.collectionIds_); + } + onChanged(); + } + if (!other.getInputUriPrefix().isEmpty()) { + inputUriPrefix_ = other.inputUriPrefix_; + 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.firestore.admin.v1.ImportDocumentsMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.admin.v1.ImportDocumentsMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.Timestamp startTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .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 this operation started.
+     * 
+ * + * .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 this operation started.
+     * 
+ * + * .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 this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .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 this operation started.
+     * 
+ * + * .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_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 operationState_ = 0; + /** + * + * + *
+     * The state of the import operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + public int getOperationStateValue() { + return operationState_; + } + /** + * + * + *
+     * The state of the import operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + public Builder setOperationStateValue(int value) { + operationState_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the import operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + public com.google.firestore.admin.v1.OperationState getOperationState() { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.OperationState result = + com.google.firestore.admin.v1.OperationState.valueOf(operationState_); + return result == null ? com.google.firestore.admin.v1.OperationState.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The state of the import operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + public Builder setOperationState(com.google.firestore.admin.v1.OperationState value) { + if (value == null) { + throw new NullPointerException(); + } + + operationState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the import operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + public Builder clearOperationState() { + + operationState_ = 0; + onChanged(); + return this; + } + + private com.google.firestore.admin.v1.Progress progressDocuments_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + progressDocumentsBuilder_; + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public boolean hasProgressDocuments() { + return progressDocumentsBuilder_ != null || progressDocuments_ != null; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public com.google.firestore.admin.v1.Progress getProgressDocuments() { + if (progressDocumentsBuilder_ == null) { + return progressDocuments_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressDocuments_; + } else { + return progressDocumentsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public Builder setProgressDocuments(com.google.firestore.admin.v1.Progress value) { + if (progressDocumentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progressDocuments_ = value; + onChanged(); + } else { + progressDocumentsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public Builder setProgressDocuments( + com.google.firestore.admin.v1.Progress.Builder builderForValue) { + if (progressDocumentsBuilder_ == null) { + progressDocuments_ = builderForValue.build(); + onChanged(); + } else { + progressDocumentsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public Builder mergeProgressDocuments(com.google.firestore.admin.v1.Progress value) { + if (progressDocumentsBuilder_ == null) { + if (progressDocuments_ != null) { + progressDocuments_ = + com.google.firestore.admin.v1.Progress.newBuilder(progressDocuments_) + .mergeFrom(value) + .buildPartial(); + } else { + progressDocuments_ = value; + } + onChanged(); + } else { + progressDocumentsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public Builder clearProgressDocuments() { + if (progressDocumentsBuilder_ == null) { + progressDocuments_ = null; + onChanged(); + } else { + progressDocuments_ = null; + progressDocumentsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public com.google.firestore.admin.v1.Progress.Builder getProgressDocumentsBuilder() { + + onChanged(); + return getProgressDocumentsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressDocumentsOrBuilder() { + if (progressDocumentsBuilder_ != null) { + return progressDocumentsBuilder_.getMessageOrBuilder(); + } else { + return progressDocuments_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressDocuments_; + } + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + getProgressDocumentsFieldBuilder() { + if (progressDocumentsBuilder_ == null) { + progressDocumentsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder>( + getProgressDocuments(), getParentForChildren(), isClean()); + progressDocuments_ = null; + } + return progressDocumentsBuilder_; + } + + private com.google.firestore.admin.v1.Progress progressBytes_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + progressBytesBuilder_; + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public boolean hasProgressBytes() { + return progressBytesBuilder_ != null || progressBytes_ != null; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public com.google.firestore.admin.v1.Progress getProgressBytes() { + if (progressBytesBuilder_ == null) { + return progressBytes_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } else { + return progressBytesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public Builder setProgressBytes(com.google.firestore.admin.v1.Progress value) { + if (progressBytesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progressBytes_ = value; + onChanged(); + } else { + progressBytesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public Builder setProgressBytes( + com.google.firestore.admin.v1.Progress.Builder builderForValue) { + if (progressBytesBuilder_ == null) { + progressBytes_ = builderForValue.build(); + onChanged(); + } else { + progressBytesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public Builder mergeProgressBytes(com.google.firestore.admin.v1.Progress value) { + if (progressBytesBuilder_ == null) { + if (progressBytes_ != null) { + progressBytes_ = + com.google.firestore.admin.v1.Progress.newBuilder(progressBytes_) + .mergeFrom(value) + .buildPartial(); + } else { + progressBytes_ = value; + } + onChanged(); + } else { + progressBytesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public Builder clearProgressBytes() { + if (progressBytesBuilder_ == null) { + progressBytes_ = null; + onChanged(); + } else { + progressBytes_ = null; + progressBytesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public com.google.firestore.admin.v1.Progress.Builder getProgressBytesBuilder() { + + onChanged(); + return getProgressBytesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder() { + if (progressBytesBuilder_ != null) { + return progressBytesBuilder_.getMessageOrBuilder(); + } else { + return progressBytes_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + getProgressBytesFieldBuilder() { + if (progressBytesBuilder_ == null) { + progressBytesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder>( + getProgressBytes(), getParentForChildren(), isClean()); + progressBytes_ = null; + } + return progressBytesBuilder_; + } + + private com.google.protobuf.LazyStringList collectionIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCollectionIdsIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + collectionIds_ = new com.google.protobuf.LazyStringArrayList(collectionIds_); + bitField0_ |= 0x00000020; + } + } + /** + * + * + *
+     * Which collection ids are being imported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public com.google.protobuf.ProtocolStringList getCollectionIdsList() { + return collectionIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Which collection ids are being imported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public int getCollectionIdsCount() { + return collectionIds_.size(); + } + /** + * + * + *
+     * Which collection ids are being imported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public java.lang.String getCollectionIds(int index) { + return collectionIds_.get(index); + } + /** + * + * + *
+     * Which collection ids are being imported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public com.google.protobuf.ByteString getCollectionIdsBytes(int index) { + return collectionIds_.getByteString(index); + } + /** + * + * + *
+     * Which collection ids are being imported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public Builder setCollectionIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectionIdsIsMutable(); + collectionIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Which collection ids are being imported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public Builder addCollectionIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectionIdsIsMutable(); + collectionIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Which collection ids are being imported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public Builder addAllCollectionIds(java.lang.Iterable values) { + ensureCollectionIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, collectionIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Which collection ids are being imported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public Builder clearCollectionIds() { + collectionIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Which collection ids are being imported.
+     * 
+ * + * repeated string collection_ids = 6; + */ + public Builder addCollectionIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCollectionIdsIsMutable(); + collectionIds_.add(value); + onChanged(); + return this; + } + + private java.lang.Object inputUriPrefix_ = ""; + /** + * + * + *
+     * The location of the documents being imported.
+     * 
+ * + * string input_uri_prefix = 7; + */ + public java.lang.String getInputUriPrefix() { + java.lang.Object ref = inputUriPrefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + inputUriPrefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The location of the documents being imported.
+     * 
+ * + * string input_uri_prefix = 7; + */ + public com.google.protobuf.ByteString getInputUriPrefixBytes() { + java.lang.Object ref = inputUriPrefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + inputUriPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The location of the documents being imported.
+     * 
+ * + * string input_uri_prefix = 7; + */ + public Builder setInputUriPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + inputUriPrefix_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The location of the documents being imported.
+     * 
+ * + * string input_uri_prefix = 7; + */ + public Builder clearInputUriPrefix() { + + inputUriPrefix_ = getDefaultInstance().getInputUriPrefix(); + onChanged(); + return this; + } + /** + * + * + *
+     * The location of the documents being imported.
+     * 
+ * + * string input_uri_prefix = 7; + */ + public Builder setInputUriPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + inputUriPrefix_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.ImportDocumentsMetadata) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ImportDocumentsMetadata) + private static final com.google.firestore.admin.v1.ImportDocumentsMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.ImportDocumentsMetadata(); + } + + public static com.google.firestore.admin.v1.ImportDocumentsMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportDocumentsMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportDocumentsMetadata(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.firestore.admin.v1.ImportDocumentsMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsMetadataOrBuilder.java new file mode 100644 index 000000000000..9c7c5cb59260 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsMetadataOrBuilder.java @@ -0,0 +1,220 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/operation.proto + +package com.google.firestore.admin.v1; + +public interface ImportDocumentsMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.ImportDocumentsMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + boolean hasStartTime(); + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + boolean hasEndTime(); + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * The state of the import operation.
+   * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + int getOperationStateValue(); + /** + * + * + *
+   * The state of the import operation.
+   * 
+ * + * .google.firestore.admin.v1.OperationState operation_state = 3; + */ + com.google.firestore.admin.v1.OperationState getOperationState(); + + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + boolean hasProgressDocuments(); + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + com.google.firestore.admin.v1.Progress getProgressDocuments(); + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 4; + */ + com.google.firestore.admin.v1.ProgressOrBuilder getProgressDocumentsOrBuilder(); + + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + boolean hasProgressBytes(); + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + com.google.firestore.admin.v1.Progress getProgressBytes(); + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + com.google.firestore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder(); + + /** + * + * + *
+   * Which collection ids are being imported.
+   * 
+ * + * repeated string collection_ids = 6; + */ + java.util.List getCollectionIdsList(); + /** + * + * + *
+   * Which collection ids are being imported.
+   * 
+ * + * repeated string collection_ids = 6; + */ + int getCollectionIdsCount(); + /** + * + * + *
+   * Which collection ids are being imported.
+   * 
+ * + * repeated string collection_ids = 6; + */ + java.lang.String getCollectionIds(int index); + /** + * + * + *
+   * Which collection ids are being imported.
+   * 
+ * + * repeated string collection_ids = 6; + */ + com.google.protobuf.ByteString getCollectionIdsBytes(int index); + + /** + * + * + *
+   * The location of the documents being imported.
+   * 
+ * + * string input_uri_prefix = 7; + */ + java.lang.String getInputUriPrefix(); + /** + * + * + *
+   * The location of the documents being imported.
+   * 
+ * + * string input_uri_prefix = 7; + */ + com.google.protobuf.ByteString getInputUriPrefixBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsRequest.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsRequest.java new file mode 100644 index 000000000000..0b2bd2219716 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsRequest.java @@ -0,0 +1,1055 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ImportDocumentsRequest} + */ +public final class ImportDocumentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.ImportDocumentsRequest) + ImportDocumentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ImportDocumentsRequest.newBuilder() to construct. + private ImportDocumentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ImportDocumentsRequest() { + name_ = ""; + collectionIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + inputUriPrefix_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ImportDocumentsRequest( + 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(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + collectionIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + collectionIds_.add(s); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + inputUriPrefix_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(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_ & 0x00000002) == 0x00000002)) { + collectionIds_ = collectionIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ImportDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ImportDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ImportDocumentsRequest.class, + com.google.firestore.admin.v1.ImportDocumentsRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Database to import into. Should be of the form:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+   * Database to import into. Should be of the form:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string name = 1; + */ + 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 COLLECTION_IDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList collectionIds_; + /** + * + * + *
+   * Which collection ids to import. Unspecified means all collections included
+   * in the import.
+   * 
+ * + * repeated string collection_ids = 2; + */ + public com.google.protobuf.ProtocolStringList getCollectionIdsList() { + return collectionIds_; + } + /** + * + * + *
+   * Which collection ids to import. Unspecified means all collections included
+   * in the import.
+   * 
+ * + * repeated string collection_ids = 2; + */ + public int getCollectionIdsCount() { + return collectionIds_.size(); + } + /** + * + * + *
+   * Which collection ids to import. Unspecified means all collections included
+   * in the import.
+   * 
+ * + * repeated string collection_ids = 2; + */ + public java.lang.String getCollectionIds(int index) { + return collectionIds_.get(index); + } + /** + * + * + *
+   * Which collection ids to import. Unspecified means all collections included
+   * in the import.
+   * 
+ * + * repeated string collection_ids = 2; + */ + public com.google.protobuf.ByteString getCollectionIdsBytes(int index) { + return collectionIds_.getByteString(index); + } + + public static final int INPUT_URI_PREFIX_FIELD_NUMBER = 3; + private volatile java.lang.Object inputUriPrefix_; + /** + * + * + *
+   * Location of the exported files.
+   * This must match the output_uri_prefix of an ExportDocumentsResponse from
+   * an export that has completed successfully.
+   * See:
+   * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix].
+   * 
+ * + * string input_uri_prefix = 3; + */ + public java.lang.String getInputUriPrefix() { + java.lang.Object ref = inputUriPrefix_; + 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(); + inputUriPrefix_ = s; + return s; + } + } + /** + * + * + *
+   * Location of the exported files.
+   * This must match the output_uri_prefix of an ExportDocumentsResponse from
+   * an export that has completed successfully.
+   * See:
+   * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix].
+   * 
+ * + * string input_uri_prefix = 3; + */ + public com.google.protobuf.ByteString getInputUriPrefixBytes() { + java.lang.Object ref = inputUriPrefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + inputUriPrefix_ = 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < collectionIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, collectionIds_.getRaw(i)); + } + if (!getInputUriPrefixBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, inputUriPrefix_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + { + int dataSize = 0; + for (int i = 0; i < collectionIds_.size(); i++) { + dataSize += computeStringSizeNoTag(collectionIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getCollectionIdsList().size(); + } + if (!getInputUriPrefixBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, inputUriPrefix_); + } + 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.firestore.admin.v1.ImportDocumentsRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.ImportDocumentsRequest other = + (com.google.firestore.admin.v1.ImportDocumentsRequest) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && getCollectionIdsList().equals(other.getCollectionIdsList()); + result = result && getInputUriPrefix().equals(other.getInputUriPrefix()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getCollectionIdsCount() > 0) { + hash = (37 * hash) + COLLECTION_IDS_FIELD_NUMBER; + hash = (53 * hash) + getCollectionIdsList().hashCode(); + } + hash = (37 * hash) + INPUT_URI_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getInputUriPrefix().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.ImportDocumentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ImportDocumentsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ImportDocumentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ImportDocumentsRequest 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.firestore.admin.v1.ImportDocumentsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ImportDocumentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ImportDocumentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ImportDocumentsRequest 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.firestore.admin.v1.ImportDocumentsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ImportDocumentsRequest 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.firestore.admin.v1.ImportDocumentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ImportDocumentsRequest 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.firestore.admin.v1.ImportDocumentsRequest 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 [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ImportDocumentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.ImportDocumentsRequest) + com.google.firestore.admin.v1.ImportDocumentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ImportDocumentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ImportDocumentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ImportDocumentsRequest.class, + com.google.firestore.admin.v1.ImportDocumentsRequest.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.ImportDocumentsRequest.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_ = ""; + + collectionIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + inputUriPrefix_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ImportDocumentsRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ImportDocumentsRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.ImportDocumentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.ImportDocumentsRequest build() { + com.google.firestore.admin.v1.ImportDocumentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ImportDocumentsRequest buildPartial() { + com.google.firestore.admin.v1.ImportDocumentsRequest result = + new com.google.firestore.admin.v1.ImportDocumentsRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + collectionIds_ = collectionIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.collectionIds_ = collectionIds_; + result.inputUriPrefix_ = inputUriPrefix_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.ImportDocumentsRequest) { + return mergeFrom((com.google.firestore.admin.v1.ImportDocumentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.ImportDocumentsRequest other) { + if (other == com.google.firestore.admin.v1.ImportDocumentsRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.collectionIds_.isEmpty()) { + if (collectionIds_.isEmpty()) { + collectionIds_ = other.collectionIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureCollectionIdsIsMutable(); + collectionIds_.addAll(other.collectionIds_); + } + onChanged(); + } + if (!other.getInputUriPrefix().isEmpty()) { + inputUriPrefix_ = other.inputUriPrefix_; + 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.firestore.admin.v1.ImportDocumentsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.admin.v1.ImportDocumentsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Database to import into. Should be of the form:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * Database to import into. Should be of the form:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * Database to import into. Should be of the form:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Database to import into. Should be of the form:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Database to import into. Should be of the form:
+     * `projects/{project_id}/databases/{database_id}`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList collectionIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCollectionIdsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + collectionIds_ = new com.google.protobuf.LazyStringArrayList(collectionIds_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Which collection ids to import. Unspecified means all collections included
+     * in the import.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public com.google.protobuf.ProtocolStringList getCollectionIdsList() { + return collectionIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * Which collection ids to import. Unspecified means all collections included
+     * in the import.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public int getCollectionIdsCount() { + return collectionIds_.size(); + } + /** + * + * + *
+     * Which collection ids to import. Unspecified means all collections included
+     * in the import.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public java.lang.String getCollectionIds(int index) { + return collectionIds_.get(index); + } + /** + * + * + *
+     * Which collection ids to import. Unspecified means all collections included
+     * in the import.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public com.google.protobuf.ByteString getCollectionIdsBytes(int index) { + return collectionIds_.getByteString(index); + } + /** + * + * + *
+     * Which collection ids to import. Unspecified means all collections included
+     * in the import.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public Builder setCollectionIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectionIdsIsMutable(); + collectionIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Which collection ids to import. Unspecified means all collections included
+     * in the import.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public Builder addCollectionIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectionIdsIsMutable(); + collectionIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Which collection ids to import. Unspecified means all collections included
+     * in the import.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public Builder addAllCollectionIds(java.lang.Iterable values) { + ensureCollectionIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, collectionIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Which collection ids to import. Unspecified means all collections included
+     * in the import.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public Builder clearCollectionIds() { + collectionIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Which collection ids to import. Unspecified means all collections included
+     * in the import.
+     * 
+ * + * repeated string collection_ids = 2; + */ + public Builder addCollectionIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCollectionIdsIsMutable(); + collectionIds_.add(value); + onChanged(); + return this; + } + + private java.lang.Object inputUriPrefix_ = ""; + /** + * + * + *
+     * Location of the exported files.
+     * This must match the output_uri_prefix of an ExportDocumentsResponse from
+     * an export that has completed successfully.
+     * See:
+     * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix].
+     * 
+ * + * string input_uri_prefix = 3; + */ + public java.lang.String getInputUriPrefix() { + java.lang.Object ref = inputUriPrefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + inputUriPrefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Location of the exported files.
+     * This must match the output_uri_prefix of an ExportDocumentsResponse from
+     * an export that has completed successfully.
+     * See:
+     * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix].
+     * 
+ * + * string input_uri_prefix = 3; + */ + public com.google.protobuf.ByteString getInputUriPrefixBytes() { + java.lang.Object ref = inputUriPrefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + inputUriPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Location of the exported files.
+     * This must match the output_uri_prefix of an ExportDocumentsResponse from
+     * an export that has completed successfully.
+     * See:
+     * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix].
+     * 
+ * + * string input_uri_prefix = 3; + */ + public Builder setInputUriPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + inputUriPrefix_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Location of the exported files.
+     * This must match the output_uri_prefix of an ExportDocumentsResponse from
+     * an export that has completed successfully.
+     * See:
+     * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix].
+     * 
+ * + * string input_uri_prefix = 3; + */ + public Builder clearInputUriPrefix() { + + inputUriPrefix_ = getDefaultInstance().getInputUriPrefix(); + onChanged(); + return this; + } + /** + * + * + *
+     * Location of the exported files.
+     * This must match the output_uri_prefix of an ExportDocumentsResponse from
+     * an export that has completed successfully.
+     * See:
+     * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix].
+     * 
+ * + * string input_uri_prefix = 3; + */ + public Builder setInputUriPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + inputUriPrefix_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.ImportDocumentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ImportDocumentsRequest) + private static final com.google.firestore.admin.v1.ImportDocumentsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.ImportDocumentsRequest(); + } + + public static com.google.firestore.admin.v1.ImportDocumentsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImportDocumentsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ImportDocumentsRequest(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.firestore.admin.v1.ImportDocumentsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsRequestOrBuilder.java new file mode 100644 index 000000000000..b9efe59427e1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsRequestOrBuilder.java @@ -0,0 +1,107 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +public interface ImportDocumentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.ImportDocumentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Database to import into. Should be of the form:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Database to import into. Should be of the form:
+   * `projects/{project_id}/databases/{database_id}`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Which collection ids to import. Unspecified means all collections included
+   * in the import.
+   * 
+ * + * repeated string collection_ids = 2; + */ + java.util.List getCollectionIdsList(); + /** + * + * + *
+   * Which collection ids to import. Unspecified means all collections included
+   * in the import.
+   * 
+ * + * repeated string collection_ids = 2; + */ + int getCollectionIdsCount(); + /** + * + * + *
+   * Which collection ids to import. Unspecified means all collections included
+   * in the import.
+   * 
+ * + * repeated string collection_ids = 2; + */ + java.lang.String getCollectionIds(int index); + /** + * + * + *
+   * Which collection ids to import. Unspecified means all collections included
+   * in the import.
+   * 
+ * + * repeated string collection_ids = 2; + */ + com.google.protobuf.ByteString getCollectionIdsBytes(int index); + + /** + * + * + *
+   * Location of the exported files.
+   * This must match the output_uri_prefix of an ExportDocumentsResponse from
+   * an export that has completed successfully.
+   * See:
+   * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix].
+   * 
+ * + * string input_uri_prefix = 3; + */ + java.lang.String getInputUriPrefix(); + /** + * + * + *
+   * Location of the exported files.
+   * This must match the output_uri_prefix of an ExportDocumentsResponse from
+   * an export that has completed successfully.
+   * See:
+   * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix].
+   * 
+ * + * string input_uri_prefix = 3; + */ + com.google.protobuf.ByteString getInputUriPrefixBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Index.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Index.java new file mode 100644 index 000000000000..25f161687743 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Index.java @@ -0,0 +1,3277 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/index.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * Cloud Firestore indexes enable simple and complex queries against
+ * documents in a database.
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.Index} + */ +public final class Index extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.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() { + name_ = ""; + queryScope_ = 0; + fields_ = java.util.Collections.emptyList(); + state_ = 0; + } + + @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(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + queryScope_ = rawValue; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + fields_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + fields_.add( + input.readMessage( + com.google.firestore.admin.v1.Index.IndexField.parser(), extensionRegistry)); + break; + } + case 32: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + default: + { + if (!parseUnknownFieldProto3(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_ & 0x00000004) == 0x00000004)) { + fields_ = java.util.Collections.unmodifiableList(fields_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.IndexProto + .internal_static_google_firestore_admin_v1_Index_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.IndexProto + .internal_static_google_firestore_admin_v1_Index_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.Index.class, + com.google.firestore.admin.v1.Index.Builder.class); + } + + /** + * + * + *
+   * Query Scope defines the scope at which a query is run. This is specified on
+   * a StructuredQuery's `from` field.
+   * 
+ * + * Protobuf enum {@code google.firestore.admin.v1.Index.QueryScope} + */ + public enum QueryScope implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The query scope is unspecified. Not a valid option.
+     * 
+ * + * QUERY_SCOPE_UNSPECIFIED = 0; + */ + QUERY_SCOPE_UNSPECIFIED(0), + /** + * + * + *
+     * Indexes with a collection query scope specified allow queries
+     * against a collection that is the child of a specific document, specified
+     * at query time, and that has the collection id specified by the index.
+     * 
+ * + * COLLECTION = 1; + */ + COLLECTION(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The query scope is unspecified. Not a valid option.
+     * 
+ * + * QUERY_SCOPE_UNSPECIFIED = 0; + */ + public static final int QUERY_SCOPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Indexes with a collection query scope specified allow queries
+     * against a collection that is the child of a specific document, specified
+     * at query time, and that has the collection id specified by the index.
+     * 
+ * + * COLLECTION = 1; + */ + public static final int COLLECTION_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static QueryScope valueOf(int value) { + return forNumber(value); + } + + public static QueryScope forNumber(int value) { + switch (value) { + case 0: + return QUERY_SCOPE_UNSPECIFIED; + case 1: + return COLLECTION; + 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 QueryScope findValueByNumber(int number) { + return QueryScope.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.firestore.admin.v1.Index.getDescriptor().getEnumTypes().get(0); + } + + private static final QueryScope[] VALUES = values(); + + public static QueryScope 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 QueryScope(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.firestore.admin.v1.Index.QueryScope) + } + + /** + * + * + *
+   * The state of an index. During index creation, an index will be in the
+   * `CREATING` state. If the index is created successfully, it will transition
+   * to the `READY` state. If the index creation encounters a problem, the index
+   * will transition to the `NEEDS_REPAIR` state.
+   * 
+ * + * Protobuf enum {@code google.firestore.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.
+     * There is an active long-running operation for the index.
+     * The index is updated when writing a document.
+     * Some index data may exist.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * The index is ready to be used.
+     * The index is updated when writing a document.
+     * The index is fully populated from all stored documents it applies to.
+     * 
+ * + * READY = 2; + */ + READY(2), + /** + * + * + *
+     * The index was being created, but something went wrong.
+     * 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 a document.
+     * Some index data may exist.
+     * Use the google.longrunning.Operations API to determine why the operation
+     * that last attempted to create this index failed, then re-create the
+     * index.
+     * 
+ * + * NEEDS_REPAIR = 3; + */ + NEEDS_REPAIR(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The state is unspecified.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The index is being created.
+     * There is an active long-running operation for the index.
+     * The index is updated when writing a document.
+     * 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 a document.
+     * The index is fully populated from all stored documents it applies to.
+     * 
+ * + * READY = 2; + */ + public static final int READY_VALUE = 2; + /** + * + * + *
+     * The index was being created, but something went wrong.
+     * 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 a document.
+     * Some index data may exist.
+     * Use the google.longrunning.Operations API to determine why the operation
+     * that last attempted to create this index failed, then re-create the
+     * index.
+     * 
+ * + * NEEDS_REPAIR = 3; + */ + public static final int NEEDS_REPAIR_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; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(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 NEEDS_REPAIR; + 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() { + 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.firestore.admin.v1.Index.getDescriptor().getEnumTypes().get(1); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.firestore.admin.v1.Index.State) + } + + public interface IndexFieldOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.Index.IndexField) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Can be __name__.
+     * For single field indexes, this must match the name of the field or may
+     * be omitted.
+     * 
+ * + * string field_path = 1; + */ + java.lang.String getFieldPath(); + /** + * + * + *
+     * Can be __name__.
+     * For single field indexes, this must match the name of the field or may
+     * be omitted.
+     * 
+ * + * string field_path = 1; + */ + com.google.protobuf.ByteString getFieldPathBytes(); + + /** + * + * + *
+     * Indicates that this field supports ordering by the specified order or
+     * comparing using =, <, <=, >, >=.
+     * 
+ * + * .google.firestore.admin.v1.Index.IndexField.Order order = 2; + */ + int getOrderValue(); + /** + * + * + *
+     * Indicates that this field supports ordering by the specified order or
+     * comparing using =, <, <=, >, >=.
+     * 
+ * + * .google.firestore.admin.v1.Index.IndexField.Order order = 2; + */ + com.google.firestore.admin.v1.Index.IndexField.Order getOrder(); + + /** + * + * + *
+     * Indicates that this field supports operations on `array_value`s.
+     * 
+ * + * .google.firestore.admin.v1.Index.IndexField.ArrayConfig array_config = 3; + */ + int getArrayConfigValue(); + /** + * + * + *
+     * Indicates that this field supports operations on `array_value`s.
+     * 
+ * + * .google.firestore.admin.v1.Index.IndexField.ArrayConfig array_config = 3; + */ + com.google.firestore.admin.v1.Index.IndexField.ArrayConfig getArrayConfig(); + + public com.google.firestore.admin.v1.Index.IndexField.ValueModeCase getValueModeCase(); + } + /** + * + * + *
+   * A field in an index.
+   * The field_path describes which field is indexed, the value_mode describes
+   * how the field value is indexed.
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.Index.IndexField} + */ + public static final class IndexField extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.Index.IndexField) + IndexFieldOrBuilder { + private static final long serialVersionUID = 0L; + // Use IndexField.newBuilder() to construct. + private IndexField(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IndexField() { + fieldPath_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private IndexField( + 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(); + + fieldPath_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + valueModeCase_ = 2; + valueMode_ = rawValue; + break; + } + case 24: + { + int rawValue = input.readEnum(); + valueModeCase_ = 3; + valueMode_ = rawValue; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.firestore.admin.v1.IndexProto + .internal_static_google_firestore_admin_v1_Index_IndexField_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.IndexProto + .internal_static_google_firestore_admin_v1_Index_IndexField_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.Index.IndexField.class, + com.google.firestore.admin.v1.Index.IndexField.Builder.class); + } + + /** + * + * + *
+     * The supported orderings.
+     * 
+ * + * Protobuf enum {@code google.firestore.admin.v1.Index.IndexField.Order} + */ + public enum Order implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * The ordering is unspecified. Not a valid option.
+       * 
+ * + * ORDER_UNSPECIFIED = 0; + */ + ORDER_UNSPECIFIED(0), + /** + * + * + *
+       * The field is ordered by ascending field value.
+       * 
+ * + * ASCENDING = 1; + */ + ASCENDING(1), + /** + * + * + *
+       * The field is ordered by descending field value.
+       * 
+ * + * DESCENDING = 2; + */ + DESCENDING(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * The ordering is unspecified. Not a valid option.
+       * 
+ * + * ORDER_UNSPECIFIED = 0; + */ + public static final int ORDER_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * The field is ordered by ascending field value.
+       * 
+ * + * ASCENDING = 1; + */ + public static final int ASCENDING_VALUE = 1; + /** + * + * + *
+       * The field is ordered by descending field value.
+       * 
+ * + * 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; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static Order valueOf(int value) { + return forNumber(value); + } + + public static Order forNumber(int value) { + switch (value) { + case 0: + return ORDER_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 Order findValueByNumber(int number) { + return Order.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.firestore.admin.v1.Index.IndexField.getDescriptor().getEnumTypes().get(0); + } + + private static final Order[] VALUES = values(); + + public static Order 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 Order(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.firestore.admin.v1.Index.IndexField.Order) + } + + /** + * + * + *
+     * The supported array value configurations.
+     * 
+ * + * Protobuf enum {@code google.firestore.admin.v1.Index.IndexField.ArrayConfig} + */ + public enum ArrayConfig implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * The index does not support additional array queries.
+       * 
+ * + * ARRAY_CONFIG_UNSPECIFIED = 0; + */ + ARRAY_CONFIG_UNSPECIFIED(0), + /** + * + * + *
+       * The index supports array containment queries.
+       * 
+ * + * CONTAINS = 1; + */ + CONTAINS(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * The index does not support additional array queries.
+       * 
+ * + * ARRAY_CONFIG_UNSPECIFIED = 0; + */ + public static final int ARRAY_CONFIG_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * The index supports array containment queries.
+       * 
+ * + * CONTAINS = 1; + */ + public static final int CONTAINS_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ArrayConfig valueOf(int value) { + return forNumber(value); + } + + public static ArrayConfig forNumber(int value) { + switch (value) { + case 0: + return ARRAY_CONFIG_UNSPECIFIED; + case 1: + return CONTAINS; + 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 ArrayConfig findValueByNumber(int number) { + return ArrayConfig.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.firestore.admin.v1.Index.IndexField.getDescriptor().getEnumTypes().get(1); + } + + private static final ArrayConfig[] VALUES = values(); + + public static ArrayConfig 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 ArrayConfig(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.firestore.admin.v1.Index.IndexField.ArrayConfig) + } + + private int valueModeCase_ = 0; + private java.lang.Object valueMode_; + + public enum ValueModeCase implements com.google.protobuf.Internal.EnumLite { + ORDER(2), + ARRAY_CONFIG(3), + VALUEMODE_NOT_SET(0); + private final int value; + + private ValueModeCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ValueModeCase valueOf(int value) { + return forNumber(value); + } + + public static ValueModeCase forNumber(int value) { + switch (value) { + case 2: + return ORDER; + case 3: + return ARRAY_CONFIG; + case 0: + return VALUEMODE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ValueModeCase getValueModeCase() { + return ValueModeCase.forNumber(valueModeCase_); + } + + public static final int FIELD_PATH_FIELD_NUMBER = 1; + private volatile java.lang.Object fieldPath_; + /** + * + * + *
+     * Can be __name__.
+     * For single field indexes, this must match the name of the field or may
+     * be omitted.
+     * 
+ * + * string field_path = 1; + */ + public java.lang.String getFieldPath() { + java.lang.Object ref = fieldPath_; + 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(); + fieldPath_ = s; + return s; + } + } + /** + * + * + *
+     * Can be __name__.
+     * For single field indexes, this must match the name of the field or may
+     * be omitted.
+     * 
+ * + * string field_path = 1; + */ + public com.google.protobuf.ByteString getFieldPathBytes() { + java.lang.Object ref = fieldPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_FIELD_NUMBER = 2; + /** + * + * + *
+     * Indicates that this field supports ordering by the specified order or
+     * comparing using =, <, <=, >, >=.
+     * 
+ * + * .google.firestore.admin.v1.Index.IndexField.Order order = 2; + */ + public int getOrderValue() { + if (valueModeCase_ == 2) { + return (java.lang.Integer) valueMode_; + } + return 0; + } + /** + * + * + *
+     * Indicates that this field supports ordering by the specified order or
+     * comparing using =, <, <=, >, >=.
+     * 
+ * + * .google.firestore.admin.v1.Index.IndexField.Order order = 2; + */ + public com.google.firestore.admin.v1.Index.IndexField.Order getOrder() { + if (valueModeCase_ == 2) { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.Index.IndexField.Order result = + com.google.firestore.admin.v1.Index.IndexField.Order.valueOf( + (java.lang.Integer) valueMode_); + return result == null + ? com.google.firestore.admin.v1.Index.IndexField.Order.UNRECOGNIZED + : result; + } + return com.google.firestore.admin.v1.Index.IndexField.Order.ORDER_UNSPECIFIED; + } + + public static final int ARRAY_CONFIG_FIELD_NUMBER = 3; + /** + * + * + *
+     * Indicates that this field supports operations on `array_value`s.
+     * 
+ * + * .google.firestore.admin.v1.Index.IndexField.ArrayConfig array_config = 3; + */ + public int getArrayConfigValue() { + if (valueModeCase_ == 3) { + return (java.lang.Integer) valueMode_; + } + return 0; + } + /** + * + * + *
+     * Indicates that this field supports operations on `array_value`s.
+     * 
+ * + * .google.firestore.admin.v1.Index.IndexField.ArrayConfig array_config = 3; + */ + public com.google.firestore.admin.v1.Index.IndexField.ArrayConfig getArrayConfig() { + if (valueModeCase_ == 3) { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.Index.IndexField.ArrayConfig result = + com.google.firestore.admin.v1.Index.IndexField.ArrayConfig.valueOf( + (java.lang.Integer) valueMode_); + return result == null + ? com.google.firestore.admin.v1.Index.IndexField.ArrayConfig.UNRECOGNIZED + : result; + } + return com.google.firestore.admin.v1.Index.IndexField.ArrayConfig.ARRAY_CONFIG_UNSPECIFIED; + } + + 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 (!getFieldPathBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fieldPath_); + } + if (valueModeCase_ == 2) { + output.writeEnum(2, ((java.lang.Integer) valueMode_)); + } + if (valueModeCase_ == 3) { + output.writeEnum(3, ((java.lang.Integer) valueMode_)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getFieldPathBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fieldPath_); + } + if (valueModeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize( + 2, ((java.lang.Integer) valueMode_)); + } + if (valueModeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize( + 3, ((java.lang.Integer) valueMode_)); + } + 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.firestore.admin.v1.Index.IndexField)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.Index.IndexField other = + (com.google.firestore.admin.v1.Index.IndexField) obj; + + boolean result = true; + result = result && getFieldPath().equals(other.getFieldPath()); + result = result && getValueModeCase().equals(other.getValueModeCase()); + if (!result) return false; + switch (valueModeCase_) { + case 2: + result = result && getOrderValue() == other.getOrderValue(); + break; + case 3: + result = result && getArrayConfigValue() == other.getArrayConfigValue(); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FIELD_PATH_FIELD_NUMBER; + hash = (53 * hash) + getFieldPath().hashCode(); + switch (valueModeCase_) { + case 2: + hash = (37 * hash) + ORDER_FIELD_NUMBER; + hash = (53 * hash) + getOrderValue(); + break; + case 3: + hash = (37 * hash) + ARRAY_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getArrayConfigValue(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.Index.IndexField parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.Index.IndexField parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.Index.IndexField parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.Index.IndexField 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.firestore.admin.v1.Index.IndexField parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.Index.IndexField parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.Index.IndexField parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.Index.IndexField 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.firestore.admin.v1.Index.IndexField parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.Index.IndexField 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.firestore.admin.v1.Index.IndexField parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.Index.IndexField 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.firestore.admin.v1.Index.IndexField 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 field in an index.
+     * The field_path describes which field is indexed, the value_mode describes
+     * how the field value is indexed.
+     * 
+ * + * Protobuf type {@code google.firestore.admin.v1.Index.IndexField} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.Index.IndexField) + com.google.firestore.admin.v1.Index.IndexFieldOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.IndexProto + .internal_static_google_firestore_admin_v1_Index_IndexField_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.IndexProto + .internal_static_google_firestore_admin_v1_Index_IndexField_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.Index.IndexField.class, + com.google.firestore.admin.v1.Index.IndexField.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.Index.IndexField.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(); + fieldPath_ = ""; + + valueModeCase_ = 0; + valueMode_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.IndexProto + .internal_static_google_firestore_admin_v1_Index_IndexField_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.Index.IndexField getDefaultInstanceForType() { + return com.google.firestore.admin.v1.Index.IndexField.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.Index.IndexField build() { + com.google.firestore.admin.v1.Index.IndexField result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.Index.IndexField buildPartial() { + com.google.firestore.admin.v1.Index.IndexField result = + new com.google.firestore.admin.v1.Index.IndexField(this); + result.fieldPath_ = fieldPath_; + if (valueModeCase_ == 2) { + result.valueMode_ = valueMode_; + } + if (valueModeCase_ == 3) { + result.valueMode_ = valueMode_; + } + result.valueModeCase_ = valueModeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.Index.IndexField) { + return mergeFrom((com.google.firestore.admin.v1.Index.IndexField) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.Index.IndexField other) { + if (other == com.google.firestore.admin.v1.Index.IndexField.getDefaultInstance()) + return this; + if (!other.getFieldPath().isEmpty()) { + fieldPath_ = other.fieldPath_; + onChanged(); + } + switch (other.getValueModeCase()) { + case ORDER: + { + setOrderValue(other.getOrderValue()); + break; + } + case ARRAY_CONFIG: + { + setArrayConfigValue(other.getArrayConfigValue()); + break; + } + case VALUEMODE_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.firestore.admin.v1.Index.IndexField parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.admin.v1.Index.IndexField) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int valueModeCase_ = 0; + private java.lang.Object valueMode_; + + public ValueModeCase getValueModeCase() { + return ValueModeCase.forNumber(valueModeCase_); + } + + public Builder clearValueMode() { + valueModeCase_ = 0; + valueMode_ = null; + onChanged(); + return this; + } + + private java.lang.Object fieldPath_ = ""; + /** + * + * + *
+       * Can be __name__.
+       * For single field indexes, this must match the name of the field or may
+       * be omitted.
+       * 
+ * + * string field_path = 1; + */ + public java.lang.String getFieldPath() { + java.lang.Object ref = fieldPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Can be __name__.
+       * For single field indexes, this must match the name of the field or may
+       * be omitted.
+       * 
+ * + * string field_path = 1; + */ + public com.google.protobuf.ByteString getFieldPathBytes() { + java.lang.Object ref = fieldPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Can be __name__.
+       * For single field indexes, this must match the name of the field or may
+       * be omitted.
+       * 
+ * + * string field_path = 1; + */ + public Builder setFieldPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + fieldPath_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Can be __name__.
+       * For single field indexes, this must match the name of the field or may
+       * be omitted.
+       * 
+ * + * string field_path = 1; + */ + public Builder clearFieldPath() { + + fieldPath_ = getDefaultInstance().getFieldPath(); + onChanged(); + return this; + } + /** + * + * + *
+       * Can be __name__.
+       * For single field indexes, this must match the name of the field or may
+       * be omitted.
+       * 
+ * + * string field_path = 1; + */ + public Builder setFieldPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + fieldPath_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * Indicates that this field supports ordering by the specified order or
+       * comparing using =, <, <=, >, >=.
+       * 
+ * + * .google.firestore.admin.v1.Index.IndexField.Order order = 2; + */ + public int getOrderValue() { + if (valueModeCase_ == 2) { + return ((java.lang.Integer) valueMode_).intValue(); + } + return 0; + } + /** + * + * + *
+       * Indicates that this field supports ordering by the specified order or
+       * comparing using =, <, <=, >, >=.
+       * 
+ * + * .google.firestore.admin.v1.Index.IndexField.Order order = 2; + */ + public Builder setOrderValue(int value) { + valueModeCase_ = 2; + valueMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Indicates that this field supports ordering by the specified order or
+       * comparing using =, <, <=, >, >=.
+       * 
+ * + * .google.firestore.admin.v1.Index.IndexField.Order order = 2; + */ + public com.google.firestore.admin.v1.Index.IndexField.Order getOrder() { + if (valueModeCase_ == 2) { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.Index.IndexField.Order result = + com.google.firestore.admin.v1.Index.IndexField.Order.valueOf( + (java.lang.Integer) valueMode_); + return result == null + ? com.google.firestore.admin.v1.Index.IndexField.Order.UNRECOGNIZED + : result; + } + return com.google.firestore.admin.v1.Index.IndexField.Order.ORDER_UNSPECIFIED; + } + /** + * + * + *
+       * Indicates that this field supports ordering by the specified order or
+       * comparing using =, <, <=, >, >=.
+       * 
+ * + * .google.firestore.admin.v1.Index.IndexField.Order order = 2; + */ + public Builder setOrder(com.google.firestore.admin.v1.Index.IndexField.Order value) { + if (value == null) { + throw new NullPointerException(); + } + valueModeCase_ = 2; + valueMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Indicates that this field supports ordering by the specified order or
+       * comparing using =, <, <=, >, >=.
+       * 
+ * + * .google.firestore.admin.v1.Index.IndexField.Order order = 2; + */ + public Builder clearOrder() { + if (valueModeCase_ == 2) { + valueModeCase_ = 0; + valueMode_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Indicates that this field supports operations on `array_value`s.
+       * 
+ * + * .google.firestore.admin.v1.Index.IndexField.ArrayConfig array_config = 3; + */ + public int getArrayConfigValue() { + if (valueModeCase_ == 3) { + return ((java.lang.Integer) valueMode_).intValue(); + } + return 0; + } + /** + * + * + *
+       * Indicates that this field supports operations on `array_value`s.
+       * 
+ * + * .google.firestore.admin.v1.Index.IndexField.ArrayConfig array_config = 3; + */ + public Builder setArrayConfigValue(int value) { + valueModeCase_ = 3; + valueMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Indicates that this field supports operations on `array_value`s.
+       * 
+ * + * .google.firestore.admin.v1.Index.IndexField.ArrayConfig array_config = 3; + */ + public com.google.firestore.admin.v1.Index.IndexField.ArrayConfig getArrayConfig() { + if (valueModeCase_ == 3) { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.Index.IndexField.ArrayConfig result = + com.google.firestore.admin.v1.Index.IndexField.ArrayConfig.valueOf( + (java.lang.Integer) valueMode_); + return result == null + ? com.google.firestore.admin.v1.Index.IndexField.ArrayConfig.UNRECOGNIZED + : result; + } + return com.google.firestore.admin.v1.Index.IndexField.ArrayConfig.ARRAY_CONFIG_UNSPECIFIED; + } + /** + * + * + *
+       * Indicates that this field supports operations on `array_value`s.
+       * 
+ * + * .google.firestore.admin.v1.Index.IndexField.ArrayConfig array_config = 3; + */ + public Builder setArrayConfig( + com.google.firestore.admin.v1.Index.IndexField.ArrayConfig value) { + if (value == null) { + throw new NullPointerException(); + } + valueModeCase_ = 3; + valueMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Indicates that this field supports operations on `array_value`s.
+       * 
+ * + * .google.firestore.admin.v1.Index.IndexField.ArrayConfig array_config = 3; + */ + public Builder clearArrayConfig() { + if (valueModeCase_ == 3) { + valueModeCase_ = 0; + valueMode_ = null; + onChanged(); + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.Index.IndexField) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.Index.IndexField) + private static final com.google.firestore.admin.v1.Index.IndexField DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.Index.IndexField(); + } + + public static com.google.firestore.admin.v1.Index.IndexField getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IndexField parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IndexField(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.firestore.admin.v1.Index.IndexField getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only.
+   * A server defined name for this index.
+   * The form of this name for composite indexes will be:
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
+   * For single field indexes, this field will be empty.
+   * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+   * Output only.
+   * A server defined name for this index.
+   * The form of this name for composite indexes will be:
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
+   * For single field indexes, this field will be empty.
+   * 
+ * + * string name = 1; + */ + 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 QUERY_SCOPE_FIELD_NUMBER = 2; + private int queryScope_; + /** + * + * + *
+   * Indexes with a collection query scope specified allow queries
+   * against a collection that is the child of a specific document, specified at
+   * query time, and that has the same collection id.
+   * Indexes with a collection group query scope specified allow queries against
+   * all collections descended from a specific document, specified at query
+   * time, and that have the same collection id as this index.
+   * 
+ * + * .google.firestore.admin.v1.Index.QueryScope query_scope = 2; + */ + public int getQueryScopeValue() { + return queryScope_; + } + /** + * + * + *
+   * Indexes with a collection query scope specified allow queries
+   * against a collection that is the child of a specific document, specified at
+   * query time, and that has the same collection id.
+   * Indexes with a collection group query scope specified allow queries against
+   * all collections descended from a specific document, specified at query
+   * time, and that have the same collection id as this index.
+   * 
+ * + * .google.firestore.admin.v1.Index.QueryScope query_scope = 2; + */ + public com.google.firestore.admin.v1.Index.QueryScope getQueryScope() { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.Index.QueryScope result = + com.google.firestore.admin.v1.Index.QueryScope.valueOf(queryScope_); + return result == null ? com.google.firestore.admin.v1.Index.QueryScope.UNRECOGNIZED : result; + } + + public static final int FIELDS_FIELD_NUMBER = 3; + private java.util.List fields_; + /** + * + * + *
+   * The fields supported by this index.
+   * For composite indexes, this is always 2 or more fields.
+   * The last field entry is always for the field path `__name__`. If, on
+   * creation, `__name__` was not specified as the last field, it will be added
+   * automatically with the same direction as that of the last field defined. If
+   * the final field in a composite index is not directional, the `__name__`
+   * will be ordered ASCENDING (unless explicitly specified).
+   * For single field indexes, this will always be exactly one entry with a
+   * field path equal to the field path of the associated field.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public java.util.List getFieldsList() { + return fields_; + } + /** + * + * + *
+   * The fields supported by this index.
+   * For composite indexes, this is always 2 or more fields.
+   * The last field entry is always for the field path `__name__`. If, on
+   * creation, `__name__` was not specified as the last field, it will be added
+   * automatically with the same direction as that of the last field defined. If
+   * the final field in a composite index is not directional, the `__name__`
+   * will be ordered ASCENDING (unless explicitly specified).
+   * For single field indexes, this will always be exactly one entry with a
+   * field path equal to the field path of the associated field.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public java.util.List + getFieldsOrBuilderList() { + return fields_; + } + /** + * + * + *
+   * The fields supported by this index.
+   * For composite indexes, this is always 2 or more fields.
+   * The last field entry is always for the field path `__name__`. If, on
+   * creation, `__name__` was not specified as the last field, it will be added
+   * automatically with the same direction as that of the last field defined. If
+   * the final field in a composite index is not directional, the `__name__`
+   * will be ordered ASCENDING (unless explicitly specified).
+   * For single field indexes, this will always be exactly one entry with a
+   * field path equal to the field path of the associated field.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public int getFieldsCount() { + return fields_.size(); + } + /** + * + * + *
+   * The fields supported by this index.
+   * For composite indexes, this is always 2 or more fields.
+   * The last field entry is always for the field path `__name__`. If, on
+   * creation, `__name__` was not specified as the last field, it will be added
+   * automatically with the same direction as that of the last field defined. If
+   * the final field in a composite index is not directional, the `__name__`
+   * will be ordered ASCENDING (unless explicitly specified).
+   * For single field indexes, this will always be exactly one entry with a
+   * field path equal to the field path of the associated field.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public com.google.firestore.admin.v1.Index.IndexField getFields(int index) { + return fields_.get(index); + } + /** + * + * + *
+   * The fields supported by this index.
+   * For composite indexes, this is always 2 or more fields.
+   * The last field entry is always for the field path `__name__`. If, on
+   * creation, `__name__` was not specified as the last field, it will be added
+   * automatically with the same direction as that of the last field defined. If
+   * the final field in a composite index is not directional, the `__name__`
+   * will be ordered ASCENDING (unless explicitly specified).
+   * For single field indexes, this will always be exactly one entry with a
+   * field path equal to the field path of the associated field.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public com.google.firestore.admin.v1.Index.IndexFieldOrBuilder getFieldsOrBuilder(int index) { + return fields_.get(index); + } + + public static final int STATE_FIELD_NUMBER = 4; + private int state_; + /** + * + * + *
+   * Output only.
+   * The serving state of the index.
+   * 
+ * + * .google.firestore.admin.v1.Index.State state = 4; + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only.
+   * The serving state of the index.
+   * 
+ * + * .google.firestore.admin.v1.Index.State state = 4; + */ + public com.google.firestore.admin.v1.Index.State getState() { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.Index.State result = + com.google.firestore.admin.v1.Index.State.valueOf(state_); + return result == null ? com.google.firestore.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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (queryScope_ + != com.google.firestore.admin.v1.Index.QueryScope.QUERY_SCOPE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, queryScope_); + } + for (int i = 0; i < fields_.size(); i++) { + output.writeMessage(3, fields_.get(i)); + } + if (state_ != com.google.firestore.admin.v1.Index.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, state_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (queryScope_ + != com.google.firestore.admin.v1.Index.QueryScope.QUERY_SCOPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, queryScope_); + } + for (int i = 0; i < fields_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, fields_.get(i)); + } + if (state_ != com.google.firestore.admin.v1.Index.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, 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.firestore.admin.v1.Index)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.Index other = (com.google.firestore.admin.v1.Index) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && queryScope_ == other.queryScope_; + result = result && getFieldsList().equals(other.getFieldsList()); + result = result && state_ == other.state_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + QUERY_SCOPE_FIELD_NUMBER; + hash = (53 * hash) + queryScope_; + if (getFieldsCount() > 0) { + hash = (37 * hash) + FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getFieldsList().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.Index parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.Index parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.Index parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.Index parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.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.firestore.admin.v1.Index parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.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.firestore.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.firestore.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.firestore.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; + } + /** + * + * + *
+   * Cloud Firestore indexes enable simple and complex queries against
+   * documents in a database.
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.Index} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.Index) + com.google.firestore.admin.v1.IndexOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.IndexProto + .internal_static_google_firestore_admin_v1_Index_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.IndexProto + .internal_static_google_firestore_admin_v1_Index_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.Index.class, + com.google.firestore.admin.v1.Index.Builder.class); + } + + // Construct using com.google.firestore.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) { + getFieldsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + queryScope_ = 0; + + if (fieldsBuilder_ == null) { + fields_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + fieldsBuilder_.clear(); + } + state_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.IndexProto + .internal_static_google_firestore_admin_v1_Index_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.Index getDefaultInstanceForType() { + return com.google.firestore.admin.v1.Index.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.Index build() { + com.google.firestore.admin.v1.Index result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.Index buildPartial() { + com.google.firestore.admin.v1.Index result = new com.google.firestore.admin.v1.Index(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + result.queryScope_ = queryScope_; + if (fieldsBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + fields_ = java.util.Collections.unmodifiableList(fields_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.fields_ = fields_; + } else { + result.fields_ = fieldsBuilder_.build(); + } + result.state_ = state_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.Index) { + return mergeFrom((com.google.firestore.admin.v1.Index) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.Index other) { + if (other == com.google.firestore.admin.v1.Index.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.queryScope_ != 0) { + setQueryScopeValue(other.getQueryScopeValue()); + } + if (fieldsBuilder_ == null) { + if (!other.fields_.isEmpty()) { + if (fields_.isEmpty()) { + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureFieldsIsMutable(); + fields_.addAll(other.fields_); + } + onChanged(); + } + } else { + if (!other.fields_.isEmpty()) { + if (fieldsBuilder_.isEmpty()) { + fieldsBuilder_.dispose(); + fieldsBuilder_ = null; + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000004); + fieldsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFieldsFieldBuilder() + : null; + } else { + fieldsBuilder_.addAllMessages(other.fields_); + } + } + } + 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.firestore.admin.v1.Index parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.admin.v1.Index) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only.
+     * A server defined name for this index.
+     * The form of this name for composite indexes will be:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
+     * For single field indexes, this field will be empty.
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * Output only.
+     * A server defined name for this index.
+     * The form of this name for composite indexes will be:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
+     * For single field indexes, this field will be empty.
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * Output only.
+     * A server defined name for this index.
+     * The form of this name for composite indexes will be:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
+     * For single field indexes, this field will be empty.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only.
+     * A server defined name for this index.
+     * The form of this name for composite indexes will be:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
+     * For single field indexes, this field will be empty.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only.
+     * A server defined name for this index.
+     * The form of this name for composite indexes will be:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
+     * For single field indexes, this field will be empty.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int queryScope_ = 0; + /** + * + * + *
+     * Indexes with a collection query scope specified allow queries
+     * against a collection that is the child of a specific document, specified at
+     * query time, and that has the same collection id.
+     * Indexes with a collection group query scope specified allow queries against
+     * all collections descended from a specific document, specified at query
+     * time, and that have the same collection id as this index.
+     * 
+ * + * .google.firestore.admin.v1.Index.QueryScope query_scope = 2; + */ + public int getQueryScopeValue() { + return queryScope_; + } + /** + * + * + *
+     * Indexes with a collection query scope specified allow queries
+     * against a collection that is the child of a specific document, specified at
+     * query time, and that has the same collection id.
+     * Indexes with a collection group query scope specified allow queries against
+     * all collections descended from a specific document, specified at query
+     * time, and that have the same collection id as this index.
+     * 
+ * + * .google.firestore.admin.v1.Index.QueryScope query_scope = 2; + */ + public Builder setQueryScopeValue(int value) { + queryScope_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indexes with a collection query scope specified allow queries
+     * against a collection that is the child of a specific document, specified at
+     * query time, and that has the same collection id.
+     * Indexes with a collection group query scope specified allow queries against
+     * all collections descended from a specific document, specified at query
+     * time, and that have the same collection id as this index.
+     * 
+ * + * .google.firestore.admin.v1.Index.QueryScope query_scope = 2; + */ + public com.google.firestore.admin.v1.Index.QueryScope getQueryScope() { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.Index.QueryScope result = + com.google.firestore.admin.v1.Index.QueryScope.valueOf(queryScope_); + return result == null ? com.google.firestore.admin.v1.Index.QueryScope.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Indexes with a collection query scope specified allow queries
+     * against a collection that is the child of a specific document, specified at
+     * query time, and that has the same collection id.
+     * Indexes with a collection group query scope specified allow queries against
+     * all collections descended from a specific document, specified at query
+     * time, and that have the same collection id as this index.
+     * 
+ * + * .google.firestore.admin.v1.Index.QueryScope query_scope = 2; + */ + public Builder setQueryScope(com.google.firestore.admin.v1.Index.QueryScope value) { + if (value == null) { + throw new NullPointerException(); + } + + queryScope_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Indexes with a collection query scope specified allow queries
+     * against a collection that is the child of a specific document, specified at
+     * query time, and that has the same collection id.
+     * Indexes with a collection group query scope specified allow queries against
+     * all collections descended from a specific document, specified at query
+     * time, and that have the same collection id as this index.
+     * 
+ * + * .google.firestore.admin.v1.Index.QueryScope query_scope = 2; + */ + public Builder clearQueryScope() { + + queryScope_ = 0; + onChanged(); + return this; + } + + private java.util.List fields_ = + java.util.Collections.emptyList(); + + private void ensureFieldsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + fields_ = new java.util.ArrayList(fields_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.Index.IndexField, + com.google.firestore.admin.v1.Index.IndexField.Builder, + com.google.firestore.admin.v1.Index.IndexFieldOrBuilder> + fieldsBuilder_; + + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public java.util.List getFieldsList() { + if (fieldsBuilder_ == null) { + return java.util.Collections.unmodifiableList(fields_); + } else { + return fieldsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public int getFieldsCount() { + if (fieldsBuilder_ == null) { + return fields_.size(); + } else { + return fieldsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public com.google.firestore.admin.v1.Index.IndexField getFields(int index) { + if (fieldsBuilder_ == null) { + return fields_.get(index); + } else { + return fieldsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public Builder setFields(int index, com.google.firestore.admin.v1.Index.IndexField value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.set(index, value); + onChanged(); + } else { + fieldsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public Builder setFields( + int index, com.google.firestore.admin.v1.Index.IndexField.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.set(index, builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public Builder addFields(com.google.firestore.admin.v1.Index.IndexField value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(value); + onChanged(); + } else { + fieldsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public Builder addFields(int index, com.google.firestore.admin.v1.Index.IndexField value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(index, value); + onChanged(); + } else { + fieldsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public Builder addFields( + com.google.firestore.admin.v1.Index.IndexField.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public Builder addFields( + int index, com.google.firestore.admin.v1.Index.IndexField.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(index, builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public Builder addAllFields( + java.lang.Iterable values) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fields_); + onChanged(); + } else { + fieldsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public Builder clearFields() { + if (fieldsBuilder_ == null) { + fields_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + fieldsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public Builder removeFields(int index) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.remove(index); + onChanged(); + } else { + fieldsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public com.google.firestore.admin.v1.Index.IndexField.Builder getFieldsBuilder(int index) { + return getFieldsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public com.google.firestore.admin.v1.Index.IndexFieldOrBuilder getFieldsOrBuilder(int index) { + if (fieldsBuilder_ == null) { + return fields_.get(index); + } else { + return fieldsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public java.util.List + getFieldsOrBuilderList() { + if (fieldsBuilder_ != null) { + return fieldsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fields_); + } + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public com.google.firestore.admin.v1.Index.IndexField.Builder addFieldsBuilder() { + return getFieldsFieldBuilder() + .addBuilder(com.google.firestore.admin.v1.Index.IndexField.getDefaultInstance()); + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public com.google.firestore.admin.v1.Index.IndexField.Builder addFieldsBuilder(int index) { + return getFieldsFieldBuilder() + .addBuilder(index, com.google.firestore.admin.v1.Index.IndexField.getDefaultInstance()); + } + /** + * + * + *
+     * The fields supported by this index.
+     * For composite indexes, this is always 2 or more fields.
+     * The last field entry is always for the field path `__name__`. If, on
+     * creation, `__name__` was not specified as the last field, it will be added
+     * automatically with the same direction as that of the last field defined. If
+     * the final field in a composite index is not directional, the `__name__`
+     * will be ordered ASCENDING (unless explicitly specified).
+     * For single field indexes, this will always be exactly one entry with a
+     * field path equal to the field path of the associated field.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + public java.util.List + getFieldsBuilderList() { + return getFieldsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.Index.IndexField, + com.google.firestore.admin.v1.Index.IndexField.Builder, + com.google.firestore.admin.v1.Index.IndexFieldOrBuilder> + getFieldsFieldBuilder() { + if (fieldsBuilder_ == null) { + fieldsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.Index.IndexField, + com.google.firestore.admin.v1.Index.IndexField.Builder, + com.google.firestore.admin.v1.Index.IndexFieldOrBuilder>( + fields_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + fields_ = null; + } + return fieldsBuilder_; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only.
+     * The serving state of the index.
+     * 
+ * + * .google.firestore.admin.v1.Index.State state = 4; + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only.
+     * The serving state of the index.
+     * 
+ * + * .google.firestore.admin.v1.Index.State state = 4; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only.
+     * The serving state of the index.
+     * 
+ * + * .google.firestore.admin.v1.Index.State state = 4; + */ + public com.google.firestore.admin.v1.Index.State getState() { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.Index.State result = + com.google.firestore.admin.v1.Index.State.valueOf(state_); + return result == null ? com.google.firestore.admin.v1.Index.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only.
+     * The serving state of the index.
+     * 
+ * + * .google.firestore.admin.v1.Index.State state = 4; + */ + public Builder setState(com.google.firestore.admin.v1.Index.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only.
+     * The serving state of the index.
+     * 
+ * + * .google.firestore.admin.v1.Index.State state = 4; + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.Index) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.Index) + private static final com.google.firestore.admin.v1.Index DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.Index(); + } + + public static com.google.firestore.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.firestore.admin.v1.Index getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexName.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexName.java new file mode 100644 index 000000000000..2b62e32d30da --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexName.java @@ -0,0 +1,248 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.google.firestore.admin.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class IndexName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/databases/{database}/collectionGroups/{collection_id}/indexes/{index_id}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String database; + private final String collectionId; + private final String indexId; + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public String getCollectionId() { + return collectionId; + } + + public String getIndexId() { + return indexId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private IndexName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + database = Preconditions.checkNotNull(builder.getDatabase()); + collectionId = Preconditions.checkNotNull(builder.getCollectionId()); + indexId = Preconditions.checkNotNull(builder.getIndexId()); + } + + public static IndexName of(String project, String database, String collectionId, String indexId) { + return newBuilder() + .setProject(project) + .setDatabase(database) + .setCollectionId(collectionId) + .setIndexId(indexId) + .build(); + } + + public static String format( + String project, String database, String collectionId, String indexId) { + return newBuilder() + .setProject(project) + .setDatabase(database) + .setCollectionId(collectionId) + .setIndexId(indexId) + .build() + .toString(); + } + + public static IndexName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "IndexName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("database"), + matchMap.get("collection_id"), + matchMap.get("index_id")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (IndexName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("database", database); + fieldMapBuilder.put("collectionId", collectionId); + fieldMapBuilder.put("indexId", indexId); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", + project, + "database", + database, + "collection_id", + collectionId, + "index_id", + indexId); + } + + /** Builder for IndexName. */ + public static class Builder { + + private String project; + private String database; + private String collectionId; + private String indexId; + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public String getCollectionId() { + return collectionId; + } + + public String getIndexId() { + return indexId; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setDatabase(String database) { + this.database = database; + return this; + } + + public Builder setCollectionId(String collectionId) { + this.collectionId = collectionId; + return this; + } + + public Builder setIndexId(String indexId) { + this.indexId = indexId; + return this; + } + + private Builder() {} + + private Builder(IndexName indexName) { + project = indexName.project; + database = indexName.database; + collectionId = indexName.collectionId; + indexId = indexName.indexId; + } + + public IndexName build() { + return new IndexName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof IndexName) { + IndexName that = (IndexName) o; + return (this.project.equals(that.project)) + && (this.database.equals(that.database)) + && (this.collectionId.equals(that.collectionId)) + && (this.indexId.equals(that.indexId)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= database.hashCode(); + h *= 1000003; + h ^= collectionId.hashCode(); + h *= 1000003; + h ^= indexId.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOperationMetadata.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOperationMetadata.java new file mode 100644 index 000000000000..28b57180dd1b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOperationMetadata.java @@ -0,0 +1,1799 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/operation.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
+ * [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.IndexOperationMetadata} + */ +public final class IndexOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.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() { + index_ = ""; + state_ = 0; + } + + @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(); + } + 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 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + index_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 42: + { + com.google.firestore.admin.v1.Progress.Builder subBuilder = null; + if (progressDocuments_ != null) { + subBuilder = progressDocuments_.toBuilder(); + } + progressDocuments_ = + input.readMessage( + com.google.firestore.admin.v1.Progress.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progressDocuments_); + progressDocuments_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.firestore.admin.v1.Progress.Builder subBuilder = null; + if (progressBytes_ != null) { + subBuilder = progressBytes_.toBuilder(); + } + progressBytes_ = + input.readMessage( + com.google.firestore.admin.v1.Progress.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(progressBytes_); + progressBytes_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(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.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_IndexOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_IndexOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.IndexOperationMetadata.class, + com.google.firestore.admin.v1.IndexOperationMetadata.Builder.class); + } + + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + 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 this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int INDEX_FIELD_NUMBER = 3; + private volatile java.lang.Object index_; + /** + * + * + *
+   * The index resource that this operation is acting on. For example:
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+   * 
+ * + * string index = 3; + */ + public java.lang.String getIndex() { + java.lang.Object ref = index_; + 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(); + index_ = s; + return s; + } + } + /** + * + * + *
+   * The index resource that this operation is acting on. For example:
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+   * 
+ * + * string index = 3; + */ + public com.google.protobuf.ByteString getIndexBytes() { + java.lang.Object ref = index_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + index_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 4; + private int state_; + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.firestore.admin.v1.OperationState state = 4; + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.firestore.admin.v1.OperationState state = 4; + */ + public com.google.firestore.admin.v1.OperationState getState() { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.OperationState result = + com.google.firestore.admin.v1.OperationState.valueOf(state_); + return result == null ? com.google.firestore.admin.v1.OperationState.UNRECOGNIZED : result; + } + + public static final int PROGRESS_DOCUMENTS_FIELD_NUMBER = 5; + private com.google.firestore.admin.v1.Progress progressDocuments_; + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 5; + */ + public boolean hasProgressDocuments() { + return progressDocuments_ != null; + } + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 5; + */ + public com.google.firestore.admin.v1.Progress getProgressDocuments() { + return progressDocuments_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressDocuments_; + } + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 5; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressDocumentsOrBuilder() { + return getProgressDocuments(); + } + + public static final int PROGRESS_BYTES_FIELD_NUMBER = 6; + private com.google.firestore.admin.v1.Progress progressBytes_; + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 6; + */ + public boolean hasProgressBytes() { + return progressBytes_ != null; + } + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 6; + */ + public com.google.firestore.admin.v1.Progress getProgressBytes() { + return progressBytes_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 6; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder() { + return getProgressBytes(); + } + + 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 (!getIndexBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, index_); + } + if (state_ + != com.google.firestore.admin.v1.OperationState.OPERATION_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, state_); + } + if (progressDocuments_ != null) { + output.writeMessage(5, getProgressDocuments()); + } + if (progressBytes_ != null) { + output.writeMessage(6, getProgressBytes()); + } + 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 (!getIndexBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, index_); + } + if (state_ + != com.google.firestore.admin.v1.OperationState.OPERATION_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (progressDocuments_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getProgressDocuments()); + } + if (progressBytes_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getProgressBytes()); + } + 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.firestore.admin.v1.IndexOperationMetadata)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.IndexOperationMetadata other = + (com.google.firestore.admin.v1.IndexOperationMetadata) obj; + + boolean result = true; + result = result && (hasStartTime() == other.hasStartTime()); + if (hasStartTime()) { + result = result && getStartTime().equals(other.getStartTime()); + } + result = result && (hasEndTime() == other.hasEndTime()); + if (hasEndTime()) { + result = result && getEndTime().equals(other.getEndTime()); + } + result = result && getIndex().equals(other.getIndex()); + result = result && state_ == other.state_; + result = result && (hasProgressDocuments() == other.hasProgressDocuments()); + if (hasProgressDocuments()) { + result = result && getProgressDocuments().equals(other.getProgressDocuments()); + } + result = result && (hasProgressBytes() == other.hasProgressBytes()); + if (hasProgressBytes()) { + result = result && getProgressBytes().equals(other.getProgressBytes()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + INDEX_FIELD_NUMBER; + hash = (53 * hash) + getIndex().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasProgressDocuments()) { + hash = (37 * hash) + PROGRESS_DOCUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getProgressDocuments().hashCode(); + } + if (hasProgressBytes()) { + hash = (37 * hash) + PROGRESS_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getProgressBytes().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.IndexOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.IndexOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.IndexOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.IndexOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.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.firestore.admin.v1.IndexOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.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.firestore.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.firestore.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.firestore.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 [google.longrunning.Operation][google.longrunning.Operation] results from
+   * [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.IndexOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.IndexOperationMetadata) + com.google.firestore.admin.v1.IndexOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_IndexOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_IndexOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.IndexOperationMetadata.class, + com.google.firestore.admin.v1.IndexOperationMetadata.Builder.class); + } + + // Construct using com.google.firestore.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 (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + index_ = ""; + + state_ = 0; + + if (progressDocumentsBuilder_ == null) { + progressDocuments_ = null; + } else { + progressDocuments_ = null; + progressDocumentsBuilder_ = null; + } + if (progressBytesBuilder_ == null) { + progressBytes_ = null; + } else { + progressBytes_ = null; + progressBytesBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_IndexOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.IndexOperationMetadata getDefaultInstanceForType() { + return com.google.firestore.admin.v1.IndexOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.IndexOperationMetadata build() { + com.google.firestore.admin.v1.IndexOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.IndexOperationMetadata buildPartial() { + com.google.firestore.admin.v1.IndexOperationMetadata result = + new com.google.firestore.admin.v1.IndexOperationMetadata(this); + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.index_ = index_; + result.state_ = state_; + if (progressDocumentsBuilder_ == null) { + result.progressDocuments_ = progressDocuments_; + } else { + result.progressDocuments_ = progressDocumentsBuilder_.build(); + } + if (progressBytesBuilder_ == null) { + result.progressBytes_ = progressBytes_; + } else { + result.progressBytes_ = progressBytesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.IndexOperationMetadata) { + return mergeFrom((com.google.firestore.admin.v1.IndexOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.IndexOperationMetadata other) { + if (other == com.google.firestore.admin.v1.IndexOperationMetadata.getDefaultInstance()) + return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getIndex().isEmpty()) { + index_ = other.index_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasProgressDocuments()) { + mergeProgressDocuments(other.getProgressDocuments()); + } + if (other.hasProgressBytes()) { + mergeProgressBytes(other.getProgressBytes()); + } + 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.firestore.admin.v1.IndexOperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.admin.v1.IndexOperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp startTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .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 this operation started.
+     * 
+ * + * .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 this operation started.
+     * 
+ * + * .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 this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time this operation started.
+     * 
+ * + * .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 this operation started.
+     * 
+ * + * .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_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 this operation completed. Will be unset if operation still in
+     * progress.
+     * 
+ * + * .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 java.lang.Object index_ = ""; + /** + * + * + *
+     * The index resource that this operation is acting on. For example:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+     * 
+ * + * string index = 3; + */ + public java.lang.String getIndex() { + java.lang.Object ref = index_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + index_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The index resource that this operation is acting on. For example:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+     * 
+ * + * string index = 3; + */ + public com.google.protobuf.ByteString getIndexBytes() { + java.lang.Object ref = index_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + index_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The index resource that this operation is acting on. For example:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+     * 
+ * + * string index = 3; + */ + public Builder setIndex(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + index_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The index resource that this operation is acting on. For example:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+     * 
+ * + * string index = 3; + */ + public Builder clearIndex() { + + index_ = getDefaultInstance().getIndex(); + onChanged(); + return this; + } + /** + * + * + *
+     * The index resource that this operation is acting on. For example:
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+     * 
+ * + * string index = 3; + */ + public Builder setIndexBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + index_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState state = 4; + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState state = 4; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState state = 4; + */ + public com.google.firestore.admin.v1.OperationState getState() { + @SuppressWarnings("deprecation") + com.google.firestore.admin.v1.OperationState result = + com.google.firestore.admin.v1.OperationState.valueOf(state_); + return result == null ? com.google.firestore.admin.v1.OperationState.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState state = 4; + */ + public Builder setState(com.google.firestore.admin.v1.OperationState value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the operation.
+     * 
+ * + * .google.firestore.admin.v1.OperationState state = 4; + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.firestore.admin.v1.Progress progressDocuments_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + progressDocumentsBuilder_; + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 5; + */ + public boolean hasProgressDocuments() { + return progressDocumentsBuilder_ != null || progressDocuments_ != null; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 5; + */ + public com.google.firestore.admin.v1.Progress getProgressDocuments() { + if (progressDocumentsBuilder_ == null) { + return progressDocuments_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressDocuments_; + } else { + return progressDocumentsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 5; + */ + public Builder setProgressDocuments(com.google.firestore.admin.v1.Progress value) { + if (progressDocumentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progressDocuments_ = value; + onChanged(); + } else { + progressDocumentsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 5; + */ + public Builder setProgressDocuments( + com.google.firestore.admin.v1.Progress.Builder builderForValue) { + if (progressDocumentsBuilder_ == null) { + progressDocuments_ = builderForValue.build(); + onChanged(); + } else { + progressDocumentsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 5; + */ + public Builder mergeProgressDocuments(com.google.firestore.admin.v1.Progress value) { + if (progressDocumentsBuilder_ == null) { + if (progressDocuments_ != null) { + progressDocuments_ = + com.google.firestore.admin.v1.Progress.newBuilder(progressDocuments_) + .mergeFrom(value) + .buildPartial(); + } else { + progressDocuments_ = value; + } + onChanged(); + } else { + progressDocumentsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 5; + */ + public Builder clearProgressDocuments() { + if (progressDocumentsBuilder_ == null) { + progressDocuments_ = null; + onChanged(); + } else { + progressDocuments_ = null; + progressDocumentsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 5; + */ + public com.google.firestore.admin.v1.Progress.Builder getProgressDocumentsBuilder() { + + onChanged(); + return getProgressDocumentsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 5; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressDocumentsOrBuilder() { + if (progressDocumentsBuilder_ != null) { + return progressDocumentsBuilder_.getMessageOrBuilder(); + } else { + return progressDocuments_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressDocuments_; + } + } + /** + * + * + *
+     * The progress, in documents, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + getProgressDocumentsFieldBuilder() { + if (progressDocumentsBuilder_ == null) { + progressDocumentsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder>( + getProgressDocuments(), getParentForChildren(), isClean()); + progressDocuments_ = null; + } + return progressDocumentsBuilder_; + } + + private com.google.firestore.admin.v1.Progress progressBytes_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + progressBytesBuilder_; + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 6; + */ + public boolean hasProgressBytes() { + return progressBytesBuilder_ != null || progressBytes_ != null; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 6; + */ + public com.google.firestore.admin.v1.Progress getProgressBytes() { + if (progressBytesBuilder_ == null) { + return progressBytes_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } else { + return progressBytesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 6; + */ + public Builder setProgressBytes(com.google.firestore.admin.v1.Progress value) { + if (progressBytesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + progressBytes_ = value; + onChanged(); + } else { + progressBytesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 6; + */ + public Builder setProgressBytes( + com.google.firestore.admin.v1.Progress.Builder builderForValue) { + if (progressBytesBuilder_ == null) { + progressBytes_ = builderForValue.build(); + onChanged(); + } else { + progressBytesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 6; + */ + public Builder mergeProgressBytes(com.google.firestore.admin.v1.Progress value) { + if (progressBytesBuilder_ == null) { + if (progressBytes_ != null) { + progressBytes_ = + com.google.firestore.admin.v1.Progress.newBuilder(progressBytes_) + .mergeFrom(value) + .buildPartial(); + } else { + progressBytes_ = value; + } + onChanged(); + } else { + progressBytesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 6; + */ + public Builder clearProgressBytes() { + if (progressBytesBuilder_ == null) { + progressBytes_ = null; + onChanged(); + } else { + progressBytes_ = null; + progressBytesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 6; + */ + public com.google.firestore.admin.v1.Progress.Builder getProgressBytesBuilder() { + + onChanged(); + return getProgressBytesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 6; + */ + public com.google.firestore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder() { + if (progressBytesBuilder_ != null) { + return progressBytesBuilder_.getMessageOrBuilder(); + } else { + return progressBytes_ == null + ? com.google.firestore.admin.v1.Progress.getDefaultInstance() + : progressBytes_; + } + } + /** + * + * + *
+     * The progress, in bytes, of this operation.
+     * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder> + getProgressBytesFieldBuilder() { + if (progressBytesBuilder_ == null) { + progressBytesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Progress, + com.google.firestore.admin.v1.Progress.Builder, + com.google.firestore.admin.v1.ProgressOrBuilder>( + getProgressBytes(), getParentForChildren(), isClean()); + progressBytes_ = null; + } + return progressBytesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.IndexOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.IndexOperationMetadata) + private static final com.google.firestore.admin.v1.IndexOperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.IndexOperationMetadata(); + } + + public static com.google.firestore.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.firestore.admin.v1.IndexOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOperationMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..4fbed77b4f73 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOperationMetadataOrBuilder.java @@ -0,0 +1,181 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/operation.proto + +package com.google.firestore.admin.v1; + +public interface IndexOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.IndexOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + boolean hasStartTime(); + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The time this operation started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + boolean hasEndTime(); + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * The time this operation completed. Will be unset if operation still in
+   * progress.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * The index resource that this operation is acting on. For example:
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+   * 
+ * + * string index = 3; + */ + java.lang.String getIndex(); + /** + * + * + *
+   * The index resource that this operation is acting on. For example:
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+   * 
+ * + * string index = 3; + */ + com.google.protobuf.ByteString getIndexBytes(); + + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.firestore.admin.v1.OperationState state = 4; + */ + int getStateValue(); + /** + * + * + *
+   * The state of the operation.
+   * 
+ * + * .google.firestore.admin.v1.OperationState state = 4; + */ + com.google.firestore.admin.v1.OperationState getState(); + + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 5; + */ + boolean hasProgressDocuments(); + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 5; + */ + com.google.firestore.admin.v1.Progress getProgressDocuments(); + /** + * + * + *
+   * The progress, in documents, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_documents = 5; + */ + com.google.firestore.admin.v1.ProgressOrBuilder getProgressDocumentsOrBuilder(); + + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 6; + */ + boolean hasProgressBytes(); + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 6; + */ + com.google.firestore.admin.v1.Progress getProgressBytes(); + /** + * + * + *
+   * The progress, in bytes, of this operation.
+   * 
+ * + * .google.firestore.admin.v1.Progress progress_bytes = 6; + */ + com.google.firestore.admin.v1.ProgressOrBuilder getProgressBytesOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOrBuilder.java new file mode 100644 index 000000000000..ce495b677d7b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOrBuilder.java @@ -0,0 +1,185 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/index.proto + +package com.google.firestore.admin.v1; + +public interface IndexOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.Index) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only.
+   * A server defined name for this index.
+   * The form of this name for composite indexes will be:
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
+   * For single field indexes, this field will be empty.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only.
+   * A server defined name for this index.
+   * The form of this name for composite indexes will be:
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
+   * For single field indexes, this field will be empty.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Indexes with a collection query scope specified allow queries
+   * against a collection that is the child of a specific document, specified at
+   * query time, and that has the same collection id.
+   * Indexes with a collection group query scope specified allow queries against
+   * all collections descended from a specific document, specified at query
+   * time, and that have the same collection id as this index.
+   * 
+ * + * .google.firestore.admin.v1.Index.QueryScope query_scope = 2; + */ + int getQueryScopeValue(); + /** + * + * + *
+   * Indexes with a collection query scope specified allow queries
+   * against a collection that is the child of a specific document, specified at
+   * query time, and that has the same collection id.
+   * Indexes with a collection group query scope specified allow queries against
+   * all collections descended from a specific document, specified at query
+   * time, and that have the same collection id as this index.
+   * 
+ * + * .google.firestore.admin.v1.Index.QueryScope query_scope = 2; + */ + com.google.firestore.admin.v1.Index.QueryScope getQueryScope(); + + /** + * + * + *
+   * The fields supported by this index.
+   * For composite indexes, this is always 2 or more fields.
+   * The last field entry is always for the field path `__name__`. If, on
+   * creation, `__name__` was not specified as the last field, it will be added
+   * automatically with the same direction as that of the last field defined. If
+   * the final field in a composite index is not directional, the `__name__`
+   * will be ordered ASCENDING (unless explicitly specified).
+   * For single field indexes, this will always be exactly one entry with a
+   * field path equal to the field path of the associated field.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + java.util.List getFieldsList(); + /** + * + * + *
+   * The fields supported by this index.
+   * For composite indexes, this is always 2 or more fields.
+   * The last field entry is always for the field path `__name__`. If, on
+   * creation, `__name__` was not specified as the last field, it will be added
+   * automatically with the same direction as that of the last field defined. If
+   * the final field in a composite index is not directional, the `__name__`
+   * will be ordered ASCENDING (unless explicitly specified).
+   * For single field indexes, this will always be exactly one entry with a
+   * field path equal to the field path of the associated field.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + com.google.firestore.admin.v1.Index.IndexField getFields(int index); + /** + * + * + *
+   * The fields supported by this index.
+   * For composite indexes, this is always 2 or more fields.
+   * The last field entry is always for the field path `__name__`. If, on
+   * creation, `__name__` was not specified as the last field, it will be added
+   * automatically with the same direction as that of the last field defined. If
+   * the final field in a composite index is not directional, the `__name__`
+   * will be ordered ASCENDING (unless explicitly specified).
+   * For single field indexes, this will always be exactly one entry with a
+   * field path equal to the field path of the associated field.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + int getFieldsCount(); + /** + * + * + *
+   * The fields supported by this index.
+   * For composite indexes, this is always 2 or more fields.
+   * The last field entry is always for the field path `__name__`. If, on
+   * creation, `__name__` was not specified as the last field, it will be added
+   * automatically with the same direction as that of the last field defined. If
+   * the final field in a composite index is not directional, the `__name__`
+   * will be ordered ASCENDING (unless explicitly specified).
+   * For single field indexes, this will always be exactly one entry with a
+   * field path equal to the field path of the associated field.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + java.util.List + getFieldsOrBuilderList(); + /** + * + * + *
+   * The fields supported by this index.
+   * For composite indexes, this is always 2 or more fields.
+   * The last field entry is always for the field path `__name__`. If, on
+   * creation, `__name__` was not specified as the last field, it will be added
+   * automatically with the same direction as that of the last field defined. If
+   * the final field in a composite index is not directional, the `__name__`
+   * will be ordered ASCENDING (unless explicitly specified).
+   * For single field indexes, this will always be exactly one entry with a
+   * field path equal to the field path of the associated field.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + com.google.firestore.admin.v1.Index.IndexFieldOrBuilder getFieldsOrBuilder(int index); + + /** + * + * + *
+   * Output only.
+   * The serving state of the index.
+   * 
+ * + * .google.firestore.admin.v1.Index.State state = 4; + */ + int getStateValue(); + /** + * + * + *
+   * Output only.
+   * The serving state of the index.
+   * 
+ * + * .google.firestore.admin.v1.Index.State state = 4; + */ + com.google.firestore.admin.v1.Index.State getState(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexProto.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexProto.java new file mode 100644 index 000000000000..ef5191e5fc23 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexProto.java @@ -0,0 +1,91 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/index.proto + +package com.google.firestore.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_firestore_admin_v1_Index_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_Index_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_Index_IndexField_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_Index_IndexField_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/firestore/admin/v1/index.proto\022" + + "\031google.firestore.admin.v1\032\034google/api/a" + + "nnotations.proto\"\221\005\n\005Index\022\014\n\004name\030\001 \001(\t" + + "\022@\n\013query_scope\030\002 \001(\0162+.google.firestore" + + ".admin.v1.Index.QueryScope\022;\n\006fields\030\003 \003" + + "(\0132+.google.firestore.admin.v1.Index.Ind" + + "exField\0225\n\005state\030\004 \001(\0162&.google.firestor" + + "e.admin.v1.Index.State\032\275\002\n\nIndexField\022\022\n" + + "\nfield_path\030\001 \001(\t\022B\n\005order\030\002 \001(\01621.googl" + + "e.firestore.admin.v1.Index.IndexField.Or" + + "derH\000\022O\n\014array_config\030\003 \001(\01627.google.fir" + + "estore.admin.v1.Index.IndexField.ArrayCo" + + "nfigH\000\"=\n\005Order\022\025\n\021ORDER_UNSPECIFIED\020\000\022\r" + + "\n\tASCENDING\020\001\022\016\n\nDESCENDING\020\002\"9\n\013ArrayCo" + + "nfig\022\034\n\030ARRAY_CONFIG_UNSPECIFIED\020\000\022\014\n\010CO" + + "NTAINS\020\001B\014\n\nvalue_mode\"9\n\nQueryScope\022\033\n\027" + + "QUERY_SCOPE_UNSPECIFIED\020\000\022\016\n\nCOLLECTION\020" + + "\001\"I\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CRE" + + "ATING\020\001\022\t\n\005READY\020\002\022\020\n\014NEEDS_REPAIR\020\003B\270\001\n" + + "\035com.google.firestore.admin.v1B\nIndexPro" + + "toP\001Z>google.golang.org/genproto/googlea" + + "pis/firestore/admin/v1;admin\242\002\004GCFS\252\002\037Go" + + "ogle.Cloud.Firestore.Admin.V1\312\002\037Google\\C" + + "loud\\Firestore\\Admin\\V1b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + }, + assigner); + internal_static_google_firestore_admin_v1_Index_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_firestore_admin_v1_Index_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_Index_descriptor, + new java.lang.String[] { + "Name", "QueryScope", "Fields", "State", + }); + internal_static_google_firestore_admin_v1_Index_IndexField_descriptor = + internal_static_google_firestore_admin_v1_Index_descriptor.getNestedTypes().get(0); + internal_static_google_firestore_admin_v1_Index_IndexField_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_Index_IndexField_descriptor, + new java.lang.String[] { + "FieldPath", "Order", "ArrayConfig", "ValueMode", + }); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListFieldsRequest.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListFieldsRequest.java new file mode 100644 index 000000000000..cc3e7dc8bde8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListFieldsRequest.java @@ -0,0 +1,1049 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ListFieldsRequest} + */ +public final class ListFieldsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.ListFieldsRequest) + ListFieldsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFieldsRequest.newBuilder() to construct. + private ListFieldsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFieldsRequest() { + parent_ = ""; + filter_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFieldsRequest( + 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(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListFieldsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListFieldsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ListFieldsRequest.class, + com.google.firestore.admin.v1.ListFieldsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * A parent name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * A parent name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The filter to apply to list results. Currently,
+   * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields
+   * that have been explicitly overridden. To issue this query, call
+   * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to
+   * `indexConfig.usesAncestorConfig:false`.
+   * 
+ * + * string filter = 2; + */ + 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; + } + } + /** + * + * + *
+   * The filter to apply to list results. Currently,
+   * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields
+   * that have been explicitly overridden. To issue this query, call
+   * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to
+   * `indexConfig.usesAncestorConfig:false`.
+   * 
+ * + * string filter = 2; + */ + 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 = 3; + private int pageSize_; + /** + * + * + *
+   * The number of results to return.
+   * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A page token, returned from a previous call to
+   * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], that may be used to get the next
+   * page of results.
+   * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, returned from a previous call to
+   * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], that may be used to get the next
+   * page of results.
+   * 
+ * + * string page_token = 4; + */ + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, 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.firestore.admin.v1.ListFieldsRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.ListFieldsRequest other = + (com.google.firestore.admin.v1.ListFieldsRequest) obj; + + boolean result = true; + result = result && getParent().equals(other.getParent()); + result = result && getFilter().equals(other.getFilter()); + result = result && (getPageSize() == other.getPageSize()); + result = result && getPageToken().equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + 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.firestore.admin.v1.ListFieldsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ListFieldsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ListFieldsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ListFieldsRequest 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.firestore.admin.v1.ListFieldsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ListFieldsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ListFieldsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ListFieldsRequest 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.firestore.admin.v1.ListFieldsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ListFieldsRequest 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.firestore.admin.v1.ListFieldsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ListFieldsRequest 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.firestore.admin.v1.ListFieldsRequest 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 [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ListFieldsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.ListFieldsRequest) + com.google.firestore.admin.v1.ListFieldsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListFieldsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListFieldsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ListFieldsRequest.class, + com.google.firestore.admin.v1.ListFieldsRequest.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.ListFieldsRequest.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(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListFieldsRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListFieldsRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.ListFieldsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListFieldsRequest build() { + com.google.firestore.admin.v1.ListFieldsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListFieldsRequest buildPartial() { + com.google.firestore.admin.v1.ListFieldsRequest result = + new com.google.firestore.admin.v1.ListFieldsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.ListFieldsRequest) { + return mergeFrom((com.google.firestore.admin.v1.ListFieldsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.ListFieldsRequest other) { + if (other == com.google.firestore.admin.v1.ListFieldsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + 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.firestore.admin.v1.ListFieldsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.admin.v1.ListFieldsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * A parent name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A parent name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A parent name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A parent name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * A parent name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The filter to apply to list results. Currently,
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields
+     * that have been explicitly overridden. To issue this query, call
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to
+     * `indexConfig.usesAncestorConfig:false`.
+     * 
+ * + * string filter = 2; + */ + 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; + } + } + /** + * + * + *
+     * The filter to apply to list results. Currently,
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields
+     * that have been explicitly overridden. To issue this query, call
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to
+     * `indexConfig.usesAncestorConfig:false`.
+     * 
+ * + * string filter = 2; + */ + 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; + } + } + /** + * + * + *
+     * The filter to apply to list results. Currently,
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields
+     * that have been explicitly overridden. To issue this query, call
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to
+     * `indexConfig.usesAncestorConfig:false`.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter to apply to list results. Currently,
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields
+     * that have been explicitly overridden. To issue this query, call
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to
+     * `indexConfig.usesAncestorConfig:false`.
+     * 
+ * + * string filter = 2; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter to apply to list results. Currently,
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields
+     * that have been explicitly overridden. To issue this query, call
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to
+     * `indexConfig.usesAncestorConfig:false`.
+     * 
+ * + * string filter = 2; + */ + 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 number of results to return.
+     * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The number of results to return.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of results to return.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, returned from a previous call to
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], that may be used to get the next
+     * page of results.
+     * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, returned from a previous call to
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], that may be used to get the next
+     * page of results.
+     * 
+ * + * string page_token = 4; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, returned from a previous call to
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], that may be used to get the next
+     * page of results.
+     * 
+ * + * string page_token = 4; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, returned from a previous call to
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], that may be used to get the next
+     * page of results.
+     * 
+ * + * string page_token = 4; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, returned from a previous call to
+     * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], that may be used to get the next
+     * page of results.
+     * 
+ * + * string page_token = 4; + */ + 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.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.ListFieldsRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ListFieldsRequest) + private static final com.google.firestore.admin.v1.ListFieldsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.ListFieldsRequest(); + } + + public static com.google.firestore.admin.v1.ListFieldsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFieldsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFieldsRequest(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.firestore.admin.v1.ListFieldsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListFieldsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListFieldsRequestOrBuilder.java new file mode 100644 index 000000000000..3456c29b4eaa --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListFieldsRequestOrBuilder.java @@ -0,0 +1,98 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +public interface ListFieldsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.ListFieldsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A parent name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * A parent name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The filter to apply to list results. Currently,
+   * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields
+   * that have been explicitly overridden. To issue this query, call
+   * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to
+   * `indexConfig.usesAncestorConfig:false`.
+   * 
+ * + * string filter = 2; + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter to apply to list results. Currently,
+   * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields
+   * that have been explicitly overridden. To issue this query, call
+   * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to
+   * `indexConfig.usesAncestorConfig:false`.
+   * 
+ * + * string filter = 2; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The number of results to return.
+   * 
+ * + * int32 page_size = 3; + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, returned from a previous call to
+   * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], that may be used to get the next
+   * page of results.
+   * 
+ * + * string page_token = 4; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, returned from a previous call to
+   * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], that may be used to get the next
+   * page of results.
+   * 
+ * + * string page_token = 4; + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListFieldsResponse.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListFieldsResponse.java new file mode 100644 index 000000000000..86c31d29d88d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListFieldsResponse.java @@ -0,0 +1,1096 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The response for [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ListFieldsResponse} + */ +public final class ListFieldsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.ListFieldsResponse) + ListFieldsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFieldsResponse.newBuilder() to construct. + private ListFieldsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFieldsResponse() { + fields_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFieldsResponse( + 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) == 0x00000001)) { + fields_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + fields_.add( + input.readMessage( + com.google.firestore.admin.v1.Field.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(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) == 0x00000001)) { + fields_ = java.util.Collections.unmodifiableList(fields_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListFieldsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListFieldsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ListFieldsResponse.class, + com.google.firestore.admin.v1.ListFieldsResponse.Builder.class); + } + + private int bitField0_; + public static final int FIELDS_FIELD_NUMBER = 1; + private java.util.List fields_; + /** + * + * + *
+   * The requested fields.
+   * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public java.util.List getFieldsList() { + return fields_; + } + /** + * + * + *
+   * The requested fields.
+   * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public java.util.List + getFieldsOrBuilderList() { + return fields_; + } + /** + * + * + *
+   * The requested fields.
+   * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public int getFieldsCount() { + return fields_.size(); + } + /** + * + * + *
+   * The requested fields.
+   * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public com.google.firestore.admin.v1.Field getFields(int index) { + return fields_.get(index); + } + /** + * + * + *
+   * The requested fields.
+   * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public com.google.firestore.admin.v1.FieldOrBuilder getFieldsOrBuilder(int index) { + return fields_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A page token that may be used to request another page of results. If blank,
+   * this is the last page.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token that may be used to request another page of results. If blank,
+   * this is the last page.
+   * 
+ * + * string next_page_token = 2; + */ + 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 < fields_.size(); i++) { + output.writeMessage(1, fields_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + 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 < fields_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, fields_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + 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.firestore.admin.v1.ListFieldsResponse)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.ListFieldsResponse other = + (com.google.firestore.admin.v1.ListFieldsResponse) obj; + + boolean result = true; + result = result && getFieldsList().equals(other.getFieldsList()); + result = result && getNextPageToken().equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFieldsCount() > 0) { + hash = (37 * hash) + FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getFieldsList().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.firestore.admin.v1.ListFieldsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ListFieldsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ListFieldsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ListFieldsResponse 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.firestore.admin.v1.ListFieldsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.ListFieldsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.ListFieldsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ListFieldsResponse 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.firestore.admin.v1.ListFieldsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ListFieldsResponse 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.firestore.admin.v1.ListFieldsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.ListFieldsResponse 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.firestore.admin.v1.ListFieldsResponse 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 [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ListFieldsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.ListFieldsResponse) + com.google.firestore.admin.v1.ListFieldsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListFieldsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListFieldsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ListFieldsResponse.class, + com.google.firestore.admin.v1.ListFieldsResponse.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.ListFieldsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFieldsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (fieldsBuilder_ == null) { + fields_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + fieldsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListFieldsResponse_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListFieldsResponse getDefaultInstanceForType() { + return com.google.firestore.admin.v1.ListFieldsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListFieldsResponse build() { + com.google.firestore.admin.v1.ListFieldsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListFieldsResponse buildPartial() { + com.google.firestore.admin.v1.ListFieldsResponse result = + new com.google.firestore.admin.v1.ListFieldsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (fieldsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + fields_ = java.util.Collections.unmodifiableList(fields_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.fields_ = fields_; + } else { + result.fields_ = fieldsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.ListFieldsResponse) { + return mergeFrom((com.google.firestore.admin.v1.ListFieldsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.ListFieldsResponse other) { + if (other == com.google.firestore.admin.v1.ListFieldsResponse.getDefaultInstance()) + return this; + if (fieldsBuilder_ == null) { + if (!other.fields_.isEmpty()) { + if (fields_.isEmpty()) { + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFieldsIsMutable(); + fields_.addAll(other.fields_); + } + onChanged(); + } + } else { + if (!other.fields_.isEmpty()) { + if (fieldsBuilder_.isEmpty()) { + fieldsBuilder_.dispose(); + fieldsBuilder_ = null; + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000001); + fieldsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFieldsFieldBuilder() + : null; + } else { + fieldsBuilder_.addAllMessages(other.fields_); + } + } + } + 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.firestore.admin.v1.ListFieldsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.admin.v1.ListFieldsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List fields_ = + java.util.Collections.emptyList(); + + private void ensureFieldsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + fields_ = new java.util.ArrayList(fields_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.Field, + com.google.firestore.admin.v1.Field.Builder, + com.google.firestore.admin.v1.FieldOrBuilder> + fieldsBuilder_; + + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public java.util.List getFieldsList() { + if (fieldsBuilder_ == null) { + return java.util.Collections.unmodifiableList(fields_); + } else { + return fieldsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public int getFieldsCount() { + if (fieldsBuilder_ == null) { + return fields_.size(); + } else { + return fieldsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public com.google.firestore.admin.v1.Field getFields(int index) { + if (fieldsBuilder_ == null) { + return fields_.get(index); + } else { + return fieldsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public Builder setFields(int index, com.google.firestore.admin.v1.Field value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.set(index, value); + onChanged(); + } else { + fieldsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public Builder setFields( + int index, com.google.firestore.admin.v1.Field.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.set(index, builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public Builder addFields(com.google.firestore.admin.v1.Field value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(value); + onChanged(); + } else { + fieldsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public Builder addFields(int index, com.google.firestore.admin.v1.Field value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(index, value); + onChanged(); + } else { + fieldsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public Builder addFields(com.google.firestore.admin.v1.Field.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public Builder addFields( + int index, com.google.firestore.admin.v1.Field.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(index, builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public Builder addAllFields( + java.lang.Iterable values) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fields_); + onChanged(); + } else { + fieldsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public Builder clearFields() { + if (fieldsBuilder_ == null) { + fields_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + fieldsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public Builder removeFields(int index) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.remove(index); + onChanged(); + } else { + fieldsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public com.google.firestore.admin.v1.Field.Builder getFieldsBuilder(int index) { + return getFieldsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public com.google.firestore.admin.v1.FieldOrBuilder getFieldsOrBuilder(int index) { + if (fieldsBuilder_ == null) { + return fields_.get(index); + } else { + return fieldsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public java.util.List + getFieldsOrBuilderList() { + if (fieldsBuilder_ != null) { + return fieldsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fields_); + } + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public com.google.firestore.admin.v1.Field.Builder addFieldsBuilder() { + return getFieldsFieldBuilder() + .addBuilder(com.google.firestore.admin.v1.Field.getDefaultInstance()); + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public com.google.firestore.admin.v1.Field.Builder addFieldsBuilder(int index) { + return getFieldsFieldBuilder() + .addBuilder(index, com.google.firestore.admin.v1.Field.getDefaultInstance()); + } + /** + * + * + *
+     * The requested fields.
+     * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + public java.util.List getFieldsBuilderList() { + return getFieldsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.Field, + com.google.firestore.admin.v1.Field.Builder, + com.google.firestore.admin.v1.FieldOrBuilder> + getFieldsFieldBuilder() { + if (fieldsBuilder_ == null) { + fieldsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.Field, + com.google.firestore.admin.v1.Field.Builder, + com.google.firestore.admin.v1.FieldOrBuilder>( + fields_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + fields_ = null; + } + return fieldsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A page token that may be used to request another page of results. If blank,
+     * this is the last page.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token that may be used to request another page of results. If blank,
+     * this is the last page.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token that may be used to request another page of results. If blank,
+     * this is the last page.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token that may be used to request another page of results. If blank,
+     * this is the last page.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token that may be used to request another page of results. If blank,
+     * this is the last page.
+     * 
+ * + * string next_page_token = 2; + */ + 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.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.ListFieldsResponse) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ListFieldsResponse) + private static final com.google.firestore.admin.v1.ListFieldsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.ListFieldsResponse(); + } + + public static com.google.firestore.admin.v1.ListFieldsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFieldsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFieldsResponse(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.firestore.admin.v1.ListFieldsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListFieldsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListFieldsResponseOrBuilder.java new file mode 100644 index 000000000000..95251958ebf3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListFieldsResponseOrBuilder.java @@ -0,0 +1,84 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +public interface ListFieldsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.ListFieldsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The requested fields.
+   * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + java.util.List getFieldsList(); + /** + * + * + *
+   * The requested fields.
+   * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + com.google.firestore.admin.v1.Field getFields(int index); + /** + * + * + *
+   * The requested fields.
+   * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + int getFieldsCount(); + /** + * + * + *
+   * The requested fields.
+   * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + java.util.List getFieldsOrBuilderList(); + /** + * + * + *
+   * The requested fields.
+   * 
+ * + * repeated .google.firestore.admin.v1.Field fields = 1; + */ + com.google.firestore.admin.v1.FieldOrBuilder getFieldsOrBuilder(int index); + + /** + * + * + *
+   * A page token that may be used to request another page of results. If blank,
+   * this is the last page.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A page token that may be used to request another page of results. If blank,
+   * this is the last page.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListIndexesRequest.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListIndexesRequest.java new file mode 100644 index 000000000000..7ae03770204e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListIndexesRequest.java @@ -0,0 +1,1021 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ListIndexesRequest} + */ +public final class ListIndexesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.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() { + parent_ = ""; + filter_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @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(); + } + 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(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(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.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListIndexesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListIndexesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ListIndexesRequest.class, + com.google.firestore.admin.v1.ListIndexesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * A parent name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * A parent name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The filter to apply to list results.
+   * 
+ * + * string filter = 2; + */ + 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; + } + } + /** + * + * + *
+   * The filter to apply to list results.
+   * 
+ * + * string filter = 2; + */ + 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 = 3; + private int pageSize_; + /** + * + * + *
+   * The number of results to return.
+   * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A page token, returned from a previous call to
+   * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], that may be used to get the next
+   * page of results.
+   * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, returned from a previous call to
+   * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], that may be used to get the next
+   * page of results.
+   * 
+ * + * string page_token = 4; + */ + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, 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.firestore.admin.v1.ListIndexesRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.ListIndexesRequest other = + (com.google.firestore.admin.v1.ListIndexesRequest) obj; + + boolean result = true; + result = result && getParent().equals(other.getParent()); + result = result && getFilter().equals(other.getFilter()); + result = result && (getPageSize() == other.getPageSize()); + result = result && getPageToken().equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + 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.firestore.admin.v1.ListIndexesRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.ListIndexesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.ListIndexesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.ListIndexesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.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.firestore.admin.v1.ListIndexesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.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.firestore.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.firestore.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.firestore.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 [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ListIndexesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.ListIndexesRequest) + com.google.firestore.admin.v1.ListIndexesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListIndexesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListIndexesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ListIndexesRequest.class, + com.google.firestore.admin.v1.ListIndexesRequest.Builder.class); + } + + // Construct using com.google.firestore.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(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListIndexesRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListIndexesRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.ListIndexesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListIndexesRequest build() { + com.google.firestore.admin.v1.ListIndexesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListIndexesRequest buildPartial() { + com.google.firestore.admin.v1.ListIndexesRequest result = + new com.google.firestore.admin.v1.ListIndexesRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.ListIndexesRequest) { + return mergeFrom((com.google.firestore.admin.v1.ListIndexesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.ListIndexesRequest other) { + if (other == com.google.firestore.admin.v1.ListIndexesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + 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.firestore.admin.v1.ListIndexesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.admin.v1.ListIndexesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * A parent name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A parent name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A parent name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A parent name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * A parent name of the form
+     * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The filter to apply to list results.
+     * 
+ * + * string filter = 2; + */ + 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; + } + } + /** + * + * + *
+     * The filter to apply to list results.
+     * 
+ * + * string filter = 2; + */ + 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; + } + } + /** + * + * + *
+     * The filter to apply to list results.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter to apply to list results.
+     * 
+ * + * string filter = 2; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter to apply to list results.
+     * 
+ * + * string filter = 2; + */ + 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 number of results to return.
+     * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The number of results to return.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of results to return.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, returned from a previous call to
+     * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], that may be used to get the next
+     * page of results.
+     * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, returned from a previous call to
+     * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], that may be used to get the next
+     * page of results.
+     * 
+ * + * string page_token = 4; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, returned from a previous call to
+     * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], that may be used to get the next
+     * page of results.
+     * 
+ * + * string page_token = 4; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, returned from a previous call to
+     * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], that may be used to get the next
+     * page of results.
+     * 
+ * + * string page_token = 4; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, returned from a previous call to
+     * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], that may be used to get the next
+     * page of results.
+     * 
+ * + * string page_token = 4; + */ + 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.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.ListIndexesRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ListIndexesRequest) + private static final com.google.firestore.admin.v1.ListIndexesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.ListIndexesRequest(); + } + + public static com.google.firestore.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.firestore.admin.v1.ListIndexesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListIndexesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListIndexesRequestOrBuilder.java new file mode 100644 index 000000000000..f12656278692 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListIndexesRequestOrBuilder.java @@ -0,0 +1,90 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +public interface ListIndexesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.ListIndexesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A parent name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * A parent name of the form
+   * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The filter to apply to list results.
+   * 
+ * + * string filter = 2; + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter to apply to list results.
+   * 
+ * + * string filter = 2; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The number of results to return.
+   * 
+ * + * int32 page_size = 3; + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, returned from a previous call to
+   * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], that may be used to get the next
+   * page of results.
+   * 
+ * + * string page_token = 4; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, returned from a previous call to
+   * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], that may be used to get the next
+   * page of results.
+   * 
+ * + * string page_token = 4; + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListIndexesResponse.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListIndexesResponse.java new file mode 100644 index 000000000000..f53c26194814 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListIndexesResponse.java @@ -0,0 +1,1097 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The response for [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ListIndexesResponse} + */ +public final class ListIndexesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.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 + 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) == 0x00000001)) { + indexes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + indexes_.add( + input.readMessage( + com.google.firestore.admin.v1.Index.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(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) == 0x00000001)) { + indexes_ = java.util.Collections.unmodifiableList(indexes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListIndexesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListIndexesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ListIndexesResponse.class, + com.google.firestore.admin.v1.ListIndexesResponse.Builder.class); + } + + private int bitField0_; + public static final int INDEXES_FIELD_NUMBER = 1; + private java.util.List indexes_; + /** + * + * + *
+   * The requested indexes.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public java.util.List getIndexesList() { + return indexes_; + } + /** + * + * + *
+   * The requested indexes.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public java.util.List + getIndexesOrBuilderList() { + return indexes_; + } + /** + * + * + *
+   * The requested indexes.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public int getIndexesCount() { + return indexes_.size(); + } + /** + * + * + *
+   * The requested indexes.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public com.google.firestore.admin.v1.Index getIndexes(int index) { + return indexes_.get(index); + } + /** + * + * + *
+   * The requested indexes.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public com.google.firestore.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_; + /** + * + * + *
+   * A page token that may be used to request another page of results. If blank,
+   * this is the last page.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token that may be used to request another page of results. If blank,
+   * this is the last page.
+   * 
+ * + * string next_page_token = 2; + */ + 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 (!getNextPageTokenBytes().isEmpty()) { + 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 (!getNextPageTokenBytes().isEmpty()) { + 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.firestore.admin.v1.ListIndexesResponse)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.ListIndexesResponse other = + (com.google.firestore.admin.v1.ListIndexesResponse) obj; + + boolean result = true; + result = result && getIndexesList().equals(other.getIndexesList()); + result = result && getNextPageToken().equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.firestore.admin.v1.ListIndexesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.ListIndexesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.ListIndexesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.ListIndexesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.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.firestore.admin.v1.ListIndexesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.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.firestore.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.firestore.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.firestore.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 [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.ListIndexesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.ListIndexesResponse) + com.google.firestore.admin.v1.ListIndexesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListIndexesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListIndexesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.ListIndexesResponse.class, + com.google.firestore.admin.v1.ListIndexesResponse.Builder.class); + } + + // Construct using com.google.firestore.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.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_ListIndexesResponse_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListIndexesResponse getDefaultInstanceForType() { + return com.google.firestore.admin.v1.ListIndexesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListIndexesResponse build() { + com.google.firestore.admin.v1.ListIndexesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.ListIndexesResponse buildPartial() { + com.google.firestore.admin.v1.ListIndexesResponse result = + new com.google.firestore.admin.v1.ListIndexesResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (indexesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + indexes_ = java.util.Collections.unmodifiableList(indexes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.indexes_ = indexes_; + } else { + result.indexes_ = indexesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.ListIndexesResponse) { + return mergeFrom((com.google.firestore.admin.v1.ListIndexesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.ListIndexesResponse other) { + if (other == com.google.firestore.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.firestore.admin.v1.ListIndexesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.firestore.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) == 0x00000001)) { + indexes_ = new java.util.ArrayList(indexes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.Index, + com.google.firestore.admin.v1.Index.Builder, + com.google.firestore.admin.v1.IndexOrBuilder> + indexesBuilder_; + + /** + * + * + *
+     * The requested indexes.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public java.util.List getIndexesList() { + if (indexesBuilder_ == null) { + return java.util.Collections.unmodifiableList(indexes_); + } else { + return indexesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The requested indexes.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public int getIndexesCount() { + if (indexesBuilder_ == null) { + return indexes_.size(); + } else { + return indexesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The requested indexes.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public com.google.firestore.admin.v1.Index getIndexes(int index) { + if (indexesBuilder_ == null) { + return indexes_.get(index); + } else { + return indexesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The requested indexes.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public Builder setIndexes(int index, com.google.firestore.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 requested indexes.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public Builder setIndexes( + int index, com.google.firestore.admin.v1.Index.Builder builderForValue) { + if (indexesBuilder_ == null) { + ensureIndexesIsMutable(); + indexes_.set(index, builderForValue.build()); + onChanged(); + } else { + indexesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested indexes.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public Builder addIndexes(com.google.firestore.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 requested indexes.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public Builder addIndexes(int index, com.google.firestore.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 requested indexes.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public Builder addIndexes(com.google.firestore.admin.v1.Index.Builder builderForValue) { + if (indexesBuilder_ == null) { + ensureIndexesIsMutable(); + indexes_.add(builderForValue.build()); + onChanged(); + } else { + indexesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested indexes.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public Builder addIndexes( + int index, com.google.firestore.admin.v1.Index.Builder builderForValue) { + if (indexesBuilder_ == null) { + ensureIndexesIsMutable(); + indexes_.add(index, builderForValue.build()); + onChanged(); + } else { + indexesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested indexes.
+     * 
+ * + * repeated .google.firestore.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 requested indexes.
+     * 
+ * + * repeated .google.firestore.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 requested indexes.
+     * 
+ * + * repeated .google.firestore.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 requested indexes.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public com.google.firestore.admin.v1.Index.Builder getIndexesBuilder(int index) { + return getIndexesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The requested indexes.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public com.google.firestore.admin.v1.IndexOrBuilder getIndexesOrBuilder(int index) { + if (indexesBuilder_ == null) { + return indexes_.get(index); + } else { + return indexesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The requested indexes.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public java.util.List + getIndexesOrBuilderList() { + if (indexesBuilder_ != null) { + return indexesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(indexes_); + } + } + /** + * + * + *
+     * The requested indexes.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public com.google.firestore.admin.v1.Index.Builder addIndexesBuilder() { + return getIndexesFieldBuilder() + .addBuilder(com.google.firestore.admin.v1.Index.getDefaultInstance()); + } + /** + * + * + *
+     * The requested indexes.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public com.google.firestore.admin.v1.Index.Builder addIndexesBuilder(int index) { + return getIndexesFieldBuilder() + .addBuilder(index, com.google.firestore.admin.v1.Index.getDefaultInstance()); + } + /** + * + * + *
+     * The requested indexes.
+     * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + public java.util.List getIndexesBuilderList() { + return getIndexesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.Index, + com.google.firestore.admin.v1.Index.Builder, + com.google.firestore.admin.v1.IndexOrBuilder> + getIndexesFieldBuilder() { + if (indexesBuilder_ == null) { + indexesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.firestore.admin.v1.Index, + com.google.firestore.admin.v1.Index.Builder, + com.google.firestore.admin.v1.IndexOrBuilder>( + indexes_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + indexes_ = null; + } + return indexesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A page token that may be used to request another page of results. If blank,
+     * this is the last page.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token that may be used to request another page of results. If blank,
+     * this is the last page.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token that may be used to request another page of results. If blank,
+     * this is the last page.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token that may be used to request another page of results. If blank,
+     * this is the last page.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token that may be used to request another page of results. If blank,
+     * this is the last page.
+     * 
+ * + * string next_page_token = 2; + */ + 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.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.ListIndexesResponse) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ListIndexesResponse) + private static final com.google.firestore.admin.v1.ListIndexesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.ListIndexesResponse(); + } + + public static com.google.firestore.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.firestore.admin.v1.ListIndexesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListIndexesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListIndexesResponseOrBuilder.java new file mode 100644 index 000000000000..84c68c85e704 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListIndexesResponseOrBuilder.java @@ -0,0 +1,84 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +public interface ListIndexesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.ListIndexesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The requested indexes.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + java.util.List getIndexesList(); + /** + * + * + *
+   * The requested indexes.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + com.google.firestore.admin.v1.Index getIndexes(int index); + /** + * + * + *
+   * The requested indexes.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + int getIndexesCount(); + /** + * + * + *
+   * The requested indexes.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + java.util.List getIndexesOrBuilderList(); + /** + * + * + *
+   * The requested indexes.
+   * 
+ * + * repeated .google.firestore.admin.v1.Index indexes = 1; + */ + com.google.firestore.admin.v1.IndexOrBuilder getIndexesOrBuilder(int index); + + /** + * + * + *
+   * A page token that may be used to request another page of results. If blank,
+   * this is the last page.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A page token that may be used to request another page of results. If blank,
+   * this is the last page.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/LocationMetadata.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/LocationMetadata.java new file mode 100644 index 000000000000..8e609d46c228 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/LocationMetadata.java @@ -0,0 +1,434 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/location.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The metadata message for [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.LocationMetadata} + */ +public final class LocationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.LocationMetadata) + LocationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use LocationMetadata.newBuilder() to construct. + private LocationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LocationMetadata() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private LocationMetadata( + 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; + default: + { + if (!parseUnknownFieldProto3(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.firestore.admin.v1.LocationProto + .internal_static_google_firestore_admin_v1_LocationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.LocationProto + .internal_static_google_firestore_admin_v1_LocationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.LocationMetadata.class, + com.google.firestore.admin.v1.LocationMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.firestore.admin.v1.LocationMetadata)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.LocationMetadata other = + (com.google.firestore.admin.v1.LocationMetadata) obj; + + boolean result = true; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.LocationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.LocationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.LocationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.LocationMetadata 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.firestore.admin.v1.LocationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.LocationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.LocationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.LocationMetadata 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.firestore.admin.v1.LocationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.LocationMetadata 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.firestore.admin.v1.LocationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.LocationMetadata 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.firestore.admin.v1.LocationMetadata 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 metadata message for [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.LocationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.LocationMetadata) + com.google.firestore.admin.v1.LocationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.LocationProto + .internal_static_google_firestore_admin_v1_LocationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.LocationProto + .internal_static_google_firestore_admin_v1_LocationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.LocationMetadata.class, + com.google.firestore.admin.v1.LocationMetadata.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.LocationMetadata.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(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.LocationProto + .internal_static_google_firestore_admin_v1_LocationMetadata_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.LocationMetadata getDefaultInstanceForType() { + return com.google.firestore.admin.v1.LocationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.LocationMetadata build() { + com.google.firestore.admin.v1.LocationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.LocationMetadata buildPartial() { + com.google.firestore.admin.v1.LocationMetadata result = + new com.google.firestore.admin.v1.LocationMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.LocationMetadata) { + return mergeFrom((com.google.firestore.admin.v1.LocationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.LocationMetadata other) { + if (other == com.google.firestore.admin.v1.LocationMetadata.getDefaultInstance()) return this; + 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.firestore.admin.v1.LocationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.admin.v1.LocationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.LocationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.LocationMetadata) + private static final com.google.firestore.admin.v1.LocationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.LocationMetadata(); + } + + public static com.google.firestore.admin.v1.LocationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LocationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LocationMetadata(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.firestore.admin.v1.LocationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/LocationMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/LocationMetadataOrBuilder.java new file mode 100644 index 000000000000..d2dbd814a6a4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/LocationMetadataOrBuilder.java @@ -0,0 +1,9 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/location.proto + +package com.google.firestore.admin.v1; + +public interface LocationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.LocationMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/LocationProto.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/LocationProto.java new file mode 100644 index 000000000000..47d7b90ffcc5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/LocationProto.java @@ -0,0 +1,64 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/location.proto + +package com.google.firestore.admin.v1; + +public final class LocationProto { + private LocationProto() {} + + 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_firestore_admin_v1_LocationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_LocationMetadata_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/firestore/admin/v1/location.pro" + + "to\022\031google.firestore.admin.v1\032\030google/ty" + + "pe/latlng.proto\032\034google/api/annotations." + + "proto\"\022\n\020LocationMetadataB\273\001\n\035com.google" + + ".firestore.admin.v1B\rLocationProtoP\001Z>go" + + "ogle.golang.org/genproto/googleapis/fire" + + "store/admin/v1;admin\242\002\004GCFS\252\002\037Google.Clo" + + "ud.Firestore.Admin.V1\312\002\037Google\\Cloud\\Fir" + + "estore\\Admin\\V1b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.type.LatLngProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }, + assigner); + internal_static_google_firestore_admin_v1_LocationMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_firestore_admin_v1_LocationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_LocationMetadata_descriptor, + new java.lang.String[] {}); + com.google.type.LatLngProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/OperationProto.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/OperationProto.java new file mode 100644 index 000000000000..6ab4f963e23d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/OperationProto.java @@ -0,0 +1,210 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/operation.proto + +package com.google.firestore.admin.v1; + +public final class OperationProto { + private OperationProto() {} + + 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_firestore_admin_v1_IndexOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_IndexOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_FieldOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_FieldOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_FieldOperationMetadata_IndexConfigDelta_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_FieldOperationMetadata_IndexConfigDelta_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_ExportDocumentsMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_ExportDocumentsMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_ImportDocumentsMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_ImportDocumentsMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_ExportDocumentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_ExportDocumentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_Progress_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_Progress_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/firestore/admin/v1/operation.pr" + + "oto\022\031google.firestore.admin.v1\032%google/f" + + "irestore/admin/v1/index.proto\032\037google/pr" + + "otobuf/timestamp.proto\032\034google/api/annot" + + "ations.proto\"\275\002\n\026IndexOperationMetadata\022" + + ".\n\nstart_time\030\001 \001(\0132\032.google.protobuf.Ti" + + "mestamp\022,\n\010end_time\030\002 \001(\0132\032.google.proto" + + "buf.Timestamp\022\r\n\005index\030\003 \001(\t\0228\n\005state\030\004 " + + "\001(\0162).google.firestore.admin.v1.Operatio" + + "nState\022?\n\022progress_documents\030\005 \001(\0132#.goo" + + "gle.firestore.admin.v1.Progress\022;\n\016progr" + + "ess_bytes\030\006 \001(\0132#.google.firestore.admin" + + ".v1.Progress\"\210\005\n\026FieldOperationMetadata\022" + + ".\n\nstart_time\030\001 \001(\0132\032.google.protobuf.Ti" + + "mestamp\022,\n\010end_time\030\002 \001(\0132\032.google.proto" + + "buf.Timestamp\022\r\n\005field\030\003 \001(\t\022_\n\023index_co" + + "nfig_deltas\030\004 \003(\0132B.google.firestore.adm" + + "in.v1.FieldOperationMetadata.IndexConfig" + + "Delta\0228\n\005state\030\005 \001(\0162).google.firestore." + + "admin.v1.OperationState\022?\n\022progress_docu" + + "ments\030\006 \001(\0132#.google.firestore.admin.v1." + + "Progress\022;\n\016progress_bytes\030\007 \001(\0132#.googl" + + "e.firestore.admin.v1.Progress\032\347\001\n\020IndexC" + + "onfigDelta\022b\n\013change_type\030\001 \001(\0162M.google" + + ".firestore.admin.v1.FieldOperationMetada" + + "ta.IndexConfigDelta.ChangeType\022/\n\005index\030" + + "\002 \001(\0132 .google.firestore.admin.v1.Index\"" + + ">\n\nChangeType\022\033\n\027CHANGE_TYPE_UNSPECIFIED" + + "\020\000\022\007\n\003ADD\020\001\022\n\n\006REMOVE\020\002\"\354\002\n\027ExportDocume" + + "ntsMetadata\022.\n\nstart_time\030\001 \001(\0132\032.google" + + ".protobuf.Timestamp\022,\n\010end_time\030\002 \001(\0132\032." + + "google.protobuf.Timestamp\022B\n\017operation_s" + + "tate\030\003 \001(\0162).google.firestore.admin.v1.O" + + "perationState\022?\n\022progress_documents\030\004 \001(" + + "\0132#.google.firestore.admin.v1.Progress\022;" + + "\n\016progress_bytes\030\005 \001(\0132#.google.firestor" + + "e.admin.v1.Progress\022\026\n\016collection_ids\030\006 " + + "\003(\t\022\031\n\021output_uri_prefix\030\007 \001(\t\"\353\002\n\027Impor" + + "tDocumentsMetadata\022.\n\nstart_time\030\001 \001(\0132\032" + + ".google.protobuf.Timestamp\022,\n\010end_time\030\002" + + " \001(\0132\032.google.protobuf.Timestamp\022B\n\017oper" + + "ation_state\030\003 \001(\0162).google.firestore.adm" + + "in.v1.OperationState\022?\n\022progress_documen" + + "ts\030\004 \001(\0132#.google.firestore.admin.v1.Pro" + + "gress\022;\n\016progress_bytes\030\005 \001(\0132#.google.f" + + "irestore.admin.v1.Progress\022\026\n\016collection" + + "_ids\030\006 \003(\t\022\030\n\020input_uri_prefix\030\007 \001(\t\"4\n\027" + + "ExportDocumentsResponse\022\031\n\021output_uri_pr" + + "efix\030\001 \001(\t\":\n\010Progress\022\026\n\016estimated_work" + + "\030\001 \001(\003\022\026\n\016completed_work\030\002 \001(\003*\236\001\n\016Opera" + + "tionState\022\037\n\033OPERATION_STATE_UNSPECIFIED" + + "\020\000\022\020\n\014INITIALIZING\020\001\022\016\n\nPROCESSING\020\002\022\016\n\n" + + "CANCELLING\020\003\022\016\n\nFINALIZING\020\004\022\016\n\nSUCCESSF" + + "UL\020\005\022\n\n\006FAILED\020\006\022\r\n\tCANCELLED\020\007B\274\001\n\035com." + + "google.firestore.admin.v1B\016OperationProt" + + "oP\001Z>google.golang.org/genproto/googleap" + + "is/firestore/admin/v1;admin\242\002\004GCFS\252\002\037Goo" + + "gle.Cloud.Firestore.Admin.V1\312\002\037Google\\Cl" + + "oud\\Firestore\\Admin\\V1b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.firestore.admin.v1.IndexProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }, + assigner); + internal_static_google_firestore_admin_v1_IndexOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_firestore_admin_v1_IndexOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_IndexOperationMetadata_descriptor, + new java.lang.String[] { + "StartTime", "EndTime", "Index", "State", "ProgressDocuments", "ProgressBytes", + }); + internal_static_google_firestore_admin_v1_FieldOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_firestore_admin_v1_FieldOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_FieldOperationMetadata_descriptor, + new java.lang.String[] { + "StartTime", + "EndTime", + "Field", + "IndexConfigDeltas", + "State", + "ProgressDocuments", + "ProgressBytes", + }); + internal_static_google_firestore_admin_v1_FieldOperationMetadata_IndexConfigDelta_descriptor = + internal_static_google_firestore_admin_v1_FieldOperationMetadata_descriptor + .getNestedTypes() + .get(0); + internal_static_google_firestore_admin_v1_FieldOperationMetadata_IndexConfigDelta_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_FieldOperationMetadata_IndexConfigDelta_descriptor, + new java.lang.String[] { + "ChangeType", "Index", + }); + internal_static_google_firestore_admin_v1_ExportDocumentsMetadata_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_firestore_admin_v1_ExportDocumentsMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_ExportDocumentsMetadata_descriptor, + new java.lang.String[] { + "StartTime", + "EndTime", + "OperationState", + "ProgressDocuments", + "ProgressBytes", + "CollectionIds", + "OutputUriPrefix", + }); + internal_static_google_firestore_admin_v1_ImportDocumentsMetadata_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_firestore_admin_v1_ImportDocumentsMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_ImportDocumentsMetadata_descriptor, + new java.lang.String[] { + "StartTime", + "EndTime", + "OperationState", + "ProgressDocuments", + "ProgressBytes", + "CollectionIds", + "InputUriPrefix", + }); + internal_static_google_firestore_admin_v1_ExportDocumentsResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_firestore_admin_v1_ExportDocumentsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_ExportDocumentsResponse_descriptor, + new java.lang.String[] { + "OutputUriPrefix", + }); + internal_static_google_firestore_admin_v1_Progress_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_firestore_admin_v1_Progress_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_Progress_descriptor, + new java.lang.String[] { + "EstimatedWork", "CompletedWork", + }); + com.google.firestore.admin.v1.IndexProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/OperationState.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/OperationState.java new file mode 100644 index 000000000000..c67fa8148333 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/OperationState.java @@ -0,0 +1,263 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/operation.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * Describes the state of the operation.
+ * 
+ * + * Protobuf enum {@code google.firestore.admin.v1.OperationState} + */ +public enum OperationState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified.
+   * 
+ * + * OPERATION_STATE_UNSPECIFIED = 0; + */ + OPERATION_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.
+   * 
+ * + * OPERATION_STATE_UNSPECIFIED = 0; + */ + public static final int OPERATION_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; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static OperationState valueOf(int value) { + return forNumber(value); + } + + public static OperationState forNumber(int value) { + switch (value) { + case 0: + return OPERATION_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 OperationState findValueByNumber(int number) { + return OperationState.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.firestore.admin.v1.OperationProto.getDescriptor().getEnumTypes().get(0); + } + + private static final OperationState[] VALUES = values(); + + public static OperationState 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 OperationState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.firestore.admin.v1.OperationState) +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ParentName.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ParentName.java new file mode 100644 index 000000000000..55ddd317273b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ParentName.java @@ -0,0 +1,213 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.google.firestore.admin.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ParentName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/databases/{database}/collectionGroups/{collection_id}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String database; + private final String collectionId; + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public String getCollectionId() { + return collectionId; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ParentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + database = Preconditions.checkNotNull(builder.getDatabase()); + collectionId = Preconditions.checkNotNull(builder.getCollectionId()); + } + + public static ParentName of(String project, String database, String collectionId) { + return newBuilder() + .setProject(project) + .setDatabase(database) + .setCollectionId(collectionId) + .build(); + } + + public static String format(String project, String database, String collectionId) { + return newBuilder() + .setProject(project) + .setDatabase(database) + .setCollectionId(collectionId) + .build() + .toString(); + } + + public static ParentName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "ParentName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("database"), matchMap.get("collection_id")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (ParentName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("database", database); + fieldMapBuilder.put("collectionId", collectionId); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, "database", database, "collection_id", collectionId); + } + + /** Builder for ParentName. */ + public static class Builder { + + private String project; + private String database; + private String collectionId; + + public String getProject() { + return project; + } + + public String getDatabase() { + return database; + } + + public String getCollectionId() { + return collectionId; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setDatabase(String database) { + this.database = database; + return this; + } + + public Builder setCollectionId(String collectionId) { + this.collectionId = collectionId; + return this; + } + + private Builder() {} + + private Builder(ParentName parentName) { + project = parentName.project; + database = parentName.database; + collectionId = parentName.collectionId; + } + + public ParentName build() { + return new ParentName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ParentName) { + ParentName that = (ParentName) o; + return (this.project.equals(that.project)) + && (this.database.equals(that.database)) + && (this.collectionId.equals(that.collectionId)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= database.hashCode(); + h *= 1000003; + h ^= collectionId.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Progress.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Progress.java new file mode 100644 index 000000000000..b68e086dee42 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Progress.java @@ -0,0 +1,599 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/operation.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * Describes the progress of the operation.
+ * Unit of work is generic and must be interpreted based on where [Progress][google.firestore.admin.v1.Progress]
+ * is used.
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.Progress} + */ +public final class Progress extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.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() { + estimatedWork_ = 0L; + completedWork_ = 0L; + } + + @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(); + } + 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 8: + { + estimatedWork_ = input.readInt64(); + break; + } + case 16: + { + completedWork_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownFieldProto3(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.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_Progress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_Progress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.Progress.class, + com.google.firestore.admin.v1.Progress.Builder.class); + } + + public static final int ESTIMATED_WORK_FIELD_NUMBER = 1; + private long estimatedWork_; + /** + * + * + *
+   * The amount of work estimated.
+   * 
+ * + * int64 estimated_work = 1; + */ + public long getEstimatedWork() { + return estimatedWork_; + } + + public static final int COMPLETED_WORK_FIELD_NUMBER = 2; + private long completedWork_; + /** + * + * + *
+   * The amount of work completed.
+   * 
+ * + * int64 completed_work = 2; + */ + public long getCompletedWork() { + return completedWork_; + } + + 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 (estimatedWork_ != 0L) { + output.writeInt64(1, estimatedWork_); + } + if (completedWork_ != 0L) { + output.writeInt64(2, completedWork_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (estimatedWork_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, estimatedWork_); + } + if (completedWork_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, completedWork_); + } + 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.firestore.admin.v1.Progress)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.Progress other = (com.google.firestore.admin.v1.Progress) obj; + + boolean result = true; + result = result && (getEstimatedWork() == other.getEstimatedWork()); + result = result && (getCompletedWork() == other.getCompletedWork()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ESTIMATED_WORK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getEstimatedWork()); + hash = (37 * hash) + COMPLETED_WORK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCompletedWork()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.Progress parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.Progress parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.Progress parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.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.firestore.admin.v1.Progress parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.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.firestore.admin.v1.Progress parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.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.firestore.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.firestore.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.firestore.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; + } + /** + * + * + *
+   * Describes the progress of the operation.
+   * Unit of work is generic and must be interpreted based on where [Progress][google.firestore.admin.v1.Progress]
+   * is used.
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.Progress} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.Progress) + com.google.firestore.admin.v1.ProgressOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_Progress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_Progress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.Progress.class, + com.google.firestore.admin.v1.Progress.Builder.class); + } + + // Construct using com.google.firestore.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(); + estimatedWork_ = 0L; + + completedWork_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.OperationProto + .internal_static_google_firestore_admin_v1_Progress_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.Progress getDefaultInstanceForType() { + return com.google.firestore.admin.v1.Progress.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.Progress build() { + com.google.firestore.admin.v1.Progress result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.Progress buildPartial() { + com.google.firestore.admin.v1.Progress result = + new com.google.firestore.admin.v1.Progress(this); + result.estimatedWork_ = estimatedWork_; + result.completedWork_ = completedWork_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.Progress) { + return mergeFrom((com.google.firestore.admin.v1.Progress) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.Progress other) { + if (other == com.google.firestore.admin.v1.Progress.getDefaultInstance()) return this; + if (other.getEstimatedWork() != 0L) { + setEstimatedWork(other.getEstimatedWork()); + } + if (other.getCompletedWork() != 0L) { + setCompletedWork(other.getCompletedWork()); + } + 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.firestore.admin.v1.Progress parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.admin.v1.Progress) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long estimatedWork_; + /** + * + * + *
+     * The amount of work estimated.
+     * 
+ * + * int64 estimated_work = 1; + */ + public long getEstimatedWork() { + return estimatedWork_; + } + /** + * + * + *
+     * The amount of work estimated.
+     * 
+ * + * int64 estimated_work = 1; + */ + public Builder setEstimatedWork(long value) { + + estimatedWork_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The amount of work estimated.
+     * 
+ * + * int64 estimated_work = 1; + */ + public Builder clearEstimatedWork() { + + estimatedWork_ = 0L; + onChanged(); + return this; + } + + private long completedWork_; + /** + * + * + *
+     * The amount of work completed.
+     * 
+ * + * int64 completed_work = 2; + */ + public long getCompletedWork() { + return completedWork_; + } + /** + * + * + *
+     * The amount of work completed.
+     * 
+ * + * int64 completed_work = 2; + */ + public Builder setCompletedWork(long value) { + + completedWork_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The amount of work completed.
+     * 
+ * + * int64 completed_work = 2; + */ + public Builder clearCompletedWork() { + + completedWork_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.Progress) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.Progress) + private static final com.google.firestore.admin.v1.Progress DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.Progress(); + } + + public static com.google.firestore.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.firestore.admin.v1.Progress getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ProgressOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ProgressOrBuilder.java new file mode 100644 index 000000000000..5eeffb29ca97 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ProgressOrBuilder.java @@ -0,0 +1,32 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/operation.proto + +package com.google.firestore.admin.v1; + +public interface ProgressOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.Progress) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The amount of work estimated.
+   * 
+ * + * int64 estimated_work = 1; + */ + long getEstimatedWork(); + + /** + * + * + *
+   * The amount of work completed.
+   * 
+ * + * int64 completed_work = 2; + */ + long getCompletedWork(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/UpdateFieldRequest.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/UpdateFieldRequest.java new file mode 100644 index 000000000000..347c7e881f9a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/UpdateFieldRequest.java @@ -0,0 +1,969 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.UpdateFieldRequest} + */ +public final class UpdateFieldRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.UpdateFieldRequest) + UpdateFieldRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateFieldRequest.newBuilder() to construct. + private UpdateFieldRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateFieldRequest() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateFieldRequest( + 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.firestore.admin.v1.Field.Builder subBuilder = null; + if (field_ != null) { + subBuilder = field_.toBuilder(); + } + field_ = + input.readMessage( + com.google.firestore.admin.v1.Field.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(field_); + field_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(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.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_UpdateFieldRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_UpdateFieldRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.UpdateFieldRequest.class, + com.google.firestore.admin.v1.UpdateFieldRequest.Builder.class); + } + + public static final int FIELD_FIELD_NUMBER = 1; + private com.google.firestore.admin.v1.Field field_; + /** + * + * + *
+   * The field to be updated.
+   * 
+ * + * .google.firestore.admin.v1.Field field = 1; + */ + public boolean hasField() { + return field_ != null; + } + /** + * + * + *
+   * The field to be updated.
+   * 
+ * + * .google.firestore.admin.v1.Field field = 1; + */ + public com.google.firestore.admin.v1.Field getField() { + return field_ == null ? com.google.firestore.admin.v1.Field.getDefaultInstance() : field_; + } + /** + * + * + *
+   * The field to be updated.
+   * 
+ * + * .google.firestore.admin.v1.Field field = 1; + */ + public com.google.firestore.admin.v1.FieldOrBuilder getFieldOrBuilder() { + return getField(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * A mask, relative to the field. If specified, only configuration specified
+   * by this field_mask will be updated in the field.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * A mask, relative to the field. If specified, only configuration specified
+   * by this field_mask will be updated in the field.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * A mask, relative to the field. If specified, only configuration specified
+   * by this field_mask will be updated in the field.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (field_ != null) { + output.writeMessage(1, getField()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (field_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getField()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + 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.firestore.admin.v1.UpdateFieldRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.UpdateFieldRequest other = + (com.google.firestore.admin.v1.UpdateFieldRequest) obj; + + boolean result = true; + result = result && (hasField() == other.hasField()); + if (hasField()) { + result = result && getField().equals(other.getField()); + } + result = result && (hasUpdateMask() == other.hasUpdateMask()); + if (hasUpdateMask()) { + result = result && getUpdateMask().equals(other.getUpdateMask()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasField()) { + hash = (37 * hash) + FIELD_FIELD_NUMBER; + hash = (53 * hash) + getField().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.UpdateFieldRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.UpdateFieldRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.UpdateFieldRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.UpdateFieldRequest 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.firestore.admin.v1.UpdateFieldRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.UpdateFieldRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.UpdateFieldRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.UpdateFieldRequest 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.firestore.admin.v1.UpdateFieldRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.UpdateFieldRequest 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.firestore.admin.v1.UpdateFieldRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.UpdateFieldRequest 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.firestore.admin.v1.UpdateFieldRequest 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 [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.UpdateFieldRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.UpdateFieldRequest) + com.google.firestore.admin.v1.UpdateFieldRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_UpdateFieldRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_UpdateFieldRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.UpdateFieldRequest.class, + com.google.firestore.admin.v1.UpdateFieldRequest.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.UpdateFieldRequest.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 (fieldBuilder_ == null) { + field_ = null; + } else { + field_ = null; + fieldBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_UpdateFieldRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.UpdateFieldRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.UpdateFieldRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.UpdateFieldRequest build() { + com.google.firestore.admin.v1.UpdateFieldRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.UpdateFieldRequest buildPartial() { + com.google.firestore.admin.v1.UpdateFieldRequest result = + new com.google.firestore.admin.v1.UpdateFieldRequest(this); + if (fieldBuilder_ == null) { + result.field_ = field_; + } else { + result.field_ = fieldBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.UpdateFieldRequest) { + return mergeFrom((com.google.firestore.admin.v1.UpdateFieldRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.UpdateFieldRequest other) { + if (other == com.google.firestore.admin.v1.UpdateFieldRequest.getDefaultInstance()) + return this; + if (other.hasField()) { + mergeField(other.getField()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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.firestore.admin.v1.UpdateFieldRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.firestore.admin.v1.UpdateFieldRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.firestore.admin.v1.Field field_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Field, + com.google.firestore.admin.v1.Field.Builder, + com.google.firestore.admin.v1.FieldOrBuilder> + fieldBuilder_; + /** + * + * + *
+     * The field to be updated.
+     * 
+ * + * .google.firestore.admin.v1.Field field = 1; + */ + public boolean hasField() { + return fieldBuilder_ != null || field_ != null; + } + /** + * + * + *
+     * The field to be updated.
+     * 
+ * + * .google.firestore.admin.v1.Field field = 1; + */ + public com.google.firestore.admin.v1.Field getField() { + if (fieldBuilder_ == null) { + return field_ == null ? com.google.firestore.admin.v1.Field.getDefaultInstance() : field_; + } else { + return fieldBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The field to be updated.
+     * 
+ * + * .google.firestore.admin.v1.Field field = 1; + */ + public Builder setField(com.google.firestore.admin.v1.Field value) { + if (fieldBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + field_ = value; + onChanged(); + } else { + fieldBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The field to be updated.
+     * 
+ * + * .google.firestore.admin.v1.Field field = 1; + */ + public Builder setField(com.google.firestore.admin.v1.Field.Builder builderForValue) { + if (fieldBuilder_ == null) { + field_ = builderForValue.build(); + onChanged(); + } else { + fieldBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The field to be updated.
+     * 
+ * + * .google.firestore.admin.v1.Field field = 1; + */ + public Builder mergeField(com.google.firestore.admin.v1.Field value) { + if (fieldBuilder_ == null) { + if (field_ != null) { + field_ = + com.google.firestore.admin.v1.Field.newBuilder(field_) + .mergeFrom(value) + .buildPartial(); + } else { + field_ = value; + } + onChanged(); + } else { + fieldBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The field to be updated.
+     * 
+ * + * .google.firestore.admin.v1.Field field = 1; + */ + public Builder clearField() { + if (fieldBuilder_ == null) { + field_ = null; + onChanged(); + } else { + field_ = null; + fieldBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The field to be updated.
+     * 
+ * + * .google.firestore.admin.v1.Field field = 1; + */ + public com.google.firestore.admin.v1.Field.Builder getFieldBuilder() { + + onChanged(); + return getFieldFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The field to be updated.
+     * 
+ * + * .google.firestore.admin.v1.Field field = 1; + */ + public com.google.firestore.admin.v1.FieldOrBuilder getFieldOrBuilder() { + if (fieldBuilder_ != null) { + return fieldBuilder_.getMessageOrBuilder(); + } else { + return field_ == null ? com.google.firestore.admin.v1.Field.getDefaultInstance() : field_; + } + } + /** + * + * + *
+     * The field to be updated.
+     * 
+ * + * .google.firestore.admin.v1.Field field = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Field, + com.google.firestore.admin.v1.Field.Builder, + com.google.firestore.admin.v1.FieldOrBuilder> + getFieldFieldBuilder() { + if (fieldBuilder_ == null) { + fieldBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.admin.v1.Field, + com.google.firestore.admin.v1.Field.Builder, + com.google.firestore.admin.v1.FieldOrBuilder>( + getField(), getParentForChildren(), isClean()); + field_ = null; + } + return fieldBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * A mask, relative to the field. If specified, only configuration specified
+     * by this field_mask will be updated in the field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * A mask, relative to the field. If specified, only configuration specified
+     * by this field_mask will be updated in the field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A mask, relative to the field. If specified, only configuration specified
+     * by this field_mask will be updated in the field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A mask, relative to the field. If specified, only configuration specified
+     * by this field_mask will be updated in the field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A mask, relative to the field. If specified, only configuration specified
+     * by this field_mask will be updated in the field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A mask, relative to the field. If specified, only configuration specified
+     * by this field_mask will be updated in the field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A mask, relative to the field. If specified, only configuration specified
+     * by this field_mask will be updated in the field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A mask, relative to the field. If specified, only configuration specified
+     * by this field_mask will be updated in the field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * A mask, relative to the field. If specified, only configuration specified
+     * by this field_mask will be updated in the field.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.UpdateFieldRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.UpdateFieldRequest) + private static final com.google.firestore.admin.v1.UpdateFieldRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.UpdateFieldRequest(); + } + + public static com.google.firestore.admin.v1.UpdateFieldRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateFieldRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateFieldRequest(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.firestore.admin.v1.UpdateFieldRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/UpdateFieldRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/UpdateFieldRequestOrBuilder.java new file mode 100644 index 000000000000..802bd7622410 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/UpdateFieldRequestOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +public interface UpdateFieldRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.UpdateFieldRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The field to be updated.
+   * 
+ * + * .google.firestore.admin.v1.Field field = 1; + */ + boolean hasField(); + /** + * + * + *
+   * The field to be updated.
+   * 
+ * + * .google.firestore.admin.v1.Field field = 1; + */ + com.google.firestore.admin.v1.Field getField(); + /** + * + * + *
+   * The field to be updated.
+   * 
+ * + * .google.firestore.admin.v1.Field field = 1; + */ + com.google.firestore.admin.v1.FieldOrBuilder getFieldOrBuilder(); + + /** + * + * + *
+   * A mask, relative to the field. If specified, only configuration specified
+   * by this field_mask will be updated in the field.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * A mask, relative to the field. If specified, only configuration specified
+   * by this field_mask will be updated in the field.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * A mask, relative to the field. If specified, only configuration specified
+   * by this field_mask will be updated in the field.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/field.proto b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/field.proto new file mode 100644 index 000000000000..a24e1aaf1dc4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/field.proto @@ -0,0 +1,96 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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.firestore.admin.v1; + +import "google/firestore/admin/v1/index.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.Admin.V1"; +option go_package = "google.golang.org/genproto/googleapis/firestore/admin/v1;admin"; +option java_multiple_files = true; +option java_outer_classname = "FieldProto"; +option java_package = "com.google.firestore.admin.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1"; + + +// Represents a single field in the database. +// +// Fields are grouped by their "Collection Group", which represent all +// collections in the database with the same id. +message Field { + // The index configuration for this field. + message IndexConfig { + // The indexes supported for this field. + repeated Index indexes = 1; + + // Output only. + // When true, the `Field`'s index configuration is set from the + // configuration specified by the `ancestor_field`. + // When false, the `Field`'s index configuration is defined explicitly. + bool uses_ancestor_config = 2; + + // Output only. + // Specifies the resource name of the `Field` from which this field's + // index configuration is set (when `uses_ancestor_config` is true), + // or from which it *would* be set if this field had no index configuration + // (when `uses_ancestor_config` is false). + string ancestor_field = 3; + + // Output only + // When true, the `Field`'s index configuration is in the process of being + // reverted. Once complete, the index config will transition to the same + // state as the field specified by `ancestor_field`, at which point + // `uses_ancestor_config` will be `true` and `reverting` will be `false`. + bool reverting = 4; + } + + // A field name of the form + // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` + // + // A field path may be a simple field name, e.g. `address` or a path to fields + // within map_value , e.g. `address.city`, + // or a special field path. The only valid special field is `*`, which + // represents any field. + // + // Field paths may be quoted using ` (backtick). The only character that needs + // to be escaped within a quoted field path is the backtick character itself, + // escaped using a backslash. Special characters in field paths that + // must be quoted include: `*`, `.`, + // ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. + // + // Examples: + // (Note: Comments here are written in markdown syntax, so there is an + // additional layer of backticks to represent a code block) + // `\`address.city\`` represents a field named `address.city`, not the map key + // `city` in the field `address`. + // `\`*\`` represents a field named `*`, not any field. + // + // A special `Field` contains the default indexing settings for all fields. + // This field's resource name is: + // `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` + // Indexes defined on this `Field` will be applied to all fields which do not + // have their own `Field` index configuration. + string name = 1; + + // The index configuration for this field. If unset, field indexing will + // revert to the configuration defined by the `ancestor_field`. To + // explicitly remove all indexes for this field, specify an index config + // with an empty list of indexes. + IndexConfig index_config = 2; +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/firestore_admin.proto b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/firestore_admin.proto new file mode 100644 index 000000000000..e753686b200e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/firestore_admin.proto @@ -0,0 +1,274 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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.firestore.admin.v1; + +import "google/api/annotations.proto"; +import "google/firestore/admin/v1/field.proto"; +import "google/firestore/admin/v1/index.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.Admin.V1"; +option go_package = "google.golang.org/genproto/googleapis/firestore/admin/v1;admin"; +option java_multiple_files = true; +option java_outer_classname = "FirestoreAdminProto"; +option java_package = "com.google.firestore.admin.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1"; + + +// Operations are created by service `FirestoreAdmin`, but are accessed via +// service `google.longrunning.Operations`. +service FirestoreAdmin { + // Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation] + // which may be used to track the status of the creation. The metadata for + // the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata]. + rpc CreateIndex(CreateIndexRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes" + body: "index" + }; + } + + // Lists composite indexes. + rpc ListIndexes(ListIndexesRequest) returns (ListIndexesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes" + }; + } + + // Gets a composite index. + rpc GetIndex(GetIndexRequest) returns (Index) { + option (google.api.http) = { + get: "/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}" + }; + } + + // Deletes a composite index. + rpc DeleteIndex(DeleteIndexRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}" + }; + } + + // Gets the metadata and configuration for a Field. + rpc GetField(GetFieldRequest) returns (Field) { + option (google.api.http) = { + get: "/v1/{name=projects/*/databases/*/collectionGroups/*/fields/*}" + }; + } + + // Updates a field configuration. Currently, field updates apply only to + // single field index configuration. However, calls to + // [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] should provide a field mask to avoid + // changing any configuration that the caller isn't aware of. The field mask + // should be specified as: `{ paths: "index_config" }`. + // + // This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to + // track the status of the field update. The metadata for + // the operation will be the type [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata]. + // + // To configure the default field settings for the database, use + // the special `Field` with resource name: + // `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. + rpc UpdateField(UpdateFieldRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}" + body: "field" + }; + } + + // Lists the field configuration and metadata for this database. + // + // Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields + // that have been explicitly overridden. To issue this query, call + // [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to + // `indexConfig.usesAncestorConfig:false`. + rpc ListFields(ListFieldsRequest) returns (ListFieldsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/databases/*/collectionGroups/*}/fields" + }; + } + + // Exports a copy of all or a subset of documents from Google Cloud Firestore + // to another storage system, such as Google Cloud Storage. Recent updates to + // documents 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 ExportDocuments(ExportDocumentsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/databases/*}:exportDocuments" + body: "*" + }; + } + + // Imports documents into Google Cloud Firestore. Existing documents with the + // same name 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 ImportDocuments operation is cancelled, it is possible + // that a subset of the data has already been imported to Cloud Firestore. + rpc ImportDocuments(ImportDocumentsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/databases/*}:importDocuments" + body: "*" + }; + } +} + +// The request for [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex]. +message CreateIndexRequest { + // A parent name of the form + // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + string parent = 1; + + // The composite index to create. + Index index = 2; +} + +// The request for [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes]. +message ListIndexesRequest { + // A parent name of the form + // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + string parent = 1; + + // The filter to apply to list results. + string filter = 2; + + // The number of results to return. + int32 page_size = 3; + + // A page token, returned from a previous call to + // [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], that may be used to get the next + // page of results. + string page_token = 4; +} + +// The response for [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes]. +message ListIndexesResponse { + // The requested indexes. + repeated Index indexes = 1; + + // A page token that may be used to request another page of results. If blank, + // this is the last page. + string next_page_token = 2; +} + +// The request for [FirestoreAdmin.GetIndex][google.firestore.admin.v1.FirestoreAdmin.GetIndex]. +message GetIndexRequest { + // A name of the form + // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + string name = 1; +} + +// The request for [FirestoreAdmin.DeleteIndex][google.firestore.admin.v1.FirestoreAdmin.DeleteIndex]. +message DeleteIndexRequest { + // A name of the form + // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + string name = 1; +} + +// The request for [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField]. +message UpdateFieldRequest { + // The field to be updated. + Field field = 1; + + // A mask, relative to the field. If specified, only configuration specified + // by this field_mask will be updated in the field. + google.protobuf.FieldMask update_mask = 2; +} + +// The request for [FirestoreAdmin.GetField][google.firestore.admin.v1.FirestoreAdmin.GetField]. +message GetFieldRequest { + // A name of the form + // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` + string name = 1; +} + +// The request for [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]. +message ListFieldsRequest { + // A parent name of the form + // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + string parent = 1; + + // The filter to apply to list results. Currently, + // [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields + // that have been explicitly overridden. To issue this query, call + // [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to + // `indexConfig.usesAncestorConfig:false`. + string filter = 2; + + // The number of results to return. + int32 page_size = 3; + + // A page token, returned from a previous call to + // [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], that may be used to get the next + // page of results. + string page_token = 4; +} + +// The response for [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]. +message ListFieldsResponse { + // The requested fields. + repeated Field fields = 1; + + // A page token that may be used to request another page of results. If blank, + // this is the last page. + string next_page_token = 2; +} + +// The request for [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments]. +message ExportDocumentsRequest { + // Database to export. Should be of the form: + // `projects/{project_id}/databases/{database_id}`. + string name = 1; + + // Which collection ids to export. Unspecified means all collections. + repeated string collection_ids = 2; + + // The output URI. Currently only supports Google Cloud Storage URIs of the + // form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name + // of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional + // Google Cloud Storage namespace path. When + // choosing a name, be sure to consider Google Cloud Storage naming + // guidelines: https://cloud.google.com/storage/docs/naming. + // If the URI is a bucket (without a namespace path), a prefix will be + // generated based on the start time. + string output_uri_prefix = 3; +} + +// The request for [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments]. +message ImportDocumentsRequest { + // Database to import into. Should be of the form: + // `projects/{project_id}/databases/{database_id}`. + string name = 1; + + // Which collection ids to import. Unspecified means all collections included + // in the import. + repeated string collection_ids = 2; + + // Location of the exported files. + // This must match the output_uri_prefix of an ExportDocumentsResponse from + // an export that has completed successfully. + // See: + // [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix]. + string input_uri_prefix = 3; +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/index.proto b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/index.proto new file mode 100644 index 000000000000..94941d3a0707 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/index.proto @@ -0,0 +1,149 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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.firestore.admin.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.Admin.V1"; +option go_package = "google.golang.org/genproto/googleapis/firestore/admin/v1;admin"; +option java_multiple_files = true; +option java_outer_classname = "IndexProto"; +option java_package = "com.google.firestore.admin.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1"; + + +// Cloud Firestore indexes enable simple and complex queries against +// documents in a database. +message Index { + // A field in an index. + // The field_path describes which field is indexed, the value_mode describes + // how the field value is indexed. + message IndexField { + // The supported orderings. + enum Order { + // The ordering is unspecified. Not a valid option. + ORDER_UNSPECIFIED = 0; + + // The field is ordered by ascending field value. + ASCENDING = 1; + + // The field is ordered by descending field value. + DESCENDING = 2; + } + + // The supported array value configurations. + enum ArrayConfig { + // The index does not support additional array queries. + ARRAY_CONFIG_UNSPECIFIED = 0; + + // The index supports array containment queries. + CONTAINS = 1; + } + + // Can be __name__. + // For single field indexes, this must match the name of the field or may + // be omitted. + string field_path = 1; + + // How the field value is indexed. + oneof value_mode { + // Indicates that this field supports ordering by the specified order or + // comparing using =, <, <=, >, >=. + Order order = 2; + + // Indicates that this field supports operations on `array_value`s. + ArrayConfig array_config = 3; + } + } + + // Query Scope defines the scope at which a query is run. This is specified on + // a StructuredQuery's `from` field. + enum QueryScope { + // The query scope is unspecified. Not a valid option. + QUERY_SCOPE_UNSPECIFIED = 0; + + // Indexes with a collection query scope specified allow queries + // against a collection that is the child of a specific document, specified + // at query time, and that has the collection id specified by the index. + COLLECTION = 1; + } + + // The state of an index. During index creation, an index will be in the + // `CREATING` state. If the index is created successfully, it will transition + // to the `READY` state. If the index creation encounters a problem, the index + // will transition to the `NEEDS_REPAIR` state. + enum State { + // The state is unspecified. + STATE_UNSPECIFIED = 0; + + // The index is being created. + // There is an active long-running operation for the index. + // The index is updated when writing a document. + // Some index data may exist. + CREATING = 1; + + // The index is ready to be used. + // The index is updated when writing a document. + // The index is fully populated from all stored documents it applies to. + READY = 2; + + // The index was being created, but something went wrong. + // 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 a document. + // Some index data may exist. + // Use the google.longrunning.Operations API to determine why the operation + // that last attempted to create this index failed, then re-create the + // index. + NEEDS_REPAIR = 3; + } + + // Output only. + // A server defined name for this index. + // The form of this name for composite indexes will be: + // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}` + // For single field indexes, this field will be empty. + string name = 1; + + // Indexes with a collection query scope specified allow queries + // against a collection that is the child of a specific document, specified at + // query time, and that has the same collection id. + // + // Indexes with a collection group query scope specified allow queries against + // all collections descended from a specific document, specified at query + // time, and that have the same collection id as this index. + QueryScope query_scope = 2; + + // The fields supported by this index. + // + // For composite indexes, this is always 2 or more fields. + // The last field entry is always for the field path `__name__`. If, on + // creation, `__name__` was not specified as the last field, it will be added + // automatically with the same direction as that of the last field defined. If + // the final field in a composite index is not directional, the `__name__` + // will be ordered ASCENDING (unless explicitly specified). + // + // For single field indexes, this will always be exactly one entry with a + // field path equal to the field path of the associated field. + repeated IndexField fields = 3; + + // Output only. + // The serving state of the index. + State state = 4; +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/location.proto b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/location.proto new file mode 100644 index 000000000000..7b56051a5c36 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/location.proto @@ -0,0 +1,35 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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.firestore.admin.v1; + +import "google/type/latlng.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.Admin.V1"; +option go_package = "google.golang.org/genproto/googleapis/firestore/admin/v1;admin"; +option java_multiple_files = true; +option java_outer_classname = "LocationProto"; +option java_package = "com.google.firestore.admin.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1"; + + +// The metadata message for [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata]. +message LocationMetadata { + +} diff --git a/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/operation.proto b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/operation.proto new file mode 100644 index 000000000000..d333d9b7de25 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/operation.proto @@ -0,0 +1,204 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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.firestore.admin.v1; + +import "google/firestore/admin/v1/index.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.Admin.V1"; +option go_package = "google.golang.org/genproto/googleapis/firestore/admin/v1;admin"; +option java_multiple_files = true; +option java_outer_classname = "OperationProto"; +option java_package = "com.google.firestore.admin.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1"; + + +// Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from +// [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex]. +message IndexOperationMetadata { + // The time this operation started. + google.protobuf.Timestamp start_time = 1; + + // The time this operation completed. Will be unset if operation still in + // progress. + google.protobuf.Timestamp end_time = 2; + + // The index resource that this operation is acting on. For example: + // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + string index = 3; + + // The state of the operation. + OperationState state = 4; + + // The progress, in documents, of this operation. + Progress progress_documents = 5; + + // The progress, in bytes, of this operation. + Progress progress_bytes = 6; +} + +// Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from +// [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField]. +message FieldOperationMetadata { + // Information about an index configuration change. + message IndexConfigDelta { + // Specifies how the index is changing. + enum ChangeType { + // The type of change is not specified or known. + CHANGE_TYPE_UNSPECIFIED = 0; + + // The single field index is being added. + ADD = 1; + + // The single field index is being removed. + REMOVE = 2; + } + + // Specifies how the index is changing. + ChangeType change_type = 1; + + // The index being changed. + Index index = 2; + } + + // The time this operation started. + google.protobuf.Timestamp start_time = 1; + + // The time this operation completed. Will be unset if operation still in + // progress. + google.protobuf.Timestamp end_time = 2; + + // The field resource that this operation is acting on. For example: + // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` + string field = 3; + + // A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this + // operation. + repeated IndexConfigDelta index_config_deltas = 4; + + // The state of the operation. + OperationState state = 5; + + // The progress, in documents, of this operation. + Progress progress_documents = 6; + + // The progress, in bytes, of this operation. + Progress progress_bytes = 7; +} + +// Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from +// [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments]. +message ExportDocumentsMetadata { + // The time this operation started. + google.protobuf.Timestamp start_time = 1; + + // The time this operation completed. Will be unset if operation still in + // progress. + google.protobuf.Timestamp end_time = 2; + + // The state of the export operation. + OperationState operation_state = 3; + + // The progress, in documents, of this operation. + Progress progress_documents = 4; + + // The progress, in bytes, of this operation. + Progress progress_bytes = 5; + + // Which collection ids are being exported. + repeated string collection_ids = 6; + + // Where the entities are being exported to. + string output_uri_prefix = 7; +} + +// Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from +// [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments]. +message ImportDocumentsMetadata { + // The time this operation started. + google.protobuf.Timestamp start_time = 1; + + // The time this operation completed. Will be unset if operation still in + // progress. + google.protobuf.Timestamp end_time = 2; + + // The state of the import operation. + OperationState operation_state = 3; + + // The progress, in documents, of this operation. + Progress progress_documents = 4; + + // The progress, in bytes, of this operation. + Progress progress_bytes = 5; + + // Which collection ids are being imported. + repeated string collection_ids = 6; + + // The location of the documents being imported. + string input_uri_prefix = 7; +} + +// Returned in the [google.longrunning.Operation][google.longrunning.Operation] response field. +message ExportDocumentsResponse { + // Location of the output files. This can be used to begin an import + // into Cloud Firestore (this project or another project) after the operation + // completes successfully. + string output_uri_prefix = 1; +} + +// Describes the state of the operation. +enum OperationState { + // Unspecified. + OPERATION_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; +} + +// Describes the progress of the operation. +// Unit of work is generic and must be interpreted based on where [Progress][google.firestore.admin.v1.Progress] +// is used. +message Progress { + // The amount of work estimated. + int64 estimated_work = 1; + + // The amount of work completed. + int64 completed_work = 2; +} diff --git a/google-cloud-bom/pom.xml b/google-cloud-bom/pom.xml index 90870c04577b..b97d967d2585 100644 --- a/google-cloud-bom/pom.xml +++ b/google-cloud-bom/pom.xml @@ -444,6 +444,11 @@ google-cloud-firestore 0.84.1-beta-SNAPSHOT
+ + com.google.api.grpc + proto-google-cloud-firestore-admin-v1 + 0.49.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-firestore-v1 @@ -454,6 +459,11 @@ proto-google-cloud-firestore-v1beta1 0.49.1-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-firestore-admin-v1 + 0.49.1-SNAPSHOT + com.google.api.grpc grpc-google-cloud-firestore-v1 diff --git a/google-cloud-clients/google-cloud-firestore/pom.xml b/google-cloud-clients/google-cloud-firestore/pom.xml index 03e40ddade22..5d18b66795fa 100644 --- a/google-cloud-clients/google-cloud-firestore/pom.xml +++ b/google-cloud-clients/google-cloud-firestore/pom.xml @@ -37,6 +37,10 @@ com.google.api api-common + + com.google.api.grpc + proto-google-cloud-firestore-admin-v1 + com.google.api.grpc proto-google-cloud-firestore-v1 @@ -50,6 +54,11 @@ auto-value provided + + com.google.api.grpc + grpc-google-cloud-firestore-admin-v1 + test + com.google.api.grpc grpc-google-cloud-firestore-v1 diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java new file mode 100644 index 000000000000..8e2bc0f78852 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java @@ -0,0 +1,1272 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.firestore.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.firestore.v1.stub.FirestoreAdminStub; +import com.google.cloud.firestore.v1.stub.FirestoreAdminStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.firestore.admin.v1.CreateIndexRequest; +import com.google.firestore.admin.v1.DeleteIndexRequest; +import com.google.firestore.admin.v1.ExportDocumentsRequest; +import com.google.firestore.admin.v1.Field; +import com.google.firestore.admin.v1.GetFieldRequest; +import com.google.firestore.admin.v1.GetIndexRequest; +import com.google.firestore.admin.v1.ImportDocumentsRequest; +import com.google.firestore.admin.v1.Index; +import com.google.firestore.admin.v1.ListFieldsRequest; +import com.google.firestore.admin.v1.ListFieldsResponse; +import com.google.firestore.admin.v1.ListIndexesRequest; +import com.google.firestore.admin.v1.ListIndexesResponse; +import com.google.firestore.admin.v1.UpdateFieldRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Operations are created by service `FirestoreAdmin`, 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: + * + *

+ * 
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ *   String formattedParent = FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+ *   Index index = Index.newBuilder().build();
+ *   Operation response = firestoreAdminClient.createIndex(formattedParent, index);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * FirestoreAdminSettings firestoreAdminSettings =
+ *     FirestoreAdminSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * FirestoreAdminClient firestoreAdminClient =
+ *     FirestoreAdminClient.create(firestoreAdminSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * FirestoreAdminSettings firestoreAdminSettings =
+ *     FirestoreAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * FirestoreAdminClient firestoreAdminClient =
+ *     FirestoreAdminClient.create(firestoreAdminSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class FirestoreAdminClient implements BackgroundResource { + private final FirestoreAdminSettings settings; + private final FirestoreAdminStub stub; + + private static final PathTemplate DATABASE_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/databases/{database}"); + + private static final PathTemplate PARENT_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/databases/{database}/collectionGroups/{collection_id}"); + + private static final PathTemplate INDEX_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/databases/{database}/collectionGroups/{collection_id}/indexes/{index_id}"); + + private static final PathTemplate FIELD_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/databases/{database}/collectionGroups/{collection_id}/fields/{field_id}"); + + /** Formats a string containing the fully-qualified path to represent a database resource. */ + public static final String formatDatabaseName(String project, String database) { + return DATABASE_PATH_TEMPLATE.instantiate( + "project", project, + "database", database); + } + + /** Formats a string containing the fully-qualified path to represent a parent resource. */ + public static final String formatParentName( + String project, String database, String collectionId) { + return PARENT_PATH_TEMPLATE.instantiate( + "project", project, + "database", database, + "collection_id", collectionId); + } + + /** Formats a string containing the fully-qualified path to represent a index resource. */ + public static final String formatIndexName( + String project, String database, String collectionId, String indexId) { + return INDEX_PATH_TEMPLATE.instantiate( + "project", project, + "database", database, + "collection_id", collectionId, + "index_id", indexId); + } + + /** Formats a string containing the fully-qualified path to represent a field resource. */ + public static final String formatFieldName( + String project, String database, String collectionId, String fieldId) { + return FIELD_PATH_TEMPLATE.instantiate( + "project", project, + "database", database, + "collection_id", collectionId, + "field_id", fieldId); + } + + /** + * Parses the project from the given fully-qualified path which represents a database resource. + */ + public static final String parseProjectFromDatabaseName(String databaseName) { + return DATABASE_PATH_TEMPLATE.parse(databaseName).get("project"); + } + + /** + * Parses the database from the given fully-qualified path which represents a database resource. + */ + public static final String parseDatabaseFromDatabaseName(String databaseName) { + return DATABASE_PATH_TEMPLATE.parse(databaseName).get("database"); + } + + /** Parses the project from the given fully-qualified path which represents a parent resource. */ + public static final String parseProjectFromParentName(String parentName) { + return PARENT_PATH_TEMPLATE.parse(parentName).get("project"); + } + + /** Parses the database from the given fully-qualified path which represents a parent resource. */ + public static final String parseDatabaseFromParentName(String parentName) { + return PARENT_PATH_TEMPLATE.parse(parentName).get("database"); + } + + /** + * Parses the collection_id from the given fully-qualified path which represents a parent + * resource. + */ + public static final String parseCollectionIdFromParentName(String parentName) { + return PARENT_PATH_TEMPLATE.parse(parentName).get("collection_id"); + } + + /** Parses the project from the given fully-qualified path which represents a index resource. */ + public static final String parseProjectFromIndexName(String indexName) { + return INDEX_PATH_TEMPLATE.parse(indexName).get("project"); + } + + /** Parses the database from the given fully-qualified path which represents a index resource. */ + public static final String parseDatabaseFromIndexName(String indexName) { + return INDEX_PATH_TEMPLATE.parse(indexName).get("database"); + } + + /** + * Parses the collection_id from the given fully-qualified path which represents a index resource. + */ + public static final String parseCollectionIdFromIndexName(String indexName) { + return INDEX_PATH_TEMPLATE.parse(indexName).get("collection_id"); + } + + /** Parses the index_id from the given fully-qualified path which represents a index resource. */ + public static final String parseIndexIdFromIndexName(String indexName) { + return INDEX_PATH_TEMPLATE.parse(indexName).get("index_id"); + } + + /** Parses the project from the given fully-qualified path which represents a field resource. */ + public static final String parseProjectFromFieldName(String fieldName) { + return FIELD_PATH_TEMPLATE.parse(fieldName).get("project"); + } + + /** Parses the database from the given fully-qualified path which represents a field resource. */ + public static final String parseDatabaseFromFieldName(String fieldName) { + return FIELD_PATH_TEMPLATE.parse(fieldName).get("database"); + } + + /** + * Parses the collection_id from the given fully-qualified path which represents a field resource. + */ + public static final String parseCollectionIdFromFieldName(String fieldName) { + return FIELD_PATH_TEMPLATE.parse(fieldName).get("collection_id"); + } + + /** Parses the field_id from the given fully-qualified path which represents a field resource. */ + public static final String parseFieldIdFromFieldName(String fieldName) { + return FIELD_PATH_TEMPLATE.parse(fieldName).get("field_id"); + } + + /** Constructs an instance of FirestoreAdminClient with default settings. */ + public static final FirestoreAdminClient create() throws IOException { + return create(FirestoreAdminSettings.newBuilder().build()); + } + + /** + * Constructs an instance of FirestoreAdminClient, 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 FirestoreAdminClient create(FirestoreAdminSettings settings) + throws IOException { + return new FirestoreAdminClient(settings); + } + + /** + * Constructs an instance of FirestoreAdminClient, using the given stub for making calls. This is + * for advanced usage - prefer to use FirestoreAdminSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final FirestoreAdminClient create(FirestoreAdminStub stub) { + return new FirestoreAdminClient(stub); + } + + /** + * Constructs an instance of FirestoreAdminClient, 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 FirestoreAdminClient(FirestoreAdminSettings settings) throws IOException { + this.settings = settings; + this.stub = ((FirestoreAdminStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected FirestoreAdminClient(FirestoreAdminStub stub) { + this.settings = null; + this.stub = stub; + } + + public final FirestoreAdminSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public FirestoreAdminStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a composite index. This returns a + * [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the + * status of the creation. The metadata for the operation will be the type + * [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata]. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedParent = FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+   *   Index index = Index.newBuilder().build();
+   *   Operation response = firestoreAdminClient.createIndex(formattedParent, index);
+   * }
+   * 
+ * + * @param parent A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * @param index The composite index to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation createIndex(String parent, Index index) { + PARENT_PATH_TEMPLATE.validate(parent, "createIndex"); + CreateIndexRequest request = + CreateIndexRequest.newBuilder().setParent(parent).setIndex(index).build(); + return createIndex(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a composite index. This returns a + * [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the + * status of the creation. The metadata for the operation will be the type + * [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata]. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedParent = FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+   *   Index index = Index.newBuilder().build();
+   *   CreateIndexRequest request = CreateIndexRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setIndex(index)
+   *     .build();
+   *   Operation response = firestoreAdminClient.createIndex(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 Operation createIndex(CreateIndexRequest request) { + return createIndexCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a composite index. This returns a + * [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the + * status of the creation. The metadata for the operation will be the type + * [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata]. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedParent = FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+   *   Index index = Index.newBuilder().build();
+   *   CreateIndexRequest request = CreateIndexRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setIndex(index)
+   *     .build();
+   *   ApiFuture<Operation> future = firestoreAdminClient.createIndexCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createIndexCallable() { + return stub.createIndexCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists composite indexes. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedParent = FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+   *   for (Index element : firestoreAdminClient.listIndexes(formattedParent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListIndexesPagedResponse listIndexes(String parent) { + PARENT_PATH_TEMPLATE.validate(parent, "listIndexes"); + ListIndexesRequest request = ListIndexesRequest.newBuilder().setParent(parent).build(); + return listIndexes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists composite indexes. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedParent = FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+   *   ListIndexesRequest request = ListIndexesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   for (Index element : firestoreAdminClient.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 composite indexes. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedParent = FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+   *   ListIndexesRequest request = ListIndexesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   ApiFuture<ListIndexesPagedResponse> future = firestoreAdminClient.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 composite indexes. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedParent = FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+   *   ListIndexesRequest request = ListIndexesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   while (true) {
+   *     ListIndexesResponse response = firestoreAdminClient.listIndexesCallable().call(request);
+   *     for (Index element : response.getIndexesList()) {
+   *       // 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(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a composite index. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedName = FirestoreAdminClient.formatIndexName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]");
+   *   Index response = firestoreAdminClient.getIndex(formattedName);
+   * }
+   * 
+ * + * @param name A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Index getIndex(String name) { + INDEX_PATH_TEMPLATE.validate(name, "getIndex"); + GetIndexRequest request = GetIndexRequest.newBuilder().setName(name).build(); + return getIndex(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a composite index. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedName = FirestoreAdminClient.formatIndexName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]");
+   *   GetIndexRequest request = GetIndexRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   Index response = firestoreAdminClient.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 a composite index. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedName = FirestoreAdminClient.formatIndexName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]");
+   *   GetIndexRequest request = GetIndexRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Index> future = firestoreAdminClient.getIndexCallable().futureCall(request);
+   *   // Do something
+   *   Index response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getIndexCallable() { + return stub.getIndexCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a composite index. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedName = FirestoreAdminClient.formatIndexName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]");
+   *   firestoreAdminClient.deleteIndex(formattedName);
+   * }
+   * 
+ * + * @param name A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteIndex(String name) { + INDEX_PATH_TEMPLATE.validate(name, "deleteIndex"); + DeleteIndexRequest request = DeleteIndexRequest.newBuilder().setName(name).build(); + deleteIndex(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a composite index. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedName = FirestoreAdminClient.formatIndexName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]");
+   *   DeleteIndexRequest request = DeleteIndexRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   firestoreAdminClient.deleteIndex(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteIndex(DeleteIndexRequest request) { + deleteIndexCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a composite index. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedName = FirestoreAdminClient.formatIndexName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]");
+   *   DeleteIndexRequest request = DeleteIndexRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Void> future = firestoreAdminClient.deleteIndexCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteIndexCallable() { + return stub.deleteIndexCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Imports documents into Google Cloud Firestore. Existing documents with the same name 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 ImportDocuments operation is cancelled, it is + * possible that a subset of the data has already been imported to Cloud Firestore. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedName = FirestoreAdminClient.formatDatabaseName("[PROJECT]", "[DATABASE]");
+   *   Operation response = firestoreAdminClient.importDocuments(formattedName);
+   * }
+   * 
+ * + * @param name Database to import into. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation importDocuments(String name) { + DATABASE_PATH_TEMPLATE.validate(name, "importDocuments"); + ImportDocumentsRequest request = ImportDocumentsRequest.newBuilder().setName(name).build(); + return importDocuments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Imports documents into Google Cloud Firestore. Existing documents with the same name 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 ImportDocuments operation is cancelled, it is + * possible that a subset of the data has already been imported to Cloud Firestore. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedName = FirestoreAdminClient.formatDatabaseName("[PROJECT]", "[DATABASE]");
+   *   ImportDocumentsRequest request = ImportDocumentsRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   Operation response = firestoreAdminClient.importDocuments(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 Operation importDocuments(ImportDocumentsRequest request) { + return importDocumentsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Imports documents into Google Cloud Firestore. Existing documents with the same name 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 ImportDocuments operation is cancelled, it is + * possible that a subset of the data has already been imported to Cloud Firestore. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedName = FirestoreAdminClient.formatDatabaseName("[PROJECT]", "[DATABASE]");
+   *   ImportDocumentsRequest request = ImportDocumentsRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Operation> future = firestoreAdminClient.importDocumentsCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable importDocumentsCallable() { + return stub.importDocumentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage + * system, such as Google Cloud Storage. Recent updates to documents 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: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedName = FirestoreAdminClient.formatDatabaseName("[PROJECT]", "[DATABASE]");
+   *   Operation response = firestoreAdminClient.exportDocuments(formattedName);
+   * }
+   * 
+ * + * @param name Database to export. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation exportDocuments(String name) { + DATABASE_PATH_TEMPLATE.validate(name, "exportDocuments"); + ExportDocumentsRequest request = ExportDocumentsRequest.newBuilder().setName(name).build(); + return exportDocuments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage + * system, such as Google Cloud Storage. Recent updates to documents 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: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedName = FirestoreAdminClient.formatDatabaseName("[PROJECT]", "[DATABASE]");
+   *   ExportDocumentsRequest request = ExportDocumentsRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   Operation response = firestoreAdminClient.exportDocuments(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 Operation exportDocuments(ExportDocumentsRequest request) { + return exportDocumentsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage + * system, such as Google Cloud Storage. Recent updates to documents 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: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedName = FirestoreAdminClient.formatDatabaseName("[PROJECT]", "[DATABASE]");
+   *   ExportDocumentsRequest request = ExportDocumentsRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Operation> future = firestoreAdminClient.exportDocumentsCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable exportDocumentsCallable() { + return stub.exportDocumentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the metadata and configuration for a Field. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedName = FirestoreAdminClient.formatFieldName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[FIELD_ID]");
+   *   Field response = firestoreAdminClient.getField(formattedName);
+   * }
+   * 
+ * + * @param name A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Field getField(String name) { + FIELD_PATH_TEMPLATE.validate(name, "getField"); + GetFieldRequest request = GetFieldRequest.newBuilder().setName(name).build(); + return getField(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the metadata and configuration for a Field. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedName = FirestoreAdminClient.formatFieldName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[FIELD_ID]");
+   *   GetFieldRequest request = GetFieldRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   Field response = firestoreAdminClient.getField(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 Field getField(GetFieldRequest request) { + return getFieldCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the metadata and configuration for a Field. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedName = FirestoreAdminClient.formatFieldName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[FIELD_ID]");
+   *   GetFieldRequest request = GetFieldRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Field> future = firestoreAdminClient.getFieldCallable().futureCall(request);
+   *   // Do something
+   *   Field response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getFieldCallable() { + return stub.getFieldCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the field configuration and metadata for this database. + * + *

Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * only supports listing fields that have been explicitly overridden. To issue this query, call + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the + * filter set to `indexConfig.usesAncestorConfig:false`. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedParent = FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+   *   for (Field element : firestoreAdminClient.listFields(formattedParent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFieldsPagedResponse listFields(String parent) { + PARENT_PATH_TEMPLATE.validate(parent, "listFields"); + ListFieldsRequest request = ListFieldsRequest.newBuilder().setParent(parent).build(); + return listFields(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the field configuration and metadata for this database. + * + *

Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * only supports listing fields that have been explicitly overridden. To issue this query, call + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the + * filter set to `indexConfig.usesAncestorConfig:false`. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedParent = FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+   *   ListFieldsRequest request = ListFieldsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   for (Field element : firestoreAdminClient.listFields(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 ListFieldsPagedResponse listFields(ListFieldsRequest request) { + return listFieldsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the field configuration and metadata for this database. + * + *

Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * only supports listing fields that have been explicitly overridden. To issue this query, call + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the + * filter set to `indexConfig.usesAncestorConfig:false`. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedParent = FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+   *   ListFieldsRequest request = ListFieldsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   ApiFuture<ListFieldsPagedResponse> future = firestoreAdminClient.listFieldsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Field element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listFieldsPagedCallable() { + return stub.listFieldsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the field configuration and metadata for this database. + * + *

Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * only supports listing fields that have been explicitly overridden. To issue this query, call + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the + * filter set to `indexConfig.usesAncestorConfig:false`. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String formattedParent = FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+   *   ListFieldsRequest request = ListFieldsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   while (true) {
+   *     ListFieldsResponse response = firestoreAdminClient.listFieldsCallable().call(request);
+   *     for (Field element : response.getFieldsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listFieldsCallable() { + return stub.listFieldsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a field configuration. Currently, field updates apply only to single field index + * configuration. However, calls to + * [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] should + * provide a field mask to avoid changing any configuration that the caller isn't aware of. The + * field mask should be specified as: `{ paths: "index_config" }`. + * + *

This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may + * be used to track the status of the field update. The metadata for the operation will be the + * type [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata]. + * + *

To configure the default field settings for the database, use the special `Field` with + * resource name: + * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   Field field = Field.newBuilder().build();
+   *   Operation response = firestoreAdminClient.updateField(field);
+   * }
+   * 
+ * + * @param field The field to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Operation updateField(Field field) { + + UpdateFieldRequest request = UpdateFieldRequest.newBuilder().setField(field).build(); + return updateField(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a field configuration. Currently, field updates apply only to single field index + * configuration. However, calls to + * [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] should + * provide a field mask to avoid changing any configuration that the caller isn't aware of. The + * field mask should be specified as: `{ paths: "index_config" }`. + * + *

This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may + * be used to track the status of the field update. The metadata for the operation will be the + * type [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata]. + * + *

To configure the default field settings for the database, use the special `Field` with + * resource name: + * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   Field field = Field.newBuilder().build();
+   *   UpdateFieldRequest request = UpdateFieldRequest.newBuilder()
+   *     .setField(field)
+   *     .build();
+   *   Operation response = firestoreAdminClient.updateField(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 Operation updateField(UpdateFieldRequest request) { + return updateFieldCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a field configuration. Currently, field updates apply only to single field index + * configuration. However, calls to + * [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] should + * provide a field mask to avoid changing any configuration that the caller isn't aware of. The + * field mask should be specified as: `{ paths: "index_config" }`. + * + *

This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may + * be used to track the status of the field update. The metadata for the operation will be the + * type [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata]. + * + *

To configure the default field settings for the database, use the special `Field` with + * resource name: + * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. + * + *

Sample code: + * + *


+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   Field field = Field.newBuilder().build();
+   *   UpdateFieldRequest request = UpdateFieldRequest.newBuilder()
+   *     .setField(field)
+   *     .build();
+   *   ApiFuture<Operation> future = firestoreAdminClient.updateFieldCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateFieldCallable() { + return stub.updateFieldCallable(); + } + + @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, + new ApiFunction() { + @Override + public ListIndexesPagedResponse apply(ListIndexesPage input) { + return 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); + } + } + + public static class ListFieldsPagedResponse + extends AbstractPagedListResponse< + ListFieldsRequest, + ListFieldsResponse, + Field, + ListFieldsPage, + ListFieldsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListFieldsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListFieldsPagedResponse apply(ListFieldsPage input) { + return new ListFieldsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListFieldsPagedResponse(ListFieldsPage page) { + super(page, ListFieldsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListFieldsPage + extends AbstractPage { + + private ListFieldsPage( + PageContext context, + ListFieldsResponse response) { + super(context, response); + } + + private static ListFieldsPage createEmptyPage() { + return new ListFieldsPage(null, null); + } + + @Override + protected ListFieldsPage createPage( + PageContext context, + ListFieldsResponse response) { + return new ListFieldsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListFieldsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListFieldsRequest, + ListFieldsResponse, + Field, + ListFieldsPage, + ListFieldsFixedSizeCollection> { + + private ListFieldsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListFieldsFixedSizeCollection createEmptyCollection() { + return new ListFieldsFixedSizeCollection(null, 0); + } + + @Override + protected ListFieldsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListFieldsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java new file mode 100644 index 000000000000..2d37ef3d5226 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java @@ -0,0 +1,278 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.firestore.v1; + +import static com.google.cloud.firestore.v1.FirestoreAdminClient.ListFieldsPagedResponse; +import static com.google.cloud.firestore.v1.FirestoreAdminClient.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.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.firestore.v1.stub.FirestoreAdminStubSettings; +import com.google.firestore.admin.v1.CreateIndexRequest; +import com.google.firestore.admin.v1.DeleteIndexRequest; +import com.google.firestore.admin.v1.ExportDocumentsRequest; +import com.google.firestore.admin.v1.Field; +import com.google.firestore.admin.v1.GetFieldRequest; +import com.google.firestore.admin.v1.GetIndexRequest; +import com.google.firestore.admin.v1.ImportDocumentsRequest; +import com.google.firestore.admin.v1.Index; +import com.google.firestore.admin.v1.ListFieldsRequest; +import com.google.firestore.admin.v1.ListFieldsResponse; +import com.google.firestore.admin.v1.ListIndexesRequest; +import com.google.firestore.admin.v1.ListIndexesResponse; +import com.google.firestore.admin.v1.UpdateFieldRequest; +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 FirestoreAdminClient}. + * + *

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

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

+ * 
+ * FirestoreAdminSettings.Builder firestoreAdminSettingsBuilder =
+ *     FirestoreAdminSettings.newBuilder();
+ * firestoreAdminSettingsBuilder.createIndexSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * FirestoreAdminSettings firestoreAdminSettings = firestoreAdminSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class FirestoreAdminSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createIndex. */ + public UnaryCallSettings createIndexSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).createIndexSettings(); + } + + /** Returns the object with the settings used for calls to listIndexes. */ + public PagedCallSettings + listIndexesSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).listIndexesSettings(); + } + + /** Returns the object with the settings used for calls to getIndex. */ + public UnaryCallSettings getIndexSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).getIndexSettings(); + } + + /** Returns the object with the settings used for calls to deleteIndex. */ + public UnaryCallSettings deleteIndexSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).deleteIndexSettings(); + } + + /** Returns the object with the settings used for calls to importDocuments. */ + public UnaryCallSettings importDocumentsSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).importDocumentsSettings(); + } + + /** Returns the object with the settings used for calls to exportDocuments. */ + public UnaryCallSettings exportDocumentsSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).exportDocumentsSettings(); + } + + /** Returns the object with the settings used for calls to getField. */ + public UnaryCallSettings getFieldSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).getFieldSettings(); + } + + /** Returns the object with the settings used for calls to listFields. */ + public PagedCallSettings + listFieldsSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).listFieldsSettings(); + } + + /** Returns the object with the settings used for calls to updateField. */ + public UnaryCallSettings updateFieldSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).updateFieldSettings(); + } + + public static final FirestoreAdminSettings create(FirestoreAdminStubSettings stub) + throws IOException { + return new FirestoreAdminSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return FirestoreAdminStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return FirestoreAdminStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return FirestoreAdminStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return FirestoreAdminStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return FirestoreAdminStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return FirestoreAdminStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return FirestoreAdminStubSettings.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 FirestoreAdminSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for FirestoreAdminSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(FirestoreAdminStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(FirestoreAdminStubSettings.newBuilder()); + } + + protected Builder(FirestoreAdminSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(FirestoreAdminStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public FirestoreAdminStubSettings.Builder getStubSettingsBuilder() { + return ((FirestoreAdminStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * 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) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** 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 listIndexes. */ + public PagedCallSettings.Builder< + ListIndexesRequest, ListIndexesResponse, ListIndexesPagedResponse> + listIndexesSettings() { + return getStubSettingsBuilder().listIndexesSettings(); + } + + /** 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 deleteIndex. */ + public UnaryCallSettings.Builder deleteIndexSettings() { + return getStubSettingsBuilder().deleteIndexSettings(); + } + + /** Returns the builder for the settings used for calls to importDocuments. */ + public UnaryCallSettings.Builder importDocumentsSettings() { + return getStubSettingsBuilder().importDocumentsSettings(); + } + + /** Returns the builder for the settings used for calls to exportDocuments. */ + public UnaryCallSettings.Builder exportDocumentsSettings() { + return getStubSettingsBuilder().exportDocumentsSettings(); + } + + /** Returns the builder for the settings used for calls to getField. */ + public UnaryCallSettings.Builder getFieldSettings() { + return getStubSettingsBuilder().getFieldSettings(); + } + + /** Returns the builder for the settings used for calls to listFields. */ + public PagedCallSettings.Builder + listFieldsSettings() { + return getStubSettingsBuilder().listFieldsSettings(); + } + + /** Returns the builder for the settings used for calls to updateField. */ + public UnaryCallSettings.Builder updateFieldSettings() { + return getStubSettingsBuilder().updateFieldSettings(); + } + + @Override + public FirestoreAdminSettings build() throws IOException { + return new FirestoreAdminSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java new file mode 100644 index 000000000000..f1b03ec48afe --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java @@ -0,0 +1,97 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.firestore.v1.stub; + +import static com.google.cloud.firestore.v1.FirestoreAdminClient.ListFieldsPagedResponse; +import static com.google.cloud.firestore.v1.FirestoreAdminClient.ListIndexesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.firestore.admin.v1.CreateIndexRequest; +import com.google.firestore.admin.v1.DeleteIndexRequest; +import com.google.firestore.admin.v1.ExportDocumentsRequest; +import com.google.firestore.admin.v1.Field; +import com.google.firestore.admin.v1.GetFieldRequest; +import com.google.firestore.admin.v1.GetIndexRequest; +import com.google.firestore.admin.v1.ImportDocumentsRequest; +import com.google.firestore.admin.v1.Index; +import com.google.firestore.admin.v1.ListFieldsRequest; +import com.google.firestore.admin.v1.ListFieldsResponse; +import com.google.firestore.admin.v1.ListIndexesRequest; +import com.google.firestore.admin.v1.ListIndexesResponse; +import com.google.firestore.admin.v1.UpdateFieldRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Google Cloud Firestore Admin API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class FirestoreAdminStub implements BackgroundResource { + + public UnaryCallable createIndexCallable() { + throw new UnsupportedOperationException("Not implemented: createIndexCallable()"); + } + + public UnaryCallable listIndexesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listIndexesPagedCallable()"); + } + + public UnaryCallable listIndexesCallable() { + throw new UnsupportedOperationException("Not implemented: listIndexesCallable()"); + } + + public UnaryCallable getIndexCallable() { + throw new UnsupportedOperationException("Not implemented: getIndexCallable()"); + } + + public UnaryCallable deleteIndexCallable() { + throw new UnsupportedOperationException("Not implemented: deleteIndexCallable()"); + } + + public UnaryCallable importDocumentsCallable() { + throw new UnsupportedOperationException("Not implemented: importDocumentsCallable()"); + } + + public UnaryCallable exportDocumentsCallable() { + throw new UnsupportedOperationException("Not implemented: exportDocumentsCallable()"); + } + + public UnaryCallable getFieldCallable() { + throw new UnsupportedOperationException("Not implemented: getFieldCallable()"); + } + + public UnaryCallable listFieldsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listFieldsPagedCallable()"); + } + + public UnaryCallable listFieldsCallable() { + throw new UnsupportedOperationException("Not implemented: listFieldsCallable()"); + } + + public UnaryCallable updateFieldCallable() { + throw new UnsupportedOperationException("Not implemented: updateFieldCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java new file mode 100644 index 000000000000..fcbca7435c55 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java @@ -0,0 +1,595 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.firestore.v1.stub; + +import static com.google.cloud.firestore.v1.FirestoreAdminClient.ListFieldsPagedResponse; +import static com.google.cloud.firestore.v1.FirestoreAdminClient.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.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.firestore.admin.v1.CreateIndexRequest; +import com.google.firestore.admin.v1.DeleteIndexRequest; +import com.google.firestore.admin.v1.ExportDocumentsRequest; +import com.google.firestore.admin.v1.Field; +import com.google.firestore.admin.v1.GetFieldRequest; +import com.google.firestore.admin.v1.GetIndexRequest; +import com.google.firestore.admin.v1.ImportDocumentsRequest; +import com.google.firestore.admin.v1.Index; +import com.google.firestore.admin.v1.ListFieldsRequest; +import com.google.firestore.admin.v1.ListFieldsResponse; +import com.google.firestore.admin.v1.ListIndexesRequest; +import com.google.firestore.admin.v1.ListIndexesResponse; +import com.google.firestore.admin.v1.UpdateFieldRequest; +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 FirestoreAdminStub}. + * + *

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

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

+ * 
+ * FirestoreAdminStubSettings.Builder firestoreAdminSettingsBuilder =
+ *     FirestoreAdminStubSettings.newBuilder();
+ * firestoreAdminSettingsBuilder.createIndexSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * FirestoreAdminStubSettings firestoreAdminSettings = firestoreAdminSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class FirestoreAdminStubSettings 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 createIndexSettings; + private final PagedCallSettings + listIndexesSettings; + private final UnaryCallSettings getIndexSettings; + private final UnaryCallSettings deleteIndexSettings; + private final UnaryCallSettings importDocumentsSettings; + private final UnaryCallSettings exportDocumentsSettings; + private final UnaryCallSettings getFieldSettings; + private final PagedCallSettings + listFieldsSettings; + private final UnaryCallSettings updateFieldSettings; + + /** 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 listIndexes. */ + public PagedCallSettings + listIndexesSettings() { + return listIndexesSettings; + } + + /** 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 deleteIndex. */ + public UnaryCallSettings deleteIndexSettings() { + return deleteIndexSettings; + } + + /** Returns the object with the settings used for calls to importDocuments. */ + public UnaryCallSettings importDocumentsSettings() { + return importDocumentsSettings; + } + + /** Returns the object with the settings used for calls to exportDocuments. */ + public UnaryCallSettings exportDocumentsSettings() { + return exportDocumentsSettings; + } + + /** Returns the object with the settings used for calls to getField. */ + public UnaryCallSettings getFieldSettings() { + return getFieldSettings; + } + + /** Returns the object with the settings used for calls to listFields. */ + public PagedCallSettings + listFieldsSettings() { + return listFieldsSettings; + } + + /** Returns the object with the settings used for calls to updateField. */ + public UnaryCallSettings updateFieldSettings() { + return updateFieldSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public FirestoreAdminStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcFirestoreAdminStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + 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 "firestore.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); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(FirestoreAdminStubSettings.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 FirestoreAdminStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createIndexSettings = settingsBuilder.createIndexSettings().build(); + listIndexesSettings = settingsBuilder.listIndexesSettings().build(); + getIndexSettings = settingsBuilder.getIndexSettings().build(); + deleteIndexSettings = settingsBuilder.deleteIndexSettings().build(); + importDocumentsSettings = settingsBuilder.importDocumentsSettings().build(); + exportDocumentsSettings = settingsBuilder.exportDocumentsSettings().build(); + getFieldSettings = settingsBuilder.getFieldSettings().build(); + listFieldsSettings = settingsBuilder.listFieldsSettings().build(); + updateFieldSettings = settingsBuilder.updateFieldSettings().build(); + } + + 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 + ? payload.getIndexesList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor + LIST_FIELDS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListFieldsRequest injectToken(ListFieldsRequest payload, String token) { + return ListFieldsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListFieldsRequest injectPageSize(ListFieldsRequest payload, int pageSize) { + return ListFieldsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListFieldsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListFieldsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListFieldsResponse payload) { + return payload.getFieldsList() != null + ? payload.getFieldsList() + : ImmutableList.of(); + } + }; + + 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); + } + }; + + private static final PagedListResponseFactory< + ListFieldsRequest, ListFieldsResponse, ListFieldsPagedResponse> + LIST_FIELDS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListFieldsRequest, ListFieldsResponse, ListFieldsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListFieldsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_FIELDS_PAGE_STR_DESC, request, context); + return ListFieldsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for FirestoreAdminStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder createIndexSettings; + private final PagedCallSettings.Builder< + ListIndexesRequest, ListIndexesResponse, ListIndexesPagedResponse> + listIndexesSettings; + private final UnaryCallSettings.Builder getIndexSettings; + private final UnaryCallSettings.Builder deleteIndexSettings; + private final UnaryCallSettings.Builder + importDocumentsSettings; + private final UnaryCallSettings.Builder + exportDocumentsSettings; + private final UnaryCallSettings.Builder getFieldSettings; + private final PagedCallSettings.Builder< + ListFieldsRequest, ListFieldsResponse, ListFieldsPagedResponse> + listFieldsSettings; + private final UnaryCallSettings.Builder updateFieldSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createIndexSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listIndexesSettings = PagedCallSettings.newBuilder(LIST_INDEXES_PAGE_STR_FACT); + + getIndexSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteIndexSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + importDocumentsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + exportDocumentsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getFieldSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listFieldsSettings = PagedCallSettings.newBuilder(LIST_FIELDS_PAGE_STR_FACT); + + updateFieldSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createIndexSettings, + listIndexesSettings, + getIndexSettings, + deleteIndexSettings, + importDocumentsSettings, + exportDocumentsSettings, + getFieldSettings, + listFieldsSettings, + updateFieldSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .createIndexSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listIndexesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getIndexSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteIndexSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .importDocumentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .exportDocumentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getFieldSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listFieldsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateFieldSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(FirestoreAdminStubSettings settings) { + super(settings); + + createIndexSettings = settings.createIndexSettings.toBuilder(); + listIndexesSettings = settings.listIndexesSettings.toBuilder(); + getIndexSettings = settings.getIndexSettings.toBuilder(); + deleteIndexSettings = settings.deleteIndexSettings.toBuilder(); + importDocumentsSettings = settings.importDocumentsSettings.toBuilder(); + exportDocumentsSettings = settings.exportDocumentsSettings.toBuilder(); + getFieldSettings = settings.getFieldSettings.toBuilder(); + listFieldsSettings = settings.listFieldsSettings.toBuilder(); + updateFieldSettings = settings.updateFieldSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createIndexSettings, + listIndexesSettings, + getIndexSettings, + deleteIndexSettings, + importDocumentsSettings, + exportDocumentsSettings, + getFieldSettings, + listFieldsSettings, + updateFieldSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * 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) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** 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 listIndexes. */ + public PagedCallSettings.Builder< + ListIndexesRequest, ListIndexesResponse, ListIndexesPagedResponse> + listIndexesSettings() { + return listIndexesSettings; + } + + /** 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 deleteIndex. */ + public UnaryCallSettings.Builder deleteIndexSettings() { + return deleteIndexSettings; + } + + /** Returns the builder for the settings used for calls to importDocuments. */ + public UnaryCallSettings.Builder importDocumentsSettings() { + return importDocumentsSettings; + } + + /** Returns the builder for the settings used for calls to exportDocuments. */ + public UnaryCallSettings.Builder exportDocumentsSettings() { + return exportDocumentsSettings; + } + + /** Returns the builder for the settings used for calls to getField. */ + public UnaryCallSettings.Builder getFieldSettings() { + return getFieldSettings; + } + + /** Returns the builder for the settings used for calls to listFields. */ + public PagedCallSettings.Builder + listFieldsSettings() { + return listFieldsSettings; + } + + /** Returns the builder for the settings used for calls to updateField. */ + public UnaryCallSettings.Builder updateFieldSettings() { + return updateFieldSettings; + } + + @Override + public FirestoreAdminStubSettings build() throws IOException { + return new FirestoreAdminStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminCallableFactory.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminCallableFactory.java new file mode 100644 index 000000000000..7b5a94bdde77 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.firestore.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Google Cloud Firestore Admin API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcFirestoreAdminCallableFactory 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 pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java new file mode 100644 index 000000000000..216ea01dcca6 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java @@ -0,0 +1,333 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.firestore.v1.stub; + +import static com.google.cloud.firestore.v1.FirestoreAdminClient.ListFieldsPagedResponse; +import static com.google.cloud.firestore.v1.FirestoreAdminClient.ListIndexesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.firestore.admin.v1.CreateIndexRequest; +import com.google.firestore.admin.v1.DeleteIndexRequest; +import com.google.firestore.admin.v1.ExportDocumentsRequest; +import com.google.firestore.admin.v1.Field; +import com.google.firestore.admin.v1.GetFieldRequest; +import com.google.firestore.admin.v1.GetIndexRequest; +import com.google.firestore.admin.v1.ImportDocumentsRequest; +import com.google.firestore.admin.v1.Index; +import com.google.firestore.admin.v1.ListFieldsRequest; +import com.google.firestore.admin.v1.ListFieldsResponse; +import com.google.firestore.admin.v1.ListIndexesRequest; +import com.google.firestore.admin.v1.ListIndexesResponse; +import com.google.firestore.admin.v1.UpdateFieldRequest; +import com.google.longrunning.Operation; +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 Google Cloud Firestore Admin API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcFirestoreAdminStub extends FirestoreAdminStub { + + private static final MethodDescriptor createIndexMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/CreateIndex") + .setRequestMarshaller(ProtoUtils.marshaller(CreateIndexRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listIndexesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ListIndexes") + .setRequestMarshaller(ProtoUtils.marshaller(ListIndexesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListIndexesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getIndexMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/GetIndex") + .setRequestMarshaller(ProtoUtils.marshaller(GetIndexRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Index.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteIndexMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/DeleteIndex") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteIndexRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + importDocumentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ImportDocuments") + .setRequestMarshaller( + ProtoUtils.marshaller(ImportDocumentsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + exportDocumentsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ExportDocuments") + .setRequestMarshaller( + ProtoUtils.marshaller(ExportDocumentsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor getFieldMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/GetField") + .setRequestMarshaller(ProtoUtils.marshaller(GetFieldRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Field.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listFieldsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ListFields") + .setRequestMarshaller(ProtoUtils.marshaller(ListFieldsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListFieldsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateFieldMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/UpdateField") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateFieldRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable createIndexCallable; + private final UnaryCallable listIndexesCallable; + private final UnaryCallable + listIndexesPagedCallable; + private final UnaryCallable getIndexCallable; + private final UnaryCallable deleteIndexCallable; + private final UnaryCallable importDocumentsCallable; + private final UnaryCallable exportDocumentsCallable; + private final UnaryCallable getFieldCallable; + private final UnaryCallable listFieldsCallable; + private final UnaryCallable listFieldsPagedCallable; + private final UnaryCallable updateFieldCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcFirestoreAdminStub create(FirestoreAdminStubSettings settings) + throws IOException { + return new GrpcFirestoreAdminStub(settings, ClientContext.create(settings)); + } + + public static final GrpcFirestoreAdminStub create(ClientContext clientContext) + throws IOException { + return new GrpcFirestoreAdminStub( + FirestoreAdminStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcFirestoreAdminStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcFirestoreAdminStub( + FirestoreAdminStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcFirestoreAdminStub, 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 GrpcFirestoreAdminStub(FirestoreAdminStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcFirestoreAdminCallableFactory()); + } + + /** + * Constructs an instance of GrpcFirestoreAdminStub, 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 GrpcFirestoreAdminStub( + FirestoreAdminStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings createIndexTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createIndexMethodDescriptor) + .build(); + GrpcCallSettings listIndexesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listIndexesMethodDescriptor) + .build(); + GrpcCallSettings getIndexTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIndexMethodDescriptor) + .build(); + GrpcCallSettings deleteIndexTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteIndexMethodDescriptor) + .build(); + GrpcCallSettings importDocumentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(importDocumentsMethodDescriptor) + .build(); + GrpcCallSettings exportDocumentsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(exportDocumentsMethodDescriptor) + .build(); + GrpcCallSettings getFieldTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getFieldMethodDescriptor) + .build(); + GrpcCallSettings listFieldsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listFieldsMethodDescriptor) + .build(); + GrpcCallSettings updateFieldTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateFieldMethodDescriptor) + .build(); + + this.createIndexCallable = + callableFactory.createUnaryCallable( + createIndexTransportSettings, settings.createIndexSettings(), clientContext); + this.listIndexesCallable = + callableFactory.createUnaryCallable( + listIndexesTransportSettings, settings.listIndexesSettings(), clientContext); + this.listIndexesPagedCallable = + callableFactory.createPagedCallable( + listIndexesTransportSettings, settings.listIndexesSettings(), clientContext); + this.getIndexCallable = + callableFactory.createUnaryCallable( + getIndexTransportSettings, settings.getIndexSettings(), clientContext); + this.deleteIndexCallable = + callableFactory.createUnaryCallable( + deleteIndexTransportSettings, settings.deleteIndexSettings(), clientContext); + this.importDocumentsCallable = + callableFactory.createUnaryCallable( + importDocumentsTransportSettings, settings.importDocumentsSettings(), clientContext); + this.exportDocumentsCallable = + callableFactory.createUnaryCallable( + exportDocumentsTransportSettings, settings.exportDocumentsSettings(), clientContext); + this.getFieldCallable = + callableFactory.createUnaryCallable( + getFieldTransportSettings, settings.getFieldSettings(), clientContext); + this.listFieldsCallable = + callableFactory.createUnaryCallable( + listFieldsTransportSettings, settings.listFieldsSettings(), clientContext); + this.listFieldsPagedCallable = + callableFactory.createPagedCallable( + listFieldsTransportSettings, settings.listFieldsSettings(), clientContext); + this.updateFieldCallable = + callableFactory.createUnaryCallable( + updateFieldTransportSettings, settings.updateFieldSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable createIndexCallable() { + return createIndexCallable; + } + + public UnaryCallable listIndexesPagedCallable() { + return listIndexesPagedCallable; + } + + public UnaryCallable listIndexesCallable() { + return listIndexesCallable; + } + + public UnaryCallable getIndexCallable() { + return getIndexCallable; + } + + public UnaryCallable deleteIndexCallable() { + return deleteIndexCallable; + } + + public UnaryCallable importDocumentsCallable() { + return importDocumentsCallable; + } + + public UnaryCallable exportDocumentsCallable() { + return exportDocumentsCallable; + } + + public UnaryCallable getFieldCallable() { + return getFieldCallable; + } + + public UnaryCallable listFieldsPagedCallable() { + return listFieldsPagedCallable; + } + + public UnaryCallable listFieldsCallable() { + return listFieldsCallable; + } + + public UnaryCallable updateFieldCallable() { + return updateFieldCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @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-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientTest.java b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientTest.java new file mode 100644 index 000000000000..d71cf13492b2 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientTest.java @@ -0,0 +1,485 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.firestore.v1; + +import static com.google.cloud.firestore.v1.FirestoreAdminClient.ListFieldsPagedResponse; +import static com.google.cloud.firestore.v1.FirestoreAdminClient.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.common.collect.Lists; +import com.google.firestore.admin.v1.CreateIndexRequest; +import com.google.firestore.admin.v1.DeleteIndexRequest; +import com.google.firestore.admin.v1.ExportDocumentsRequest; +import com.google.firestore.admin.v1.Field; +import com.google.firestore.admin.v1.GetFieldRequest; +import com.google.firestore.admin.v1.GetIndexRequest; +import com.google.firestore.admin.v1.ImportDocumentsRequest; +import com.google.firestore.admin.v1.Index; +import com.google.firestore.admin.v1.ListFieldsRequest; +import com.google.firestore.admin.v1.ListFieldsResponse; +import com.google.firestore.admin.v1.ListIndexesRequest; +import com.google.firestore.admin.v1.ListIndexesResponse; +import com.google.firestore.admin.v1.UpdateFieldRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class FirestoreAdminClientTest { + private static MockFirestoreAdmin mockFirestoreAdmin; + private static MockServiceHelper serviceHelper; + private FirestoreAdminClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockFirestoreAdmin = new MockFirestoreAdmin(); + serviceHelper = + new MockServiceHelper("in-process-1", Arrays.asList(mockFirestoreAdmin)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + FirestoreAdminSettings settings = + FirestoreAdminSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = FirestoreAdminClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createIndexTest() { + String name = "name3373707"; + boolean done = true; + Operation expectedResponse = Operation.newBuilder().setName(name).setDone(done).build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + String formattedParent = + FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]"); + Index index = Index.newBuilder().build(); + + Operation actualResponse = client.createIndex(formattedParent, index); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateIndexRequest actualRequest = (CreateIndexRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(index, actualRequest.getIndex()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createIndexExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + String formattedParent = + FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]"); + Index index = Index.newBuilder().build(); + + client.createIndex(formattedParent, index); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listIndexesTest() { + String nextPageToken = ""; + Index indexesElement = Index.newBuilder().build(); + List indexes = Arrays.asList(indexesElement); + ListIndexesResponse expectedResponse = + ListIndexesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllIndexes(indexes) + .build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + String formattedParent = + FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]"); + + ListIndexesPagedResponse pagedListResponse = client.listIndexes(formattedParent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getIndexesList().get(0), resources.get(0)); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListIndexesRequest actualRequest = (ListIndexesRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listIndexesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + String formattedParent = + FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]"); + + client.listIndexes(formattedParent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getIndexTest() { + String name2 = "name2-1052831874"; + Index expectedResponse = Index.newBuilder().setName(name2).build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + String formattedName = + FirestoreAdminClient.formatIndexName( + "[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]"); + + Index actualResponse = client.getIndex(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIndexRequest actualRequest = (GetIndexRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getIndexExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + String formattedName = + FirestoreAdminClient.formatIndexName( + "[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]"); + + client.getIndex(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteIndexTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + String formattedName = + FirestoreAdminClient.formatIndexName( + "[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]"); + + client.deleteIndex(formattedName); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteIndexRequest actualRequest = (DeleteIndexRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteIndexExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + String formattedName = + FirestoreAdminClient.formatIndexName( + "[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]"); + + client.deleteIndex(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void importDocumentsTest() { + String name2 = "name2-1052831874"; + boolean done = true; + Operation expectedResponse = Operation.newBuilder().setName(name2).setDone(done).build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + String formattedName = FirestoreAdminClient.formatDatabaseName("[PROJECT]", "[DATABASE]"); + + Operation actualResponse = client.importDocuments(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ImportDocumentsRequest actualRequest = (ImportDocumentsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void importDocumentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + String formattedName = FirestoreAdminClient.formatDatabaseName("[PROJECT]", "[DATABASE]"); + + client.importDocuments(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void exportDocumentsTest() { + String name2 = "name2-1052831874"; + boolean done = true; + Operation expectedResponse = Operation.newBuilder().setName(name2).setDone(done).build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + String formattedName = FirestoreAdminClient.formatDatabaseName("[PROJECT]", "[DATABASE]"); + + Operation actualResponse = client.exportDocuments(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ExportDocumentsRequest actualRequest = (ExportDocumentsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void exportDocumentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + String formattedName = FirestoreAdminClient.formatDatabaseName("[PROJECT]", "[DATABASE]"); + + client.exportDocuments(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getFieldTest() { + String name2 = "name2-1052831874"; + Field expectedResponse = Field.newBuilder().setName(name2).build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + String formattedName = + FirestoreAdminClient.formatFieldName( + "[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[FIELD_ID]"); + + Field actualResponse = client.getField(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFieldRequest actualRequest = (GetFieldRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getFieldExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + String formattedName = + FirestoreAdminClient.formatFieldName( + "[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[FIELD_ID]"); + + client.getField(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listFieldsTest() { + String nextPageToken = ""; + Field fieldsElement = Field.newBuilder().build(); + List fields = Arrays.asList(fieldsElement); + ListFieldsResponse expectedResponse = + ListFieldsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllFields(fields) + .build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + String formattedParent = + FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]"); + + ListFieldsPagedResponse pagedListResponse = client.listFields(formattedParent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFieldsList().get(0), resources.get(0)); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFieldsRequest actualRequest = (ListFieldsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listFieldsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + String formattedParent = + FirestoreAdminClient.formatParentName("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]"); + + client.listFields(formattedParent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateFieldTest() { + String name = "name3373707"; + boolean done = true; + Operation expectedResponse = Operation.newBuilder().setName(name).setDone(done).build(); + mockFirestoreAdmin.addResponse(expectedResponse); + + Field field = Field.newBuilder().build(); + + Operation actualResponse = client.updateField(field); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateFieldRequest actualRequest = (UpdateFieldRequest) actualRequests.get(0); + + Assert.assertEquals(field, actualRequest.getField()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateFieldExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + Field field = Field.newBuilder().build(); + + client.updateField(field); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/MockFirestoreAdmin.java b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/MockFirestoreAdmin.java new file mode 100644 index 000000000000..86413e0ea045 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/MockFirestoreAdmin.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.firestore.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockFirestoreAdmin implements MockGrpcService { + private final MockFirestoreAdminImpl serviceImpl; + + public MockFirestoreAdmin() { + serviceImpl = new MockFirestoreAdminImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(GeneratedMessageV3 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-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/MockFirestoreAdminImpl.java b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/MockFirestoreAdminImpl.java new file mode 100644 index 000000000000..b660c6efbf41 --- /dev/null +++ b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/MockFirestoreAdminImpl.java @@ -0,0 +1,203 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.firestore.v1; + +import com.google.api.core.BetaApi; +import com.google.firestore.admin.v1.CreateIndexRequest; +import com.google.firestore.admin.v1.DeleteIndexRequest; +import com.google.firestore.admin.v1.ExportDocumentsRequest; +import com.google.firestore.admin.v1.Field; +import com.google.firestore.admin.v1.FirestoreAdminGrpc.FirestoreAdminImplBase; +import com.google.firestore.admin.v1.GetFieldRequest; +import com.google.firestore.admin.v1.GetIndexRequest; +import com.google.firestore.admin.v1.ImportDocumentsRequest; +import com.google.firestore.admin.v1.Index; +import com.google.firestore.admin.v1.ListFieldsRequest; +import com.google.firestore.admin.v1.ListFieldsResponse; +import com.google.firestore.admin.v1.ListIndexesRequest; +import com.google.firestore.admin.v1.ListIndexesResponse; +import com.google.firestore.admin.v1.UpdateFieldRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockFirestoreAdminImpl extends FirestoreAdminImplBase { + private ArrayList requests; + private Queue responses; + + public MockFirestoreAdminImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(GeneratedMessageV3 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 createIndex(CreateIndexRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + 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("Unrecognized response type")); + } + } + + @Override + public void listIndexes( + ListIndexesRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + 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("Unrecognized response type")); + } + } + + @Override + public void getIndex(GetIndexRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + 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("Unrecognized response type")); + } + } + + @Override + public void deleteIndex(DeleteIndexRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getField(GetFieldRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Field) { + requests.add(request); + responseObserver.onNext((Field) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateField(UpdateFieldRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + 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("Unrecognized response type")); + } + } + + @Override + public void listFields( + ListFieldsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListFieldsResponse) { + requests.add(request); + responseObserver.onNext((ListFieldsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void exportDocuments( + ExportDocumentsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + 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("Unrecognized response type")); + } + } + + @Override + public void importDocuments( + ImportDocumentsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + 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("Unrecognized response type")); + } + } +} diff --git a/google-cloud-clients/google-cloud-firestore/synth.metadata b/google-cloud-clients/google-cloud-firestore/synth.metadata index 0ffd460f60b8..895ea00dabab 100644 --- a/google-cloud-clients/google-cloud-firestore/synth.metadata +++ b/google-cloud-clients/google-cloud-firestore/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-03-22T07:43:53.166974Z", + "updateTime": "2019-03-22T15:57:43.978857Z", "sources": [ { "generator": { @@ -18,6 +18,16 @@ } ], "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "firestore-admin", + "apiVersion": "v1", + "language": "java", + "generator": "gapic", + "config": "google/firestore/admin/artman_firestore_v1.yaml" + } + }, { "client": { "source": "googleapis", diff --git a/google-cloud-clients/google-cloud-firestore/synth.py b/google-cloud-clients/google-cloud-firestore/synth.py index 9ba8a5ea2ae3..e5439df61900 100644 --- a/google-cloud-clients/google-cloud-firestore/synth.py +++ b/google-cloud-clients/google-cloud-firestore/synth.py @@ -20,34 +20,21 @@ gapic = gcp.GAPICGenerator() -service = 'firestore' -version='v1beta1' - -library = gapic.java_library( - service=service, - version='v1beta1', - config_path=f'/google/firestore/artman_firestore.yaml', - artman_output_name='') - -s.copy(library / f'gapic-google-cloud-{service}-{version}/src', 'src') -s.copy(library / f'grpc-google-cloud-{service}-{version}/src', f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') -s.copy(library / f'proto-google-cloud-{service}-{version}/src', f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') - -java.format_code('./src') -java.format_code(f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') -java.format_code(f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') - -version='v1' -library = gapic.java_library( - service=service, - version='v1', - config_path=f'/google/firestore/artman_firestore_v1.yaml', - artman_output_name='') - -s.copy(library / f'gapic-google-cloud-{service}-{version}/src', 'src') -s.copy(library / f'grpc-google-cloud-{service}-{version}/src', f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') -s.copy(library / f'proto-google-cloud-{service}-{version}/src', f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') - -java.format_code('./src') -java.format_code(f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') -java.format_code(f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') \ No newline at end of file +def generate_client(service, version, config_path): + library = gapic.java_library( + service=service, + version=version, + config_path=config_path, + artman_output_name='') + + s.copy(library / f'gapic-google-cloud-{service}-{version}/src', 'src') + s.copy(library / f'grpc-google-cloud-{service}-{version}/src', f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') + s.copy(library / f'proto-google-cloud-{service}-{version}/src', f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') + + java.format_code('./src') + java.format_code(f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') + java.format_code(f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') + +generate_client('firestore-admin', 'v1', '/google/firestore/admin/artman_firestore_v1.yaml') +generate_client('firestore', 'v1beta1', '/google/firestore/artman_firestore.yaml') +generate_client('firestore', 'v1', '/google/firestore/artman_firestore_v1.yaml') diff --git a/versions.txt b/versions.txt index 3ac017f7b68c..1f93512558c6 100644 --- a/versions.txt +++ b/versions.txt @@ -77,6 +77,7 @@ grpc-google-cloud-dialogflow-v2:0.49.0:0.49.1-SNAPSHOT grpc-google-cloud-dialogflow-v2beta1:0.49.0:0.49.1-SNAPSHOT grpc-google-cloud-dlp-v2:0.49.0:0.49.1-SNAPSHOT grpc-google-cloud-error-reporting-v1beta1:0.49.0:0.49.1-SNAPSHOT +grpc-google-cloud-firestore-admin-v1:0.49.0:0.49.1-SNAPSHOT grpc-google-cloud-firestore-v1:0.49.0:0.49.1-SNAPSHOT grpc-google-cloud-firestore-v1beta1:0.49.0:0.49.1-SNAPSHOT grpc-google-cloud-iamcredentials-v1:0.11.0-alpha:0.11.1-alpha-SNAPSHOT @@ -134,6 +135,7 @@ proto-google-cloud-dialogflow-v2:0.49.0:0.49.1-SNAPSHOT proto-google-cloud-dialogflow-v2beta1:0.49.0:0.49.1-SNAPSHOT proto-google-cloud-dlp-v2:0.49.0:0.49.1-SNAPSHOT proto-google-cloud-error-reporting-v1beta1:0.49.0:0.49.1-SNAPSHOT +proto-google-cloud-firestore-admin-v1:0.49.0:0.49.1-SNAPSHOT proto-google-cloud-firestore-v1:0.49.0:0.49.1-SNAPSHOT proto-google-cloud-firestore-v1beta1:0.49.0:0.49.1-SNAPSHOT proto-google-cloud-iamcredentials-v1:0.11.0-alpha:0.11.1-alpha-SNAPSHOT