diff --git a/google/cloud/firestore_admin_v1/proto/operation.proto b/google/cloud/firestore_admin_v1/proto/operation.proto index 08194fe09..6494ab7cb 100644 --- a/google/cloud/firestore_admin_v1/proto/operation.proto +++ b/google/cloud/firestore_admin_v1/proto/operation.proto @@ -162,17 +162,6 @@ message ExportDocumentsResponse { string output_uri_prefix = 1; } -// 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; -} - // Describes the state of the operation. enum OperationState { // Unspecified. @@ -201,3 +190,14 @@ enum OperationState { // 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/firestore_v1/gapic/enums.py b/google/cloud/firestore_v1/gapic/enums.py index 1220f0d91..857e350e4 100644 --- a/google/cloud/firestore_v1/gapic/enums.py +++ b/google/cloud/firestore_v1/gapic/enums.py @@ -91,6 +91,10 @@ class Operator(enum.IntEnum): ``order_by``. EQUAL (int): Equal. ARRAY_CONTAINS (int): Contains. Requires that the field is an array. + IN (int): In. Requires that ``value`` is a non-empty ArrayValue with at most 10 + values. + ARRAY_CONTAINS_ANY (int): Contains any. Requires that the field is an array and ``value`` is a + non-empty ArrayValue with at most 10 values. """ OPERATOR_UNSPECIFIED = 0 @@ -100,6 +104,8 @@ class Operator(enum.IntEnum): GREATER_THAN_OR_EQUAL = 4 EQUAL = 5 ARRAY_CONTAINS = 7 + IN = 8 + ARRAY_CONTAINS_ANY = 9 class UnaryFilter(object): class Operator(enum.IntEnum): diff --git a/google/cloud/firestore_v1/proto/query.proto b/google/cloud/firestore_v1/proto/query.proto index e2d7b836f..a8d5e7a2e 100644 --- a/google/cloud/firestore_v1/proto/query.proto +++ b/google/cloud/firestore_v1/proto/query.proto @@ -102,6 +102,14 @@ message StructuredQuery { // Contains. Requires that the field is an array. ARRAY_CONTAINS = 7; + + // In. Requires that `value` is a non-empty ArrayValue with at most 10 + // values. + IN = 8; + + // Contains any. Requires that the field is an array and + // `value` is a non-empty ArrayValue with at most 10 values. + ARRAY_CONTAINS_ANY = 9; } // The field to filter by. @@ -114,18 +122,6 @@ message StructuredQuery { Value value = 3; } - // A sort direction. - enum Direction { - // Unspecified. - DIRECTION_UNSPECIFIED = 0; - - // Ascending. - ASCENDING = 1; - - // Descending. - DESCENDING = 2; - } - // A filter with a single operand. message UnaryFilter { // A unary operator. @@ -150,6 +146,15 @@ message StructuredQuery { } } + // The projection of document's fields to return. + message Projection { + // The fields to return. + // + // If empty, all fields are returned. To only return the name + // of the document, use `['__name__']`. + repeated FieldReference fields = 2; + } + // An order on a field. message Order { // The field to order by. @@ -164,13 +169,16 @@ message StructuredQuery { string field_path = 2; } - // The projection of document's fields to return. - message Projection { - // The fields to return. - // - // If empty, all fields are returned. To only return the name - // of the document, use `['__name__']`. - repeated FieldReference fields = 2; + // A sort direction. + enum Direction { + // Unspecified. + DIRECTION_UNSPECIFIED = 0; + + // Ascending. + ASCENDING = 1; + + // Descending. + DESCENDING = 2; } // The projection to return. diff --git a/google/cloud/firestore_v1/proto/query_pb2.py b/google/cloud/firestore_v1/proto/query_pb2.py index 089b33a34..057de9276 100644 --- a/google/cloud/firestore_v1/proto/query_pb2.py +++ b/google/cloud/firestore_v1/proto/query_pb2.py @@ -30,7 +30,7 @@ "\n\027com.google.firestore.v1B\nQueryProtoP\001Z.google.firestore.v1beta1.StructuredQuery.FieldFilter.Operator\x12.\n\x05value\x18\x03 \x01(\x0b\x32\x1f.google.firestore.v1beta1.Value"\x97\x01\n\x08Operator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\x00\x12\r\n\tLESS_THAN\x10\x01\x12\x16\n\x12LESS_THAN_OR_EQUAL\x10\x02\x12\x10\n\x0cGREATER_THAN\x10\x03\x12\x19\n\x15GREATER_THAN_OR_EQUAL\x10\x04\x12\t\n\x05\x45QUAL\x10\x05\x12\x12\n\x0e\x41RRAY_CONTAINS\x10\x07\x1a\xf3\x01\n\x0bUnaryFilter\x12J\n\x02op\x18\x01 \x01(\x0e\x32>.google.firestore.v1beta1.StructuredQuery.UnaryFilter.Operator\x12I\n\x05\x66ield\x18\x02 \x01(\x0b\x32\x38.google.firestore.v1beta1.StructuredQuery.FieldReferenceH\x00"=\n\x08Operator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\x00\x12\n\n\x06IS_NAN\x10\x02\x12\x0b\n\x07IS_NULL\x10\x03\x42\x0e\n\x0coperand_type\x1a\x98\x01\n\x05Order\x12G\n\x05\x66ield\x18\x01 \x01(\x0b\x32\x38.google.firestore.v1beta1.StructuredQuery.FieldReference\x12\x46\n\tdirection\x18\x02 \x01(\x0e\x32\x33.google.firestore.v1beta1.StructuredQuery.Direction\x1a$\n\x0e\x46ieldReference\x12\x12\n\nfield_path\x18\x02 \x01(\t\x1aV\n\nProjection\x12H\n\x06\x66ields\x18\x02 \x03(\x0b\x32\x38.google.firestore.v1beta1.StructuredQuery.FieldReference"E\n\tDirection\x12\x19\n\x15\x44IRECTION_UNSPECIFIED\x10\x00\x12\r\n\tASCENDING\x10\x01\x12\x0e\n\nDESCENDING\x10\x02"I\n\x06\x43ursor\x12/\n\x06values\x18\x01 \x03(\x0b\x32\x1f.google.firestore.v1beta1.Value\x12\x0e\n\x06\x62\x65\x66ore\x18\x02 \x01(\x08\x42\xb8\x01\n\x1c\x63om.google.firestore.v1beta1B\nQueryProtoP\x01ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\xa2\x02\x04GCFS\xaa\x02\x1eGoogle.Cloud.Firestore.V1Beta1\xca\x02\x1eGoogle\\Cloud\\Firestore\\V1beta1b\x06proto3' + '\n0google/cloud/firestore_v1beta1/proto/query.proto\x12\x18google.firestore.v1beta1\x1a\x33google/cloud/firestore_v1beta1/proto/document.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1cgoogle/api/annotations.proto"\xd9\x0f\n\x0fStructuredQuery\x12\x44\n\x06select\x18\x01 \x01(\x0b\x32\x34.google.firestore.v1beta1.StructuredQuery.Projection\x12J\n\x04\x66rom\x18\x02 \x03(\x0b\x32<.google.firestore.v1beta1.StructuredQuery.CollectionSelector\x12?\n\x05where\x18\x03 \x01(\x0b\x32\x30.google.firestore.v1beta1.StructuredQuery.Filter\x12\x41\n\x08order_by\x18\x04 \x03(\x0b\x32/.google.firestore.v1beta1.StructuredQuery.Order\x12\x32\n\x08start_at\x18\x07 \x01(\x0b\x32 .google.firestore.v1beta1.Cursor\x12\x30\n\x06\x65nd_at\x18\x08 \x01(\x0b\x32 .google.firestore.v1beta1.Cursor\x12\x0e\n\x06offset\x18\x06 \x01(\x05\x12*\n\x05limit\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x1a\x44\n\x12\x43ollectionSelector\x12\x15\n\rcollection_id\x18\x02 \x01(\t\x12\x17\n\x0f\x61ll_descendants\x18\x03 \x01(\x08\x1a\x8c\x02\n\x06\x46ilter\x12U\n\x10\x63omposite_filter\x18\x01 \x01(\x0b\x32\x39.google.firestore.v1beta1.StructuredQuery.CompositeFilterH\x00\x12M\n\x0c\x66ield_filter\x18\x02 \x01(\x0b\x32\x35.google.firestore.v1beta1.StructuredQuery.FieldFilterH\x00\x12M\n\x0cunary_filter\x18\x03 \x01(\x0b\x32\x35.google.firestore.v1beta1.StructuredQuery.UnaryFilterH\x00\x42\r\n\x0b\x66ilter_type\x1a\xd3\x01\n\x0f\x43ompositeFilter\x12N\n\x02op\x18\x01 \x01(\x0e\x32\x42.google.firestore.v1beta1.StructuredQuery.CompositeFilter.Operator\x12\x41\n\x07\x66ilters\x18\x02 \x03(\x0b\x32\x30.google.firestore.v1beta1.StructuredQuery.Filter"-\n\x08Operator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41ND\x10\x01\x1a\x8c\x03\n\x0b\x46ieldFilter\x12G\n\x05\x66ield\x18\x01 \x01(\x0b\x32\x38.google.firestore.v1beta1.StructuredQuery.FieldReference\x12J\n\x02op\x18\x02 \x01(\x0e\x32>.google.firestore.v1beta1.StructuredQuery.FieldFilter.Operator\x12.\n\x05value\x18\x03 \x01(\x0b\x32\x1f.google.firestore.v1beta1.Value"\xb7\x01\n\x08Operator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\x00\x12\r\n\tLESS_THAN\x10\x01\x12\x16\n\x12LESS_THAN_OR_EQUAL\x10\x02\x12\x10\n\x0cGREATER_THAN\x10\x03\x12\x19\n\x15GREATER_THAN_OR_EQUAL\x10\x04\x12\t\n\x05\x45QUAL\x10\x05\x12\x12\n\x0e\x41RRAY_CONTAINS\x10\x07\x12\x06\n\x02IN\x10\x08\x12\x16\n\x12\x41RRAY_CONTAINS_ANY\x10\t\x1a\xf3\x01\n\x0bUnaryFilter\x12J\n\x02op\x18\x01 \x01(\x0e\x32>.google.firestore.v1beta1.StructuredQuery.UnaryFilter.Operator\x12I\n\x05\x66ield\x18\x02 \x01(\x0b\x32\x38.google.firestore.v1beta1.StructuredQuery.FieldReferenceH\x00"=\n\x08Operator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\x00\x12\n\n\x06IS_NAN\x10\x02\x12\x0b\n\x07IS_NULL\x10\x03\x42\x0e\n\x0coperand_type\x1a\x98\x01\n\x05Order\x12G\n\x05\x66ield\x18\x01 \x01(\x0b\x32\x38.google.firestore.v1beta1.StructuredQuery.FieldReference\x12\x46\n\tdirection\x18\x02 \x01(\x0e\x32\x33.google.firestore.v1beta1.StructuredQuery.Direction\x1aV\n\nProjection\x12H\n\x06\x66ields\x18\x02 \x03(\x0b\x32\x38.google.firestore.v1beta1.StructuredQuery.FieldReference\x1a$\n\x0e\x46ieldReference\x12\x12\n\nfield_path\x18\x02 \x01(\t"E\n\tDirection\x12\x19\n\x15\x44IRECTION_UNSPECIFIED\x10\x00\x12\r\n\tASCENDING\x10\x01\x12\x0e\n\nDESCENDING\x10\x02"I\n\x06\x43ursor\x12/\n\x06values\x18\x01 \x03(\x0b\x32\x1f.google.firestore.v1beta1.Value\x12\x0e\n\x06\x62\x65\x66ore\x18\x02 \x01(\x08\x42\xb8\x01\n\x1c\x63om.google.firestore.v1beta1B\nQueryProtoP\x01ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\xa2\x02\x04GCFS\xaa\x02\x1eGoogle.Cloud.Firestore.V1Beta1\xca\x02\x1eGoogle\\Cloud\\Firestore\\V1beta1b\x06proto3' ), dependencies=[ google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_document__pb2.DESCRIPTOR, @@ -103,11 +103,21 @@ _descriptor.EnumValueDescriptor( name="ARRAY_CONTAINS", index=6, number=7, serialized_options=None, type=None ), + _descriptor.EnumValueDescriptor( + name="IN", index=7, number=8, serialized_options=None, type=None + ), + _descriptor.EnumValueDescriptor( + name="ARRAY_CONTAINS_ANY", + index=8, + number=9, + serialized_options=None, + type=None, + ), ], containing_type=None, serialized_options=None, serialized_start=1422, - serialized_end=1573, + serialized_end=1605, ) _sym_db.RegisterEnumDescriptor(_STRUCTUREDQUERY_FIELDFILTER_OPERATOR) @@ -133,8 +143,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=1742, - serialized_end=1803, + serialized_start=1774, + serialized_end=1835, ) _sym_db.RegisterEnumDescriptor(_STRUCTUREDQUERY_UNARYFILTER_OPERATOR) @@ -160,8 +170,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2102, - serialized_end=2171, + serialized_start=2134, + serialized_end=2203, ) _sym_db.RegisterEnumDescriptor(_STRUCTUREDQUERY_DIRECTION) @@ -431,7 +441,7 @@ extension_ranges=[], oneofs=[], serialized_start=1209, - serialized_end=1573, + serialized_end=1605, ) _STRUCTUREDQUERY_UNARYFILTER = _descriptor.Descriptor( @@ -494,8 +504,8 @@ fields=[], ) ], - serialized_start=1576, - serialized_end=1819, + serialized_start=1608, + serialized_end=1851, ) _STRUCTUREDQUERY_ORDER = _descriptor.Descriptor( @@ -550,27 +560,27 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1822, - serialized_end=1974, + serialized_start=1854, + serialized_end=2006, ) -_STRUCTUREDQUERY_FIELDREFERENCE = _descriptor.Descriptor( - name="FieldReference", - full_name="google.firestore.v1beta1.StructuredQuery.FieldReference", +_STRUCTUREDQUERY_PROJECTION = _descriptor.Descriptor( + name="Projection", + full_name="google.firestore.v1beta1.StructuredQuery.Projection", filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name="field_path", - full_name="google.firestore.v1beta1.StructuredQuery.FieldReference.field_path", + name="fields", + full_name="google.firestore.v1beta1.StructuredQuery.Projection.fields", index=0, number=2, - type=9, - cpp_type=9, - label=1, + type=11, + cpp_type=10, + label=3, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=[], message_type=None, enum_type=None, containing_type=None, @@ -588,27 +598,27 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1976, - serialized_end=2012, + serialized_start=2008, + serialized_end=2094, ) -_STRUCTUREDQUERY_PROJECTION = _descriptor.Descriptor( - name="Projection", - full_name="google.firestore.v1beta1.StructuredQuery.Projection", +_STRUCTUREDQUERY_FIELDREFERENCE = _descriptor.Descriptor( + name="FieldReference", + full_name="google.firestore.v1beta1.StructuredQuery.FieldReference", filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name="fields", - full_name="google.firestore.v1beta1.StructuredQuery.Projection.fields", + name="field_path", + full_name="google.firestore.v1beta1.StructuredQuery.FieldReference.field_path", index=0, number=2, - type=11, - cpp_type=10, - label=3, + type=9, + cpp_type=9, + label=1, has_default_value=False, - default_value=[], + default_value=_b("").decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -626,8 +636,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2014, - serialized_end=2100, + serialized_start=2096, + serialized_end=2132, ) _STRUCTUREDQUERY = _descriptor.Descriptor( @@ -790,8 +800,8 @@ _STRUCTUREDQUERY_FIELDFILTER, _STRUCTUREDQUERY_UNARYFILTER, _STRUCTUREDQUERY_ORDER, - _STRUCTUREDQUERY_FIELDREFERENCE, _STRUCTUREDQUERY_PROJECTION, + _STRUCTUREDQUERY_FIELDREFERENCE, ], enum_types=[_STRUCTUREDQUERY_DIRECTION], serialized_options=None, @@ -800,7 +810,7 @@ extension_ranges=[], oneofs=[], serialized_start=194, - serialized_end=2171, + serialized_end=2203, ) @@ -856,8 +866,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2173, - serialized_end=2246, + serialized_start=2205, + serialized_end=2278, ) _STRUCTUREDQUERY_COLLECTIONSELECTOR.containing_type = _STRUCTUREDQUERY @@ -933,11 +943,11 @@ "direction" ].enum_type = _STRUCTUREDQUERY_DIRECTION _STRUCTUREDQUERY_ORDER.containing_type = _STRUCTUREDQUERY -_STRUCTUREDQUERY_FIELDREFERENCE.containing_type = _STRUCTUREDQUERY _STRUCTUREDQUERY_PROJECTION.fields_by_name[ "fields" ].message_type = _STRUCTUREDQUERY_FIELDREFERENCE _STRUCTUREDQUERY_PROJECTION.containing_type = _STRUCTUREDQUERY +_STRUCTUREDQUERY_FIELDREFERENCE.containing_type = _STRUCTUREDQUERY _STRUCTUREDQUERY.fields_by_name["select"].message_type = _STRUCTUREDQUERY_PROJECTION _STRUCTUREDQUERY.fields_by_name[ "from" @@ -1084,17 +1094,6 @@ # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.StructuredQuery.Order) ), ), - FieldReference=_reflection.GeneratedProtocolMessageType( - "FieldReference", - (_message.Message,), - dict( - DESCRIPTOR=_STRUCTUREDQUERY_FIELDREFERENCE, - __module__="google.cloud.firestore_v1beta1.proto.query_pb2", - __doc__="""A reference to a field, such as ``max(messages.time) as max_time``. - """, - # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.StructuredQuery.FieldReference) - ), - ), Projection=_reflection.GeneratedProtocolMessageType( "Projection", (_message.Message,), @@ -1112,6 +1111,17 @@ # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.StructuredQuery.Projection) ), ), + FieldReference=_reflection.GeneratedProtocolMessageType( + "FieldReference", + (_message.Message,), + dict( + DESCRIPTOR=_STRUCTUREDQUERY_FIELDREFERENCE, + __module__="google.cloud.firestore_v1beta1.proto.query_pb2", + __doc__="""A reference to a field, such as ``max(messages.time) as max_time``. + """, + # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.StructuredQuery.FieldReference) + ), + ), DESCRIPTOR=_STRUCTUREDQUERY, __module__="google.cloud.firestore_v1beta1.proto.query_pb2", __doc__="""A Firestore query. @@ -1160,8 +1170,8 @@ _sym_db.RegisterMessage(StructuredQuery.FieldFilter) _sym_db.RegisterMessage(StructuredQuery.UnaryFilter) _sym_db.RegisterMessage(StructuredQuery.Order) -_sym_db.RegisterMessage(StructuredQuery.FieldReference) _sym_db.RegisterMessage(StructuredQuery.Projection) +_sym_db.RegisterMessage(StructuredQuery.FieldReference) Cursor = _reflection.GeneratedProtocolMessageType( "Cursor", diff --git a/synth.metadata b/synth.metadata index ab85f3700..e22035e70 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,18 +1,19 @@ { - "updateTime": "2019-09-19T12:22:24.552315Z", + "updateTime": "2019-10-10T12:25:00.305808Z", "sources": [ { "generator": { "name": "artman", - "version": "0.36.3", - "dockerImage": "googleapis/artman@sha256:66ca01f27ef7dc50fbfb7743b67028115a6a8acf43b2d82f9fc826de008adac4" + "version": "0.38.0", + "dockerImage": "googleapis/artman@sha256:0d2f8d429110aeb8d82df6550ef4ede59d40df9062d260a1580fce688b0512bf" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "23f6c4d8d49ef3f1aaa45768869d8616efe4a307" + "sha": "10f91fa12f70e8e0209a45fc10807ed1f77c7e4e", + "internalRef": "273826591" } }, {