- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please + As of January 1, 2020 this library no longer supports Python 2 on the latest released version. + Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.
{% block body %} {% endblock %} diff --git a/docs/conf.py b/docs/conf.py index 5a50b3c58..12129534a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -38,21 +38,18 @@ "sphinx.ext.napoleon", "sphinx.ext.todo", "sphinx.ext.viewcode", + "recommonmark", ] # autodoc/autosummary flags autoclass_content = "both" -autodoc_default_flags = ["members"] +autodoc_default_options = {"members": True} autosummary_generate = True # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] @@ -340,7 +337,7 @@ intersphinx_mapping = { "python": ("http://python.readthedocs.org/en/latest/", None), "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,), "grpc": ("https://grpc.io/grpc/python/", None), } diff --git a/docs/index.rst b/docs/index.rst index b8157df9b..7d225f392 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,12 +1,6 @@ .. include:: README.rst -.. note:: - - Because the firestore client uses :mod:`grpcio` library, it is safe to - share instances across threads. In multiprocessing scenarios, the best - practice is to create client instances *after* the invocation of - :func:`os.fork` by :class:`multiprocessing.Pool` or - :class:`multiprocessing.Process`. +.. include:: multiprocessing.rst API Reference ------------- diff --git a/docs/multiprocessing.rst b/docs/multiprocessing.rst new file mode 100644 index 000000000..1cb29d4ca --- /dev/null +++ b/docs/multiprocessing.rst @@ -0,0 +1,7 @@ +.. note:: + + Because this client uses :mod:`grpcio` library, it is safe to + share instances across threads. In multiprocessing scenarios, the best + practice is to create client instances *after* the invocation of + :func:`os.fork` by :class:`multiprocessing.Pool` or + :class:`multiprocessing.Process`. diff --git a/google/cloud/firestore_admin_v1/__init__.py b/google/cloud/firestore_admin_v1/__init__.py index 23f844b61..dc284bb96 100644 --- a/google/cloud/firestore_admin_v1/__init__.py +++ b/google/cloud/firestore_admin_v1/__init__.py @@ -26,8 +26,8 @@ if sys.version_info[:2] == (2, 7): message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" + "A future version of this library will drop support for Python 2.7. " + "More details about Python 2 support for Google Cloud Client Libraries " "can be found at https://cloud.google.com/python/docs/python2-sunset/" ) warnings.warn(message, DeprecationWarning) @@ -38,4 +38,8 @@ class FirestoreAdminClient(firestore_admin_client.FirestoreAdminClient): enums = enums -__all__ = ("enums", "types", "FirestoreAdminClient") +__all__ = ( + "enums", + "types", + "FirestoreAdminClient", +) diff --git a/google/cloud/firestore_admin_v1/gapic/enums.py b/google/cloud/firestore_admin_v1/gapic/enums.py index 09acf6c3e..0f162f179 100644 --- a/google/cloud/firestore_admin_v1/gapic/enums.py +++ b/google/cloud/firestore_admin_v1/gapic/enums.py @@ -66,8 +66,8 @@ class ChangeType(enum.IntEnum): class Index(object): class QueryScope(enum.IntEnum): """ - Query Scope defines the scope at which a query is run. This is specified - on a StructuredQuery's ``from`` field. + Query Scope defines the scope at which a query is run. This is + specified on a StructuredQuery's ``from`` field. Attributes: QUERY_SCOPE_UNSPECIFIED (int): The query scope is unspecified. Not a valid option. @@ -85,8 +85,8 @@ class QueryScope(enum.IntEnum): class State(enum.IntEnum): """ - The state of an index. During index creation, an index will be in the - ``CREATING`` state. If the index is created successfully, it will + 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. diff --git a/google/cloud/firestore_admin_v1/gapic/firestore_admin_client.py b/google/cloud/firestore_admin_v1/gapic/firestore_admin_client.py index 9b80814f9..b009aa2ff 100644 --- a/google/cloud/firestore_admin_v1/gapic/firestore_admin_client.py +++ b/google/cloud/firestore_admin_v1/gapic/firestore_admin_client.py @@ -27,6 +27,8 @@ import google.api_core.gapic_v1.method import google.api_core.gapic_v1.routing_header import google.api_core.grpc_helpers +import google.api_core.operation +import google.api_core.operations_v1 import google.api_core.page_iterator import google.api_core.path_template import grpc @@ -40,20 +42,21 @@ from google.cloud.firestore_admin_v1.proto import firestore_admin_pb2 from google.cloud.firestore_admin_v1.proto import firestore_admin_pb2_grpc from google.cloud.firestore_admin_v1.proto import index_pb2 +from google.cloud.firestore_admin_v1.proto import operation_pb2 from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 from google.protobuf import field_mask_pb2 _GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-firestore" + "google-cloud-firestore", ).version class FirestoreAdminClient(object): """ - Operations are created by service ``FirestoreAdmin``, but are accessed - via service ``google.longrunning.Operations``. + Operations are created by service ``FirestoreAdmin``, but are + accessed via service ``google.longrunning.Operations``. """ SERVICE_ADDRESS = "firestore.googleapis.com:443" @@ -83,6 +86,16 @@ def from_service_account_file(cls, filename, *args, **kwargs): from_service_account_json = from_service_account_file + @classmethod + def collection_group_path(cls, project, database, collection): + """Return a fully-qualified collection_group string.""" + return google.api_core.path_template.expand( + "projects/{project}/databases/{database}/collectionGroups/{collection}", + project=project, + database=database, + collection=collection, + ) + @classmethod def database_path(cls, project, database): """Return a fully-qualified database string.""" @@ -93,25 +106,25 @@ def database_path(cls, project, database): ) @classmethod - def field_path(cls, project, database, collection_id, field_id): + def field_path(cls, project, database, collection, field): """Return a fully-qualified field string.""" return google.api_core.path_template.expand( - "projects/{project}/databases/{database}/collectionGroups/{collection_id}/fields/{field_id}", + "projects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field}", project=project, database=database, - collection_id=collection_id, - field_id=field_id, + collection=collection, + field=field, ) @classmethod - def index_path(cls, project, database, collection_id, index_id): + def index_path(cls, project, database, collection, index): """Return a fully-qualified index string.""" return google.api_core.path_template.expand( - "projects/{project}/databases/{database}/collectionGroups/{collection_id}/indexes/{index_id}", + "projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}", project=project, database=database, - collection_id=collection_id, - index_id=index_id, + collection=collection, + index=index, ) @classmethod @@ -211,12 +224,12 @@ def __init__( self.transport = transport else: self.transport = firestore_admin_grpc_transport.FirestoreAdminGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials, ) if client_info is None: client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION + gapic_version=_GAPIC_LIBRARY_VERSION, ) else: client_info.gapic_version = _GAPIC_LIBRARY_VERSION @@ -227,7 +240,7 @@ def __init__( # (Ordinarily, these are the defaults specified in the `*_config.py` # file next to this one.) self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] + client_config["interfaces"][self._INTERFACE_NAME], ) # Save a dictionary of cached API call functions. @@ -237,39 +250,28 @@ def __init__( self._inner_api_calls = {} # Service calls - def create_index( + def delete_index( self, - parent, - index, + name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Creates a composite index. This returns a - ``google.longrunning.Operation`` which may be used to track the status - of the creation. The metadata for the operation will be the type - ``IndexOperationMetadata``. + Deletes a composite index. Example: >>> from google.cloud import firestore_admin_v1 >>> >>> client = firestore_admin_v1.FirestoreAdminClient() >>> - >>> parent = client.parent_path('[PROJECT]', '[DATABASE]', '[COLLECTION_ID]') - >>> - >>> # TODO: Initialize `index`: - >>> index = {} + >>> name = client.index_path('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]') >>> - >>> response = client.create_index(parent, index) + >>> client.delete_index(name) Args: - parent (str): Required. A parent name of the form - ``projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`` - index (Union[dict, ~google.cloud.firestore_admin_v1.types.Index]): Required. The composite index to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_admin_v1.types.Index` + name (str): Required. A name of the form + ``projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -279,9 +281,6 @@ def create_index( metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata that is provided to the method. - Returns: - A :class:`~google.cloud.firestore_admin_v1.types.Operation` instance. - Raises: google.api_core.exceptions.GoogleAPICallError: If the request failed for any reason. @@ -290,22 +289,22 @@ def create_index( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "create_index" not in self._inner_api_calls: + if "delete_index" not in self._inner_api_calls: self._inner_api_calls[ - "create_index" + "delete_index" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_index, - default_retry=self._method_configs["CreateIndex"].retry, - default_timeout=self._method_configs["CreateIndex"].timeout, + self.transport.delete_index, + default_retry=self._method_configs["DeleteIndex"].retry, + default_timeout=self._method_configs["DeleteIndex"].timeout, client_info=self._client_info, ) - request = firestore_admin_pb2.CreateIndexRequest(parent=parent, index=index) + request = firestore_admin_pb2.DeleteIndexRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) try: - routing_header = [("parent", parent)] + routing_header = [("name", name)] except AttributeError: pass else: @@ -314,52 +313,62 @@ def create_index( ) metadata.append(routing_metadata) - return self._inner_api_calls["create_index"]( + self._inner_api_calls["delete_index"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def list_indexes( + def update_field( self, - parent, - filter_=None, - page_size=None, + field, + update_mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Lists composite indexes. + Updates a field configuration. Currently, field updates apply only + to single field index configuration. However, calls to + ``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`` which may be used + to track the status of the field update. The metadata for the operation + will be the type ``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/*``. Example: >>> from google.cloud import firestore_admin_v1 >>> >>> client = firestore_admin_v1.FirestoreAdminClient() >>> - >>> parent = client.parent_path('[PROJECT]', '[DATABASE]', '[COLLECTION_ID]') + >>> # TODO: Initialize `field`: + >>> field = {} >>> - >>> # Iterate over all results - >>> for element in client.list_indexes(parent): - ... # process element - ... pass + >>> response = client.update_field(field) >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() >>> - >>> # Alternatively: + >>> response.add_done_callback(callback) >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_indexes(parent).pages: - ... for element in page: - ... # process element - ... pass + >>> # Handle metadata. + >>> metadata = response.metadata() Args: - parent (str): Required. A parent name of the form - ``projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`` - filter_ (str): The filter to apply to list results. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. + field (Union[dict, ~google.cloud.firestore_admin_v1.types.Field]): Required. The field to be updated. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.firestore_admin_v1.types.Field` + update_mask (Union[dict, ~google.cloud.firestore_admin_v1.types.FieldMask]): A mask, relative to the field. If specified, only configuration + specified by this field_mask will be updated in the field. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.firestore_admin_v1.types.FieldMask` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -370,10 +379,7 @@ def list_indexes( that is provided to the method. Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.firestore_admin_v1.types.Index` instances. - You can also iterate over the pages of the response - using its `pages` property. + A :class:`~google.cloud.firestore_admin_v1.types._OperationFuture` instance. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -383,24 +389,24 @@ def list_indexes( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "list_indexes" not in self._inner_api_calls: + if "update_field" not in self._inner_api_calls: self._inner_api_calls[ - "list_indexes" + "update_field" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_indexes, - default_retry=self._method_configs["ListIndexes"].retry, - default_timeout=self._method_configs["ListIndexes"].timeout, + self.transport.update_field, + default_retry=self._method_configs["UpdateField"].retry, + default_timeout=self._method_configs["UpdateField"].timeout, client_info=self._client_info, ) - request = firestore_admin_pb2.ListIndexesRequest( - parent=parent, filter=filter_, page_size=page_size + request = firestore_admin_pb2.UpdateFieldRequest( + field=field, update_mask=update_mask, ) if metadata is None: metadata = [] metadata = list(metadata) try: - routing_header = [("parent", parent)] + routing_header = [("field.name", field.name)] except AttributeError: pass else: @@ -409,43 +415,58 @@ def list_indexes( ) metadata.append(routing_metadata) - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_indexes"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="indexes", - request_token_field="page_token", - response_token_field="next_page_token", + operation = self._inner_api_calls["update_field"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + return google.api_core.operation.from_gapic( + operation, + self.transport._operations_client, + field_pb2.Field, + metadata_type=operation_pb2.FieldOperationMetadata, ) - return iterator - def get_index( + def create_index( self, - name, + parent, + index, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Gets a composite index. + Creates a composite index. This returns a + ``google.longrunning.Operation`` which may be used to track the status + of the creation. The metadata for the operation will be the type + ``IndexOperationMetadata``. Example: >>> from google.cloud import firestore_admin_v1 >>> >>> client = firestore_admin_v1.FirestoreAdminClient() >>> - >>> name = client.index_path('[PROJECT]', '[DATABASE]', '[COLLECTION_ID]', '[INDEX_ID]') + >>> parent = client.collection_group_path('[PROJECT]', '[DATABASE]', '[COLLECTION]') >>> - >>> response = client.get_index(name) + >>> # TODO: Initialize `index`: + >>> index = {} + >>> + >>> response = client.create_index(parent, index) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() Args: - name (str): Required. A name of the form - ``projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`` + parent (str): Required. A parent name of the form + ``projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`` + index (Union[dict, ~google.cloud.firestore_admin_v1.types.Index]): Required. The composite index to create. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.firestore_admin_v1.types.Index` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -456,7 +477,7 @@ def get_index( that is provided to the method. Returns: - A :class:`~google.cloud.firestore_admin_v1.types.Index` instance. + A :class:`~google.cloud.firestore_admin_v1.types._OperationFuture` instance. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -466,22 +487,22 @@ def get_index( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "get_index" not in self._inner_api_calls: + if "create_index" not in self._inner_api_calls: self._inner_api_calls[ - "get_index" + "create_index" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_index, - default_retry=self._method_configs["GetIndex"].retry, - default_timeout=self._method_configs["GetIndex"].timeout, + self.transport.create_index, + default_retry=self._method_configs["CreateIndex"].retry, + default_timeout=self._method_configs["CreateIndex"].timeout, client_info=self._client_info, ) - request = firestore_admin_pb2.GetIndexRequest(name=name) + request = firestore_admin_pb2.CreateIndexRequest(parent=parent, index=index,) if metadata is None: metadata = [] metadata = list(metadata) try: - routing_header = [("name", name)] + routing_header = [("parent", parent)] except AttributeError: pass else: @@ -490,111 +511,58 @@ def get_index( ) metadata.append(routing_metadata) - return self._inner_api_calls["get_index"]( + operation = self._inner_api_calls["create_index"]( request, retry=retry, timeout=timeout, metadata=metadata ) + return google.api_core.operation.from_gapic( + operation, + self.transport._operations_client, + index_pb2.Index, + metadata_type=operation_pb2.IndexOperationMetadata, + ) - def delete_index( + def list_indexes( self, - name, + parent, + filter_=None, + page_size=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Deletes a composite index. + Lists composite indexes. Example: >>> from google.cloud import firestore_admin_v1 >>> >>> client = firestore_admin_v1.FirestoreAdminClient() >>> - >>> name = client.index_path('[PROJECT]', '[DATABASE]', '[COLLECTION_ID]', '[INDEX_ID]') + >>> parent = client.collection_group_path('[PROJECT]', '[DATABASE]', '[COLLECTION]') >>> - >>> client.delete_index(name) - - Args: - name (str): Required. A name of the form - ``projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_index" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_index" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_index, - default_retry=self._method_configs["DeleteIndex"].retry, - default_timeout=self._method_configs["DeleteIndex"].timeout, - client_info=self._client_info, - ) - - request = firestore_admin_pb2.DeleteIndexRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_index"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def import_documents( - self, - name, - collection_ids=None, - input_uri_prefix=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import firestore_admin_v1 + >>> # Iterate over all results + >>> for element in client.list_indexes(parent): + ... # process element + ... pass >>> - >>> client = firestore_admin_v1.FirestoreAdminClient() >>> - >>> name = client.database_path('[PROJECT]', '[DATABASE]') + >>> # Alternatively: >>> - >>> response = client.import_documents(name) + >>> # Iterate over results one page at a time + >>> for page in client.list_indexes(parent).pages: + ... for element in page: + ... # process element + ... pass Args: - name (str): Required. Database to import into. Should be of the form: - ``projects/{project_id}/databases/{database_id}``. - collection_ids (list[str]): Which collection ids to import. Unspecified means all collections included - in the import. - input_uri_prefix (str): 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``. + parent (str): Required. A parent name of the form + ``projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`` + filter_ (str): The filter to apply to list results. + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -605,7 +573,10 @@ def import_documents( that is provided to the method. Returns: - A :class:`~google.cloud.firestore_admin_v1.types.Operation` instance. + A :class:`~google.api_core.page_iterator.PageIterator` instance. + An iterable of :class:`~google.cloud.firestore_admin_v1.types.Index` instances. + You can also iterate over the pages of the response + using its `pages` property. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -615,24 +586,24 @@ def import_documents( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "import_documents" not in self._inner_api_calls: + if "list_indexes" not in self._inner_api_calls: self._inner_api_calls[ - "import_documents" + "list_indexes" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.import_documents, - default_retry=self._method_configs["ImportDocuments"].retry, - default_timeout=self._method_configs["ImportDocuments"].timeout, + self.transport.list_indexes, + default_retry=self._method_configs["ListIndexes"].retry, + default_timeout=self._method_configs["ListIndexes"].timeout, client_info=self._client_info, ) - request = firestore_admin_pb2.ImportDocumentsRequest( - name=name, collection_ids=collection_ids, input_uri_prefix=input_uri_prefix + request = firestore_admin_pb2.ListIndexesRequest( + parent=parent, filter=filter_, page_size=page_size, ) if metadata is None: metadata = [] metadata = list(metadata) try: - routing_header = [("name", name)] + routing_header = [("parent", parent)] except AttributeError: pass else: @@ -641,50 +612,43 @@ def import_documents( ) metadata.append(routing_metadata) - return self._inner_api_calls["import_documents"]( - request, retry=retry, timeout=timeout, metadata=metadata + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._inner_api_calls["list_indexes"], + retry=retry, + timeout=timeout, + metadata=metadata, + ), + request=request, + items_field="indexes", + request_token_field="page_token", + response_token_field="next_page_token", ) + return iterator - def export_documents( + def get_index( self, name, - collection_ids=None, - output_uri_prefix=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - 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. + Gets a composite index. Example: >>> from google.cloud import firestore_admin_v1 >>> >>> client = firestore_admin_v1.FirestoreAdminClient() >>> - >>> name = client.database_path('[PROJECT]', '[DATABASE]') + >>> name = client.index_path('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]') >>> - >>> response = client.export_documents(name) + >>> response = client.get_index(name) Args: - name (str): Required. Database to export. Should be of the form: - ``projects/{project_id}/databases/{database_id}``. - collection_ids (list[str]): Which collection ids to export. Unspecified means all collections. - output_uri_prefix (str): 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. + name (str): Required. A name of the form + ``projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -695,7 +659,7 @@ def export_documents( that is provided to the method. Returns: - A :class:`~google.cloud.firestore_admin_v1.types.Operation` instance. + A :class:`~google.cloud.firestore_admin_v1.types.Index` instance. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -705,21 +669,17 @@ def export_documents( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "export_documents" not in self._inner_api_calls: + if "get_index" not in self._inner_api_calls: self._inner_api_calls[ - "export_documents" + "get_index" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.export_documents, - default_retry=self._method_configs["ExportDocuments"].retry, - default_timeout=self._method_configs["ExportDocuments"].timeout, + self.transport.get_index, + default_retry=self._method_configs["GetIndex"].retry, + default_timeout=self._method_configs["GetIndex"].timeout, client_info=self._client_info, ) - request = firestore_admin_pb2.ExportDocumentsRequest( - name=name, - collection_ids=collection_ids, - output_uri_prefix=output_uri_prefix, - ) + request = firestore_admin_pb2.GetIndexRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -733,7 +693,7 @@ def export_documents( ) metadata.append(routing_metadata) - return self._inner_api_calls["export_documents"]( + return self._inner_api_calls["get_index"]( request, retry=retry, timeout=timeout, metadata=metadata ) @@ -752,7 +712,7 @@ def get_field( >>> >>> client = firestore_admin_v1.FirestoreAdminClient() >>> - >>> name = client.field_path('[PROJECT]', '[DATABASE]', '[COLLECTION_ID]', '[FIELD_ID]') + >>> name = client.field_path('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[FIELD]') >>> >>> response = client.get_field(name) @@ -789,7 +749,7 @@ def get_field( client_info=self._client_info, ) - request = firestore_admin_pb2.GetFieldRequest(name=name) + request = firestore_admin_pb2.GetFieldRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -829,7 +789,7 @@ def list_fields( >>> >>> client = firestore_admin_v1.FirestoreAdminClient() >>> - >>> parent = client.parent_path('[PROJECT]', '[DATABASE]', '[COLLECTION_ID]') + >>> parent = client.collection_group_path('[PROJECT]', '[DATABASE]', '[COLLECTION]') >>> >>> # Iterate over all results >>> for element in client.list_fields(parent): @@ -892,7 +852,7 @@ def list_fields( ) request = firestore_admin_pb2.ListFieldsRequest( - parent=parent, filter=filter_, page_size=page_size + parent=parent, filter=filter_, page_size=page_size, ) if metadata is None: metadata = [] @@ -922,49 +882,156 @@ def list_fields( ) return iterator - def update_field( + def export_documents( self, - field, - update_mask=None, + name, + collection_ids=None, + output_uri_prefix=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Updates a field configuration. Currently, field updates apply only to - single field index configuration. However, calls to - ``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`` which may be used - to track the status of the field update. The metadata for the operation - will be the type ``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/*``. + 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. Example: >>> from google.cloud import firestore_admin_v1 >>> >>> client = firestore_admin_v1.FirestoreAdminClient() >>> - >>> # TODO: Initialize `field`: - >>> field = {} + >>> name = client.database_path('[PROJECT]', '[DATABASE]') >>> - >>> response = client.update_field(field) + >>> response = client.export_documents(name) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() Args: - field (Union[dict, ~google.cloud.firestore_admin_v1.types.Field]): Required. The field to be updated. + name (str): Required. Database to export. Should be of the form: + ``projects/{project_id}/databases/{database_id}``. + collection_ids (list[str]): Which collection ids to export. Unspecified means all collections. + output_uri_prefix (str): 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. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_admin_v1.types.Field` - update_mask (Union[dict, ~google.cloud.firestore_admin_v1.types.FieldMask]): A mask, relative to the field. If specified, only configuration - specified by this field\_mask will be updated in the field. + Returns: + A :class:`~google.cloud.firestore_admin_v1.types._OperationFuture` instance. - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_admin_v1.types.FieldMask` + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "export_documents" not in self._inner_api_calls: + self._inner_api_calls[ + "export_documents" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.export_documents, + default_retry=self._method_configs["ExportDocuments"].retry, + default_timeout=self._method_configs["ExportDocuments"].timeout, + client_info=self._client_info, + ) + + request = firestore_admin_pb2.ExportDocumentsRequest( + name=name, + collection_ids=collection_ids, + output_uri_prefix=output_uri_prefix, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + operation = self._inner_api_calls["export_documents"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + return google.api_core.operation.from_gapic( + operation, + self.transport._operations_client, + operation_pb2.ExportDocumentsResponse, + metadata_type=operation_pb2.ExportDocumentsMetadata, + ) + + def import_documents( + self, + name, + collection_ids=None, + input_uri_prefix=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + 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. + + Example: + >>> from google.cloud import firestore_admin_v1 + >>> + >>> client = firestore_admin_v1.FirestoreAdminClient() + >>> + >>> name = client.database_path('[PROJECT]', '[DATABASE]') + >>> + >>> response = client.import_documents(name) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + name (str): Required. Database to import into. Should be of the form: + ``projects/{project_id}/databases/{database_id}``. + collection_ids (list[str]): Which collection ids to import. Unspecified means all collections included + in the import. + input_uri_prefix (str): 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``. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -975,7 +1042,7 @@ def update_field( that is provided to the method. Returns: - A :class:`~google.cloud.firestore_admin_v1.types.Operation` instance. + A :class:`~google.cloud.firestore_admin_v1.types._OperationFuture` instance. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -985,24 +1052,24 @@ def update_field( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "update_field" not in self._inner_api_calls: + if "import_documents" not in self._inner_api_calls: self._inner_api_calls[ - "update_field" + "import_documents" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_field, - default_retry=self._method_configs["UpdateField"].retry, - default_timeout=self._method_configs["UpdateField"].timeout, + self.transport.import_documents, + default_retry=self._method_configs["ImportDocuments"].retry, + default_timeout=self._method_configs["ImportDocuments"].timeout, client_info=self._client_info, ) - request = firestore_admin_pb2.UpdateFieldRequest( - field=field, update_mask=update_mask + request = firestore_admin_pb2.ImportDocumentsRequest( + name=name, collection_ids=collection_ids, input_uri_prefix=input_uri_prefix, ) if metadata is None: metadata = [] metadata = list(metadata) try: - routing_header = [("field.name", field.name)] + routing_header = [("name", name)] except AttributeError: pass else: @@ -1011,6 +1078,12 @@ def update_field( ) metadata.append(routing_metadata) - return self._inner_api_calls["update_field"]( + operation = self._inner_api_calls["import_documents"]( request, retry=retry, timeout=timeout, metadata=metadata ) + return google.api_core.operation.from_gapic( + operation, + self.transport._operations_client, + empty_pb2.Empty, + metadata_type=operation_pb2.ImportDocumentsMetadata, + ) diff --git a/google/cloud/firestore_admin_v1/gapic/firestore_admin_client_config.py b/google/cloud/firestore_admin_v1/gapic/firestore_admin_client_config.py index f073ae456..c9d1077c5 100644 --- a/google/cloud/firestore_admin_v1/gapic/firestore_admin_client_config.py +++ b/google/cloud/firestore_admin_v1/gapic/firestore_admin_client_config.py @@ -4,6 +4,7 @@ "retry_codes": { "idempotent": ["DEADLINE_EXCEEDED", "INTERNAL", "UNAVAILABLE"], "non_idempotent": [], + "idempotent2": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], }, "retry_params": { "default": { @@ -17,47 +18,47 @@ } }, "methods": { - "CreateIndex": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListIndexes": { + "DeleteIndex": { "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, - "GetIndex": { + "UpdateField": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, - "DeleteIndex": { + "CreateIndex": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, - "ImportDocuments": { + "ListIndexes": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "idempotent2", "retry_params_name": "default", }, - "ExportDocuments": { + "GetIndex": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "idempotent2", "retry_params_name": "default", }, "GetField": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "idempotent2", "retry_params_name": "default", }, "ListFields": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "idempotent2", "retry_params_name": "default", }, - "UpdateField": { + "ExportDocuments": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "ImportDocuments": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default", diff --git a/google/cloud/firestore_admin_v1/gapic/transports/firestore_admin_grpc_transport.py b/google/cloud/firestore_admin_v1/gapic/transports/firestore_admin_grpc_transport.py index f1bdc0171..ff9e62f44 100644 --- a/google/cloud/firestore_admin_v1/gapic/transports/firestore_admin_grpc_transport.py +++ b/google/cloud/firestore_admin_v1/gapic/transports/firestore_admin_grpc_transport.py @@ -16,6 +16,7 @@ import google.api_core.grpc_helpers +import google.api_core.operations_v1 from google.cloud.firestore_admin_v1.proto import firestore_admin_pb2_grpc @@ -56,7 +57,7 @@ def __init__( # exception (channels come with credentials baked in already). if channel is not None and credentials is not None: raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." + "The `channel` and `credentials` arguments are mutually " "exclusive.", ) # Create the channel. @@ -75,9 +76,18 @@ def __init__( # gRPC uses objects called "stubs" that are bound to the # channel and provide a basic method for each RPC. self._stubs = { - "firestore_admin_stub": firestore_admin_pb2_grpc.FirestoreAdminStub(channel) + "firestore_admin_stub": firestore_admin_pb2_grpc.FirestoreAdminStub( + channel + ), } + # Because this API includes a method that returns a + # long-running operation (proto: google.longrunning.Operation), + # instantiate an LRO client. + self._operations_client = google.api_core.operations_v1.OperationsClient( + channel + ) + @classmethod def create_channel( cls, address="firestore.googleapis.com:443", credentials=None, **kwargs @@ -111,96 +121,84 @@ def channel(self): return self._channel @property - def create_index(self): - """Return the gRPC stub for :meth:`FirestoreAdminClient.create_index`. + def delete_index(self): + """Return the gRPC stub for :meth:`FirestoreAdminClient.delete_index`. - Creates a composite index. This returns a - ``google.longrunning.Operation`` which may be used to track the status - of the creation. The metadata for the operation will be the type - ``IndexOperationMetadata``. + Deletes a composite index. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_admin_stub"].CreateIndex + return self._stubs["firestore_admin_stub"].DeleteIndex @property - def list_indexes(self): - """Return the gRPC stub for :meth:`FirestoreAdminClient.list_indexes`. - - Lists composite indexes. + def update_field(self): + """Return the gRPC stub for :meth:`FirestoreAdminClient.update_field`. - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["firestore_admin_stub"].ListIndexes + Updates a field configuration. Currently, field updates apply only + to single field index configuration. However, calls to + ``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" }``. - @property - def get_index(self): - """Return the gRPC stub for :meth:`FirestoreAdminClient.get_index`. + This call returns a ``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``. - Gets a composite index. + 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/*``. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_admin_stub"].GetIndex + return self._stubs["firestore_admin_stub"].UpdateField @property - def delete_index(self): - """Return the gRPC stub for :meth:`FirestoreAdminClient.delete_index`. + def create_index(self): + """Return the gRPC stub for :meth:`FirestoreAdminClient.create_index`. - Deletes a composite index. + Creates a composite index. This returns a + ``google.longrunning.Operation`` which may be used to track the status + of the creation. The metadata for the operation will be the type + ``IndexOperationMetadata``. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_admin_stub"].DeleteIndex + return self._stubs["firestore_admin_stub"].CreateIndex @property - def import_documents(self): - """Return the gRPC stub for :meth:`FirestoreAdminClient.import_documents`. + def list_indexes(self): + """Return the gRPC stub for :meth:`FirestoreAdminClient.list_indexes`. - 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. + Lists composite indexes. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_admin_stub"].ImportDocuments + return self._stubs["firestore_admin_stub"].ListIndexes @property - def export_documents(self): - """Return the gRPC stub for :meth:`FirestoreAdminClient.export_documents`. + def get_index(self): + """Return the gRPC stub for :meth:`FirestoreAdminClient.get_index`. - 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. + Gets a composite index. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_admin_stub"].ExportDocuments + return self._stubs["firestore_admin_stub"].GetIndex @property def get_field(self): @@ -234,26 +232,38 @@ def list_fields(self): return self._stubs["firestore_admin_stub"].ListFields @property - def update_field(self): - """Return the gRPC stub for :meth:`FirestoreAdminClient.update_field`. + def export_documents(self): + """Return the gRPC stub for :meth:`FirestoreAdminClient.export_documents`. - Updates a field configuration. Currently, field updates apply only to - single field index configuration. However, calls to - ``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" }``. + 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. - This call returns a ``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``. + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["firestore_admin_stub"].ExportDocuments - 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/*``. + @property + def import_documents(self): + """Return the gRPC stub for :meth:`FirestoreAdminClient.import_documents`. + + 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. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_admin_stub"].UpdateField + return self._stubs["firestore_admin_stub"].ImportDocuments diff --git a/google/cloud/firestore_admin_v1/proto/field.proto b/google/cloud/firestore_admin_v1/proto/field.proto index 48430d87c..1b9b99cf3 100644 --- a/google/cloud/firestore_admin_v1/proto/field.proto +++ b/google/cloud/firestore_admin_v1/proto/field.proto @@ -28,6 +28,7 @@ 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"; +option ruby_package = "Google::Cloud::Firestore::Admin::V1"; // Represents a single field in the database. // diff --git a/google/cloud/firestore_admin_v1/proto/field_pb2.py b/google/cloud/firestore_admin_v1/proto/field_pb2.py index 281ac78d8..667863351 100644 --- a/google/cloud/firestore_admin_v1/proto/field_pb2.py +++ b/google/cloud/firestore_admin_v1/proto/field_pb2.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/firestore/admin_v1/proto/field.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +# source: google/cloud/firestore_admin_v1/proto/field.proto +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -17,24 +14,21 @@ from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 from google.cloud.firestore_admin_v1.proto import ( - index_pb2 as google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2, + index_pb2 as google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_index__pb2, ) from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/firestore/admin_v1/proto/field.proto", + name="google/cloud/firestore_admin_v1/proto/field.proto", package="google.firestore.admin.v1", syntax="proto3", - serialized_options=_b( - "\n\035com.google.firestore.admin.v1B\nFieldProtoP\001Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\242\002\004GCFS\252\002\037Google.Cloud.Firestore.Admin.V1\312\002\037Google\\Cloud\\Firestore\\Admin\\V1" - ), - serialized_pb=_b( - '\n1google/cloud/firestore/admin_v1/proto/field.proto\x12\x19google.firestore.admin.v1\x1a\x19google/api/resource.proto\x1a\x31google/cloud/firestore/admin_v1/proto/index.proto\x1a\x1cgoogle/api/annotations.proto"\xe0\x02\n\x05\x46ield\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x42\n\x0cindex_config\x18\x02 \x01(\x0b\x32,.google.firestore.admin.v1.Field.IndexConfig\x1a\x89\x01\n\x0bIndexConfig\x12\x31\n\x07indexes\x18\x01 \x03(\x0b\x32 .google.firestore.admin.v1.Index\x12\x1c\n\x14uses_ancestor_config\x18\x02 \x01(\x08\x12\x16\n\x0e\x61ncestor_field\x18\x03 \x01(\t\x12\x11\n\treverting\x18\x04 \x01(\x08:y\xea\x41v\n\x1e\x66irestore.googleapis.com/Field\x12Tprojects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field}B\xb8\x01\n\x1d\x63om.google.firestore.admin.v1B\nFieldProtoP\x01Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1b\x06proto3' - ), + serialized_options=b"\n\035com.google.firestore.admin.v1B\nFieldProtoP\001Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\242\002\004GCFS\252\002\037Google.Cloud.Firestore.Admin.V1\312\002\037Google\\Cloud\\Firestore\\Admin\\V1\352\002#Google::Cloud::Firestore::Admin::V1", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n1google/cloud/firestore_admin_v1/proto/field.proto\x12\x19google.firestore.admin.v1\x1a\x19google/api/resource.proto\x1a\x31google/cloud/firestore_admin_v1/proto/index.proto\x1a\x1cgoogle/api/annotations.proto"\xe0\x02\n\x05\x46ield\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x42\n\x0cindex_config\x18\x02 \x01(\x0b\x32,.google.firestore.admin.v1.Field.IndexConfig\x1a\x89\x01\n\x0bIndexConfig\x12\x31\n\x07indexes\x18\x01 \x03(\x0b\x32 .google.firestore.admin.v1.Index\x12\x1c\n\x14uses_ancestor_config\x18\x02 \x01(\x08\x12\x16\n\x0e\x61ncestor_field\x18\x03 \x01(\t\x12\x11\n\treverting\x18\x04 \x01(\x08:y\xea\x41v\n\x1e\x66irestore.googleapis.com/Field\x12Tprojects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field}B\xde\x01\n\x1d\x63om.google.firestore.admin.v1B\nFieldProtoP\x01Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1b\x06proto3', dependencies=[ google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2.DESCRIPTOR, + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_index__pb2.DESCRIPTOR, google_dot_api_dot_annotations__pb2.DESCRIPTOR, ], ) @@ -46,6 +40,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="indexes", @@ -64,6 +59,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="uses_ancestor_config", @@ -82,6 +78,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="ancestor_field", @@ -92,7 +89,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -100,6 +97,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="reverting", @@ -118,6 +116,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -138,6 +137,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -148,7 +148,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -156,6 +156,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="index_config", @@ -174,14 +175,13 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], - nested_types=[_FIELD_INDEXCONFIG], + nested_types=[_FIELD_INDEXCONFIG,], enum_types=[], - serialized_options=_b( - "\352Av\n\036firestore.googleapis.com/Field\022Tprojects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field}" - ), + serialized_options=b"\352Av\n\036firestore.googleapis.com/Field\022Tprojects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field}", is_extendable=False, syntax="proto3", extension_ranges=[], @@ -193,7 +193,7 @@ _FIELD_INDEXCONFIG.fields_by_name[ "indexes" ].message_type = ( - google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2._INDEX + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_index__pb2._INDEX ) _FIELD_INDEXCONFIG.containing_type = _FIELD _FIELD.fields_by_name["index_config"].message_type = _FIELD_INDEXCONFIG @@ -203,62 +203,59 @@ Field = _reflection.GeneratedProtocolMessageType( "Field", (_message.Message,), - dict( - IndexConfig=_reflection.GeneratedProtocolMessageType( + { + "IndexConfig": _reflection.GeneratedProtocolMessageType( "IndexConfig", (_message.Message,), - dict( - DESCRIPTOR=_FIELD_INDEXCONFIG, - __module__="google.cloud.firestore.admin_v1.proto.field_pb2", - __doc__="""The index configuration for this field. - + { + "DESCRIPTOR": _FIELD_INDEXCONFIG, + "__module__": "google.cloud.firestore_admin_v1.proto.field_pb2", + "__doc__": """The index configuration for this field. Attributes: indexes: The indexes supported for this field. uses_ancestor_config: - 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 + 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. ancestor_field: Output only. Specifies the resource name of the ``Field`` from - which this field's index configuration is set (when + 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). reverting: - Output only When true, the ``Field``'s index configuration is - in the process of being reverted. Once complete, the index + 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``. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.Field.IndexConfig) - ), + }, ), - DESCRIPTOR=_FIELD, - __module__="google.cloud.firestore.admin_v1.proto.field_pb2", - __doc__="""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. - + "DESCRIPTOR": _FIELD, + "__module__": "google.cloud.firestore_admin_v1.proto.field_pb2", + "__doc__": """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. Attributes: name: A field name of the form ``projects/{project_id}/databases/{da tabase_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 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 + paths that must be quoted include:``\ \*\ ``,``.\ :literal:`, + ``` (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 @@ -266,7 +263,7 @@ ``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/{d + field’s resource name is: ``projects/{project_id}/databases/{d atabase_id}/collectionGroups/__default__/fields/*`` Indexes defined on this ``Field`` will be applied to all fields which do not have their own ``Field`` index configuration. @@ -277,7 +274,7 @@ field, specify an index config with an empty list of indexes. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.Field) - ), + }, ) _sym_db.RegisterMessage(Field) _sym_db.RegisterMessage(Field.IndexConfig) diff --git a/google/cloud/firestore_admin_v1/proto/field_pb2_grpc.py b/google/cloud/firestore_admin_v1/proto/field_pb2_grpc.py index 07cb78fe0..8a9393943 100644 --- a/google/cloud/firestore_admin_v1/proto/field_pb2_grpc.py +++ b/google/cloud/firestore_admin_v1/proto/field_pb2_grpc.py @@ -1,2 +1,3 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc diff --git a/google/cloud/firestore_admin_v1/proto/firestore_admin.proto b/google/cloud/firestore_admin_v1/proto/firestore_admin.proto index 75dd2d311..c3eb58f9c 100644 --- a/google/cloud/firestore_admin_v1/proto/firestore_admin.proto +++ b/google/cloud/firestore_admin_v1/proto/firestore_admin.proto @@ -34,6 +34,7 @@ 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"; +option ruby_package = "Google::Cloud::Firestore::Admin::V1"; option (google.api.resource_definition) = { type: "firestore.googleapis.com/Database" pattern: "projects/{project}/databases/{database}" diff --git a/google/cloud/firestore_admin_v1/proto/firestore_admin_pb2.py b/google/cloud/firestore_admin_v1/proto/firestore_admin_pb2.py index 0737cfd86..d346ca8e0 100644 --- a/google/cloud/firestore_admin_v1/proto/firestore_admin_pb2.py +++ b/google/cloud/firestore_admin_v1/proto/firestore_admin_pb2.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/firestore/admin_v1/proto/firestore_admin.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +# source: google/cloud/firestore_admin_v1/proto/firestore_admin.proto +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -20,10 +17,10 @@ from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 from google.cloud.firestore_admin_v1.proto import ( - field_pb2 as google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_field__pb2, + field_pb2 as google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_field__pb2, ) from google.cloud.firestore_admin_v1.proto import ( - index_pb2 as google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2, + index_pb2 as google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_index__pb2, ) from google.longrunning import ( operations_pb2 as google_dot_longrunning_dot_operations__pb2, @@ -33,22 +30,19 @@ DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/firestore/admin_v1/proto/firestore_admin.proto", + name="google/cloud/firestore_admin_v1/proto/firestore_admin.proto", package="google.firestore.admin.v1", syntax="proto3", - serialized_options=_b( - "\n\035com.google.firestore.admin.v1B\023FirestoreAdminProtoP\001Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\242\002\004GCFS\252\002\037Google.Cloud.Firestore.Admin.V1\312\002\037Google\\Cloud\\Firestore\\Admin\\V1\352AL\n!firestore.googleapis.com/Database\022'projects/{project}/databases/{database}\352Aq\n(firestore.googleapis.com/CollectionGroup\022Eprojects/{project}/databases/{database}/collectionGroups/{collection}" - ), - serialized_pb=_b( - '\n;google/cloud/firestore/admin_v1/proto/firestore_admin.proto\x12\x19google.firestore.admin.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x31google/cloud/firestore/admin_v1/proto/field.proto\x1a\x31google/cloud/firestore/admin_v1/proto/index.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\x8c\x01\n\x12\x43reateIndexRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(firestore.googleapis.com/CollectionGroup\x12\x34\n\x05index\x18\x02 \x01(\x0b\x32 .google.firestore.admin.v1.IndexB\x03\xe0\x41\x02"\x8d\x01\n\x12ListIndexesRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(firestore.googleapis.com/CollectionGroup\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"a\n\x13ListIndexesResponse\x12\x31\n\x07indexes\x18\x01 \x03(\x0b\x32 .google.firestore.admin.v1.Index\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"G\n\x0fGetIndexRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x66irestore.googleapis.com/Index"J\n\x12\x44\x65leteIndexRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x66irestore.googleapis.com/Index"{\n\x12UpdateFieldRequest\x12\x34\n\x05\x66ield\x18\x01 \x01(\x0b\x32 .google.firestore.admin.v1.FieldB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"G\n\x0fGetFieldRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x66irestore.googleapis.com/Field"\x8c\x01\n\x11ListFieldsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(firestore.googleapis.com/CollectionGroup\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"_\n\x12ListFieldsResponse\x12\x30\n\x06\x66ields\x18\x01 \x03(\x0b\x32 .google.firestore.admin.v1.Field\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x84\x01\n\x16\x45xportDocumentsRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Database\x12\x16\n\x0e\x63ollection_ids\x18\x02 \x03(\t\x12\x19\n\x11output_uri_prefix\x18\x03 \x01(\t"\x83\x01\n\x16ImportDocumentsRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Database\x12\x16\n\x0e\x63ollection_ids\x18\x02 \x03(\t\x12\x18\n\x10input_uri_prefix\x18\x03 \x01(\t2\xf5\x0e\n\x0e\x46irestoreAdmin\x12\xdb\x01\n\x0b\x43reateIndex\x12-.google.firestore.admin.v1.CreateIndexRequest\x1a\x1d.google.longrunning.Operation"~\x82\xd3\xe4\x93\x02G">/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes:\x05index\xda\x41\x0cparent,index\xca\x41\x1f\n\x05Index\x12\x16IndexOperationMetadata\x12\xbd\x01\n\x0bListIndexes\x12-.google.firestore.admin.v1.ListIndexesRequest\x1a..google.firestore.admin.v1.ListIndexesResponse"O\x82\xd3\xe4\x93\x02@\x12>/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes\xda\x41\x06parent\x12\xa7\x01\n\x08GetIndex\x12*.google.firestore.admin.v1.GetIndexRequest\x1a .google.firestore.admin.v1.Index"M\x82\xd3\xe4\x93\x02@\x12>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}\xda\x41\x04name\x12\xa3\x01\n\x0b\x44\x65leteIndex\x12-.google.firestore.admin.v1.DeleteIndexRequest\x1a\x16.google.protobuf.Empty"M\x82\xd3\xe4\x93\x02@*>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}\xda\x41\x04name\x12\xa6\x01\n\x08GetField\x12*.google.firestore.admin.v1.GetFieldRequest\x1a .google.firestore.admin.v1.Field"L\x82\xd3\xe4\x93\x02?\x12=/v1/{name=projects/*/databases/*/collectionGroups/*/fields/*}\xda\x41\x04name\x12\xd9\x01\n\x0bUpdateField\x12-.google.firestore.admin.v1.UpdateFieldRequest\x1a\x1d.google.longrunning.Operation"|\x82\xd3\xe4\x93\x02L2C/v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}:\x05\x66ield\xda\x41\x05\x66ield\xca\x41\x1f\n\x05\x46ield\x12\x16\x46ieldOperationMetadata\x12\xb9\x01\n\nListFields\x12,.google.firestore.admin.v1.ListFieldsRequest\x1a-.google.firestore.admin.v1.ListFieldsResponse"N\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/databases/*/collectionGroups/*}/fields\xda\x41\x06parent\x12\xdd\x01\n\x0f\x45xportDocuments\x12\x31.google.firestore.admin.v1.ExportDocumentsRequest\x1a\x1d.google.longrunning.Operation"x\x82\xd3\xe4\x93\x02\x36"1/v1/{name=projects/*/databases/*}:exportDocuments:\x01*\xda\x41\x04name\xca\x41\x32\n\x17\x45xportDocumentsResponse\x12\x17\x45xportDocumentsMetadata\x12\xdb\x01\n\x0fImportDocuments\x12\x31.google.firestore.admin.v1.ImportDocumentsRequest\x1a\x1d.google.longrunning.Operation"v\x82\xd3\xe4\x93\x02\x36"1/v1/{name=projects/*/databases/*}:importDocuments:\x01*\xda\x41\x04name\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17ImportDocumentsMetadata\x1av\xca\x41\x18\x66irestore.googleapis.com\xd2\x41Xhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastoreB\x84\x03\n\x1d\x63om.google.firestore.admin.v1B\x13\x46irestoreAdminProtoP\x01Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x41L\n!firestore.googleapis.com/Database\x12\'projects/{project}/databases/{database}\xea\x41q\n(firestore.googleapis.com/CollectionGroup\x12\x45projects/{project}/databases/{database}/collectionGroups/{collection}b\x06proto3' - ), + serialized_options=b"\n\035com.google.firestore.admin.v1B\023FirestoreAdminProtoP\001Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\242\002\004GCFS\252\002\037Google.Cloud.Firestore.Admin.V1\312\002\037Google\\Cloud\\Firestore\\Admin\\V1\352\002#Google::Cloud::Firestore::Admin::V1\352AL\n!firestore.googleapis.com/Database\022'projects/{project}/databases/{database}\352Aq\n(firestore.googleapis.com/CollectionGroup\022Eprojects/{project}/databases/{database}/collectionGroups/{collection}", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n;google/cloud/firestore_admin_v1/proto/firestore_admin.proto\x12\x19google.firestore.admin.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x31google/cloud/firestore_admin_v1/proto/field.proto\x1a\x31google/cloud/firestore_admin_v1/proto/index.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\x8c\x01\n\x12\x43reateIndexRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(firestore.googleapis.com/CollectionGroup\x12\x34\n\x05index\x18\x02 \x01(\x0b\x32 .google.firestore.admin.v1.IndexB\x03\xe0\x41\x02"\x8d\x01\n\x12ListIndexesRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(firestore.googleapis.com/CollectionGroup\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"a\n\x13ListIndexesResponse\x12\x31\n\x07indexes\x18\x01 \x03(\x0b\x32 .google.firestore.admin.v1.Index\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"G\n\x0fGetIndexRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x66irestore.googleapis.com/Index"J\n\x12\x44\x65leteIndexRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x66irestore.googleapis.com/Index"{\n\x12UpdateFieldRequest\x12\x34\n\x05\x66ield\x18\x01 \x01(\x0b\x32 .google.firestore.admin.v1.FieldB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"G\n\x0fGetFieldRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x66irestore.googleapis.com/Field"\x8c\x01\n\x11ListFieldsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(firestore.googleapis.com/CollectionGroup\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"_\n\x12ListFieldsResponse\x12\x30\n\x06\x66ields\x18\x01 \x03(\x0b\x32 .google.firestore.admin.v1.Field\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x84\x01\n\x16\x45xportDocumentsRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Database\x12\x16\n\x0e\x63ollection_ids\x18\x02 \x03(\t\x12\x19\n\x11output_uri_prefix\x18\x03 \x01(\t"\x83\x01\n\x16ImportDocumentsRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!firestore.googleapis.com/Database\x12\x16\n\x0e\x63ollection_ids\x18\x02 \x03(\t\x12\x18\n\x10input_uri_prefix\x18\x03 \x01(\t2\xf5\x0e\n\x0e\x46irestoreAdmin\x12\xdb\x01\n\x0b\x43reateIndex\x12-.google.firestore.admin.v1.CreateIndexRequest\x1a\x1d.google.longrunning.Operation"~\x82\xd3\xe4\x93\x02G">/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes:\x05index\xda\x41\x0cparent,index\xca\x41\x1f\n\x05Index\x12\x16IndexOperationMetadata\x12\xbd\x01\n\x0bListIndexes\x12-.google.firestore.admin.v1.ListIndexesRequest\x1a..google.firestore.admin.v1.ListIndexesResponse"O\x82\xd3\xe4\x93\x02@\x12>/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes\xda\x41\x06parent\x12\xa7\x01\n\x08GetIndex\x12*.google.firestore.admin.v1.GetIndexRequest\x1a .google.firestore.admin.v1.Index"M\x82\xd3\xe4\x93\x02@\x12>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}\xda\x41\x04name\x12\xa3\x01\n\x0b\x44\x65leteIndex\x12-.google.firestore.admin.v1.DeleteIndexRequest\x1a\x16.google.protobuf.Empty"M\x82\xd3\xe4\x93\x02@*>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}\xda\x41\x04name\x12\xa6\x01\n\x08GetField\x12*.google.firestore.admin.v1.GetFieldRequest\x1a .google.firestore.admin.v1.Field"L\x82\xd3\xe4\x93\x02?\x12=/v1/{name=projects/*/databases/*/collectionGroups/*/fields/*}\xda\x41\x04name\x12\xd9\x01\n\x0bUpdateField\x12-.google.firestore.admin.v1.UpdateFieldRequest\x1a\x1d.google.longrunning.Operation"|\x82\xd3\xe4\x93\x02L2C/v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}:\x05\x66ield\xda\x41\x05\x66ield\xca\x41\x1f\n\x05\x46ield\x12\x16\x46ieldOperationMetadata\x12\xb9\x01\n\nListFields\x12,.google.firestore.admin.v1.ListFieldsRequest\x1a-.google.firestore.admin.v1.ListFieldsResponse"N\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/databases/*/collectionGroups/*}/fields\xda\x41\x06parent\x12\xdd\x01\n\x0f\x45xportDocuments\x12\x31.google.firestore.admin.v1.ExportDocumentsRequest\x1a\x1d.google.longrunning.Operation"x\x82\xd3\xe4\x93\x02\x36"1/v1/{name=projects/*/databases/*}:exportDocuments:\x01*\xda\x41\x04name\xca\x41\x32\n\x17\x45xportDocumentsResponse\x12\x17\x45xportDocumentsMetadata\x12\xdb\x01\n\x0fImportDocuments\x12\x31.google.firestore.admin.v1.ImportDocumentsRequest\x1a\x1d.google.longrunning.Operation"v\x82\xd3\xe4\x93\x02\x36"1/v1/{name=projects/*/databases/*}:importDocuments:\x01*\xda\x41\x04name\xca\x41\x30\n\x15google.protobuf.Empty\x12\x17ImportDocumentsMetadata\x1av\xca\x41\x18\x66irestore.googleapis.com\xd2\x41Xhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastoreB\xaa\x03\n\x1d\x63om.google.firestore.admin.v1B\x13\x46irestoreAdminProtoP\x01Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1\xea\x41L\n!firestore.googleapis.com/Database\x12\'projects/{project}/databases/{database}\xea\x41q\n(firestore.googleapis.com/CollectionGroup\x12\x45projects/{project}/databases/{database}/collectionGroups/{collection}b\x06proto3', dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, google_dot_api_dot_client__pb2.DESCRIPTOR, google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_field__pb2.DESCRIPTOR, - google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2.DESCRIPTOR, + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_field__pb2.DESCRIPTOR, + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_index__pb2.DESCRIPTOR, google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, @@ -62,6 +56,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="parent", @@ -72,16 +67,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A*\n(firestore.googleapis.com/CollectionGroup" - ), + serialized_options=b"\340A\002\372A*\n(firestore.googleapis.com/CollectionGroup", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="index", @@ -98,8 +92,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -121,6 +116,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="parent", @@ -131,16 +127,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A*\n(firestore.googleapis.com/CollectionGroup" - ), + serialized_options=b"\340A\002\372A*\n(firestore.googleapis.com/CollectionGroup", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="filter", @@ -151,7 +146,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -159,6 +154,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="page_size", @@ -177,6 +173,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="page_token", @@ -187,7 +184,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -195,6 +192,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -216,6 +214,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="indexes", @@ -234,6 +233,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="next_page_token", @@ -244,7 +244,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -252,6 +252,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -273,6 +274,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -283,17 +285,16 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A \n\036firestore.googleapis.com/Index" - ), + serialized_options=b"\340A\002\372A \n\036firestore.googleapis.com/Index", file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -314,6 +315,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -324,17 +326,16 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A \n\036firestore.googleapis.com/Index" - ), + serialized_options=b"\340A\002\372A \n\036firestore.googleapis.com/Index", file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -355,6 +356,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="field", @@ -371,8 +373,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="update_mask", @@ -391,6 +394,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -412,6 +416,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -422,17 +427,16 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A \n\036firestore.googleapis.com/Field" - ), + serialized_options=b"\340A\002\372A \n\036firestore.googleapis.com/Field", file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -453,6 +457,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="parent", @@ -463,16 +468,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A*\n(firestore.googleapis.com/CollectionGroup" - ), + serialized_options=b"\340A\002\372A*\n(firestore.googleapis.com/CollectionGroup", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="filter", @@ -483,7 +487,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -491,6 +495,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="page_size", @@ -509,6 +514,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="page_token", @@ -519,7 +525,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -527,6 +533,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -548,6 +555,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="fields", @@ -566,6 +574,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="next_page_token", @@ -576,7 +585,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -584,6 +593,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -605,6 +615,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -615,16 +626,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!firestore.googleapis.com/Database" - ), + serialized_options=b"\340A\002\372A#\n!firestore.googleapis.com/Database", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="collection_ids", @@ -643,6 +653,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="output_uri_prefix", @@ -653,7 +664,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -661,6 +672,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -682,6 +694,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -692,16 +705,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!firestore.googleapis.com/Database" - ), + serialized_options=b"\340A\002\372A#\n!firestore.googleapis.com/Database", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="collection_ids", @@ -720,6 +732,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="input_uri_prefix", @@ -730,7 +743,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -738,6 +751,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -755,17 +769,17 @@ _CREATEINDEXREQUEST.fields_by_name[ "index" ].message_type = ( - google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2._INDEX + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_index__pb2._INDEX ) _LISTINDEXESRESPONSE.fields_by_name[ "indexes" ].message_type = ( - google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2._INDEX + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_index__pb2._INDEX ) _UPDATEFIELDREQUEST.fields_by_name[ "field" ].message_type = ( - google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_field__pb2._FIELD + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_field__pb2._FIELD ) _UPDATEFIELDREQUEST.fields_by_name[ "update_mask" @@ -773,7 +787,7 @@ _LISTFIELDSRESPONSE.fields_by_name[ "fields" ].message_type = ( - google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_field__pb2._FIELD + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_field__pb2._FIELD ) DESCRIPTOR.message_types_by_name["CreateIndexRequest"] = _CREATEINDEXREQUEST DESCRIPTOR.message_types_by_name["ListIndexesRequest"] = _LISTINDEXESREQUEST @@ -791,12 +805,11 @@ CreateIndexRequest = _reflection.GeneratedProtocolMessageType( "CreateIndexRequest", (_message.Message,), - dict( - DESCRIPTOR=_CREATEINDEXREQUEST, - __module__="google.cloud.firestore.admin_v1.proto.firestore_admin_pb2", - __doc__="""The request for - [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex]. - + { + "DESCRIPTOR": _CREATEINDEXREQUEST, + "__module__": "google.cloud.firestore_admin_v1.proto.firestore_admin_pb2", + "__doc__": """The request for [FirestoreAdmin.CreateIndex][google.firestore.admin.v1 + .FirestoreAdmin.CreateIndex]. Attributes: parent: @@ -806,19 +819,18 @@ Required. The composite index to create. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.CreateIndexRequest) - ), + }, ) _sym_db.RegisterMessage(CreateIndexRequest) ListIndexesRequest = _reflection.GeneratedProtocolMessageType( "ListIndexesRequest", (_message.Message,), - dict( - DESCRIPTOR=_LISTINDEXESREQUEST, - __module__="google.cloud.firestore.admin_v1.proto.firestore_admin_pb2", - __doc__="""The request for - [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes]. - + { + "DESCRIPTOR": _LISTINDEXESREQUEST, + "__module__": "google.cloud.firestore_admin_v1.proto.firestore_admin_pb2", + "__doc__": """The request for [FirestoreAdmin.ListIndexes][google.firestore.admin.v1 + .FirestoreAdmin.ListIndexes]. Attributes: parent: @@ -834,19 +846,18 @@ exes], that may be used to get the next page of results. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ListIndexesRequest) - ), + }, ) _sym_db.RegisterMessage(ListIndexesRequest) ListIndexesResponse = _reflection.GeneratedProtocolMessageType( "ListIndexesResponse", (_message.Message,), - dict( - DESCRIPTOR=_LISTINDEXESRESPONSE, - __module__="google.cloud.firestore.admin_v1.proto.firestore_admin_pb2", - __doc__="""The response for - [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes]. - + { + "DESCRIPTOR": _LISTINDEXESRESPONSE, + "__module__": "google.cloud.firestore_admin_v1.proto.firestore_admin_pb2", + "__doc__": """The response for [FirestoreAdmin.ListIndexes][google.firestore.admin.v + 1.FirestoreAdmin.ListIndexes]. Attributes: indexes: @@ -856,19 +867,18 @@ results. If blank, this is the last page. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ListIndexesResponse) - ), + }, ) _sym_db.RegisterMessage(ListIndexesResponse) GetIndexRequest = _reflection.GeneratedProtocolMessageType( "GetIndexRequest", (_message.Message,), - dict( - DESCRIPTOR=_GETINDEXREQUEST, - __module__="google.cloud.firestore.admin_v1.proto.firestore_admin_pb2", - __doc__="""The request for - [FirestoreAdmin.GetIndex][google.firestore.admin.v1.FirestoreAdmin.GetIndex]. - + { + "DESCRIPTOR": _GETINDEXREQUEST, + "__module__": "google.cloud.firestore_admin_v1.proto.firestore_admin_pb2", + "__doc__": """The request for [FirestoreAdmin.GetIndex][google.firestore.admin.v1.Fi + restoreAdmin.GetIndex]. Attributes: name: @@ -877,19 +887,18 @@ _id}`` """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.GetIndexRequest) - ), + }, ) _sym_db.RegisterMessage(GetIndexRequest) DeleteIndexRequest = _reflection.GeneratedProtocolMessageType( "DeleteIndexRequest", (_message.Message,), - dict( - DESCRIPTOR=_DELETEINDEXREQUEST, - __module__="google.cloud.firestore.admin_v1.proto.firestore_admin_pb2", - __doc__="""The request for - [FirestoreAdmin.DeleteIndex][google.firestore.admin.v1.FirestoreAdmin.DeleteIndex]. - + { + "DESCRIPTOR": _DELETEINDEXREQUEST, + "__module__": "google.cloud.firestore_admin_v1.proto.firestore_admin_pb2", + "__doc__": """The request for [FirestoreAdmin.DeleteIndex][google.firestore.admin.v1 + .FirestoreAdmin.DeleteIndex]. Attributes: name: @@ -898,42 +907,40 @@ _id}`` """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.DeleteIndexRequest) - ), + }, ) _sym_db.RegisterMessage(DeleteIndexRequest) UpdateFieldRequest = _reflection.GeneratedProtocolMessageType( "UpdateFieldRequest", (_message.Message,), - dict( - DESCRIPTOR=_UPDATEFIELDREQUEST, - __module__="google.cloud.firestore.admin_v1.proto.firestore_admin_pb2", - __doc__="""The request for - [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField]. - + { + "DESCRIPTOR": _UPDATEFIELDREQUEST, + "__module__": "google.cloud.firestore_admin_v1.proto.firestore_admin_pb2", + "__doc__": """The request for [FirestoreAdmin.UpdateField][google.firestore.admin.v1 + .FirestoreAdmin.UpdateField]. Attributes: field: Required. The field to be updated. update_mask: A mask, relative to the field. If specified, only - configuration specified by this field\_mask will be updated in + configuration specified by this field_mask will be updated in the field. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.UpdateFieldRequest) - ), + }, ) _sym_db.RegisterMessage(UpdateFieldRequest) GetFieldRequest = _reflection.GeneratedProtocolMessageType( "GetFieldRequest", (_message.Message,), - dict( - DESCRIPTOR=_GETFIELDREQUEST, - __module__="google.cloud.firestore.admin_v1.proto.firestore_admin_pb2", - __doc__="""The request for - [FirestoreAdmin.GetField][google.firestore.admin.v1.FirestoreAdmin.GetField]. - + { + "DESCRIPTOR": _GETFIELDREQUEST, + "__module__": "google.cloud.firestore_admin_v1.proto.firestore_admin_pb2", + "__doc__": """The request for [FirestoreAdmin.GetField][google.firestore.admin.v1.Fi + restoreAdmin.GetField]. Attributes: name: @@ -942,19 +949,18 @@ id}`` """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.GetFieldRequest) - ), + }, ) _sym_db.RegisterMessage(GetFieldRequest) ListFieldsRequest = _reflection.GeneratedProtocolMessageType( "ListFieldsRequest", (_message.Message,), - dict( - DESCRIPTOR=_LISTFIELDSREQUEST, - __module__="google.cloud.firestore.admin_v1.proto.firestore_admin_pb2", - __doc__="""The request for - [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]. - + { + "DESCRIPTOR": _LISTFIELDSREQUEST, + "__module__": "google.cloud.firestore_admin_v1.proto.firestore_admin_pb2", + "__doc__": """The request for [FirestoreAdmin.ListFields][google.firestore.admin.v1. + FirestoreAdmin.ListFields]. Attributes: parent: @@ -975,19 +981,18 @@ ds], that may be used to get the next page of results. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ListFieldsRequest) - ), + }, ) _sym_db.RegisterMessage(ListFieldsRequest) ListFieldsResponse = _reflection.GeneratedProtocolMessageType( "ListFieldsResponse", (_message.Message,), - dict( - DESCRIPTOR=_LISTFIELDSRESPONSE, - __module__="google.cloud.firestore.admin_v1.proto.firestore_admin_pb2", - __doc__="""The response for - [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]. - + { + "DESCRIPTOR": _LISTFIELDSRESPONSE, + "__module__": "google.cloud.firestore_admin_v1.proto.firestore_admin_pb2", + "__doc__": """The response for [FirestoreAdmin.ListFields][google.firestore.admin.v1 + .FirestoreAdmin.ListFields]. Attributes: fields: @@ -997,19 +1002,18 @@ results. If blank, this is the last page. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ListFieldsResponse) - ), + }, ) _sym_db.RegisterMessage(ListFieldsResponse) ExportDocumentsRequest = _reflection.GeneratedProtocolMessageType( "ExportDocumentsRequest", (_message.Message,), - dict( - DESCRIPTOR=_EXPORTDOCUMENTSREQUEST, - __module__="google.cloud.firestore.admin_v1.proto.firestore_admin_pb2", - __doc__="""The request for - [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments]. - + { + "DESCRIPTOR": _EXPORTDOCUMENTSREQUEST, + "__module__": "google.cloud.firestore_admin_v1.proto.firestore_admin_pb2", + "__doc__": """The request for [FirestoreAdmin.ExportDocuments][google.firestore.admi + n.v1.FirestoreAdmin.ExportDocuments]. Attributes: name: @@ -1030,19 +1034,18 @@ based on the start time. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ExportDocumentsRequest) - ), + }, ) _sym_db.RegisterMessage(ExportDocumentsRequest) ImportDocumentsRequest = _reflection.GeneratedProtocolMessageType( "ImportDocumentsRequest", (_message.Message,), - dict( - DESCRIPTOR=_IMPORTDOCUMENTSREQUEST, - __module__="google.cloud.firestore.admin_v1.proto.firestore_admin_pb2", - __doc__="""The request for - [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments]. - + { + "DESCRIPTOR": _IMPORTDOCUMENTSREQUEST, + "__module__": "google.cloud.firestore_admin_v1.proto.firestore_admin_pb2", + "__doc__": """The request for [FirestoreAdmin.ImportDocuments][google.firestore.admi + n.v1.FirestoreAdmin.ImportDocuments]. Attributes: name: @@ -1053,14 +1056,13 @@ collections included in the import. input_uri_prefix: 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 - ]. + 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]. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ImportDocumentsRequest) - ), + }, ) _sym_db.RegisterMessage(ImportDocumentsRequest) @@ -1082,9 +1084,8 @@ full_name="google.firestore.admin.v1.FirestoreAdmin", file=DESCRIPTOR, index=0, - serialized_options=_b( - "\312A\030firestore.googleapis.com\322AXhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastore" - ), + serialized_options=b"\312A\030firestore.googleapis.com\322AXhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastore", + create_key=_descriptor._internal_create_key, serialized_start=1650, serialized_end=3559, methods=[ @@ -1095,9 +1096,8 @@ containing_service=None, input_type=_CREATEINDEXREQUEST, output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002G">/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes:\005index\332A\014parent,index\312A\037\n\005Index\022\026IndexOperationMetadata' - ), + serialized_options=b'\202\323\344\223\002G">/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes:\005index\332A\014parent,index\312A\037\n\005Index\022\026IndexOperationMetadata', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="ListIndexes", @@ -1106,9 +1106,8 @@ containing_service=None, input_type=_LISTINDEXESREQUEST, output_type=_LISTINDEXESRESPONSE, - serialized_options=_b( - "\202\323\344\223\002@\022>/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes\332A\006parent" - ), + serialized_options=b"\202\323\344\223\002@\022>/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes\332A\006parent", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="GetIndex", @@ -1116,10 +1115,9 @@ index=2, containing_service=None, input_type=_GETINDEXREQUEST, - output_type=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2._INDEX, - serialized_options=_b( - "\202\323\344\223\002@\022>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}\332A\004name" - ), + output_type=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_index__pb2._INDEX, + serialized_options=b"\202\323\344\223\002@\022>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}\332A\004name", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="DeleteIndex", @@ -1128,9 +1126,8 @@ containing_service=None, input_type=_DELETEINDEXREQUEST, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002@*>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}\332A\004name" - ), + serialized_options=b"\202\323\344\223\002@*>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}\332A\004name", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="GetField", @@ -1138,10 +1135,9 @@ index=4, containing_service=None, input_type=_GETFIELDREQUEST, - output_type=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_field__pb2._FIELD, - serialized_options=_b( - "\202\323\344\223\002?\022=/v1/{name=projects/*/databases/*/collectionGroups/*/fields/*}\332A\004name" - ), + output_type=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_field__pb2._FIELD, + serialized_options=b"\202\323\344\223\002?\022=/v1/{name=projects/*/databases/*/collectionGroups/*/fields/*}\332A\004name", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="UpdateField", @@ -1150,9 +1146,8 @@ containing_service=None, input_type=_UPDATEFIELDREQUEST, output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - "\202\323\344\223\002L2C/v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}:\005field\332A\005field\312A\037\n\005Field\022\026FieldOperationMetadata" - ), + serialized_options=b"\202\323\344\223\002L2C/v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}:\005field\332A\005field\312A\037\n\005Field\022\026FieldOperationMetadata", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="ListFields", @@ -1161,9 +1156,8 @@ containing_service=None, input_type=_LISTFIELDSREQUEST, output_type=_LISTFIELDSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002?\022=/v1/{parent=projects/*/databases/*/collectionGroups/*}/fields\332A\006parent" - ), + serialized_options=b"\202\323\344\223\002?\022=/v1/{parent=projects/*/databases/*/collectionGroups/*}/fields\332A\006parent", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="ExportDocuments", @@ -1172,9 +1166,8 @@ containing_service=None, input_type=_EXPORTDOCUMENTSREQUEST, output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\0026"1/v1/{name=projects/*/databases/*}:exportDocuments:\001*\332A\004name\312A2\n\027ExportDocumentsResponse\022\027ExportDocumentsMetadata' - ), + serialized_options=b'\202\323\344\223\0026"1/v1/{name=projects/*/databases/*}:exportDocuments:\001*\332A\004name\312A2\n\027ExportDocumentsResponse\022\027ExportDocumentsMetadata', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="ImportDocuments", @@ -1183,9 +1176,8 @@ containing_service=None, input_type=_IMPORTDOCUMENTSREQUEST, output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\0026"1/v1/{name=projects/*/databases/*}:importDocuments:\001*\332A\004name\312A0\n\025google.protobuf.Empty\022\027ImportDocumentsMetadata' - ), + serialized_options=b'\202\323\344\223\0026"1/v1/{name=projects/*/databases/*}:importDocuments:\001*\332A\004name\312A0\n\025google.protobuf.Empty\022\027ImportDocumentsMetadata', + create_key=_descriptor._internal_create_key, ), ], ) diff --git a/google/cloud/firestore_admin_v1/proto/firestore_admin_pb2_grpc.py b/google/cloud/firestore_admin_v1/proto/firestore_admin_pb2_grpc.py index 269e920b3..7ed771461 100644 --- a/google/cloud/firestore_admin_v1/proto/firestore_admin_pb2_grpc.py +++ b/google/cloud/firestore_admin_v1/proto/firestore_admin_pb2_grpc.py @@ -1,14 +1,15 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc from google.cloud.firestore_admin_v1.proto import ( - field_pb2 as google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_field__pb2, + field_pb2 as google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_field__pb2, ) from google.cloud.firestore_admin_v1.proto import ( - firestore_admin_pb2 as google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2, + firestore_admin_pb2 as google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2, ) from google.cloud.firestore_admin_v1.proto import ( - index_pb2 as google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2, + index_pb2 as google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_index__pb2, ) from google.longrunning import ( operations_pb2 as google_dot_longrunning_dot_operations__pb2, @@ -18,119 +19,119 @@ class FirestoreAdminStub(object): """Operations are created by service `FirestoreAdmin`, but are accessed via - service `google.longrunning.Operations`. - """ + service `google.longrunning.Operations`. + """ def __init__(self, channel): """Constructor. - Args: - channel: A grpc.Channel. - """ + Args: + channel: A grpc.Channel. + """ self.CreateIndex = channel.unary_unary( "/google.firestore.admin.v1.FirestoreAdmin/CreateIndex", - request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.CreateIndexRequest.SerializeToString, + request_serializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.CreateIndexRequest.SerializeToString, response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, ) self.ListIndexes = channel.unary_unary( "/google.firestore.admin.v1.FirestoreAdmin/ListIndexes", - request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ListIndexesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ListIndexesResponse.FromString, + request_serializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ListIndexesRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ListIndexesResponse.FromString, ) self.GetIndex = channel.unary_unary( "/google.firestore.admin.v1.FirestoreAdmin/GetIndex", - request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.GetIndexRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2.Index.FromString, + request_serializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.GetIndexRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_index__pb2.Index.FromString, ) self.DeleteIndex = channel.unary_unary( "/google.firestore.admin.v1.FirestoreAdmin/DeleteIndex", - request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.DeleteIndexRequest.SerializeToString, + request_serializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.DeleteIndexRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, ) self.GetField = channel.unary_unary( "/google.firestore.admin.v1.FirestoreAdmin/GetField", - request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.GetFieldRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_field__pb2.Field.FromString, + request_serializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.GetFieldRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_field__pb2.Field.FromString, ) self.UpdateField = channel.unary_unary( "/google.firestore.admin.v1.FirestoreAdmin/UpdateField", - request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.UpdateFieldRequest.SerializeToString, + request_serializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.UpdateFieldRequest.SerializeToString, response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, ) self.ListFields = channel.unary_unary( "/google.firestore.admin.v1.FirestoreAdmin/ListFields", - request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ListFieldsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ListFieldsResponse.FromString, + request_serializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ListFieldsRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ListFieldsResponse.FromString, ) self.ExportDocuments = channel.unary_unary( "/google.firestore.admin.v1.FirestoreAdmin/ExportDocuments", - request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ExportDocumentsRequest.SerializeToString, + request_serializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ExportDocumentsRequest.SerializeToString, response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, ) self.ImportDocuments = channel.unary_unary( "/google.firestore.admin.v1.FirestoreAdmin/ImportDocuments", - request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ImportDocumentsRequest.SerializeToString, + request_serializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ImportDocumentsRequest.SerializeToString, response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, ) class FirestoreAdminServicer(object): """Operations are created by service `FirestoreAdmin`, but are accessed via - service `google.longrunning.Operations`. - """ + service `google.longrunning.Operations`. + """ def CreateIndex(self, request, context): """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]. - """ + 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]. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def ListIndexes(self, request, context): """Lists composite indexes. - """ + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def GetIndex(self, request, context): """Gets a composite index. - """ + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def DeleteIndex(self, request, context): """Deletes a composite index. - """ + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def GetField(self, request, context): """Gets the metadata and configuration for a Field. - """ + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def UpdateField(self, request, context): """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/*`. - """ + 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/*`. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -138,36 +139,36 @@ def UpdateField(self, request, context): def ListFields(self, request, context): """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`. - """ + 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`. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def ExportDocuments(self, request, context): """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. - """ + 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. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def ImportDocuments(self, request, context): """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. - """ + 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. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -177,47 +178,47 @@ def add_FirestoreAdminServicer_to_server(servicer, server): rpc_method_handlers = { "CreateIndex": grpc.unary_unary_rpc_method_handler( servicer.CreateIndex, - request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.CreateIndexRequest.FromString, + request_deserializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.CreateIndexRequest.FromString, response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, ), "ListIndexes": grpc.unary_unary_rpc_method_handler( servicer.ListIndexes, - request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ListIndexesRequest.FromString, - response_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ListIndexesResponse.SerializeToString, + request_deserializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ListIndexesRequest.FromString, + response_serializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ListIndexesResponse.SerializeToString, ), "GetIndex": grpc.unary_unary_rpc_method_handler( servicer.GetIndex, - request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.GetIndexRequest.FromString, - response_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2.Index.SerializeToString, + request_deserializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.GetIndexRequest.FromString, + response_serializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_index__pb2.Index.SerializeToString, ), "DeleteIndex": grpc.unary_unary_rpc_method_handler( servicer.DeleteIndex, - request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.DeleteIndexRequest.FromString, + request_deserializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.DeleteIndexRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), "GetField": grpc.unary_unary_rpc_method_handler( servicer.GetField, - request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.GetFieldRequest.FromString, - response_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_field__pb2.Field.SerializeToString, + request_deserializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.GetFieldRequest.FromString, + response_serializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_field__pb2.Field.SerializeToString, ), "UpdateField": grpc.unary_unary_rpc_method_handler( servicer.UpdateField, - request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.UpdateFieldRequest.FromString, + request_deserializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.UpdateFieldRequest.FromString, response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, ), "ListFields": grpc.unary_unary_rpc_method_handler( servicer.ListFields, - request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ListFieldsRequest.FromString, - response_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ListFieldsResponse.SerializeToString, + request_deserializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ListFieldsRequest.FromString, + response_serializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ListFieldsResponse.SerializeToString, ), "ExportDocuments": grpc.unary_unary_rpc_method_handler( servicer.ExportDocuments, - request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ExportDocumentsRequest.FromString, + request_deserializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ExportDocumentsRequest.FromString, response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, ), "ImportDocuments": grpc.unary_unary_rpc_method_handler( servicer.ImportDocuments, - request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ImportDocumentsRequest.FromString, + request_deserializer=google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ImportDocumentsRequest.FromString, response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, ), } @@ -225,3 +226,253 @@ def add_FirestoreAdminServicer_to_server(servicer, server): "google.firestore.admin.v1.FirestoreAdmin", rpc_method_handlers ) server.add_generic_rpc_handlers((generic_handler,)) + + +# This class is part of an EXPERIMENTAL API. +class FirestoreAdmin(object): + """Operations are created by service `FirestoreAdmin`, but are accessed via + service `google.longrunning.Operations`. + """ + + @staticmethod + def CreateIndex( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.admin.v1.FirestoreAdmin/CreateIndex", + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.CreateIndexRequest.SerializeToString, + google_dot_longrunning_dot_operations__pb2.Operation.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def ListIndexes( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.admin.v1.FirestoreAdmin/ListIndexes", + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ListIndexesRequest.SerializeToString, + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ListIndexesResponse.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def GetIndex( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.admin.v1.FirestoreAdmin/GetIndex", + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.GetIndexRequest.SerializeToString, + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_index__pb2.Index.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def DeleteIndex( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.admin.v1.FirestoreAdmin/DeleteIndex", + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.DeleteIndexRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def GetField( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.admin.v1.FirestoreAdmin/GetField", + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.GetFieldRequest.SerializeToString, + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_field__pb2.Field.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def UpdateField( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.admin.v1.FirestoreAdmin/UpdateField", + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.UpdateFieldRequest.SerializeToString, + google_dot_longrunning_dot_operations__pb2.Operation.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def ListFields( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.admin.v1.FirestoreAdmin/ListFields", + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ListFieldsRequest.SerializeToString, + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ListFieldsResponse.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def ExportDocuments( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.admin.v1.FirestoreAdmin/ExportDocuments", + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ExportDocumentsRequest.SerializeToString, + google_dot_longrunning_dot_operations__pb2.Operation.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def ImportDocuments( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.admin.v1.FirestoreAdmin/ImportDocuments", + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_firestore__admin__pb2.ImportDocumentsRequest.SerializeToString, + google_dot_longrunning_dot_operations__pb2.Operation.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) diff --git a/google/cloud/firestore_admin_v1/proto/index.proto b/google/cloud/firestore_admin_v1/proto/index.proto index 4b9c6e35b..e27686be4 100644 --- a/google/cloud/firestore_admin_v1/proto/index.proto +++ b/google/cloud/firestore_admin_v1/proto/index.proto @@ -27,6 +27,7 @@ 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"; +option ruby_package = "Google::Cloud::Firestore::Admin::V1"; // Cloud Firestore indexes enable simple and complex queries against // documents in a database. diff --git a/google/cloud/firestore_admin_v1/proto/index_pb2.py b/google/cloud/firestore_admin_v1/proto/index_pb2.py index 85356236d..2e7f17893 100644 --- a/google/cloud/firestore_admin_v1/proto/index_pb2.py +++ b/google/cloud/firestore_admin_v1/proto/index_pb2.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/firestore/admin_v1/proto/index.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +# source: google/cloud/firestore_admin_v1/proto/index.proto +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -20,15 +17,12 @@ DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/firestore/admin_v1/proto/index.proto", + name="google/cloud/firestore_admin_v1/proto/index.proto", package="google.firestore.admin.v1", syntax="proto3", - serialized_options=_b( - "\n\035com.google.firestore.admin.v1B\nIndexProtoP\001Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\242\002\004GCFS\252\002\037Google.Cloud.Firestore.Admin.V1\312\002\037Google\\Cloud\\Firestore\\Admin\\V1" - ), - serialized_pb=_b( - '\n1google/cloud/firestore/admin_v1/proto/index.proto\x12\x19google.firestore.admin.v1\x1a\x19google/api/resource.proto\x1a\x1cgoogle/api/annotations.proto"\xa3\x06\n\x05Index\x12\x0c\n\x04name\x18\x01 \x01(\t\x12@\n\x0bquery_scope\x18\x02 \x01(\x0e\x32+.google.firestore.admin.v1.Index.QueryScope\x12;\n\x06\x66ields\x18\x03 \x03(\x0b\x32+.google.firestore.admin.v1.Index.IndexField\x12\x35\n\x05state\x18\x04 \x01(\x0e\x32&.google.firestore.admin.v1.Index.State\x1a\xbd\x02\n\nIndexField\x12\x12\n\nfield_path\x18\x01 \x01(\t\x12\x42\n\x05order\x18\x02 \x01(\x0e\x32\x31.google.firestore.admin.v1.Index.IndexField.OrderH\x00\x12O\n\x0c\x61rray_config\x18\x03 \x01(\x0e\x32\x37.google.firestore.admin.v1.Index.IndexField.ArrayConfigH\x00"=\n\x05Order\x12\x15\n\x11ORDER_UNSPECIFIED\x10\x00\x12\r\n\tASCENDING\x10\x01\x12\x0e\n\nDESCENDING\x10\x02"9\n\x0b\x41rrayConfig\x12\x1c\n\x18\x41RRAY_CONFIG_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43ONTAINS\x10\x01\x42\x0c\n\nvalue_mode"O\n\nQueryScope\x12\x1b\n\x17QUERY_SCOPE_UNSPECIFIED\x10\x00\x12\x0e\n\nCOLLECTION\x10\x01\x12\x14\n\x10\x43OLLECTION_GROUP\x10\x02"I\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x10\n\x0cNEEDS_REPAIR\x10\x03:z\xea\x41w\n\x1e\x66irestore.googleapis.com/Index\x12Uprojects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}B\xb8\x01\n\x1d\x63om.google.firestore.admin.v1B\nIndexProtoP\x01Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1b\x06proto3' - ), + serialized_options=b"\n\035com.google.firestore.admin.v1B\nIndexProtoP\001Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\242\002\004GCFS\252\002\037Google.Cloud.Firestore.Admin.V1\312\002\037Google\\Cloud\\Firestore\\Admin\\V1\352\002#Google::Cloud::Firestore::Admin::V1", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n1google/cloud/firestore_admin_v1/proto/index.proto\x12\x19google.firestore.admin.v1\x1a\x19google/api/resource.proto\x1a\x1cgoogle/api/annotations.proto"\xa3\x06\n\x05Index\x12\x0c\n\x04name\x18\x01 \x01(\t\x12@\n\x0bquery_scope\x18\x02 \x01(\x0e\x32+.google.firestore.admin.v1.Index.QueryScope\x12;\n\x06\x66ields\x18\x03 \x03(\x0b\x32+.google.firestore.admin.v1.Index.IndexField\x12\x35\n\x05state\x18\x04 \x01(\x0e\x32&.google.firestore.admin.v1.Index.State\x1a\xbd\x02\n\nIndexField\x12\x12\n\nfield_path\x18\x01 \x01(\t\x12\x42\n\x05order\x18\x02 \x01(\x0e\x32\x31.google.firestore.admin.v1.Index.IndexField.OrderH\x00\x12O\n\x0c\x61rray_config\x18\x03 \x01(\x0e\x32\x37.google.firestore.admin.v1.Index.IndexField.ArrayConfigH\x00"=\n\x05Order\x12\x15\n\x11ORDER_UNSPECIFIED\x10\x00\x12\r\n\tASCENDING\x10\x01\x12\x0e\n\nDESCENDING\x10\x02"9\n\x0b\x41rrayConfig\x12\x1c\n\x18\x41RRAY_CONFIG_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43ONTAINS\x10\x01\x42\x0c\n\nvalue_mode"O\n\nQueryScope\x12\x1b\n\x17QUERY_SCOPE_UNSPECIFIED\x10\x00\x12\x0e\n\nCOLLECTION\x10\x01\x12\x14\n\x10\x43OLLECTION_GROUP\x10\x02"I\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x10\n\x0cNEEDS_REPAIR\x10\x03:z\xea\x41w\n\x1e\x66irestore.googleapis.com/Index\x12Uprojects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}B\xde\x01\n\x1d\x63om.google.firestore.admin.v1B\nIndexProtoP\x01Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1b\x06proto3', dependencies=[ google_dot_api_dot_resource__pb2.DESCRIPTOR, google_dot_api_dot_annotations__pb2.DESCRIPTOR, @@ -41,6 +35,7 @@ full_name="google.firestore.admin.v1.Index.IndexField.Order", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="ORDER_UNSPECIFIED", @@ -48,12 +43,23 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="ASCENDING", index=1, number=1, serialized_options=None, type=None + name="ASCENDING", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="DESCENDING", index=2, number=2, serialized_options=None, type=None + name="DESCENDING", + index=2, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -68,6 +74,7 @@ full_name="google.firestore.admin.v1.Index.IndexField.ArrayConfig", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="ARRAY_CONFIG_UNSPECIFIED", @@ -75,9 +82,15 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="CONTAINS", index=1, number=1, serialized_options=None, type=None + name="CONTAINS", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -92,6 +105,7 @@ full_name="google.firestore.admin.v1.Index.QueryScope", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="QUERY_SCOPE_UNSPECIFIED", @@ -99,9 +113,15 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="COLLECTION", index=1, number=1, serialized_options=None, type=None + name="COLLECTION", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( name="COLLECTION_GROUP", @@ -109,6 +129,7 @@ number=2, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -123,6 +144,7 @@ full_name="google.firestore.admin.v1.Index.State", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="STATE_UNSPECIFIED", @@ -130,15 +152,31 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="CREATING", index=1, number=1, serialized_options=None, type=None + name="CREATING", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="READY", index=2, number=2, serialized_options=None, type=None + name="READY", + index=2, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="NEEDS_REPAIR", index=3, number=3, serialized_options=None, type=None + name="NEEDS_REPAIR", + index=3, + number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -155,6 +193,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="field_path", @@ -165,7 +204,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -173,6 +212,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="order", @@ -191,6 +231,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="array_config", @@ -209,11 +250,12 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], nested_types=[], - enum_types=[_INDEX_INDEXFIELD_ORDER, _INDEX_INDEXFIELD_ARRAYCONFIG], + enum_types=[_INDEX_INDEXFIELD_ORDER, _INDEX_INDEXFIELD_ARRAYCONFIG,], serialized_options=None, is_extendable=False, syntax="proto3", @@ -224,8 +266,9 @@ full_name="google.firestore.admin.v1.Index.IndexField.value_mode", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=344, serialized_end=661, @@ -237,6 +280,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -247,7 +291,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -255,6 +299,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="query_scope", @@ -273,6 +318,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="fields", @@ -291,6 +337,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="state", @@ -309,14 +356,13 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], - nested_types=[_INDEX_INDEXFIELD], - enum_types=[_INDEX_QUERYSCOPE, _INDEX_STATE], - serialized_options=_b( - "\352Aw\n\036firestore.googleapis.com/Index\022Uprojects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}" - ), + nested_types=[_INDEX_INDEXFIELD,], + enum_types=[_INDEX_QUERYSCOPE, _INDEX_STATE,], + serialized_options=b"\352Aw\n\036firestore.googleapis.com/Index\022Uprojects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}", is_extendable=False, syntax="proto3", extension_ranges=[], @@ -355,16 +401,15 @@ Index = _reflection.GeneratedProtocolMessageType( "Index", (_message.Message,), - dict( - IndexField=_reflection.GeneratedProtocolMessageType( + { + "IndexField": _reflection.GeneratedProtocolMessageType( "IndexField", (_message.Message,), - dict( - DESCRIPTOR=_INDEX_INDEXFIELD, - __module__="google.cloud.firestore.admin_v1.proto.index_pb2", - __doc__="""A field in an index. The field\_path describes which field - is indexed, the value\_mode describes how the field value is indexed. - + { + "DESCRIPTOR": _INDEX_INDEXFIELD, + "__module__": "google.cloud.firestore_admin_v1.proto.index_pb2", + "__doc__": """A field in an index. The field_path describes which field is indexed, + the value_mode describes how the field value is indexed. Attributes: field_path: @@ -380,13 +425,12 @@ ``array_value``\ s. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.Index.IndexField) - ), + }, ), - DESCRIPTOR=_INDEX, - __module__="google.cloud.firestore.admin_v1.proto.index_pb2", - __doc__="""Cloud Firestore indexes enable simple and complex queries - against documents in a database. - + "DESCRIPTOR": _INDEX, + "__module__": "google.cloud.firestore_admin_v1.proto.index_pb2", + "__doc__": """Cloud Firestore indexes enable simple and complex queries against + documents in a database. Attributes: name: @@ -418,7 +462,7 @@ Output only. The serving state of the index. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.Index) - ), + }, ) _sym_db.RegisterMessage(Index) _sym_db.RegisterMessage(Index.IndexField) diff --git a/google/cloud/firestore_admin_v1/proto/index_pb2_grpc.py b/google/cloud/firestore_admin_v1/proto/index_pb2_grpc.py index 07cb78fe0..8a9393943 100644 --- a/google/cloud/firestore_admin_v1/proto/index_pb2_grpc.py +++ b/google/cloud/firestore_admin_v1/proto/index_pb2_grpc.py @@ -1,2 +1,3 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc diff --git a/google/cloud/firestore_admin_v1/proto/location.proto b/google/cloud/firestore_admin_v1/proto/location.proto index d9dc6f9b9..e435c6f0d 100644 --- a/google/cloud/firestore_admin_v1/proto/location.proto +++ b/google/cloud/firestore_admin_v1/proto/location.proto @@ -27,6 +27,7 @@ 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"; +option ruby_package = "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/cloud/firestore_admin_v1/proto/location_pb2.py b/google/cloud/firestore_admin_v1/proto/location_pb2.py index 782589541..3bc821280 100644 --- a/google/cloud/firestore_admin_v1/proto/location_pb2.py +++ b/google/cloud/firestore_admin_v1/proto/location_pb2.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/firestore/admin_v1/proto/location.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +# source: google/cloud/firestore_admin_v1/proto/location.proto +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -20,15 +17,12 @@ DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/firestore/admin_v1/proto/location.proto", + name="google/cloud/firestore_admin_v1/proto/location.proto", package="google.firestore.admin.v1", syntax="proto3", - serialized_options=_b( - "\n\035com.google.firestore.admin.v1B\rLocationProtoP\001Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\242\002\004GCFS\252\002\037Google.Cloud.Firestore.Admin.V1\312\002\037Google\\Cloud\\Firestore\\Admin\\V1" - ), - serialized_pb=_b( - '\n4google/cloud/firestore/admin_v1/proto/location.proto\x12\x19google.firestore.admin.v1\x1a\x18google/type/latlng.proto\x1a\x1cgoogle/api/annotations.proto"\x12\n\x10LocationMetadataB\xbb\x01\n\x1d\x63om.google.firestore.admin.v1B\rLocationProtoP\x01Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1b\x06proto3' - ), + serialized_options=b"\n\035com.google.firestore.admin.v1B\rLocationProtoP\001Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\242\002\004GCFS\252\002\037Google.Cloud.Firestore.Admin.V1\312\002\037Google\\Cloud\\Firestore\\Admin\\V1\352\002#Google::Cloud::Firestore::Admin::V1", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n4google/cloud/firestore_admin_v1/proto/location.proto\x12\x19google.firestore.admin.v1\x1a\x18google/type/latlng.proto\x1a\x1cgoogle/api/annotations.proto"\x12\n\x10LocationMetadataB\xe1\x01\n\x1d\x63om.google.firestore.admin.v1B\rLocationProtoP\x01Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1b\x06proto3', dependencies=[ google_dot_type_dot_latlng__pb2.DESCRIPTOR, google_dot_api_dot_annotations__pb2.DESCRIPTOR, @@ -42,6 +36,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], extensions=[], nested_types=[], @@ -61,15 +56,13 @@ LocationMetadata = _reflection.GeneratedProtocolMessageType( "LocationMetadata", (_message.Message,), - dict( - DESCRIPTOR=_LOCATIONMETADATA, - __module__="google.cloud.firestore.admin_v1.proto.location_pb2", - __doc__="""The metadata message for - [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata]. - - """, + { + "DESCRIPTOR": _LOCATIONMETADATA, + "__module__": "google.cloud.firestore_admin_v1.proto.location_pb2", + "__doc__": """The metadata message for [google.cloud.location.Location.metadata][goo + gle.cloud.location.Location.metadata].""", # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.LocationMetadata) - ), + }, ) _sym_db.RegisterMessage(LocationMetadata) diff --git a/google/cloud/firestore_admin_v1/proto/location_pb2_grpc.py b/google/cloud/firestore_admin_v1/proto/location_pb2_grpc.py index 07cb78fe0..8a9393943 100644 --- a/google/cloud/firestore_admin_v1/proto/location_pb2_grpc.py +++ b/google/cloud/firestore_admin_v1/proto/location_pb2_grpc.py @@ -1,2 +1,3 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc diff --git a/google/cloud/firestore_admin_v1/proto/operation.proto b/google/cloud/firestore_admin_v1/proto/operation.proto index 08194fe09..dcdc6ee65 100644 --- a/google/cloud/firestore_admin_v1/proto/operation.proto +++ b/google/cloud/firestore_admin_v1/proto/operation.proto @@ -28,6 +28,7 @@ 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"; +option ruby_package = "Google::Cloud::Firestore::Admin::V1"; // Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from // [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex]. diff --git a/google/cloud/firestore_admin_v1/proto/operation_pb2.py b/google/cloud/firestore_admin_v1/proto/operation_pb2.py index d34dd007f..acf0996ff 100644 --- a/google/cloud/firestore_admin_v1/proto/operation_pb2.py +++ b/google/cloud/firestore_admin_v1/proto/operation_pb2.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/firestore/admin_v1/proto/operation.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +# source: google/cloud/firestore_admin_v1/proto/operation.proto +"""Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -17,24 +14,21 @@ from google.cloud.firestore_admin_v1.proto import ( - index_pb2 as google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2, + index_pb2 as google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_index__pb2, ) from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/firestore/admin_v1/proto/operation.proto", + name="google/cloud/firestore_admin_v1/proto/operation.proto", package="google.firestore.admin.v1", syntax="proto3", - serialized_options=_b( - "\n\035com.google.firestore.admin.v1B\016OperationProtoP\001Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\242\002\004GCFS\252\002\037Google.Cloud.Firestore.Admin.V1\312\002\037Google\\Cloud\\Firestore\\Admin\\V1" - ), - serialized_pb=_b( - '\n5google/cloud/firestore/admin_v1/proto/operation.proto\x12\x19google.firestore.admin.v1\x1a\x31google/cloud/firestore/admin_v1/proto/index.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"\xbd\x02\n\x16IndexOperationMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05index\x18\x03 \x01(\t\x12\x38\n\x05state\x18\x04 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12?\n\x12progress_documents\x18\x05 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12;\n\x0eprogress_bytes\x18\x06 \x01(\x0b\x32#.google.firestore.admin.v1.Progress"\x88\x05\n\x16\x46ieldOperationMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05\x66ield\x18\x03 \x01(\t\x12_\n\x13index_config_deltas\x18\x04 \x03(\x0b\x32\x42.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta\x12\x38\n\x05state\x18\x05 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12?\n\x12progress_documents\x18\x06 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12;\n\x0eprogress_bytes\x18\x07 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x1a\xe7\x01\n\x10IndexConfigDelta\x12\x62\n\x0b\x63hange_type\x18\x01 \x01(\x0e\x32M.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType\x12/\n\x05index\x18\x02 \x01(\x0b\x32 .google.firestore.admin.v1.Index">\n\nChangeType\x12\x1b\n\x17\x43HANGE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02"\xec\x02\n\x17\x45xportDocumentsMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x42\n\x0foperation_state\x18\x03 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12?\n\x12progress_documents\x18\x04 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12;\n\x0eprogress_bytes\x18\x05 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12\x16\n\x0e\x63ollection_ids\x18\x06 \x03(\t\x12\x19\n\x11output_uri_prefix\x18\x07 \x01(\t"\xeb\x02\n\x17ImportDocumentsMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x42\n\x0foperation_state\x18\x03 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12?\n\x12progress_documents\x18\x04 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12;\n\x0eprogress_bytes\x18\x05 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12\x16\n\x0e\x63ollection_ids\x18\x06 \x03(\t\x12\x18\n\x10input_uri_prefix\x18\x07 \x01(\t"4\n\x17\x45xportDocumentsResponse\x12\x19\n\x11output_uri_prefix\x18\x01 \x01(\t":\n\x08Progress\x12\x16\n\x0e\x65stimated_work\x18\x01 \x01(\x03\x12\x16\n\x0e\x63ompleted_work\x18\x02 \x01(\x03*\x9e\x01\n\x0eOperationState\x12\x1f\n\x1bOPERATION_STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINITIALIZING\x10\x01\x12\x0e\n\nPROCESSING\x10\x02\x12\x0e\n\nCANCELLING\x10\x03\x12\x0e\n\nFINALIZING\x10\x04\x12\x0e\n\nSUCCESSFUL\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\r\n\tCANCELLED\x10\x07\x42\xbc\x01\n\x1d\x63om.google.firestore.admin.v1B\x0eOperationProtoP\x01Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1b\x06proto3' - ), + serialized_options=b"\n\035com.google.firestore.admin.v1B\016OperationProtoP\001Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\242\002\004GCFS\252\002\037Google.Cloud.Firestore.Admin.V1\312\002\037Google\\Cloud\\Firestore\\Admin\\V1\352\002#Google::Cloud::Firestore::Admin::V1", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n5google/cloud/firestore_admin_v1/proto/operation.proto\x12\x19google.firestore.admin.v1\x1a\x31google/cloud/firestore_admin_v1/proto/index.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"\xbd\x02\n\x16IndexOperationMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05index\x18\x03 \x01(\t\x12\x38\n\x05state\x18\x04 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12?\n\x12progress_documents\x18\x05 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12;\n\x0eprogress_bytes\x18\x06 \x01(\x0b\x32#.google.firestore.admin.v1.Progress"\x88\x05\n\x16\x46ieldOperationMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05\x66ield\x18\x03 \x01(\t\x12_\n\x13index_config_deltas\x18\x04 \x03(\x0b\x32\x42.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta\x12\x38\n\x05state\x18\x05 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12?\n\x12progress_documents\x18\x06 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12;\n\x0eprogress_bytes\x18\x07 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x1a\xe7\x01\n\x10IndexConfigDelta\x12\x62\n\x0b\x63hange_type\x18\x01 \x01(\x0e\x32M.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType\x12/\n\x05index\x18\x02 \x01(\x0b\x32 .google.firestore.admin.v1.Index">\n\nChangeType\x12\x1b\n\x17\x43HANGE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02"\xec\x02\n\x17\x45xportDocumentsMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x42\n\x0foperation_state\x18\x03 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12?\n\x12progress_documents\x18\x04 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12;\n\x0eprogress_bytes\x18\x05 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12\x16\n\x0e\x63ollection_ids\x18\x06 \x03(\t\x12\x19\n\x11output_uri_prefix\x18\x07 \x01(\t"\xeb\x02\n\x17ImportDocumentsMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x42\n\x0foperation_state\x18\x03 \x01(\x0e\x32).google.firestore.admin.v1.OperationState\x12?\n\x12progress_documents\x18\x04 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12;\n\x0eprogress_bytes\x18\x05 \x01(\x0b\x32#.google.firestore.admin.v1.Progress\x12\x16\n\x0e\x63ollection_ids\x18\x06 \x03(\t\x12\x18\n\x10input_uri_prefix\x18\x07 \x01(\t"4\n\x17\x45xportDocumentsResponse\x12\x19\n\x11output_uri_prefix\x18\x01 \x01(\t":\n\x08Progress\x12\x16\n\x0e\x65stimated_work\x18\x01 \x01(\x03\x12\x16\n\x0e\x63ompleted_work\x18\x02 \x01(\x03*\x9e\x01\n\x0eOperationState\x12\x1f\n\x1bOPERATION_STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINITIALIZING\x10\x01\x12\x0e\n\nPROCESSING\x10\x02\x12\x0e\n\nCANCELLING\x10\x03\x12\x0e\n\nFINALIZING\x10\x04\x12\x0e\n\nSUCCESSFUL\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\r\n\tCANCELLED\x10\x07\x42\xe2\x01\n\x1d\x63om.google.firestore.admin.v1B\x0eOperationProtoP\x01Z>google.golang.org/genproto/googleapis/firestore/admin/v1;admin\xa2\x02\x04GCFS\xaa\x02\x1fGoogle.Cloud.Firestore.Admin.V1\xca\x02\x1fGoogle\\Cloud\\Firestore\\Admin\\V1\xea\x02#Google::Cloud::Firestore::Admin::V1b\x06proto3', dependencies=[ - google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2.DESCRIPTOR, + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_index__pb2.DESCRIPTOR, google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, google_dot_api_dot_annotations__pb2.DESCRIPTOR, ], @@ -45,6 +39,7 @@ full_name="google.firestore.admin.v1.OperationState", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="OPERATION_STATE_UNSPECIFIED", @@ -52,27 +47,63 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="INITIALIZING", index=1, number=1, serialized_options=None, type=None + name="INITIALIZING", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="PROCESSING", index=2, number=2, serialized_options=None, type=None + name="PROCESSING", + index=2, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="CANCELLING", index=3, number=3, serialized_options=None, type=None + name="CANCELLING", + index=3, + number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="FINALIZING", index=4, number=4, serialized_options=None, type=None + name="FINALIZING", + index=4, + number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="SUCCESSFUL", index=5, number=5, serialized_options=None, type=None + name="SUCCESSFUL", + index=5, + number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="FAILED", index=6, number=6, serialized_options=None, type=None + name="FAILED", + index=6, + number=6, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="CANCELLED", index=7, number=7, serialized_options=None, type=None + name="CANCELLED", + index=7, + number=7, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -98,6 +129,7 @@ full_name="google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="CHANGE_TYPE_UNSPECIFIED", @@ -105,12 +137,23 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="ADD", index=1, number=1, serialized_options=None, type=None + name="ADD", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="REMOVE", index=2, number=2, serialized_options=None, type=None + name="REMOVE", + index=2, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -127,6 +170,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="start_time", @@ -145,6 +189,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="end_time", @@ -163,6 +208,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="index", @@ -173,7 +219,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -181,6 +227,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="state", @@ -199,6 +246,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="progress_documents", @@ -217,6 +265,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="progress_bytes", @@ -235,6 +284,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -256,6 +306,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="change_type", @@ -274,6 +325,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="index", @@ -292,11 +344,12 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], nested_types=[], - enum_types=[_FIELDOPERATIONMETADATA_INDEXCONFIGDELTA_CHANGETYPE], + enum_types=[_FIELDOPERATIONMETADATA_INDEXCONFIGDELTA_CHANGETYPE,], serialized_options=None, is_extendable=False, syntax="proto3", @@ -312,6 +365,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="start_time", @@ -330,6 +384,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="end_time", @@ -348,6 +403,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="field", @@ -358,7 +414,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -366,6 +422,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="index_config_deltas", @@ -384,6 +441,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="state", @@ -402,6 +460,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="progress_documents", @@ -420,6 +479,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="progress_bytes", @@ -438,10 +498,11 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], - nested_types=[_FIELDOPERATIONMETADATA_INDEXCONFIGDELTA], + nested_types=[_FIELDOPERATIONMETADATA_INDEXCONFIGDELTA,], enum_types=[], serialized_options=None, is_extendable=False, @@ -459,6 +520,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="start_time", @@ -477,6 +539,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="end_time", @@ -495,6 +558,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="operation_state", @@ -513,6 +577,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="progress_documents", @@ -531,6 +596,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="progress_bytes", @@ -549,6 +615,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="collection_ids", @@ -567,6 +634,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="output_uri_prefix", @@ -577,7 +645,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -585,6 +653,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -606,6 +675,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="start_time", @@ -624,6 +694,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="end_time", @@ -642,6 +713,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="operation_state", @@ -660,6 +732,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="progress_documents", @@ -678,6 +751,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="progress_bytes", @@ -696,6 +770,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="collection_ids", @@ -714,6 +789,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="input_uri_prefix", @@ -724,7 +800,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -732,6 +808,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -753,6 +830,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="output_uri_prefix", @@ -763,7 +841,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -771,7 +849,8 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -792,6 +871,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="estimated_work", @@ -810,6 +890,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="completed_work", @@ -828,6 +909,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -857,7 +939,7 @@ _FIELDOPERATIONMETADATA_INDEXCONFIGDELTA.fields_by_name[ "index" ].message_type = ( - google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2._INDEX + google_dot_cloud_dot_firestore__admin__v1_dot_proto_dot_index__pb2._INDEX ) _FIELDOPERATIONMETADATA_INDEXCONFIGDELTA.containing_type = _FIELDOPERATIONMETADATA _FIELDOPERATIONMETADATA_INDEXCONFIGDELTA_CHANGETYPE.containing_type = ( @@ -905,14 +987,13 @@ IndexOperationMetadata = _reflection.GeneratedProtocolMessageType( "IndexOperationMetadata", (_message.Message,), - dict( - DESCRIPTOR=_INDEXOPERATIONMETADATA, - __module__="google.cloud.firestore.admin_v1.proto.operation_pb2", - __doc__="""Metadata for + { + "DESCRIPTOR": _INDEXOPERATIONMETADATA, + "__module__": "google.cloud.firestore_admin_v1.proto.operation_pb2", + "__doc__": """Metadata for [google.longrunning.Operation][google.longrunning.Operation] results - from - [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex]. - + from [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreA + dmin.CreateIndex]. Attributes: start_time: @@ -932,22 +1013,21 @@ The progress, in bytes, of this operation. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.IndexOperationMetadata) - ), + }, ) _sym_db.RegisterMessage(IndexOperationMetadata) FieldOperationMetadata = _reflection.GeneratedProtocolMessageType( "FieldOperationMetadata", (_message.Message,), - dict( - IndexConfigDelta=_reflection.GeneratedProtocolMessageType( + { + "IndexConfigDelta": _reflection.GeneratedProtocolMessageType( "IndexConfigDelta", (_message.Message,), - dict( - DESCRIPTOR=_FIELDOPERATIONMETADATA_INDEXCONFIGDELTA, - __module__="google.cloud.firestore.admin_v1.proto.operation_pb2", - __doc__="""Information about an index configuration change. - + { + "DESCRIPTOR": _FIELDOPERATIONMETADATA_INDEXCONFIGDELTA, + "__module__": "google.cloud.firestore_admin_v1.proto.operation_pb2", + "__doc__": """Information about an index configuration change. Attributes: change_type: @@ -956,15 +1036,14 @@ The index being changed. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta) - ), + }, ), - DESCRIPTOR=_FIELDOPERATIONMETADATA, - __module__="google.cloud.firestore.admin_v1.proto.operation_pb2", - __doc__="""Metadata for + "DESCRIPTOR": _FIELDOPERATIONMETADATA, + "__module__": "google.cloud.firestore_admin_v1.proto.operation_pb2", + "__doc__": """Metadata for [google.longrunning.Operation][google.longrunning.Operation] results - from - [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField]. - + from [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreA + dmin.UpdateField]. Attributes: start_time: @@ -988,7 +1067,7 @@ The progress, in bytes, of this operation. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.FieldOperationMetadata) - ), + }, ) _sym_db.RegisterMessage(FieldOperationMetadata) _sym_db.RegisterMessage(FieldOperationMetadata.IndexConfigDelta) @@ -996,14 +1075,13 @@ ExportDocumentsMetadata = _reflection.GeneratedProtocolMessageType( "ExportDocumentsMetadata", (_message.Message,), - dict( - DESCRIPTOR=_EXPORTDOCUMENTSMETADATA, - __module__="google.cloud.firestore.admin_v1.proto.operation_pb2", - __doc__="""Metadata for + { + "DESCRIPTOR": _EXPORTDOCUMENTSMETADATA, + "__module__": "google.cloud.firestore_admin_v1.proto.operation_pb2", + "__doc__": """Metadata for [google.longrunning.Operation][google.longrunning.Operation] results - from - [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments]. - + from [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.Firest + oreAdmin.ExportDocuments]. Attributes: start_time: @@ -1023,21 +1101,20 @@ Where the entities are being exported to. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ExportDocumentsMetadata) - ), + }, ) _sym_db.RegisterMessage(ExportDocumentsMetadata) ImportDocumentsMetadata = _reflection.GeneratedProtocolMessageType( "ImportDocumentsMetadata", (_message.Message,), - dict( - DESCRIPTOR=_IMPORTDOCUMENTSMETADATA, - __module__="google.cloud.firestore.admin_v1.proto.operation_pb2", - __doc__="""Metadata for + { + "DESCRIPTOR": _IMPORTDOCUMENTSMETADATA, + "__module__": "google.cloud.firestore_admin_v1.proto.operation_pb2", + "__doc__": """Metadata for [google.longrunning.Operation][google.longrunning.Operation] results - from - [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments]. - + from [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.Firest + oreAdmin.ImportDocuments]. Attributes: start_time: @@ -1057,21 +1134,20 @@ The location of the documents being imported. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ImportDocumentsMetadata) - ), + }, ) _sym_db.RegisterMessage(ImportDocumentsMetadata) ExportDocumentsResponse = _reflection.GeneratedProtocolMessageType( "ExportDocumentsResponse", (_message.Message,), - dict( - DESCRIPTOR=_EXPORTDOCUMENTSRESPONSE, - __module__="google.cloud.firestore.admin_v1.proto.operation_pb2", - __doc__="""Returned in the + { + "DESCRIPTOR": _EXPORTDOCUMENTSRESPONSE, + "__module__": "google.cloud.firestore_admin_v1.proto.operation_pb2", + "__doc__": """Returned in the [google.longrunning.Operation][google.longrunning.Operation] response field. - Attributes: output_uri_prefix: Location of the output files. This can be used to begin an @@ -1079,21 +1155,20 @@ after the operation completes successfully. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.ExportDocumentsResponse) - ), + }, ) _sym_db.RegisterMessage(ExportDocumentsResponse) Progress = _reflection.GeneratedProtocolMessageType( "Progress", (_message.Message,), - dict( - DESCRIPTOR=_PROGRESS, - __module__="google.cloud.firestore.admin_v1.proto.operation_pb2", - __doc__="""Describes the progress of the operation. Unit of work is - generic and must be interpreted based on where + { + "DESCRIPTOR": _PROGRESS, + "__module__": "google.cloud.firestore_admin_v1.proto.operation_pb2", + "__doc__": """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. - Attributes: estimated_work: The amount of work estimated. @@ -1101,7 +1176,7 @@ The amount of work completed. """, # @@protoc_insertion_point(class_scope:google.firestore.admin.v1.Progress) - ), + }, ) _sym_db.RegisterMessage(Progress) diff --git a/google/cloud/firestore_admin_v1/proto/operation_pb2_grpc.py b/google/cloud/firestore_admin_v1/proto/operation_pb2_grpc.py index 07cb78fe0..8a9393943 100644 --- a/google/cloud/firestore_admin_v1/proto/operation_pb2_grpc.py +++ b/google/cloud/firestore_admin_v1/proto/operation_pb2_grpc.py @@ -1,2 +1,3 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc diff --git a/google/cloud/firestore_v1/gapic/enums.py b/google/cloud/firestore_v1/gapic/enums.py index ee7a9ec6f..2d71222a5 100644 --- a/google/cloud/firestore_v1/gapic/enums.py +++ b/google/cloud/firestore_v1/gapic/enums.py @@ -21,8 +21,8 @@ class NullValue(enum.IntEnum): """ - ``NullValue`` is a singleton enumeration to represent the null value for - the ``Value`` type union. + ``NullValue`` is a singleton enumeration to represent the null value + for the ``Value`` type union. The JSON representation for ``NullValue`` is JSON ``null``. @@ -84,17 +84,42 @@ class Operator(enum.IntEnum): Attributes: OPERATOR_UNSPECIFIED (int): Unspecified. This value must not be used. - LESS_THAN (int): Less than. Requires that the field come first in ``order_by``. - LESS_THAN_OR_EQUAL (int): Less than or equal. Requires that the field come first in ``order_by``. - GREATER_THAN (int): Greater than. Requires that the field come first in ``order_by``. - GREATER_THAN_OR_EQUAL (int): Greater than or equal. Requires that the field come first in - ``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. + LESS_THAN (int): The given ``field`` is less than the given ``value``. + + Requires: + + - That ``field`` come first in ``order_by``. + LESS_THAN_OR_EQUAL (int): The given ``field`` is less than or equal to the given ``value``. + + Requires: + + - That ``field`` come first in ``order_by``. + GREATER_THAN (int): The given ``field`` is greater than the given ``value``. + + Requires: + + - That ``field`` come first in ``order_by``. + GREATER_THAN_OR_EQUAL (int): The given ``field`` is greater than or equal to the given ``value``. + + Requires: + + - That ``field`` come first in ``order_by``. + EQUAL (int): The given ``field`` is equal to the given ``value``. + ARRAY_CONTAINS (int): The given ``field`` is an array that contains the given ``value``. + IN (int): The given ``field`` is equal to at least one value in the given + array. + + Requires: + + - That ``value`` is a non-empty ``ArrayValue`` with at most 10 values. + - No other ``IN``, ``ARRAY_CONTAINS_ANY``, or ``NOT_IN``. + ARRAY_CONTAINS_ANY (int): The given ``field`` is an array that contains any of the values in + the given array. + + Requires: + + - That ``value`` is a non-empty ``ArrayValue`` with at most 10 values. + - No other ``IN``, ``ARRAY_CONTAINS_ANY``, or ``NOT_IN``. """ OPERATOR_UNSPECIFIED = 0 @@ -114,8 +139,8 @@ class Operator(enum.IntEnum): Attributes: OPERATOR_UNSPECIFIED (int): Unspecified. This value must not be used. - IS_NAN (int): Test if a field is equal to NaN. - IS_NULL (int): Test if an expression evaluates to Null. + IS_NAN (int): The given ``field`` is equal to ``NaN``. + IS_NULL (int): The given ``field`` is equal to ``NULL``. """ OPERATOR_UNSPECIFIED = 0 @@ -129,11 +154,12 @@ class TargetChangeType(enum.IntEnum): The type of change. Attributes: - NO_CHANGE (int): No change has occurred. Used only to send an updated ``resume_token``. + NO_CHANGE (int): No change has occurred. Used only to send an updated + ``resume_token``. ADD (int): The targets have been added. REMOVE (int): The targets have been removed. - CURRENT (int): The targets reflect all changes committed before the targets were added - to the stream. + CURRENT (int): The targets reflect all changes committed before the targets were + added to the stream. This will be sent after or with a ``read_time`` that is greater than or equal to the time at which the targets were added. diff --git a/google/cloud/firestore_v1/gapic/firestore_client.py b/google/cloud/firestore_v1/gapic/firestore_client.py index d6f3e3320..8438a712b 100644 --- a/google/cloud/firestore_v1/gapic/firestore_client.py +++ b/google/cloud/firestore_v1/gapic/firestore_client.py @@ -28,7 +28,6 @@ import google.api_core.gapic_v1.routing_header import google.api_core.grpc_helpers import google.api_core.page_iterator -import google.api_core.path_template import google.api_core.protobuf_helpers import grpc @@ -46,7 +45,7 @@ _GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-firestore" + "google-cloud-firestore", ).version @@ -215,12 +214,12 @@ def __init__( self.transport = transport else: self.transport = firestore_grpc_transport.FirestoreGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials, ) if client_info is None: client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION + gapic_version=_GAPIC_LIBRARY_VERSION, ) else: client_info.gapic_version = _GAPIC_LIBRARY_VERSION @@ -231,7 +230,7 @@ def __init__( # (Ordinarily, these are the defaults specified in the `*_config.py` # file next to this one.) self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] + client_config["interfaces"][self._INTERFACE_NAME], ) # Save a dictionary of cached API call functions. @@ -259,7 +258,8 @@ def get_document( >>> >>> client = firestore_v1.FirestoreClient() >>> - >>> name = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') + >>> # TODO: Initialize `name`: + >>> name = '' >>> >>> response = client.get_document(name) @@ -275,7 +275,7 @@ def get_document( message :class:`~google.cloud.firestore_v1.types.DocumentMask` transaction (bytes): Reads the document in a transaction. read_time (Union[dict, ~google.cloud.firestore_v1.types.Timestamp]): Reads the version of the document at the given time. - This may not be older than 60 seconds. + This may not be older than 270 seconds. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.firestore_v1.types.Timestamp` @@ -312,11 +312,11 @@ def get_document( # Sanity check: We have some fields which are mutually exclusive; # raise ValueError if more than one is sent. google.api_core.protobuf_helpers.check_oneof( - transaction=transaction, read_time=read_time + transaction=transaction, read_time=read_time, ) request = firestore_pb2.GetDocumentRequest( - name=name, mask=mask, transaction=transaction, read_time=read_time + name=name, mask=mask, transaction=transaction, read_time=read_time, ) if metadata is None: metadata = [] @@ -357,7 +357,8 @@ def list_documents( >>> >>> client = firestore_v1.FirestoreClient() >>> - >>> parent = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') + >>> # TODO: Initialize `parent`: + >>> parent = '' >>> >>> # TODO: Initialize `collection_id`: >>> collection_id = '' @@ -399,7 +400,7 @@ def list_documents( message :class:`~google.cloud.firestore_v1.types.DocumentMask` transaction (bytes): Reads documents in a transaction. read_time (Union[dict, ~google.cloud.firestore_v1.types.Timestamp]): Reads documents as they were at the given time. - This may not be older than 60 seconds. + This may not be older than 270 seconds. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.firestore_v1.types.Timestamp` @@ -446,7 +447,7 @@ def list_documents( # Sanity check: We have some fields which are mutually exclusive; # raise ValueError if more than one is sent. google.api_core.protobuf_helpers.check_oneof( - transaction=transaction, read_time=read_time + transaction=transaction, read_time=read_time, ) request = firestore_pb2.ListDocumentsRequest( @@ -493,18 +494,16 @@ def create_document( >>> >>> client = firestore_v1.FirestoreClient() >>> - >>> parent = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') + >>> # TODO: Initialize `parent`: + >>> parent = '' >>> >>> # TODO: Initialize `collection_id`: >>> collection_id = '' >>> - >>> # TODO: Initialize `document_id`: - >>> document_id = '' - >>> >>> # TODO: Initialize `document`: >>> document = {} >>> - >>> response = client.create_document(parent, collection_id, document_id, document) + >>> response = client.create_document(parent, collection_id, document) Args: parent (str): Required. The parent resource. For example: @@ -512,13 +511,13 @@ def create_document( ``projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`` collection_id (str): Required. The collection ID, relative to ``parent``, to list. For example: ``chatrooms``. - document_id (str): The client-assigned document ID to use for this document. - - Optional. If not specified, an ID will be assigned by the service. document (Union[dict, ~google.cloud.firestore_v1.types.Document]): Required. The document to create. ``name`` must not be set. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.firestore_v1.types.Document` + document_id (str): The client-assigned document ID to use for this document. + + Optional. If not specified, an ID will be assigned by the service. mask (Union[dict, ~google.cloud.firestore_v1.types.DocumentMask]): The fields to return. If not set, returns all fields. If the document has a field that is not present in this mask, that field @@ -559,8 +558,8 @@ def create_document( request = firestore_pb2.CreateDocumentRequest( parent=parent, collection_id=collection_id, - document_id=document_id, document=document, + document_id=document_id, mask=mask, ) return self._inner_api_calls["create_document"]( @@ -570,7 +569,7 @@ def create_document( def update_document( self, document, - update_mask, + update_mask=None, mask=None, current_document=None, retry=google.api_core.gapic_v1.method.DEFAULT, @@ -588,10 +587,7 @@ def update_document( >>> # TODO: Initialize `document`: >>> document = {} >>> - >>> # TODO: Initialize `update_mask`: - >>> update_mask = {} - >>> - >>> response = client.update_document(document, update_mask) + >>> response = client.update_document(document) Args: document (Union[dict, ~google.cloud.firestore_v1.types.Document]): Required. The updated document. @@ -690,12 +686,14 @@ def delete_document( >>> >>> client = firestore_v1.FirestoreClient() >>> - >>> name = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') + >>> # TODO: Initialize `name`: + >>> name = '' >>> >>> client.delete_document(name) Args: - name (str): Required. The resource name of the Document to delete. In the format: + name (str): Required. The resource name of the Document to delete. In the + format: ``projects/{project_id}/databases/{database_id}/documents/{document_path}``. current_document (Union[dict, ~google.cloud.firestore_v1.types.Precondition]): An optional precondition on the document. The request will fail if this is set and not met by the target document. @@ -730,7 +728,7 @@ def delete_document( ) request = firestore_pb2.DeleteDocumentRequest( - name=name, current_document=current_document + name=name, current_document=current_document, ) if metadata is None: metadata = [] @@ -752,7 +750,7 @@ def delete_document( def batch_get_documents( self, database, - documents, + documents=None, mask=None, transaction=None, new_transaction=None, @@ -772,12 +770,10 @@ def batch_get_documents( >>> >>> client = firestore_v1.FirestoreClient() >>> - >>> database = client.database_root_path('[PROJECT]', '[DATABASE]') - >>> - >>> # TODO: Initialize `documents`: - >>> documents = [] + >>> # TODO: Initialize `database`: + >>> database = '' >>> - >>> for element in client.batch_get_documents(database, documents): + >>> for element in client.batch_get_documents(database): ... # process element ... pass @@ -804,7 +800,7 @@ def batch_get_documents( If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.firestore_v1.types.TransactionOptions` read_time (Union[dict, ~google.cloud.firestore_v1.types.Timestamp]): Reads documents as they were at the given time. - This may not be older than 60 seconds. + This may not be older than 270 seconds. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.firestore_v1.types.Timestamp` @@ -871,6 +867,98 @@ def batch_get_documents( request, retry=retry, timeout=timeout, metadata=metadata ) + def batch_write( + self, + database, + writes=None, + labels=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Applies a batch of write operations. + + The BatchWrite method does not apply the write operations atomically and + can apply them out of order. Method does not allow more than one write + per document. Each write succeeds or fails independently. See the + ``BatchWriteResponse`` for the success status of each write. + + If you require an atomically applied set of writes, use ``Commit`` + instead. + + Example: + >>> from google.cloud import firestore_v1 + >>> + >>> client = firestore_v1.FirestoreClient() + >>> + >>> # TODO: Initialize `database`: + >>> database = '' + >>> + >>> response = client.batch_write(database) + + Args: + database (str): Required. The database name. In the format: + ``projects/{project_id}/databases/{database_id}``. + writes (list[Union[dict, ~google.cloud.firestore_v1.types.Write]]): The writes to apply. + + Method does not apply writes atomically and does not guarantee ordering. + Each write succeeds or fails independently. You cannot write to the same + document more than once per request. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.firestore_v1.types.Write` + labels (dict[str -> str]): Labels associated with this batch write. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.firestore_v1.types.BatchWriteResponse` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "batch_write" not in self._inner_api_calls: + self._inner_api_calls[ + "batch_write" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.batch_write, + default_retry=self._method_configs["BatchWrite"].retry, + default_timeout=self._method_configs["BatchWrite"].timeout, + client_info=self._client_info, + ) + + request = firestore_pb2.BatchWriteRequest( + database=database, writes=writes, labels=labels, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("database", database)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["batch_write"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + def begin_transaction( self, database, @@ -887,7 +975,8 @@ def begin_transaction( >>> >>> client = firestore_v1.FirestoreClient() >>> - >>> database = client.database_root_path('[PROJECT]', '[DATABASE]') + >>> # TODO: Initialize `database`: + >>> database = '' >>> >>> response = client.begin_transaction(database) @@ -930,7 +1019,7 @@ def begin_transaction( ) request = firestore_pb2.BeginTransactionRequest( - database=database, options=options_ + database=database, options=options_, ) if metadata is None: metadata = [] @@ -952,7 +1041,7 @@ def begin_transaction( def commit( self, database, - writes, + writes=None, transaction=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, @@ -966,12 +1055,10 @@ def commit( >>> >>> client = firestore_v1.FirestoreClient() >>> - >>> database = client.database_root_path('[PROJECT]', '[DATABASE]') + >>> # TODO: Initialize `database`: + >>> database = '' >>> - >>> # TODO: Initialize `writes`: - >>> writes = [] - >>> - >>> response = client.commit(database, writes) + >>> response = client.commit(database) Args: database (str): Required. The database name. In the format: @@ -1014,7 +1101,7 @@ def commit( ) request = firestore_pb2.CommitRequest( - database=database, writes=writes, transaction=transaction + database=database, writes=writes, transaction=transaction, ) if metadata is None: metadata = [] @@ -1049,7 +1136,8 @@ def rollback( >>> >>> client = firestore_v1.FirestoreClient() >>> - >>> database = client.database_root_path('[PROJECT]', '[DATABASE]') + >>> # TODO: Initialize `database`: + >>> database = '' >>> >>> # TODO: Initialize `transaction`: >>> transaction = b'' @@ -1088,7 +1176,7 @@ def rollback( ) request = firestore_pb2.RollbackRequest( - database=database, transaction=transaction + database=database, transaction=transaction, ) if metadata is None: metadata = [] @@ -1126,7 +1214,8 @@ def run_query( >>> >>> client = firestore_v1.FirestoreClient() >>> - >>> parent = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') + >>> # TODO: Initialize `parent`: + >>> parent = '' >>> >>> for element in client.run_query(parent): ... # process element @@ -1151,7 +1240,7 @@ def run_query( If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.firestore_v1.types.TransactionOptions` read_time (Union[dict, ~google.cloud.firestore_v1.types.Timestamp]): Reads documents as they were at the given time. - This may not be older than 60 seconds. + This may not be older than 270 seconds. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.firestore_v1.types.Timestamp` @@ -1187,7 +1276,7 @@ def run_query( # Sanity check: We have some fields which are mutually exclusive; # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof(structured_query=structured_query) + google.api_core.protobuf_helpers.check_oneof(structured_query=structured_query,) # Sanity check: We have some fields which are mutually exclusive; # raise ValueError if more than one is sent. @@ -1231,14 +1320,13 @@ def write( """ Streams batches of document updates and deletes, in order. - EXPERIMENTAL: This method interface might change in the future. - Example: >>> from google.cloud import firestore_v1 >>> >>> client = firestore_v1.FirestoreClient() >>> - >>> database = client.database_root_path('[PROJECT]', '[DATABASE]') + >>> # TODO: Initialize `database`: + >>> database = '' >>> request = {'database': database} >>> >>> requests = [request] @@ -1293,14 +1381,13 @@ def listen( """ Listens to changes. - EXPERIMENTAL: This method interface might change in the future. - Example: >>> from google.cloud import firestore_v1 >>> >>> client = firestore_v1.FirestoreClient() >>> - >>> database = client.database_root_path('[PROJECT]', '[DATABASE]') + >>> # TODO: Initialize `database`: + >>> database = '' >>> request = {'database': database} >>> >>> requests = [request] @@ -1361,7 +1448,8 @@ def list_collection_ids( >>> >>> client = firestore_v1.FirestoreClient() >>> - >>> parent = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') + >>> # TODO: Initialize `parent`: + >>> parent = '' >>> >>> # Iterate over all results >>> for element in client.list_collection_ids(parent): @@ -1421,7 +1509,7 @@ def list_collection_ids( ) request = firestore_pb2.ListCollectionIdsRequest( - parent=parent, page_size=page_size + parent=parent, page_size=page_size, ) if metadata is None: metadata = [] @@ -1450,3 +1538,135 @@ def list_collection_ids( response_token_field="next_page_token", ) return iterator + + def partition_query( + self, + parent, + structured_query=None, + partition_count=None, + page_size=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Partitions a query by returning partition cursors that can be used to run + the query in parallel. The returned partition cursors are split points that + can be used by RunQuery as starting/end points for the query results. + + Example: + >>> from google.cloud import firestore_v1 + >>> + >>> client = firestore_v1.FirestoreClient() + >>> + >>> # TODO: Initialize `parent`: + >>> parent = '' + >>> + >>> # Iterate over all results + >>> for element in client.partition_query(parent): + ... # process element + ... pass + >>> + >>> + >>> # Alternatively: + >>> + >>> # Iterate over results one page at a time + >>> for page in client.partition_query(parent).pages: + ... for element in page: + ... # process element + ... pass + + Args: + parent (str): Required. The parent resource name. In the format: + ``projects/{project_id}/databases/{database_id}/documents``. Document + resource names are not supported; only database resource names can be + specified. + structured_query (Union[dict, ~google.cloud.firestore_v1.types.StructuredQuery]): A structured query. + Filters, order bys, limits, offsets, and start/end cursors are not + supported. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.firestore_v1.types.StructuredQuery` + partition_count (long): The desired maximum number of partition points. + The partitions may be returned across multiple pages of results. + The number must be strictly positive. The actual number of partitions + returned may be fewer. + + For example, this may be set to one fewer than the number of parallel + queries to be run, or in running a data pipeline job, one fewer than the + number of workers or compute instances available. + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.api_core.page_iterator.PageIterator` instance. + An iterable of :class:`~google.cloud.firestore_v1.types.Cursor` instances. + You can also iterate over the pages of the response + using its `pages` property. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "partition_query" not in self._inner_api_calls: + self._inner_api_calls[ + "partition_query" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.partition_query, + default_retry=self._method_configs["PartitionQuery"].retry, + default_timeout=self._method_configs["PartitionQuery"].timeout, + client_info=self._client_info, + ) + + # Sanity check: We have some fields which are mutually exclusive; + # raise ValueError if more than one is sent. + google.api_core.protobuf_helpers.check_oneof(structured_query=structured_query,) + + request = firestore_pb2.PartitionQueryRequest( + parent=parent, + structured_query=structured_query, + partition_count=partition_count, + page_size=page_size, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._inner_api_calls["partition_query"], + retry=retry, + timeout=timeout, + metadata=metadata, + ), + request=request, + items_field="partitions", + request_token_field="page_token", + response_token_field="next_page_token", + ) + return iterator diff --git a/google/cloud/firestore_v1/gapic/firestore_client_config.py b/google/cloud/firestore_v1/gapic/firestore_client_config.py index 53f9f267d..95cdc8cd3 100644 --- a/google/cloud/firestore_v1/gapic/firestore_client_config.py +++ b/google/cloud/firestore_v1/gapic/firestore_client_config.py @@ -3,7 +3,9 @@ "google.firestore.v1.Firestore": { "retry_codes": { "idempotent": ["DEADLINE_EXCEEDED", "INTERNAL", "UNAVAILABLE"], + "aborted_unavailable": ["ABORTED", "UNAVAILABLE"], "non_idempotent": [], + "idempotent2": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], }, "retry_params": { "default": { @@ -28,12 +30,12 @@ "methods": { "GetDocument": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "idempotent2", "retry_params_name": "default", }, "ListDocuments": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "idempotent2", "retry_params_name": "default", }, "CreateDocument": { @@ -52,10 +54,15 @@ "retry_params_name": "default", }, "BatchGetDocuments": { - "timeout_millis": 300000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "streaming", }, + "BatchWrite": { + "timeout_millis": 60000, + "retry_codes_name": "aborted_unavailable", + "retry_params_name": "default", + }, "BeginTransaction": { "timeout_millis": 60000, "retry_codes_name": "idempotent", @@ -77,12 +84,12 @@ "retry_params_name": "streaming", }, "Write": { - "timeout_millis": 86400000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "streaming", }, "Listen": { - "timeout_millis": 86400000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "streaming", }, @@ -91,6 +98,11 @@ "retry_codes_name": "idempotent", "retry_params_name": "default", }, + "PartitionQuery": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, }, } } diff --git a/google/cloud/firestore_v1/gapic/transports/firestore_grpc_transport.py b/google/cloud/firestore_v1/gapic/transports/firestore_grpc_transport.py index ce730eaac..13cfc84e8 100644 --- a/google/cloud/firestore_v1/gapic/transports/firestore_grpc_transport.py +++ b/google/cloud/firestore_v1/gapic/transports/firestore_grpc_transport.py @@ -56,7 +56,7 @@ def __init__( # exception (channels come with credentials baked in already). if channel is not None and credentials is not None: raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." + "The `channel` and `credentials` arguments are mutually " "exclusive.", ) # Create the channel. @@ -74,7 +74,9 @@ def __init__( # gRPC uses objects called "stubs" that are bound to the # channel and provide a basic method for each RPC. - self._stubs = {"firestore_stub": firestore_pb2_grpc.FirestoreStub(channel)} + self._stubs = { + "firestore_stub": firestore_pb2_grpc.FirestoreStub(channel), + } @classmethod def create_channel( @@ -189,6 +191,27 @@ def batch_get_documents(self): """ return self._stubs["firestore_stub"].BatchGetDocuments + @property + def batch_write(self): + """Return the gRPC stub for :meth:`FirestoreClient.batch_write`. + + Applies a batch of write operations. + + The BatchWrite method does not apply the write operations atomically and + can apply them out of order. Method does not allow more than one write + per document. Each write succeeds or fails independently. See the + ``BatchWriteResponse`` for the success status of each write. + + If you require an atomically applied set of writes, use ``Commit`` + instead. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["firestore_stub"].BatchWrite + @property def begin_transaction(self): """Return the gRPC stub for :meth:`FirestoreClient.begin_transaction`. @@ -279,3 +302,18 @@ def list_collection_ids(self): deserialized response object. """ return self._stubs["firestore_stub"].ListCollectionIds + + @property + def partition_query(self): + """Return the gRPC stub for :meth:`FirestoreClient.partition_query`. + + Partitions a query by returning partition cursors that can be used to run + the query in parallel. The returned partition cursors are split points that + can be used by RunQuery as starting/end points for the query results. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["firestore_stub"].PartitionQuery diff --git a/google/cloud/firestore_v1/proto/common.proto b/google/cloud/firestore_v1/proto/common.proto index 8e2ef27ff..4367f168d 100644 --- a/google/cloud/firestore_v1/proto/common.proto +++ b/google/cloud/firestore_v1/proto/common.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -27,6 +26,7 @@ option java_outer_classname = "CommonProto"; option java_package = "com.google.firestore.v1"; option objc_class_prefix = "GCFS"; option php_namespace = "Google\\Cloud\\Firestore\\V1"; +option ruby_package = "Google::Cloud::Firestore::V1"; // A set of field paths on a document. // Used to restrict a get or update operation on a document to a subset of its diff --git a/google/cloud/firestore_v1/proto/common_pb2.py b/google/cloud/firestore_v1/proto/common_pb2.py index 3d25c5b80..7aea997da 100644 --- a/google/cloud/firestore_v1/proto/common_pb2.py +++ b/google/cloud/firestore_v1/proto/common_pb2.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/firestore_v1/proto/common.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -23,12 +20,9 @@ name="google/cloud/firestore_v1/proto/common.proto", package="google.firestore.v1", syntax="proto3", - serialized_options=_b( - "\n\027com.google.firestore.v1B\013CommonProtoP\001Z labels = 3; +} + +// The response from [Firestore.BatchWrite][google.firestore.v1.Firestore.BatchWrite]. +message BatchWriteResponse { + // The result of applying the writes. + // + // This i-th write result corresponds to the i-th write in the + // request. + repeated WriteResult write_results = 1; + + // The status of applying the writes. + // + // This i-th write status corresponds to the i-th write in the + // request. + repeated google.rpc.Status status = 2; +} diff --git a/google/cloud/firestore_v1/proto/firestore_pb2.py b/google/cloud/firestore_v1/proto/firestore_pb2.py index 06e39be5b..c4e854268 100644 --- a/google/cloud/firestore_v1/proto/firestore_pb2.py +++ b/google/cloud/firestore_v1/proto/firestore_pb2.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/firestore_v1/proto/firestore.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -39,12 +36,9 @@ name="google/cloud/firestore_v1/proto/firestore.proto", package="google.firestore.v1", syntax="proto3", - serialized_options=_b( - "\n\027com.google.firestore.v1B\016FirestoreProtoP\001Z\n\x06labels\x18\x04 \x03(\x0b\x32..google.firestore.v1.ListenRequest.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x0f\n\rtarget_change"\xd5\x02\n\x0eListenResponse\x12:\n\rtarget_change\x18\x02 \x01(\x0b\x32!.google.firestore.v1.TargetChangeH\x00\x12>\n\x0f\x64ocument_change\x18\x03 \x01(\x0b\x32#.google.firestore.v1.DocumentChangeH\x00\x12>\n\x0f\x64ocument_delete\x18\x04 \x01(\x0b\x32#.google.firestore.v1.DocumentDeleteH\x00\x12>\n\x0f\x64ocument_remove\x18\x06 \x01(\x0b\x32#.google.firestore.v1.DocumentRemoveH\x00\x12\x36\n\x06\x66ilter\x18\x05 \x01(\x0b\x32$.google.firestore.v1.ExistenceFilterH\x00\x42\x0f\n\rresponse_type"\xa1\x03\n\x06Target\x12\x38\n\x05query\x18\x02 \x01(\x0b\x32\'.google.firestore.v1.Target.QueryTargetH\x00\x12@\n\tdocuments\x18\x03 \x01(\x0b\x32+.google.firestore.v1.Target.DocumentsTargetH\x00\x12\x16\n\x0cresume_token\x18\x04 \x01(\x0cH\x01\x12/\n\tread_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12\x11\n\ttarget_id\x18\x05 \x01(\x05\x12\x0c\n\x04once\x18\x06 \x01(\x08\x1a$\n\x0f\x44ocumentsTarget\x12\x11\n\tdocuments\x18\x02 \x03(\t\x1am\n\x0bQueryTarget\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12@\n\x10structured_query\x18\x02 \x01(\x0b\x32$.google.firestore.v1.StructuredQueryH\x00\x42\x0c\n\nquery_typeB\r\n\x0btarget_typeB\r\n\x0bresume_type"\xaa\x02\n\x0cTargetChange\x12N\n\x12target_change_type\x18\x01 \x01(\x0e\x32\x32.google.firestore.v1.TargetChange.TargetChangeType\x12\x12\n\ntarget_ids\x18\x02 \x03(\x05\x12!\n\x05\x63\x61use\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12\x14\n\x0cresume_token\x18\x04 \x01(\x0c\x12-\n\tread_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"N\n\x10TargetChangeType\x12\r\n\tNO_CHANGE\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x12\x0b\n\x07\x43URRENT\x10\x03\x12\t\n\x05RESET\x10\x04"V\n\x18ListCollectionIdsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"L\n\x19ListCollectionIdsResponse\x12\x16\n\x0e\x63ollection_ids\x18\x01 \x03(\t\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xd7\x13\n\tFirestore\x12\x8f\x01\n\x0bGetDocument\x12\'.google.firestore.v1.GetDocumentRequest\x1a\x1d.google.firestore.v1.Document"8\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{name=projects/*/databases/*/documents/*/**}\x12\xb2\x01\n\rListDocuments\x12).google.firestore.v1.ListDocumentsRequest\x1a*.google.firestore.v1.ListDocumentsResponse"J\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}\x12\xaf\x01\n\x0e\x43reateDocument\x12*.google.firestore.v1.CreateDocumentRequest\x1a\x1d.google.firestore.v1.Document"R\x82\xd3\xe4\x93\x02L"@/v1/{parent=projects/*/databases/*/documents/**}/{collection_id}:\x08\x64ocument\x12\xbf\x01\n\x0eUpdateDocument\x12*.google.firestore.v1.UpdateDocumentRequest\x1a\x1d.google.firestore.v1.Document"b\x82\xd3\xe4\x93\x02\x45\x32\x39/v1/{document.name=projects/*/databases/*/documents/*/**}:\x08\x64ocument\xda\x41\x14\x64ocument,update_mask\x12\x95\x01\n\x0e\x44\x65leteDocument\x12*.google.firestore.v1.DeleteDocumentRequest\x1a\x16.google.protobuf.Empty"?\x82\xd3\xe4\x93\x02\x32*0/v1/{name=projects/*/databases/*/documents/*/**}\xda\x41\x04name\x12\xb9\x01\n\x11\x42\x61tchGetDocuments\x12-.google.firestore.v1.BatchGetDocumentsRequest\x1a..google.firestore.v1.BatchGetDocumentsResponse"C\x82\xd3\xe4\x93\x02="8/v1/{database=projects/*/databases/*}/documents:batchGet:\x01*0\x01\x12\xc7\x01\n\x10\x42\x65ginTransaction\x12,.google.firestore.v1.BeginTransactionRequest\x1a-.google.firestore.v1.BeginTransactionResponse"V\x82\xd3\xe4\x93\x02\x45"@/v1/{database=projects/*/databases/*}/documents:beginTransaction:\x01*\xda\x41\x08\x64\x61tabase\x12\xa6\x01\n\x06\x43ommit\x12".google.firestore.v1.CommitRequest\x1a#.google.firestore.v1.CommitResponse"S\x82\xd3\xe4\x93\x02;"6/v1/{database=projects/*/databases/*}/documents:commit:\x01*\xda\x41\x0f\x64\x61tabase,writes\x12\xa4\x01\n\x08Rollback\x12$.google.firestore.v1.RollbackRequest\x1a\x16.google.protobuf.Empty"Z\x82\xd3\xe4\x93\x02="8/v1/{database=projects/*/databases/*}/documents:rollback:\x01*\xda\x41\x14\x64\x61tabase,transaction\x12\xdf\x01\n\x08RunQuery\x12$.google.firestore.v1.RunQueryRequest\x1a%.google.firestore.v1.RunQueryResponse"\x83\x01\x82\xd3\xe4\x93\x02}"6/v1/{parent=projects/*/databases/*/documents}:runQuery:\x01*Z@";/v1/{parent=projects/*/databases/*/documents/*/**}:runQuery:\x01*0\x01\x12\x94\x01\n\x05Write\x12!.google.firestore.v1.WriteRequest\x1a".google.firestore.v1.WriteResponse"@\x82\xd3\xe4\x93\x02:"5/v1/{database=projects/*/databases/*}/documents:write:\x01*(\x01\x30\x01\x12\x98\x01\n\x06Listen\x12".google.firestore.v1.ListenRequest\x1a#.google.firestore.v1.ListenResponse"A\x82\xd3\xe4\x93\x02;"6/v1/{database=projects/*/databases/*}/documents:listen:\x01*(\x01\x30\x01\x12\x94\x02\n\x11ListCollectionIds\x12-.google.firestore.v1.ListCollectionIdsRequest\x1a..google.firestore.v1.ListCollectionIdsResponse"\x9f\x01\x82\xd3\xe4\x93\x02\x8f\x01"?/v1/{parent=projects/*/databases/*/documents}:listCollectionIds:\x01*ZI"D/v1/{parent=projects/*/databases/*/documents/*/**}:listCollectionIds:\x01*\xda\x41\x06parent\x1av\xca\x41\x18\x66irestore.googleapis.com\xd2\x41Xhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastoreB\xa8\x01\n\x17\x63om.google.firestore.v1B\x0e\x46irestoreProtoP\x01Z\n\x06labels\x18\x04 \x03(\x0b\x32..google.firestore.v1.ListenRequest.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x0f\n\rtarget_change"\xd5\x02\n\x0eListenResponse\x12:\n\rtarget_change\x18\x02 \x01(\x0b\x32!.google.firestore.v1.TargetChangeH\x00\x12>\n\x0f\x64ocument_change\x18\x03 \x01(\x0b\x32#.google.firestore.v1.DocumentChangeH\x00\x12>\n\x0f\x64ocument_delete\x18\x04 \x01(\x0b\x32#.google.firestore.v1.DocumentDeleteH\x00\x12>\n\x0f\x64ocument_remove\x18\x06 \x01(\x0b\x32#.google.firestore.v1.DocumentRemoveH\x00\x12\x36\n\x06\x66ilter\x18\x05 \x01(\x0b\x32$.google.firestore.v1.ExistenceFilterH\x00\x42\x0f\n\rresponse_type"\xa1\x03\n\x06Target\x12\x38\n\x05query\x18\x02 \x01(\x0b\x32\'.google.firestore.v1.Target.QueryTargetH\x00\x12@\n\tdocuments\x18\x03 \x01(\x0b\x32+.google.firestore.v1.Target.DocumentsTargetH\x00\x12\x16\n\x0cresume_token\x18\x04 \x01(\x0cH\x01\x12/\n\tread_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12\x11\n\ttarget_id\x18\x05 \x01(\x05\x12\x0c\n\x04once\x18\x06 \x01(\x08\x1a$\n\x0f\x44ocumentsTarget\x12\x11\n\tdocuments\x18\x02 \x03(\t\x1am\n\x0bQueryTarget\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12@\n\x10structured_query\x18\x02 \x01(\x0b\x32$.google.firestore.v1.StructuredQueryH\x00\x42\x0c\n\nquery_typeB\r\n\x0btarget_typeB\r\n\x0bresume_type"\xaa\x02\n\x0cTargetChange\x12N\n\x12target_change_type\x18\x01 \x01(\x0e\x32\x32.google.firestore.v1.TargetChange.TargetChangeType\x12\x12\n\ntarget_ids\x18\x02 \x03(\x05\x12!\n\x05\x63\x61use\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12\x14\n\x0cresume_token\x18\x04 \x01(\x0c\x12-\n\tread_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"N\n\x10TargetChangeType\x12\r\n\tNO_CHANGE\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x12\x0b\n\x07\x43URRENT\x10\x03\x12\t\n\x05RESET\x10\x04"V\n\x18ListCollectionIdsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"L\n\x19ListCollectionIdsResponse\x12\x16\n\x0e\x63ollection_ids\x18\x01 \x03(\t\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\xc9\x01\n\x11\x42\x61tchWriteRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12*\n\x06writes\x18\x02 \x03(\x0b\x32\x1a.google.firestore.v1.Write\x12\x42\n\x06labels\x18\x03 \x03(\x0b\x32\x32.google.firestore.v1.BatchWriteRequest.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"q\n\x12\x42\x61tchWriteResponse\x12\x37\n\rwrite_results\x18\x01 \x03(\x0b\x32 .google.firestore.v1.WriteResult\x12"\n\x06status\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status2\xfd\x16\n\tFirestore\x12\x8f\x01\n\x0bGetDocument\x12\'.google.firestore.v1.GetDocumentRequest\x1a\x1d.google.firestore.v1.Document"8\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{name=projects/*/databases/*/documents/*/**}\x12\xb2\x01\n\rListDocuments\x12).google.firestore.v1.ListDocumentsRequest\x1a*.google.firestore.v1.ListDocumentsResponse"J\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}\x12\xbf\x01\n\x0eUpdateDocument\x12*.google.firestore.v1.UpdateDocumentRequest\x1a\x1d.google.firestore.v1.Document"b\x82\xd3\xe4\x93\x02\x45\x32\x39/v1/{document.name=projects/*/databases/*/documents/*/**}:\x08\x64ocument\xda\x41\x14\x64ocument,update_mask\x12\x95\x01\n\x0e\x44\x65leteDocument\x12*.google.firestore.v1.DeleteDocumentRequest\x1a\x16.google.protobuf.Empty"?\x82\xd3\xe4\x93\x02\x32*0/v1/{name=projects/*/databases/*/documents/*/**}\xda\x41\x04name\x12\xb9\x01\n\x11\x42\x61tchGetDocuments\x12-.google.firestore.v1.BatchGetDocumentsRequest\x1a..google.firestore.v1.BatchGetDocumentsResponse"C\x82\xd3\xe4\x93\x02="8/v1/{database=projects/*/databases/*}/documents:batchGet:\x01*0\x01\x12\xc7\x01\n\x10\x42\x65ginTransaction\x12,.google.firestore.v1.BeginTransactionRequest\x1a-.google.firestore.v1.BeginTransactionResponse"V\x82\xd3\xe4\x93\x02\x45"@/v1/{database=projects/*/databases/*}/documents:beginTransaction:\x01*\xda\x41\x08\x64\x61tabase\x12\xa6\x01\n\x06\x43ommit\x12".google.firestore.v1.CommitRequest\x1a#.google.firestore.v1.CommitResponse"S\x82\xd3\xe4\x93\x02;"6/v1/{database=projects/*/databases/*}/documents:commit:\x01*\xda\x41\x0f\x64\x61tabase,writes\x12\xa4\x01\n\x08Rollback\x12$.google.firestore.v1.RollbackRequest\x1a\x16.google.protobuf.Empty"Z\x82\xd3\xe4\x93\x02="8/v1/{database=projects/*/databases/*}/documents:rollback:\x01*\xda\x41\x14\x64\x61tabase,transaction\x12\xdf\x01\n\x08RunQuery\x12$.google.firestore.v1.RunQueryRequest\x1a%.google.firestore.v1.RunQueryResponse"\x83\x01\x82\xd3\xe4\x93\x02}"6/v1/{parent=projects/*/databases/*/documents}:runQuery:\x01*Z@";/v1/{parent=projects/*/databases/*/documents/*/**}:runQuery:\x01*0\x01\x12\xfc\x01\n\x0ePartitionQuery\x12*.google.firestore.v1.PartitionQueryRequest\x1a+.google.firestore.v1.PartitionQueryResponse"\x90\x01\x82\xd3\xe4\x93\x02\x89\x01"= 0 if specified. """, # @@protoc_insertion_point(class_scope:google.firestore.v1.StructuredQuery) - ), + }, ) _sym_db.RegisterMessage(StructuredQuery) _sym_db.RegisterMessage(StructuredQuery.CollectionSelector) @@ -1168,18 +1249,17 @@ _sym_db.RegisterMessage(StructuredQuery.CompositeFilter) _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.Order) Cursor = _reflection.GeneratedProtocolMessageType( "Cursor", (_message.Message,), - dict( - DESCRIPTOR=_CURSOR, - __module__="google.cloud.firestore_v1.proto.query_pb2", - __doc__="""A position in a query result set. - + { + "DESCRIPTOR": _CURSOR, + "__module__": "google.cloud.firestore_v1.proto.query_pb2", + "__doc__": """A position in a query result set. Attributes: values: @@ -1191,7 +1271,7 @@ relative to the sort order defined by the query. """, # @@protoc_insertion_point(class_scope:google.firestore.v1.Cursor) - ), + }, ) _sym_db.RegisterMessage(Cursor) diff --git a/google/cloud/firestore_v1/proto/query_pb2_grpc.py b/google/cloud/firestore_v1/proto/query_pb2_grpc.py index 07cb78fe0..8a9393943 100644 --- a/google/cloud/firestore_v1/proto/query_pb2_grpc.py +++ b/google/cloud/firestore_v1/proto/query_pb2_grpc.py @@ -1,2 +1,3 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc diff --git a/google/cloud/firestore_v1/proto/write.proto b/google/cloud/firestore_v1/proto/write.proto index 51d923918..a6befb0e6 100644 --- a/google/cloud/firestore_v1/proto/write.proto +++ b/google/cloud/firestore_v1/proto/write.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -29,6 +28,7 @@ option java_outer_classname = "WriteProto"; option java_package = "com.google.firestore.v1"; option objc_class_prefix = "GCFS"; option php_namespace = "Google\\Cloud\\Firestore\\V1"; +option ruby_package = "Google::Cloud::Firestore::V1"; // A write on a document. message Write { @@ -42,9 +42,6 @@ message Write { string delete = 2; // Applies a transformation to a document. - // At most one `transform` per document is allowed in a given request. - // An `update` cannot follow a `transform` on the same document in a given - // request. DocumentTransform transform = 6; } @@ -60,6 +57,13 @@ message Write { // The field paths in this mask must not contain a reserved field name. DocumentMask update_mask = 3; + // The transforms to perform after update. + // + // This field can be set only when the operation is `update`. If present, this + // write is equivalent to performing `update` and `transform` to the same + // document atomically and in order. + repeated DocumentTransform.FieldTransform update_transforms = 7; + // An optional precondition on the document. // // The write will fail if this is set and not met by the target document. diff --git a/google/cloud/firestore_v1/proto/write_pb2.py b/google/cloud/firestore_v1/proto/write_pb2.py index 1ed1c4424..bcfd76ca1 100644 --- a/google/cloud/firestore_v1/proto/write_pb2.py +++ b/google/cloud/firestore_v1/proto/write_pb2.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/firestore_v1/proto/write.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -29,12 +26,9 @@ name="google/cloud/firestore_v1/proto/write.proto", package="google.firestore.v1", syntax="proto3", - serialized_options=_b( - "\n\027com.google.firestore.v1B\nWriteProtoP\001Z>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> - >>> name = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') + >>> # TODO: Initialize `name`: + >>> name = '' >>> - >>> response = client.get_document(name) + >>> client.delete_document(name) Args: - name (str): Required. The resource name of the Document to get. In the format: + name (str): Required. The resource name of the Document to delete. In the + format: ``projects/{project_id}/databases/{database_id}/documents/{document_path}``. - mask (Union[dict, ~google.cloud.firestore_v1beta1.types.DocumentMask]): The fields to return. If not set, returns all fields. - - If the document has a field that is not present in this mask, that field - will not be returned in the response. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_v1beta1.types.DocumentMask` - transaction (bytes): Reads the document in a transaction. - read_time (Union[dict, ~google.cloud.firestore_v1beta1.types.Timestamp]): Reads the version of the document at the given time. - This may not be older than 60 seconds. + current_document (Union[dict, ~google.cloud.firestore_v1beta1.types.Precondition]): An optional precondition on the document. + The request will fail if this is set and not met by the target document. If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_v1beta1.types.Timestamp` + message :class:`~google.cloud.firestore_v1beta1.types.Precondition` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -297,9 +288,6 @@ def get_document( metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata that is provided to the method. - Returns: - A :class:`~google.cloud.firestore_v1beta1.types.Document` instance. - Raises: google.api_core.exceptions.GoogleAPICallError: If the request failed for any reason. @@ -308,24 +296,18 @@ def get_document( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "get_document" not in self._inner_api_calls: + if "delete_document" not in self._inner_api_calls: self._inner_api_calls[ - "get_document" + "delete_document" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_document, - default_retry=self._method_configs["GetDocument"].retry, - default_timeout=self._method_configs["GetDocument"].timeout, + self.transport.delete_document, + default_retry=self._method_configs["DeleteDocument"].retry, + default_timeout=self._method_configs["DeleteDocument"].timeout, client_info=self._client_info, ) - # Sanity check: We have some fields which are mutually exclusive; - # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof( - transaction=transaction, read_time=read_time - ) - - request = firestore_pb2.GetDocumentRequest( - name=name, mask=mask, transaction=transaction, read_time=read_time + request = firestore_pb2.DeleteDocumentRequest( + name=name, current_document=current_document, ) if metadata is None: metadata = [] @@ -340,85 +322,67 @@ def get_document( ) metadata.append(routing_metadata) - return self._inner_api_calls["get_document"]( + self._inner_api_calls["delete_document"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def list_documents( + def batch_get_documents( self, - parent, - collection_id, - page_size=None, - order_by=None, + database, + documents=None, mask=None, transaction=None, + new_transaction=None, read_time=None, - show_missing=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Lists documents. + Gets multiple documents. + + Documents returned by this method are not guaranteed to be returned in the + same order that they were requested. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> - >>> parent = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') - >>> - >>> # TODO: Initialize `collection_id`: - >>> collection_id = '' + >>> # TODO: Initialize `database`: + >>> database = '' >>> - >>> # Iterate over all results - >>> for element in client.list_documents(parent, collection_id): + >>> for element in client.batch_get_documents(database): ... # process element ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_documents(parent, collection_id).pages: - ... for element in page: - ... # process element - ... pass Args: - parent (str): Required. The parent resource name. In the format: - ``projects/{project_id}/databases/{database_id}/documents`` or + database (str): Required. The database name. In the format: + ``projects/{project_id}/databases/{database_id}``. + documents (list[str]): The names of the documents to retrieve. In the format: ``projects/{project_id}/databases/{database_id}/documents/{document_path}``. - For example: ``projects/my-project/databases/my-database/documents`` or - ``projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`` - collection_id (str): Required. The collection ID, relative to ``parent``, to list. For - example: ``chatrooms`` or ``messages``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - order_by (str): The order to sort results by. For example: ``priority desc, name``. + The request will fail if any of the document is not a child resource of + the given ``database``. Duplicate names will be elided. mask (Union[dict, ~google.cloud.firestore_v1beta1.types.DocumentMask]): The fields to return. If not set, returns all fields. - If a document has a field that is not present in this mask, that field - will not be returned in the response. + If a document has a field that is not present in this mask, that field will + not be returned in the response. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.firestore_v1beta1.types.DocumentMask` transaction (bytes): Reads documents in a transaction. + new_transaction (Union[dict, ~google.cloud.firestore_v1beta1.types.TransactionOptions]): Starts a new transaction and reads the documents. + Defaults to a read-only transaction. + The new transaction ID will be returned as the first response in the + stream. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.firestore_v1beta1.types.TransactionOptions` read_time (Union[dict, ~google.cloud.firestore_v1beta1.types.Timestamp]): Reads documents as they were at the given time. This may not be older than 60 seconds. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.firestore_v1beta1.types.Timestamp` - show_missing (bool): If the list should show missing documents. A missing document is a - document that does not exist but has sub-documents. These documents will - be returned with a key but will not have fields, - ``Document.create_time``, or ``Document.update_time`` set. - - Requests with ``show_missing`` may not specify ``where`` or - ``order_by``. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -429,10 +393,7 @@ def list_documents( that is provided to the method. Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.firestore_v1beta1.types.Document` instances. - You can also iterate over the pages of the response - using its `pages` property. + Iterable[~google.cloud.firestore_v1beta1.types.BatchGetDocumentsResponse]. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -442,99 +403,78 @@ def list_documents( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "list_documents" not in self._inner_api_calls: + if "batch_get_documents" not in self._inner_api_calls: self._inner_api_calls[ - "list_documents" + "batch_get_documents" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_documents, - default_retry=self._method_configs["ListDocuments"].retry, - default_timeout=self._method_configs["ListDocuments"].timeout, + self.transport.batch_get_documents, + default_retry=self._method_configs["BatchGetDocuments"].retry, + default_timeout=self._method_configs["BatchGetDocuments"].timeout, client_info=self._client_info, ) # Sanity check: We have some fields which are mutually exclusive; # raise ValueError if more than one is sent. google.api_core.protobuf_helpers.check_oneof( - transaction=transaction, read_time=read_time + transaction=transaction, + new_transaction=new_transaction, + read_time=read_time, ) - request = firestore_pb2.ListDocumentsRequest( - parent=parent, - collection_id=collection_id, - page_size=page_size, - order_by=order_by, + request = firestore_pb2.BatchGetDocumentsRequest( + database=database, + documents=documents, mask=mask, transaction=transaction, + new_transaction=new_transaction, read_time=read_time, - show_missing=show_missing, ) - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_documents"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="documents", - request_token_field="page_token", - response_token_field="next_page_token", + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("database", database)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["batch_get_documents"]( + request, retry=retry, timeout=timeout, metadata=metadata ) - return iterator - def create_document( + def begin_transaction( self, - parent, - collection_id, - document_id, - document, - mask=None, + database, + options_=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Creates a new document. + Starts a new transaction. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> - >>> parent = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') - >>> - >>> # TODO: Initialize `collection_id`: - >>> collection_id = '' - >>> - >>> # TODO: Initialize `document_id`: - >>> document_id = '' - >>> - >>> # TODO: Initialize `document`: - >>> document = {} + >>> # TODO: Initialize `database`: + >>> database = '' >>> - >>> response = client.create_document(parent, collection_id, document_id, document) + >>> response = client.begin_transaction(database) Args: - parent (str): Required. The parent resource. For example: - ``projects/{project_id}/databases/{database_id}/documents`` or - ``projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`` - collection_id (str): Required. The collection ID, relative to ``parent``, to list. For - example: ``chatrooms``. - document_id (str): The client-assigned document ID to use for this document. - - Optional. If not specified, an ID will be assigned by the service. - document (Union[dict, ~google.cloud.firestore_v1beta1.types.Document]): Required. The document to create. ``name`` must not be set. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_v1beta1.types.Document` - mask (Union[dict, ~google.cloud.firestore_v1beta1.types.DocumentMask]): The fields to return. If not set, returns all fields. - - If the document has a field that is not present in this mask, that field - will not be returned in the response. + database (str): Required. The database name. In the format: + ``projects/{project_id}/databases/{database_id}``. + options_ (Union[dict, ~google.cloud.firestore_v1beta1.types.TransactionOptions]): The options for the transaction. + Defaults to a read-write transaction. If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_v1beta1.types.DocumentMask` + message :class:`~google.cloud.firestore_v1beta1.types.TransactionOptions` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -545,7 +485,7 @@ def create_document( that is provided to the method. Returns: - A :class:`~google.cloud.firestore_v1beta1.types.Document` instance. + A :class:`~google.cloud.firestore_v1beta1.types.BeginTransactionResponse` instance. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -555,162 +495,64 @@ def create_document( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "create_document" not in self._inner_api_calls: + if "begin_transaction" not in self._inner_api_calls: self._inner_api_calls[ - "create_document" + "begin_transaction" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_document, - default_retry=self._method_configs["CreateDocument"].retry, - default_timeout=self._method_configs["CreateDocument"].timeout, + self.transport.begin_transaction, + default_retry=self._method_configs["BeginTransaction"].retry, + default_timeout=self._method_configs["BeginTransaction"].timeout, client_info=self._client_info, ) - request = firestore_pb2.CreateDocumentRequest( - parent=parent, - collection_id=collection_id, - document_id=document_id, - document=document, - mask=mask, + request = firestore_pb2.BeginTransactionRequest( + database=database, options=options_, ) - return self._inner_api_calls["create_document"]( + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("database", database)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["begin_transaction"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def update_document( + def rollback( self, - document, - update_mask, - mask=None, - current_document=None, + database, + transaction, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Updates or inserts a document. + Rolls back a transaction. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> - >>> # TODO: Initialize `document`: - >>> document = {} + >>> # TODO: Initialize `database`: + >>> database = '' >>> - >>> # TODO: Initialize `update_mask`: - >>> update_mask = {} + >>> # TODO: Initialize `transaction`: + >>> transaction = b'' >>> - >>> response = client.update_document(document, update_mask) + >>> client.rollback(database, transaction) Args: - document (Union[dict, ~google.cloud.firestore_v1beta1.types.Document]): Required. The updated document. - Creates the document if it does not already exist. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_v1beta1.types.Document` - update_mask (Union[dict, ~google.cloud.firestore_v1beta1.types.DocumentMask]): The fields to update. - None of the field paths in the mask may contain a reserved name. - - If the document exists on the server and has fields not referenced in the - mask, they are left unchanged. - Fields referenced in the mask, but not present in the input document, are - deleted from the document on the server. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_v1beta1.types.DocumentMask` - mask (Union[dict, ~google.cloud.firestore_v1beta1.types.DocumentMask]): The fields to return. If not set, returns all fields. - - If the document has a field that is not present in this mask, that field - will not be returned in the response. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_v1beta1.types.DocumentMask` - current_document (Union[dict, ~google.cloud.firestore_v1beta1.types.Precondition]): An optional precondition on the document. - The request will fail if this is set and not met by the target document. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_v1beta1.types.Precondition` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.firestore_v1beta1.types.Document` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_document" not in self._inner_api_calls: - self._inner_api_calls[ - "update_document" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_document, - default_retry=self._method_configs["UpdateDocument"].retry, - default_timeout=self._method_configs["UpdateDocument"].timeout, - client_info=self._client_info, - ) - - request = firestore_pb2.UpdateDocumentRequest( - document=document, - update_mask=update_mask, - mask=mask, - current_document=current_document, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("document.name", document.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_document"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_document( - self, - name, - current_document=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a document. - - Example: - >>> from google.cloud import firestore_v1beta1 - >>> - >>> client = firestore_v1beta1.FirestoreClient() - >>> - >>> name = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') - >>> - >>> client.delete_document(name) - - Args: - name (str): Required. The resource name of the Document to delete. In the format: - ``projects/{project_id}/databases/{database_id}/documents/{document_path}``. - current_document (Union[dict, ~google.cloud.firestore_v1beta1.types.Precondition]): An optional precondition on the document. - The request will fail if this is set and not met by the target document. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_v1beta1.types.Precondition` + database (str): Required. The database name. In the format: + ``projects/{project_id}/databases/{database_id}``. + transaction (bytes): Required. The transaction to roll back. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -728,24 +570,24 @@ def delete_document( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "delete_document" not in self._inner_api_calls: + if "rollback" not in self._inner_api_calls: self._inner_api_calls[ - "delete_document" + "rollback" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_document, - default_retry=self._method_configs["DeleteDocument"].retry, - default_timeout=self._method_configs["DeleteDocument"].timeout, + self.transport.rollback, + default_retry=self._method_configs["Rollback"].retry, + default_timeout=self._method_configs["Rollback"].timeout, client_info=self._client_info, ) - request = firestore_pb2.DeleteDocumentRequest( - name=name, current_document=current_document + request = firestore_pb2.RollbackRequest( + database=database, transaction=transaction, ) if metadata is None: metadata = [] metadata = list(metadata) try: - routing_header = [("name", name)] + routing_header = [("database", database)] except AttributeError: pass else: @@ -754,15 +596,14 @@ def delete_document( ) metadata.append(routing_metadata) - self._inner_api_calls["delete_document"]( + self._inner_api_calls["rollback"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def batch_get_documents( + def run_query( self, - database, - documents, - mask=None, + parent, + structured_query=None, transaction=None, new_transaction=None, read_time=None, @@ -771,39 +612,30 @@ def batch_get_documents( metadata=None, ): """ - Gets multiple documents. - - Documents returned by this method are not guaranteed to be returned in the - same order that they were requested. + Runs a query. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> - >>> database = client.database_root_path('[PROJECT]', '[DATABASE]') - >>> - >>> # TODO: Initialize `documents`: - >>> documents = [] + >>> # TODO: Initialize `parent`: + >>> parent = '' >>> - >>> for element in client.batch_get_documents(database, documents): + >>> for element in client.run_query(parent): ... # process element ... pass Args: - database (str): Required. The database name. In the format: - ``projects/{project_id}/databases/{database_id}``. - documents (list[str]): The names of the documents to retrieve. In the format: + parent (str): Required. The parent resource name. In the format: + ``projects/{project_id}/databases/{database_id}/documents`` or ``projects/{project_id}/databases/{database_id}/documents/{document_path}``. - The request will fail if any of the document is not a child resource of - the given ``database``. Duplicate names will be elided. - mask (Union[dict, ~google.cloud.firestore_v1beta1.types.DocumentMask]): The fields to return. If not set, returns all fields. - - If a document has a field that is not present in this mask, that field will - not be returned in the response. + For example: ``projects/my-project/databases/my-database/documents`` or + ``projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`` + structured_query (Union[dict, ~google.cloud.firestore_v1beta1.types.StructuredQuery]): A structured query. If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_v1beta1.types.DocumentMask` + message :class:`~google.cloud.firestore_v1beta1.types.StructuredQuery` transaction (bytes): Reads documents in a transaction. new_transaction (Union[dict, ~google.cloud.firestore_v1beta1.types.TransactionOptions]): Starts a new transaction and reads the documents. Defaults to a read-only transaction. @@ -827,7 +659,7 @@ def batch_get_documents( that is provided to the method. Returns: - Iterable[~google.cloud.firestore_v1beta1.types.BatchGetDocumentsResponse]. + Iterable[~google.cloud.firestore_v1beta1.types.RunQueryResponse]. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -837,16 +669,20 @@ def batch_get_documents( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "batch_get_documents" not in self._inner_api_calls: + if "run_query" not in self._inner_api_calls: self._inner_api_calls[ - "batch_get_documents" + "run_query" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_get_documents, - default_retry=self._method_configs["BatchGetDocuments"].retry, - default_timeout=self._method_configs["BatchGetDocuments"].timeout, + self.transport.run_query, + default_retry=self._method_configs["RunQuery"].retry, + default_timeout=self._method_configs["RunQuery"].timeout, client_info=self._client_info, ) + # Sanity check: We have some fields which are mutually exclusive; + # raise ValueError if more than one is sent. + google.api_core.protobuf_helpers.check_oneof(structured_query=structured_query,) + # Sanity check: We have some fields which are mutually exclusive; # raise ValueError if more than one is sent. google.api_core.protobuf_helpers.check_oneof( @@ -855,10 +691,9 @@ def batch_get_documents( read_time=read_time, ) - request = firestore_pb2.BatchGetDocumentsRequest( - database=database, - documents=documents, - mask=mask, + request = firestore_pb2.RunQueryRequest( + parent=parent, + structured_query=structured_query, transaction=transaction, new_transaction=new_transaction, read_time=read_time, @@ -867,7 +702,7 @@ def batch_get_documents( metadata = [] metadata = list(metadata) try: - routing_header = [("database", database)] + routing_header = [("parent", parent)] except AttributeError: pass else: @@ -876,38 +711,37 @@ def batch_get_documents( ) metadata.append(routing_metadata) - return self._inner_api_calls["batch_get_documents"]( + return self._inner_api_calls["run_query"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def begin_transaction( + def write( self, - database, - options_=None, + requests, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Starts a new transaction. + Streams batches of document updates and deletes, in order. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> - >>> database = client.database_root_path('[PROJECT]', '[DATABASE]') + >>> # TODO: Initialize `database`: + >>> database = '' + >>> request = {'database': database} >>> - >>> response = client.begin_transaction(database) + >>> requests = [request] + >>> for element in client.write(requests): + ... # process element + ... pass Args: - database (str): Required. The database name. In the format: - ``projects/{project_id}/databases/{database_id}``. - options_ (Union[dict, ~google.cloud.firestore_v1beta1.types.TransactionOptions]): The options for the transaction. - Defaults to a read-write transaction. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_v1beta1.types.TransactionOptions` + requests (iterator[dict|google.cloud.firestore_v1beta1.proto.firestore_pb2.WriteRequest]): The input objects. If a dict is provided, it must be of the + same form as the protobuf message :class:`~google.cloud.firestore_v1beta1.types.WriteRequest` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -918,7 +752,7 @@ def begin_transaction( that is provided to the method. Returns: - A :class:`~google.cloud.firestore_v1beta1.types.BeginTransactionResponse` instance. + Iterable[~google.cloud.firestore_v1beta1.types.WriteResponse]. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -928,70 +762,47 @@ def begin_transaction( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "begin_transaction" not in self._inner_api_calls: + if "write" not in self._inner_api_calls: self._inner_api_calls[ - "begin_transaction" + "write" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.begin_transaction, - default_retry=self._method_configs["BeginTransaction"].retry, - default_timeout=self._method_configs["BeginTransaction"].timeout, + self.transport.write, + default_retry=self._method_configs["Write"].retry, + default_timeout=self._method_configs["Write"].timeout, client_info=self._client_info, ) - request = firestore_pb2.BeginTransactionRequest( - database=database, options=options_ - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("database", database)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["begin_transaction"]( - request, retry=retry, timeout=timeout, metadata=metadata + return self._inner_api_calls["write"]( + requests, retry=retry, timeout=timeout, metadata=metadata ) - def commit( + def listen( self, - database, - writes, - transaction=None, + requests, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Commits a transaction, while optionally updating documents. + Listens to changes. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> - >>> database = client.database_root_path('[PROJECT]', '[DATABASE]') - >>> - >>> # TODO: Initialize `writes`: - >>> writes = [] + >>> # TODO: Initialize `database`: + >>> database = '' + >>> request = {'database': database} >>> - >>> response = client.commit(database, writes) + >>> requests = [request] + >>> for element in client.listen(requests): + ... # process element + ... pass Args: - database (str): Required. The database name. In the format: - ``projects/{project_id}/databases/{database_id}``. - writes (list[Union[dict, ~google.cloud.firestore_v1beta1.types.Write]]): The writes to apply. - - Always executed atomically and in order. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_v1beta1.types.Write` - transaction (bytes): If set, applies all writes in this transaction, and commits it. + requests (iterator[dict|google.cloud.firestore_v1beta1.proto.firestore_pb2.ListenRequest]): The input objects. If a dict is provided, it must be of the + same form as the protobuf message :class:`~google.cloud.firestore_v1beta1.types.ListenRequest` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -1002,7 +813,7 @@ def commit( that is provided to the method. Returns: - A :class:`~google.cloud.firestore_v1beta1.types.CommitResponse` instance. + Iterable[~google.cloud.firestore_v1beta1.types.ListenResponse]. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -1012,24 +823,104 @@ def commit( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "commit" not in self._inner_api_calls: + if "listen" not in self._inner_api_calls: self._inner_api_calls[ - "commit" + "listen" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.commit, - default_retry=self._method_configs["Commit"].retry, - default_timeout=self._method_configs["Commit"].timeout, + self.transport.listen, + default_retry=self._method_configs["Listen"].retry, + default_timeout=self._method_configs["Listen"].timeout, client_info=self._client_info, ) - request = firestore_pb2.CommitRequest( - database=database, writes=writes, transaction=transaction + return self._inner_api_calls["listen"]( + requests, retry=retry, timeout=timeout, metadata=metadata + ) + + def list_collection_ids( + self, + parent, + page_size=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Lists all the collection IDs underneath a document. + + Example: + >>> from google.cloud import firestore_v1beta1 + >>> + >>> client = firestore_v1beta1.FirestoreClient() + >>> + >>> # TODO: Initialize `parent`: + >>> parent = '' + >>> + >>> # Iterate over all results + >>> for element in client.list_collection_ids(parent): + ... # process element + ... pass + >>> + >>> + >>> # Alternatively: + >>> + >>> # Iterate over results one page at a time + >>> for page in client.list_collection_ids(parent).pages: + ... for element in page: + ... # process element + ... pass + + Args: + parent (str): Required. The parent document. In the format: + ``projects/{project_id}/databases/{database_id}/documents/{document_path}``. + For example: + ``projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`` + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.api_core.page_iterator.PageIterator` instance. + An iterable of :class:`str` instances. + You can also iterate over the pages of the response + using its `pages` property. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "list_collection_ids" not in self._inner_api_calls: + self._inner_api_calls[ + "list_collection_ids" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.list_collection_ids, + default_retry=self._method_configs["ListCollectionIds"].retry, + default_timeout=self._method_configs["ListCollectionIds"].timeout, + client_info=self._client_info, + ) + + request = firestore_pb2.ListCollectionIdsRequest( + parent=parent, page_size=page_size, ) if metadata is None: metadata = [] metadata = list(metadata) try: - routing_header = [("database", database)] + routing_header = [("parent", parent)] except AttributeError: pass else: @@ -1038,37 +929,60 @@ def commit( ) metadata.append(routing_metadata) - return self._inner_api_calls["commit"]( - request, retry=retry, timeout=timeout, metadata=metadata + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._inner_api_calls["list_collection_ids"], + retry=retry, + timeout=timeout, + metadata=metadata, + ), + request=request, + items_field="collection_ids", + request_token_field="page_token", + response_token_field="next_page_token", ) + return iterator - def rollback( + def get_document( self, - database, - transaction, + name, + mask=None, + transaction=None, + read_time=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Rolls back a transaction. + Gets a single document. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> - >>> database = client.database_root_path('[PROJECT]', '[DATABASE]') - >>> - >>> # TODO: Initialize `transaction`: - >>> transaction = b'' + >>> # TODO: Initialize `name`: + >>> name = '' >>> - >>> client.rollback(database, transaction) + >>> response = client.get_document(name) Args: - database (str): Required. The database name. In the format: - ``projects/{project_id}/databases/{database_id}``. - transaction (bytes): Required. The transaction to roll back. + name (str): Required. The resource name of the Document to get. In the format: + ``projects/{project_id}/databases/{database_id}/documents/{document_path}``. + mask (Union[dict, ~google.cloud.firestore_v1beta1.types.DocumentMask]): The fields to return. If not set, returns all fields. + + If the document has a field that is not present in this mask, that field + will not be returned in the response. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.firestore_v1beta1.types.DocumentMask` + transaction (bytes): Reads the document in a transaction. + read_time (Union[dict, ~google.cloud.firestore_v1beta1.types.Timestamp]): Reads the version of the document at the given time. + This may not be older than 60 seconds. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.firestore_v1beta1.types.Timestamp` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -1078,6 +992,9 @@ def rollback( metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata that is provided to the method. + Returns: + A :class:`~google.cloud.firestore_v1beta1.types.Document` instance. + Raises: google.api_core.exceptions.GoogleAPICallError: If the request failed for any reason. @@ -1086,24 +1003,30 @@ def rollback( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "rollback" not in self._inner_api_calls: + if "get_document" not in self._inner_api_calls: self._inner_api_calls[ - "rollback" + "get_document" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.rollback, - default_retry=self._method_configs["Rollback"].retry, - default_timeout=self._method_configs["Rollback"].timeout, + self.transport.get_document, + default_retry=self._method_configs["GetDocument"].retry, + default_timeout=self._method_configs["GetDocument"].timeout, client_info=self._client_info, ) - request = firestore_pb2.RollbackRequest( - database=database, transaction=transaction + # Sanity check: We have some fields which are mutually exclusive; + # raise ValueError if more than one is sent. + google.api_core.protobuf_helpers.check_oneof( + transaction=transaction, read_time=read_time, + ) + + request = firestore_pb2.GetDocumentRequest( + name=name, mask=mask, transaction=transaction, read_time=read_time, ) if metadata is None: metadata = [] metadata = list(metadata) try: - routing_header = [("database", database)] + routing_header = [("name", name)] except AttributeError: pass else: @@ -1112,34 +1035,51 @@ def rollback( ) metadata.append(routing_metadata) - self._inner_api_calls["rollback"]( + return self._inner_api_calls["get_document"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def run_query( + def list_documents( self, parent, - structured_query=None, + collection_id, + page_size=None, + order_by=None, + mask=None, transaction=None, - new_transaction=None, read_time=None, + show_missing=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Runs a query. + Lists documents. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> - >>> parent = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') + >>> # TODO: Initialize `parent`: + >>> parent = '' >>> - >>> for element in client.run_query(parent): + >>> # TODO: Initialize `collection_id`: + >>> collection_id = '' + >>> + >>> # Iterate over all results + >>> for element in client.list_documents(parent, collection_id): ... # process element ... pass + >>> + >>> + >>> # Alternatively: + >>> + >>> # Iterate over results one page at a time + >>> for page in client.list_documents(parent, collection_id).pages: + ... for element in page: + ... # process element + ... pass Args: parent (str): Required. The parent resource name. In the format: @@ -1147,23 +1087,34 @@ def run_query( ``projects/{project_id}/databases/{database_id}/documents/{document_path}``. For example: ``projects/my-project/databases/my-database/documents`` or ``projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`` - structured_query (Union[dict, ~google.cloud.firestore_v1beta1.types.StructuredQuery]): A structured query. + collection_id (str): Required. The collection ID, relative to ``parent``, to list. For + example: ``chatrooms`` or ``messages``. + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + order_by (str): The order to sort results by. For example: ``priority desc, name``. + mask (Union[dict, ~google.cloud.firestore_v1beta1.types.DocumentMask]): The fields to return. If not set, returns all fields. - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_v1beta1.types.StructuredQuery` - transaction (bytes): Reads documents in a transaction. - new_transaction (Union[dict, ~google.cloud.firestore_v1beta1.types.TransactionOptions]): Starts a new transaction and reads the documents. - Defaults to a read-only transaction. - The new transaction ID will be returned as the first response in the - stream. + If a document has a field that is not present in this mask, that field + will not be returned in the response. If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.firestore_v1beta1.types.TransactionOptions` + message :class:`~google.cloud.firestore_v1beta1.types.DocumentMask` + transaction (bytes): Reads documents in a transaction. read_time (Union[dict, ~google.cloud.firestore_v1beta1.types.Timestamp]): Reads documents as they were at the given time. This may not be older than 60 seconds. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.firestore_v1beta1.types.Timestamp` + show_missing (bool): If the list should show missing documents. A missing document is a + document that does not exist but has sub-documents. These documents will + be returned with a key but will not have fields, + ``Document.create_time``, or ``Document.update_time`` set. + + Requests with ``show_missing`` may not specify ``where`` or + ``order_by``. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -1174,7 +1125,10 @@ def run_query( that is provided to the method. Returns: - Iterable[~google.cloud.firestore_v1beta1.types.RunQueryResponse]. + A :class:`~google.api_core.page_iterator.PageIterator` instance. + An iterable of :class:`~google.cloud.firestore_v1beta1.types.Document` instances. + You can also iterate over the pages of the response + using its `pages` property. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -1184,80 +1138,97 @@ def run_query( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "run_query" not in self._inner_api_calls: + if "list_documents" not in self._inner_api_calls: self._inner_api_calls[ - "run_query" + "list_documents" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.run_query, - default_retry=self._method_configs["RunQuery"].retry, - default_timeout=self._method_configs["RunQuery"].timeout, + self.transport.list_documents, + default_retry=self._method_configs["ListDocuments"].retry, + default_timeout=self._method_configs["ListDocuments"].timeout, client_info=self._client_info, ) - # Sanity check: We have some fields which are mutually exclusive; - # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof(structured_query=structured_query) - # Sanity check: We have some fields which are mutually exclusive; # raise ValueError if more than one is sent. google.api_core.protobuf_helpers.check_oneof( - transaction=transaction, - new_transaction=new_transaction, - read_time=read_time, + transaction=transaction, read_time=read_time, ) - request = firestore_pb2.RunQueryRequest( + request = firestore_pb2.ListDocumentsRequest( parent=parent, - structured_query=structured_query, + collection_id=collection_id, + page_size=page_size, + order_by=order_by, + mask=mask, transaction=transaction, - new_transaction=new_transaction, read_time=read_time, + show_missing=show_missing, ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["run_query"]( - request, retry=retry, timeout=timeout, metadata=metadata + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._inner_api_calls["list_documents"], + retry=retry, + timeout=timeout, + metadata=metadata, + ), + request=request, + items_field="documents", + request_token_field="page_token", + response_token_field="next_page_token", ) + return iterator - def write( + def create_document( self, - requests, + parent, + collection_id, + document_id, + document, + mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Streams batches of document updates and deletes, in order. - - EXPERIMENTAL: This method interface might change in the future. + Creates a new document. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> - >>> database = client.database_root_path('[PROJECT]', '[DATABASE]') - >>> request = {'database': database} + >>> # TODO: Initialize `parent`: + >>> parent = '' >>> - >>> requests = [request] - >>> for element in client.write(requests): - ... # process element - ... pass + >>> # TODO: Initialize `collection_id`: + >>> collection_id = '' + >>> + >>> # TODO: Initialize `document`: + >>> document = {} + >>> + >>> response = client.create_document(parent, collection_id, document) Args: - requests (iterator[dict|google.cloud.firestore_v1beta1.proto.firestore_pb2.WriteRequest]): The input objects. If a dict is provided, it must be of the - same form as the protobuf message :class:`~google.cloud.firestore_v1beta1.types.WriteRequest` + parent (str): Required. The parent resource. For example: + ``projects/{project_id}/databases/{database_id}/documents`` or + ``projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`` + collection_id (str): Required. The collection ID, relative to ``parent``, to list. For + example: ``chatrooms``. + document (Union[dict, ~google.cloud.firestore_v1beta1.types.Document]): Required. The document to create. ``name`` must not be set. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.firestore_v1beta1.types.Document` + document_id (str): The client-assigned document ID to use for this document. + + Optional. If not specified, an ID will be assigned by the service. + mask (Union[dict, ~google.cloud.firestore_v1beta1.types.DocumentMask]): The fields to return. If not set, returns all fields. + + If the document has a field that is not present in this mask, that field + will not be returned in the response. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.firestore_v1beta1.types.DocumentMask` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -1268,7 +1239,7 @@ def write( that is provided to the method. Returns: - Iterable[~google.cloud.firestore_v1beta1.types.WriteResponse]. + A :class:`~google.cloud.firestore_v1beta1.types.Document` instance. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -1278,48 +1249,78 @@ def write( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "write" not in self._inner_api_calls: + if "create_document" not in self._inner_api_calls: self._inner_api_calls[ - "write" + "create_document" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.write, - default_retry=self._method_configs["Write"].retry, - default_timeout=self._method_configs["Write"].timeout, + self.transport.create_document, + default_retry=self._method_configs["CreateDocument"].retry, + default_timeout=self._method_configs["CreateDocument"].timeout, client_info=self._client_info, ) - return self._inner_api_calls["write"]( - requests, retry=retry, timeout=timeout, metadata=metadata + request = firestore_pb2.CreateDocumentRequest( + parent=parent, + collection_id=collection_id, + document=document, + document_id=document_id, + mask=mask, + ) + return self._inner_api_calls["create_document"]( + request, retry=retry, timeout=timeout, metadata=metadata ) - def listen( + def update_document( self, - requests, + document, + update_mask=None, + mask=None, + current_document=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Listens to changes. - - EXPERIMENTAL: This method interface might change in the future. + Updates or inserts a document. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> - >>> database = client.database_root_path('[PROJECT]', '[DATABASE]') - >>> request = {'database': database} + >>> # TODO: Initialize `document`: + >>> document = {} >>> - >>> requests = [request] - >>> for element in client.listen(requests): - ... # process element - ... pass + >>> response = client.update_document(document) Args: - requests (iterator[dict|google.cloud.firestore_v1beta1.proto.firestore_pb2.ListenRequest]): The input objects. If a dict is provided, it must be of the - same form as the protobuf message :class:`~google.cloud.firestore_v1beta1.types.ListenRequest` + document (Union[dict, ~google.cloud.firestore_v1beta1.types.Document]): Required. The updated document. + Creates the document if it does not already exist. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.firestore_v1beta1.types.Document` + update_mask (Union[dict, ~google.cloud.firestore_v1beta1.types.DocumentMask]): The fields to update. + None of the field paths in the mask may contain a reserved name. + + If the document exists on the server and has fields not referenced in the + mask, they are left unchanged. + Fields referenced in the mask, but not present in the input document, are + deleted from the document on the server. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.firestore_v1beta1.types.DocumentMask` + mask (Union[dict, ~google.cloud.firestore_v1beta1.types.DocumentMask]): The fields to return. If not set, returns all fields. + + If the document has a field that is not present in this mask, that field + will not be returned in the response. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.firestore_v1beta1.types.DocumentMask` + current_document (Union[dict, ~google.cloud.firestore_v1beta1.types.Precondition]): An optional precondition on the document. + The request will fail if this is set and not met by the target document. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.firestore_v1beta1.types.Precondition` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -1330,7 +1331,7 @@ def listen( that is provided to the method. Returns: - Iterable[~google.cloud.firestore_v1beta1.types.ListenResponse]. + A :class:`~google.cloud.firestore_v1beta1.types.Document` instance. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -1340,62 +1341,71 @@ def listen( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "listen" not in self._inner_api_calls: + if "update_document" not in self._inner_api_calls: self._inner_api_calls[ - "listen" + "update_document" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.listen, - default_retry=self._method_configs["Listen"].retry, - default_timeout=self._method_configs["Listen"].timeout, + self.transport.update_document, + default_retry=self._method_configs["UpdateDocument"].retry, + default_timeout=self._method_configs["UpdateDocument"].timeout, client_info=self._client_info, ) - return self._inner_api_calls["listen"]( - requests, retry=retry, timeout=timeout, metadata=metadata + request = firestore_pb2.UpdateDocumentRequest( + document=document, + update_mask=update_mask, + mask=mask, + current_document=current_document, ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("document.name", document.name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) - def list_collection_ids( + return self._inner_api_calls["update_document"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def commit( self, - parent, - page_size=None, + database, + writes=None, + transaction=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Lists all the collection IDs underneath a document. + Commits a transaction, while optionally updating documents. Example: >>> from google.cloud import firestore_v1beta1 >>> >>> client = firestore_v1beta1.FirestoreClient() >>> - >>> parent = client.any_path_path('[PROJECT]', '[DATABASE]', '[DOCUMENT]', '[ANY_PATH]') - >>> - >>> # Iterate over all results - >>> for element in client.list_collection_ids(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: + >>> # TODO: Initialize `database`: + >>> database = '' >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_collection_ids(parent).pages: - ... for element in page: - ... # process element - ... pass + >>> response = client.commit(database) Args: - parent (str): Required. The parent document. In the format: - ``projects/{project_id}/databases/{database_id}/documents/{document_path}``. - For example: - ``projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`` - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. + database (str): Required. The database name. In the format: + ``projects/{project_id}/databases/{database_id}``. + writes (list[Union[dict, ~google.cloud.firestore_v1beta1.types.Write]]): The writes to apply. + + Always executed atomically and in order. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.firestore_v1beta1.types.Write` + transaction (bytes): If set, applies all writes in this transaction, and commits it. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -1406,10 +1416,7 @@ def list_collection_ids( that is provided to the method. Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`str` instances. - You can also iterate over the pages of the response - using its `pages` property. + A :class:`~google.cloud.firestore_v1beta1.types.CommitResponse` instance. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -1419,24 +1426,24 @@ def list_collection_ids( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "list_collection_ids" not in self._inner_api_calls: + if "commit" not in self._inner_api_calls: self._inner_api_calls[ - "list_collection_ids" + "commit" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_collection_ids, - default_retry=self._method_configs["ListCollectionIds"].retry, - default_timeout=self._method_configs["ListCollectionIds"].timeout, + self.transport.commit, + default_retry=self._method_configs["Commit"].retry, + default_timeout=self._method_configs["Commit"].timeout, client_info=self._client_info, ) - request = firestore_pb2.ListCollectionIdsRequest( - parent=parent, page_size=page_size + request = firestore_pb2.CommitRequest( + database=database, writes=writes, transaction=transaction, ) if metadata is None: metadata = [] metadata = list(metadata) try: - routing_header = [("parent", parent)] + routing_header = [("database", database)] except AttributeError: pass else: @@ -1445,17 +1452,6 @@ def list_collection_ids( ) metadata.append(routing_metadata) - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_collection_ids"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="collection_ids", - request_token_field="page_token", - response_token_field="next_page_token", + return self._inner_api_calls["commit"]( + request, retry=retry, timeout=timeout, metadata=metadata ) - return iterator diff --git a/google/cloud/firestore_v1beta1/gapic/firestore_client_config.py b/google/cloud/firestore_v1beta1/gapic/firestore_client_config.py index dd458fe97..46067cef5 100644 --- a/google/cloud/firestore_v1beta1/gapic/firestore_client_config.py +++ b/google/cloud/firestore_v1beta1/gapic/firestore_client_config.py @@ -26,33 +26,13 @@ }, }, "methods": { - "GetDocument": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListDocuments": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateDocument": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateDocument": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, "DeleteDocument": { "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "BatchGetDocuments": { - "timeout_millis": 300000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "streaming", }, @@ -61,11 +41,6 @@ "retry_codes_name": "idempotent", "retry_params_name": "default", }, - "Commit": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, "Rollback": { "timeout_millis": 60000, "retry_codes_name": "idempotent", @@ -77,12 +52,12 @@ "retry_params_name": "streaming", }, "Write": { - "timeout_millis": 86400000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "streaming", }, "Listen": { - "timeout_millis": 86400000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "streaming", }, @@ -91,6 +66,31 @@ "retry_codes_name": "idempotent", "retry_params_name": "default", }, + "GetDocument": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "ListDocuments": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "CreateDocument": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "UpdateDocument": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "Commit": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, }, } } diff --git a/google/cloud/firestore_v1beta1/gapic/transports/firestore_grpc_transport.py b/google/cloud/firestore_v1beta1/gapic/transports/firestore_grpc_transport.py index 9f26080c8..c13f53332 100644 --- a/google/cloud/firestore_v1beta1/gapic/transports/firestore_grpc_transport.py +++ b/google/cloud/firestore_v1beta1/gapic/transports/firestore_grpc_transport.py @@ -56,7 +56,7 @@ def __init__( # exception (channels come with credentials baked in already). if channel is not None and credentials is not None: raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." + "The `channel` and `credentials` arguments are mutually " "exclusive.", ) # Create the channel. @@ -74,7 +74,9 @@ def __init__( # gRPC uses objects called "stubs" that are bound to the # channel and provide a basic method for each RPC. - self._stubs = {"firestore_stub": firestore_pb2_grpc.FirestoreStub(channel)} + self._stubs = { + "firestore_stub": firestore_pb2_grpc.FirestoreStub(channel), + } @classmethod def create_channel( @@ -109,173 +111,173 @@ def channel(self): return self._channel @property - def get_document(self): - """Return the gRPC stub for :meth:`FirestoreClient.get_document`. + def delete_document(self): + """Return the gRPC stub for :meth:`FirestoreClient.delete_document`. - Gets a single document. + Deletes a document. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_stub"].GetDocument + return self._stubs["firestore_stub"].DeleteDocument @property - def list_documents(self): - """Return the gRPC stub for :meth:`FirestoreClient.list_documents`. + def batch_get_documents(self): + """Return the gRPC stub for :meth:`FirestoreClient.batch_get_documents`. - Lists documents. + Gets multiple documents. + + Documents returned by this method are not guaranteed to be returned in the + same order that they were requested. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_stub"].ListDocuments + return self._stubs["firestore_stub"].BatchGetDocuments @property - def create_document(self): - """Return the gRPC stub for :meth:`FirestoreClient.create_document`. + def begin_transaction(self): + """Return the gRPC stub for :meth:`FirestoreClient.begin_transaction`. - Creates a new document. + Starts a new transaction. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_stub"].CreateDocument + return self._stubs["firestore_stub"].BeginTransaction @property - def update_document(self): - """Return the gRPC stub for :meth:`FirestoreClient.update_document`. + def rollback(self): + """Return the gRPC stub for :meth:`FirestoreClient.rollback`. - Updates or inserts a document. + Rolls back a transaction. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_stub"].UpdateDocument + return self._stubs["firestore_stub"].Rollback @property - def delete_document(self): - """Return the gRPC stub for :meth:`FirestoreClient.delete_document`. + def run_query(self): + """Return the gRPC stub for :meth:`FirestoreClient.run_query`. - Deletes a document. + Runs a query. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_stub"].DeleteDocument + return self._stubs["firestore_stub"].RunQuery @property - def batch_get_documents(self): - """Return the gRPC stub for :meth:`FirestoreClient.batch_get_documents`. - - Gets multiple documents. + def write(self): + """Return the gRPC stub for :meth:`FirestoreClient.write`. - Documents returned by this method are not guaranteed to be returned in the - same order that they were requested. + Streams batches of document updates and deletes, in order. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_stub"].BatchGetDocuments + return self._stubs["firestore_stub"].Write @property - def begin_transaction(self): - """Return the gRPC stub for :meth:`FirestoreClient.begin_transaction`. + def listen(self): + """Return the gRPC stub for :meth:`FirestoreClient.listen`. - Starts a new transaction. + Listens to changes. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_stub"].BeginTransaction + return self._stubs["firestore_stub"].Listen @property - def commit(self): - """Return the gRPC stub for :meth:`FirestoreClient.commit`. + def list_collection_ids(self): + """Return the gRPC stub for :meth:`FirestoreClient.list_collection_ids`. - Commits a transaction, while optionally updating documents. + Lists all the collection IDs underneath a document. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_stub"].Commit + return self._stubs["firestore_stub"].ListCollectionIds @property - def rollback(self): - """Return the gRPC stub for :meth:`FirestoreClient.rollback`. + def get_document(self): + """Return the gRPC stub for :meth:`FirestoreClient.get_document`. - Rolls back a transaction. + Gets a single document. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_stub"].Rollback + return self._stubs["firestore_stub"].GetDocument @property - def run_query(self): - """Return the gRPC stub for :meth:`FirestoreClient.run_query`. + def list_documents(self): + """Return the gRPC stub for :meth:`FirestoreClient.list_documents`. - Runs a query. + Lists documents. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_stub"].RunQuery + return self._stubs["firestore_stub"].ListDocuments @property - def write(self): - """Return the gRPC stub for :meth:`FirestoreClient.write`. + def create_document(self): + """Return the gRPC stub for :meth:`FirestoreClient.create_document`. - Streams batches of document updates and deletes, in order. + Creates a new document. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_stub"].Write + return self._stubs["firestore_stub"].CreateDocument @property - def listen(self): - """Return the gRPC stub for :meth:`FirestoreClient.listen`. + def update_document(self): + """Return the gRPC stub for :meth:`FirestoreClient.update_document`. - Listens to changes. + Updates or inserts a document. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_stub"].Listen + return self._stubs["firestore_stub"].UpdateDocument @property - def list_collection_ids(self): - """Return the gRPC stub for :meth:`FirestoreClient.list_collection_ids`. + def commit(self): + """Return the gRPC stub for :meth:`FirestoreClient.commit`. - Lists all the collection IDs underneath a document. + Commits a transaction, while optionally updating documents. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["firestore_stub"].ListCollectionIds + return self._stubs["firestore_stub"].Commit diff --git a/google/cloud/firestore_v1beta1/proto/common.proto b/google/cloud/firestore_v1beta1/proto/common.proto index 2eaa18347..b71a2e32e 100644 --- a/google/cloud/firestore_v1beta1/proto/common.proto +++ b/google/cloud/firestore_v1beta1/proto/common.proto @@ -27,6 +27,7 @@ option java_outer_classname = "CommonProto"; option java_package = "com.google.firestore.v1beta1"; option objc_class_prefix = "GCFS"; option php_namespace = "Google\\Cloud\\Firestore\\V1beta1"; +option ruby_package = "Google::Cloud::Firestore::V1beta1"; // A set of field paths on a document. // Used to restrict a get or update operation on a document to a subset of its diff --git a/google/cloud/firestore_v1beta1/proto/common_pb2.py b/google/cloud/firestore_v1beta1/proto/common_pb2.py index 8469940a4..4ac2d2d1f 100644 --- a/google/cloud/firestore_v1beta1/proto/common_pb2.py +++ b/google/cloud/firestore_v1beta1/proto/common_pb2.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/firestore_v1beta1/proto/common.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -23,12 +20,9 @@ name="google/cloud/firestore_v1beta1/proto/common.proto", package="google.firestore.v1beta1", syntax="proto3", - serialized_options=_b( - "\n\034com.google.firestore.v1beta1B\013CommonProtoP\001ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\242\002\004GCFS\252\002\036Google.Cloud.Firestore.V1Beta1\312\002\036Google\\Cloud\\Firestore\\V1beta1" - ), - serialized_pb=_b( - '\n1google/cloud/firestore_v1beta1/proto/common.proto\x12\x18google.firestore.v1beta1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"#\n\x0c\x44ocumentMask\x12\x13\n\x0b\x66ield_paths\x18\x01 \x03(\t"e\n\x0cPrecondition\x12\x10\n\x06\x65xists\x18\x01 \x01(\x08H\x00\x12\x31\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x10\n\x0e\x63ondition_type"\xb3\x02\n\x12TransactionOptions\x12J\n\tread_only\x18\x02 \x01(\x0b\x32\x35.google.firestore.v1beta1.TransactionOptions.ReadOnlyH\x00\x12L\n\nread_write\x18\x03 \x01(\x0b\x32\x36.google.firestore.v1beta1.TransactionOptions.ReadWriteH\x00\x1a&\n\tReadWrite\x12\x19\n\x11retry_transaction\x18\x01 \x01(\x0c\x1aS\n\x08ReadOnly\x12/\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x16\n\x14\x63onsistency_selectorB\x06\n\x04modeB\xb9\x01\n\x1c\x63om.google.firestore.v1beta1B\x0b\x43ommonProtoP\x01ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\xa2\x02\x04GCFS\xaa\x02\x1eGoogle.Cloud.Firestore.V1Beta1\xca\x02\x1eGoogle\\Cloud\\Firestore\\V1beta1b\x06proto3' - ), + serialized_options=b"\n\034com.google.firestore.v1beta1B\013CommonProtoP\001ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\242\002\004GCFS\252\002\036Google.Cloud.Firestore.V1Beta1\312\002\036Google\\Cloud\\Firestore\\V1beta1\352\002!Google::Cloud::Firestore::V1beta1", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n1google/cloud/firestore_v1beta1/proto/common.proto\x12\x18google.firestore.v1beta1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"#\n\x0c\x44ocumentMask\x12\x13\n\x0b\x66ield_paths\x18\x01 \x03(\t"e\n\x0cPrecondition\x12\x10\n\x06\x65xists\x18\x01 \x01(\x08H\x00\x12\x31\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x10\n\x0e\x63ondition_type"\xb3\x02\n\x12TransactionOptions\x12J\n\tread_only\x18\x02 \x01(\x0b\x32\x35.google.firestore.v1beta1.TransactionOptions.ReadOnlyH\x00\x12L\n\nread_write\x18\x03 \x01(\x0b\x32\x36.google.firestore.v1beta1.TransactionOptions.ReadWriteH\x00\x1a&\n\tReadWrite\x12\x19\n\x11retry_transaction\x18\x01 \x01(\x0c\x1aS\n\x08ReadOnly\x12/\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x16\n\x14\x63onsistency_selectorB\x06\n\x04modeB\xdd\x01\n\x1c\x63om.google.firestore.v1beta1B\x0b\x43ommonProtoP\x01ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\xa2\x02\x04GCFS\xaa\x02\x1eGoogle.Cloud.Firestore.V1Beta1\xca\x02\x1eGoogle\\Cloud\\Firestore\\V1beta1\xea\x02!Google::Cloud::Firestore::V1beta1b\x06proto3', dependencies=[ google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, google_dot_api_dot_annotations__pb2.DESCRIPTOR, @@ -42,6 +36,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="field_paths", @@ -60,7 +55,8 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -81,6 +77,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="exists", @@ -99,6 +96,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="update_time", @@ -117,6 +115,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -132,8 +131,9 @@ full_name="google.firestore.v1beta1.Precondition.condition_type", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=179, serialized_end=280, @@ -146,6 +146,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="retry_transaction", @@ -156,7 +157,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -164,7 +165,8 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -184,6 +186,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="read_time", @@ -202,7 +205,8 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -217,8 +221,9 @@ full_name="google.firestore.v1beta1.TransactionOptions.ReadOnly.consistency_selector", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=499, serialized_end=582, @@ -230,6 +235,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="read_only", @@ -248,6 +254,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="read_write", @@ -266,10 +273,11 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], - nested_types=[_TRANSACTIONOPTIONS_READWRITE, _TRANSACTIONOPTIONS_READONLY], + nested_types=[_TRANSACTIONOPTIONS_READWRITE, _TRANSACTIONOPTIONS_READONLY,], enum_types=[], serialized_options=None, is_extendable=False, @@ -281,8 +289,9 @@ full_name="google.firestore.v1beta1.TransactionOptions.mode", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=283, serialized_end=590, @@ -340,15 +349,14 @@ DocumentMask = _reflection.GeneratedProtocolMessageType( "DocumentMask", (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENTMASK, - __module__="google.cloud.firestore_v1beta1.proto.common_pb2", - __doc__="""A set of field paths on a document. Used to restrict a get - or update operation on a document to a subset of its fields. This is - different from standard field masks, as this is always scoped to a - [Document][google.firestore.v1beta1.Document], and takes in account the - dynamic nature of [Value][google.firestore.v1beta1.Value]. - + { + "DESCRIPTOR": _DOCUMENTMASK, + "__module__": "google.cloud.firestore_v1beta1.proto.common_pb2", + "__doc__": """A set of field paths on a document. Used to restrict a get or update + operation on a document to a subset of its fields. This is different + from standard field masks, as this is always scoped to a + [Document][google.firestore.v1beta1.Document], and takes in account + the dynamic nature of [Value][google.firestore.v1beta1.Value]. Attributes: field_paths: @@ -357,19 +365,17 @@ for a field path syntax reference. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.DocumentMask) - ), + }, ) _sym_db.RegisterMessage(DocumentMask) Precondition = _reflection.GeneratedProtocolMessageType( "Precondition", (_message.Message,), - dict( - DESCRIPTOR=_PRECONDITION, - __module__="google.cloud.firestore_v1beta1.proto.common_pb2", - __doc__="""A precondition on a document, used for conditional - operations. - + { + "DESCRIPTOR": _PRECONDITION, + "__module__": "google.cloud.firestore_v1beta1.proto.common_pb2", + "__doc__": """A precondition on a document, used for conditional operations. Attributes: condition_type: @@ -382,40 +388,37 @@ updated at that time. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.Precondition) - ), + }, ) _sym_db.RegisterMessage(Precondition) TransactionOptions = _reflection.GeneratedProtocolMessageType( "TransactionOptions", (_message.Message,), - dict( - ReadWrite=_reflection.GeneratedProtocolMessageType( + { + "ReadWrite": _reflection.GeneratedProtocolMessageType( "ReadWrite", (_message.Message,), - dict( - DESCRIPTOR=_TRANSACTIONOPTIONS_READWRITE, - __module__="google.cloud.firestore_v1beta1.proto.common_pb2", - __doc__="""Options for a transaction that can be used to read and - write documents. - + { + "DESCRIPTOR": _TRANSACTIONOPTIONS_READWRITE, + "__module__": "google.cloud.firestore_v1beta1.proto.common_pb2", + "__doc__": """Options for a transaction that can be used to read and write + documents. Attributes: retry_transaction: An optional transaction to retry. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.TransactionOptions.ReadWrite) - ), + }, ), - ReadOnly=_reflection.GeneratedProtocolMessageType( + "ReadOnly": _reflection.GeneratedProtocolMessageType( "ReadOnly", (_message.Message,), - dict( - DESCRIPTOR=_TRANSACTIONOPTIONS_READONLY, - __module__="google.cloud.firestore_v1beta1.proto.common_pb2", - __doc__="""Options for a transaction that can only be used to read - documents. - + { + "DESCRIPTOR": _TRANSACTIONOPTIONS_READONLY, + "__module__": "google.cloud.firestore_v1beta1.proto.common_pb2", + "__doc__": """Options for a transaction that can only be used to read documents. Attributes: consistency_selector: @@ -426,12 +429,11 @@ 60 seconds. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.TransactionOptions.ReadOnly) - ), + }, ), - DESCRIPTOR=_TRANSACTIONOPTIONS, - __module__="google.cloud.firestore_v1beta1.proto.common_pb2", - __doc__="""Options for creating a new transaction. - + "DESCRIPTOR": _TRANSACTIONOPTIONS, + "__module__": "google.cloud.firestore_v1beta1.proto.common_pb2", + "__doc__": """Options for creating a new transaction. Attributes: mode: @@ -443,7 +445,7 @@ operations. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.TransactionOptions) - ), + }, ) _sym_db.RegisterMessage(TransactionOptions) _sym_db.RegisterMessage(TransactionOptions.ReadWrite) diff --git a/google/cloud/firestore_v1beta1/proto/common_pb2_grpc.py b/google/cloud/firestore_v1beta1/proto/common_pb2_grpc.py index 07cb78fe0..8a9393943 100644 --- a/google/cloud/firestore_v1beta1/proto/common_pb2_grpc.py +++ b/google/cloud/firestore_v1beta1/proto/common_pb2_grpc.py @@ -1,2 +1,3 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc diff --git a/google/cloud/firestore_v1beta1/proto/document.proto b/google/cloud/firestore_v1beta1/proto/document.proto index 7caae4688..38d81af96 100644 --- a/google/cloud/firestore_v1beta1/proto/document.proto +++ b/google/cloud/firestore_v1beta1/proto/document.proto @@ -29,6 +29,7 @@ option java_outer_classname = "DocumentProto"; option java_package = "com.google.firestore.v1beta1"; option objc_class_prefix = "GCFS"; option php_namespace = "Google\\Cloud\\Firestore\\V1beta1"; +option ruby_package = "Google::Cloud::Firestore::V1beta1"; // A Firestore document. // diff --git a/google/cloud/firestore_v1beta1/proto/document_pb2.py b/google/cloud/firestore_v1beta1/proto/document_pb2.py index 4ca1f65ed..b4b150e6c 100644 --- a/google/cloud/firestore_v1beta1/proto/document_pb2.py +++ b/google/cloud/firestore_v1beta1/proto/document_pb2.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/firestore_v1beta1/proto/document.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -25,12 +22,9 @@ name="google/cloud/firestore_v1beta1/proto/document.proto", package="google.firestore.v1beta1", syntax="proto3", - serialized_options=_b( - "\n\034com.google.firestore.v1beta1B\rDocumentProtoP\001ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\242\002\004GCFS\252\002\036Google.Cloud.Firestore.V1Beta1\312\002\036Google\\Cloud\\Firestore\\V1beta1" - ), - serialized_pb=_b( - '\n3google/cloud/firestore_v1beta1/proto/document.proto\x12\x18google.firestore.v1beta1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x18google/type/latlng.proto\x1a\x1cgoogle/api/annotations.proto"\x8a\x02\n\x08\x44ocument\x12\x0c\n\x04name\x18\x01 \x01(\t\x12>\n\x06\x66ields\x18\x02 \x03(\x0b\x32..google.firestore.v1beta1.Document.FieldsEntry\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aN\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.google.firestore.v1beta1.Value:\x02\x38\x01"\xb8\x03\n\x05Value\x12\x30\n\nnull_value\x18\x0b \x01(\x0e\x32\x1a.google.protobuf.NullValueH\x00\x12\x17\n\rboolean_value\x18\x01 \x01(\x08H\x00\x12\x17\n\rinteger_value\x18\x02 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x03 \x01(\x01H\x00\x12\x35\n\x0ftimestamp_value\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x16\n\x0cstring_value\x18\x11 \x01(\tH\x00\x12\x15\n\x0b\x62ytes_value\x18\x12 \x01(\x0cH\x00\x12\x19\n\x0freference_value\x18\x05 \x01(\tH\x00\x12.\n\x0fgeo_point_value\x18\x08 \x01(\x0b\x32\x13.google.type.LatLngH\x00\x12;\n\x0b\x61rray_value\x18\t \x01(\x0b\x32$.google.firestore.v1beta1.ArrayValueH\x00\x12\x37\n\tmap_value\x18\x06 \x01(\x0b\x32".google.firestore.v1beta1.MapValueH\x00\x42\x0c\n\nvalue_type"=\n\nArrayValue\x12/\n\x06values\x18\x01 \x03(\x0b\x32\x1f.google.firestore.v1beta1.Value"\x9a\x01\n\x08MapValue\x12>\n\x06\x66ields\x18\x01 \x03(\x0b\x32..google.firestore.v1beta1.MapValue.FieldsEntry\x1aN\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.google.firestore.v1beta1.Value:\x02\x38\x01\x42\xbb\x01\n\x1c\x63om.google.firestore.v1beta1B\rDocumentProtoP\x01ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\xa2\x02\x04GCFS\xaa\x02\x1eGoogle.Cloud.Firestore.V1Beta1\xca\x02\x1eGoogle\\Cloud\\Firestore\\V1beta1b\x06proto3' - ), + serialized_options=b"\n\034com.google.firestore.v1beta1B\rDocumentProtoP\001ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\242\002\004GCFS\252\002\036Google.Cloud.Firestore.V1Beta1\312\002\036Google\\Cloud\\Firestore\\V1beta1\352\002!Google::Cloud::Firestore::V1beta1", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n3google/cloud/firestore_v1beta1/proto/document.proto\x12\x18google.firestore.v1beta1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x18google/type/latlng.proto\x1a\x1cgoogle/api/annotations.proto"\x8a\x02\n\x08\x44ocument\x12\x0c\n\x04name\x18\x01 \x01(\t\x12>\n\x06\x66ields\x18\x02 \x03(\x0b\x32..google.firestore.v1beta1.Document.FieldsEntry\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aN\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.google.firestore.v1beta1.Value:\x02\x38\x01"\xb8\x03\n\x05Value\x12\x30\n\nnull_value\x18\x0b \x01(\x0e\x32\x1a.google.protobuf.NullValueH\x00\x12\x17\n\rboolean_value\x18\x01 \x01(\x08H\x00\x12\x17\n\rinteger_value\x18\x02 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x03 \x01(\x01H\x00\x12\x35\n\x0ftimestamp_value\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x16\n\x0cstring_value\x18\x11 \x01(\tH\x00\x12\x15\n\x0b\x62ytes_value\x18\x12 \x01(\x0cH\x00\x12\x19\n\x0freference_value\x18\x05 \x01(\tH\x00\x12.\n\x0fgeo_point_value\x18\x08 \x01(\x0b\x32\x13.google.type.LatLngH\x00\x12;\n\x0b\x61rray_value\x18\t \x01(\x0b\x32$.google.firestore.v1beta1.ArrayValueH\x00\x12\x37\n\tmap_value\x18\x06 \x01(\x0b\x32".google.firestore.v1beta1.MapValueH\x00\x42\x0c\n\nvalue_type"=\n\nArrayValue\x12/\n\x06values\x18\x01 \x03(\x0b\x32\x1f.google.firestore.v1beta1.Value"\x9a\x01\n\x08MapValue\x12>\n\x06\x66ields\x18\x01 \x03(\x0b\x32..google.firestore.v1beta1.MapValue.FieldsEntry\x1aN\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.google.firestore.v1beta1.Value:\x02\x38\x01\x42\xdf\x01\n\x1c\x63om.google.firestore.v1beta1B\rDocumentProtoP\x01ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\xa2\x02\x04GCFS\xaa\x02\x1eGoogle.Cloud.Firestore.V1Beta1\xca\x02\x1eGoogle\\Cloud\\Firestore\\V1beta1\xea\x02!Google::Cloud::Firestore::V1beta1b\x06proto3', dependencies=[ google_dot_protobuf_dot_struct__pb2.DESCRIPTOR, google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, @@ -46,6 +40,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="key", @@ -56,7 +51,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -64,6 +59,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="value", @@ -82,12 +78,13 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], nested_types=[], enum_types=[], - serialized_options=_b("8\001"), + serialized_options=b"8\001", is_extendable=False, syntax="proto3", extension_ranges=[], @@ -102,6 +99,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -112,7 +110,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -120,6 +118,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="fields", @@ -138,6 +137,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="create_time", @@ -156,6 +156,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="update_time", @@ -174,10 +175,11 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], - nested_types=[_DOCUMENT_FIELDSENTRY], + nested_types=[_DOCUMENT_FIELDSENTRY,], enum_types=[], serialized_options=None, is_extendable=False, @@ -195,6 +197,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="null_value", @@ -213,6 +216,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="boolean_value", @@ -231,6 +235,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="integer_value", @@ -249,6 +254,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="double_value", @@ -267,6 +273,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="timestamp_value", @@ -285,6 +292,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="string_value", @@ -295,7 +303,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -303,6 +311,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="bytes_value", @@ -313,7 +322,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -321,6 +330,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="reference_value", @@ -331,7 +341,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -339,6 +349,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="geo_point_value", @@ -357,6 +368,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="array_value", @@ -375,6 +387,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="map_value", @@ -393,6 +406,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -408,8 +422,9 @@ full_name="google.firestore.v1beta1.Value.value_type", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=470, serialized_end=910, @@ -422,6 +437,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="values", @@ -440,7 +456,8 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -461,6 +478,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="key", @@ -471,7 +489,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -479,6 +497,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="value", @@ -497,12 +516,13 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], nested_types=[], enum_types=[], - serialized_options=_b("8\001"), + serialized_options=b"8\001", is_extendable=False, syntax="proto3", extension_ranges=[], @@ -517,6 +537,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="fields", @@ -535,10 +556,11 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], - nested_types=[_MAPVALUE_FIELDSENTRY], + nested_types=[_MAPVALUE_FIELDSENTRY,], enum_types=[], serialized_options=None, is_extendable=False, @@ -636,29 +658,26 @@ Document = _reflection.GeneratedProtocolMessageType( "Document", (_message.Message,), - dict( - FieldsEntry=_reflection.GeneratedProtocolMessageType( + { + "FieldsEntry": _reflection.GeneratedProtocolMessageType( "FieldsEntry", (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_FIELDSENTRY, - __module__="google.cloud.firestore_v1beta1.proto.document_pb2" + { + "DESCRIPTOR": _DOCUMENT_FIELDSENTRY, + "__module__": "google.cloud.firestore_v1beta1.proto.document_pb2" # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.Document.FieldsEntry) - ), + }, ), - DESCRIPTOR=_DOCUMENT, - __module__="google.cloud.firestore_v1beta1.proto.document_pb2", - __doc__="""A Firestore document. - - Must not exceed 1 MiB - 4 bytes. - + "DESCRIPTOR": _DOCUMENT, + "__module__": "google.cloud.firestore_v1beta1.proto.document_pb2", + "__doc__": """A Firestore document. Must not exceed 1 MiB - 4 bytes. Attributes: name: The resource name of the document, for example ``projects/{pro ject_id}/databases/{database_id}/documents/{document_path}``. fields: - The document's fields. The map keys represent field names. A + The document’s fields. The map keys represent field names. A simple field name contains only characters ``a`` to ``z``, ``A`` to ``Z``, ``0`` to ``9``, or ``_``, and must not start with ``0`` to ``9``. For example, ``foo_bar_17``. Field names @@ -672,10 +691,11 @@ delimited by ``.``. For example, the structured field ``"foo" : { map_value: { "x&y" : { string_value: "hello" }}}`` would be represented by the field path ``foo.x&y``. Within a field - path, a quoted field name starts and ends with ````` and may - contain any character. Some characters, including `````, must - be escaped using a ``\``. For example, ```x&y``` represents - ``x&y`` and ```bak\`tik``` represents ``bak`tik``. + path, a quoted field name starts and ends with :literal:`\`` + and may contain any character. Some characters, including + :literal:`\``, must be escaped using a ``\``. For example, + :literal:`\`x&y\`` represents ``x&y`` and + :literal:`\`bak\`tik\`` represents :literal:`bak`tik`. create_time: Output only. The time at which the document was created. This value increases monotonically when a document is deleted then @@ -689,7 +709,7 @@ ``read_time`` of a query. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.Document) - ), + }, ) _sym_db.RegisterMessage(Document) _sym_db.RegisterMessage(Document.FieldsEntry) @@ -697,11 +717,10 @@ Value = _reflection.GeneratedProtocolMessageType( "Value", (_message.Message,), - dict( - DESCRIPTOR=_VALUE, - __module__="google.cloud.firestore_v1beta1.proto.document_pb2", - __doc__="""A message that can hold any of the supported value types. - + { + "DESCRIPTOR": _VALUE, + "__module__": "google.cloud.firestore_v1beta1.proto.document_pb2", + "__doc__": """A message that can hold any of the supported value types. Attributes: value_type: @@ -737,56 +756,54 @@ A map value. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.Value) - ), + }, ) _sym_db.RegisterMessage(Value) ArrayValue = _reflection.GeneratedProtocolMessageType( "ArrayValue", (_message.Message,), - dict( - DESCRIPTOR=_ARRAYVALUE, - __module__="google.cloud.firestore_v1beta1.proto.document_pb2", - __doc__="""An array value. - + { + "DESCRIPTOR": _ARRAYVALUE, + "__module__": "google.cloud.firestore_v1beta1.proto.document_pb2", + "__doc__": """An array value. Attributes: values: Values in the array. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.ArrayValue) - ), + }, ) _sym_db.RegisterMessage(ArrayValue) MapValue = _reflection.GeneratedProtocolMessageType( "MapValue", (_message.Message,), - dict( - FieldsEntry=_reflection.GeneratedProtocolMessageType( + { + "FieldsEntry": _reflection.GeneratedProtocolMessageType( "FieldsEntry", (_message.Message,), - dict( - DESCRIPTOR=_MAPVALUE_FIELDSENTRY, - __module__="google.cloud.firestore_v1beta1.proto.document_pb2" + { + "DESCRIPTOR": _MAPVALUE_FIELDSENTRY, + "__module__": "google.cloud.firestore_v1beta1.proto.document_pb2" # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.MapValue.FieldsEntry) - ), + }, ), - DESCRIPTOR=_MAPVALUE, - __module__="google.cloud.firestore_v1beta1.proto.document_pb2", - __doc__="""A map value. - + "DESCRIPTOR": _MAPVALUE, + "__module__": "google.cloud.firestore_v1beta1.proto.document_pb2", + "__doc__": """A map value. Attributes: fields: - The map's fields. The map keys represent field names. Field + The map’s fields. The map keys represent field names. Field names matching the regular expression ``__.*__`` are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.MapValue) - ), + }, ) _sym_db.RegisterMessage(MapValue) _sym_db.RegisterMessage(MapValue.FieldsEntry) diff --git a/google/cloud/firestore_v1beta1/proto/document_pb2_grpc.py b/google/cloud/firestore_v1beta1/proto/document_pb2_grpc.py index 07cb78fe0..8a9393943 100644 --- a/google/cloud/firestore_v1beta1/proto/document_pb2_grpc.py +++ b/google/cloud/firestore_v1beta1/proto/document_pb2_grpc.py @@ -1,2 +1,3 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc diff --git a/google/cloud/firestore_v1beta1/proto/firestore.proto b/google/cloud/firestore_v1beta1/proto/firestore.proto index c2b15b048..5cdccb7ea 100644 --- a/google/cloud/firestore_v1beta1/proto/firestore.proto +++ b/google/cloud/firestore_v1beta1/proto/firestore.proto @@ -35,6 +35,7 @@ option java_outer_classname = "FirestoreProto"; option java_package = "com.google.firestore.v1beta1"; option objc_class_prefix = "GCFS"; option php_namespace = "Google\\Cloud\\Firestore\\V1beta1"; +option ruby_package = "Google::Cloud::Firestore::V1beta1"; // Specification of the Firestore API. diff --git a/google/cloud/firestore_v1beta1/proto/firestore_pb2.py b/google/cloud/firestore_v1beta1/proto/firestore_pb2.py index 7d29eb882..3356808a2 100644 --- a/google/cloud/firestore_v1beta1/proto/firestore_pb2.py +++ b/google/cloud/firestore_v1beta1/proto/firestore_pb2.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/firestore_v1beta1/proto/firestore.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -39,12 +36,9 @@ name="google/cloud/firestore_v1beta1/proto/firestore.proto", package="google.firestore.v1beta1", syntax="proto3", - serialized_options=_b( - "\n\034com.google.firestore.v1beta1B\016FirestoreProtoP\001ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\242\002\004GCFS\252\002\036Google.Cloud.Firestore.V1Beta1\312\002\036Google\\Cloud\\Firestore\\V1beta1" - ), - serialized_pb=_b( - '\n4google/cloud/firestore_v1beta1/proto/firestore.proto\x12\x18google.firestore.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x31google/cloud/firestore_v1beta1/proto/common.proto\x1a\x33google/cloud/firestore_v1beta1/proto/document.proto\x1a\x30google/cloud/firestore_v1beta1/proto/query.proto\x1a\x30google/cloud/firestore_v1beta1/proto/write.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto"\xbd\x01\n\x12GetDocumentRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x04mask\x18\x02 \x01(\x0b\x32&.google.firestore.v1beta1.DocumentMask\x12\x15\n\x0btransaction\x18\x03 \x01(\x0cH\x00\x12/\n\tread_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x16\n\x14\x63onsistency_selector"\xac\x02\n\x14ListDocumentsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rcollection_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x06 \x01(\t\x12\x34\n\x04mask\x18\x07 \x01(\x0b\x32&.google.firestore.v1beta1.DocumentMask\x12\x15\n\x0btransaction\x18\x08 \x01(\x0cH\x00\x12/\n\tread_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x14\n\x0cshow_missing\x18\x0c \x01(\x08\x42\x16\n\x14\x63onsistency_selector"g\n\x15ListDocumentsResponse\x12\x35\n\tdocuments\x18\x01 \x03(\x0b\x32".google.firestore.v1beta1.Document\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\xce\x01\n\x15\x43reateDocumentRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rcollection_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64ocument_id\x18\x03 \x01(\t\x12\x39\n\x08\x64ocument\x18\x04 \x01(\x0b\x32".google.firestore.v1beta1.DocumentB\x03\xe0\x41\x02\x12\x34\n\x04mask\x18\x05 \x01(\x0b\x32&.google.firestore.v1beta1.DocumentMask"\x87\x02\n\x15UpdateDocumentRequest\x12\x39\n\x08\x64ocument\x18\x01 \x01(\x0b\x32".google.firestore.v1beta1.DocumentB\x03\xe0\x41\x02\x12;\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32&.google.firestore.v1beta1.DocumentMask\x12\x34\n\x04mask\x18\x03 \x01(\x0b\x32&.google.firestore.v1beta1.DocumentMask\x12@\n\x10\x63urrent_document\x18\x04 \x01(\x0b\x32&.google.firestore.v1beta1.Precondition"l\n\x15\x44\x65leteDocumentRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12@\n\x10\x63urrent_document\x18\x02 \x01(\x0b\x32&.google.firestore.v1beta1.Precondition"\xa3\x02\n\x18\x42\x61tchGetDocumentsRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tdocuments\x18\x02 \x03(\t\x12\x34\n\x04mask\x18\x03 \x01(\x0b\x32&.google.firestore.v1beta1.DocumentMask\x12\x15\n\x0btransaction\x18\x04 \x01(\x0cH\x00\x12G\n\x0fnew_transaction\x18\x05 \x01(\x0b\x32,.google.firestore.v1beta1.TransactionOptionsH\x00\x12/\n\tread_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x16\n\x14\x63onsistency_selector"\xb1\x01\n\x19\x42\x61tchGetDocumentsResponse\x12\x33\n\x05\x66ound\x18\x01 \x01(\x0b\x32".google.firestore.v1beta1.DocumentH\x00\x12\x11\n\x07missing\x18\x02 \x01(\tH\x00\x12\x13\n\x0btransaction\x18\x03 \x01(\x0c\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x08\n\x06result"o\n\x17\x42\x65ginTransactionRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\x07options\x18\x02 \x01(\x0b\x32,.google.firestore.v1beta1.TransactionOptions"/\n\x18\x42\x65ginTransactionResponse\x12\x13\n\x0btransaction\x18\x01 \x01(\x0c"l\n\rCommitRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12/\n\x06writes\x18\x02 \x03(\x0b\x32\x1f.google.firestore.v1beta1.Write\x12\x13\n\x0btransaction\x18\x03 \x01(\x0c"\x7f\n\x0e\x43ommitResponse\x12<\n\rwrite_results\x18\x01 \x03(\x0b\x32%.google.firestore.v1beta1.WriteResult\x12/\n\x0b\x63ommit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"B\n\x0fRollbackRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0btransaction\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02"\xa4\x02\n\x0fRunQueryRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x45\n\x10structured_query\x18\x02 \x01(\x0b\x32).google.firestore.v1beta1.StructuredQueryH\x00\x12\x15\n\x0btransaction\x18\x05 \x01(\x0cH\x01\x12G\n\x0fnew_transaction\x18\x06 \x01(\x0b\x32,.google.firestore.v1beta1.TransactionOptionsH\x01\x12/\n\tread_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x42\x0c\n\nquery_typeB\x16\n\x14\x63onsistency_selector"\xa5\x01\n\x10RunQueryResponse\x12\x13\n\x0btransaction\x18\x02 \x01(\x0c\x12\x34\n\x08\x64ocument\x18\x01 \x01(\x0b\x32".google.firestore.v1beta1.Document\x12-\n\tread_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fskipped_results\x18\x04 \x01(\x05"\xf2\x01\n\x0cWriteRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tstream_id\x18\x02 \x01(\t\x12/\n\x06writes\x18\x03 \x03(\x0b\x32\x1f.google.firestore.v1beta1.Write\x12\x14\n\x0cstream_token\x18\x04 \x01(\x0c\x12\x42\n\x06labels\x18\x05 \x03(\x0b\x32\x32.google.firestore.v1beta1.WriteRequest.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\xa7\x01\n\rWriteResponse\x12\x11\n\tstream_id\x18\x01 \x01(\t\x12\x14\n\x0cstream_token\x18\x02 \x01(\x0c\x12<\n\rwrite_results\x18\x03 \x03(\x0b\x32%.google.firestore.v1beta1.WriteResult\x12/\n\x0b\x63ommit_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\xfc\x01\n\rListenRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\nadd_target\x18\x02 \x01(\x0b\x32 .google.firestore.v1beta1.TargetH\x00\x12\x17\n\rremove_target\x18\x03 \x01(\x05H\x00\x12\x43\n\x06labels\x18\x04 \x03(\x0b\x32\x33.google.firestore.v1beta1.ListenRequest.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x0f\n\rtarget_change"\xee\x02\n\x0eListenResponse\x12?\n\rtarget_change\x18\x02 \x01(\x0b\x32&.google.firestore.v1beta1.TargetChangeH\x00\x12\x43\n\x0f\x64ocument_change\x18\x03 \x01(\x0b\x32(.google.firestore.v1beta1.DocumentChangeH\x00\x12\x43\n\x0f\x64ocument_delete\x18\x04 \x01(\x0b\x32(.google.firestore.v1beta1.DocumentDeleteH\x00\x12\x43\n\x0f\x64ocument_remove\x18\x06 \x01(\x0b\x32(.google.firestore.v1beta1.DocumentRemoveH\x00\x12;\n\x06\x66ilter\x18\x05 \x01(\x0b\x32).google.firestore.v1beta1.ExistenceFilterH\x00\x42\x0f\n\rresponse_type"\xb0\x03\n\x06Target\x12=\n\x05query\x18\x02 \x01(\x0b\x32,.google.firestore.v1beta1.Target.QueryTargetH\x00\x12\x45\n\tdocuments\x18\x03 \x01(\x0b\x32\x30.google.firestore.v1beta1.Target.DocumentsTargetH\x00\x12\x16\n\x0cresume_token\x18\x04 \x01(\x0cH\x01\x12/\n\tread_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12\x11\n\ttarget_id\x18\x05 \x01(\x05\x12\x0c\n\x04once\x18\x06 \x01(\x08\x1a$\n\x0f\x44ocumentsTarget\x12\x11\n\tdocuments\x18\x02 \x03(\t\x1ar\n\x0bQueryTarget\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x45\n\x10structured_query\x18\x02 \x01(\x0b\x32).google.firestore.v1beta1.StructuredQueryH\x00\x42\x0c\n\nquery_typeB\r\n\x0btarget_typeB\r\n\x0bresume_type"\xaf\x02\n\x0cTargetChange\x12S\n\x12target_change_type\x18\x01 \x01(\x0e\x32\x37.google.firestore.v1beta1.TargetChange.TargetChangeType\x12\x12\n\ntarget_ids\x18\x02 \x03(\x05\x12!\n\x05\x63\x61use\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12\x14\n\x0cresume_token\x18\x04 \x01(\x0c\x12-\n\tread_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"N\n\x10TargetChangeType\x12\r\n\tNO_CHANGE\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x12\x0b\n\x07\x43URRENT\x10\x03\x12\t\n\x05RESET\x10\x04"V\n\x18ListCollectionIdsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"L\n\x19ListCollectionIdsResponse\x12\x16\n\x0e\x63ollection_ids\x18\x01 \x03(\t\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\x9b\x15\n\tFirestore\x12\x9e\x01\n\x0bGetDocument\x12,.google.firestore.v1beta1.GetDocumentRequest\x1a".google.firestore.v1beta1.Document"=\x82\xd3\xe4\x93\x02\x37\x12\x35/v1beta1/{name=projects/*/databases/*/documents/*/**}\x12\xc1\x01\n\rListDocuments\x12..google.firestore.v1beta1.ListDocumentsRequest\x1a/.google.firestore.v1beta1.ListDocumentsResponse"O\x82\xd3\xe4\x93\x02I\x12G/v1beta1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}\x12\xbe\x01\n\x0e\x43reateDocument\x12/.google.firestore.v1beta1.CreateDocumentRequest\x1a".google.firestore.v1beta1.Document"W\x82\xd3\xe4\x93\x02Q"E/v1beta1/{parent=projects/*/databases/*/documents/**}/{collection_id}:\x08\x64ocument\x12\xce\x01\n\x0eUpdateDocument\x12/.google.firestore.v1beta1.UpdateDocumentRequest\x1a".google.firestore.v1beta1.Document"g\x82\xd3\xe4\x93\x02J2>/v1beta1/{document.name=projects/*/databases/*/documents/*/**}:\x08\x64ocument\xda\x41\x14\x64ocument,update_mask\x12\x9f\x01\n\x0e\x44\x65leteDocument\x12/.google.firestore.v1beta1.DeleteDocumentRequest\x1a\x16.google.protobuf.Empty"D\x82\xd3\xe4\x93\x02\x37*5/v1beta1/{name=projects/*/databases/*/documents/*/**}\xda\x41\x04name\x12\xc8\x01\n\x11\x42\x61tchGetDocuments\x12\x32.google.firestore.v1beta1.BatchGetDocumentsRequest\x1a\x33.google.firestore.v1beta1.BatchGetDocumentsResponse"H\x82\xd3\xe4\x93\x02\x42"=/v1beta1/{database=projects/*/databases/*}/documents:batchGet:\x01*0\x01\x12\xd6\x01\n\x10\x42\x65ginTransaction\x12\x31.google.firestore.v1beta1.BeginTransactionRequest\x1a\x32.google.firestore.v1beta1.BeginTransactionResponse"[\x82\xd3\xe4\x93\x02J"E/v1beta1/{database=projects/*/databases/*}/documents:beginTransaction:\x01*\xda\x41\x08\x64\x61tabase\x12\xb5\x01\n\x06\x43ommit\x12\'.google.firestore.v1beta1.CommitRequest\x1a(.google.firestore.v1beta1.CommitResponse"X\x82\xd3\xe4\x93\x02@";/v1beta1/{database=projects/*/databases/*}/documents:commit:\x01*\xda\x41\x0f\x64\x61tabase,writes\x12\xae\x01\n\x08Rollback\x12).google.firestore.v1beta1.RollbackRequest\x1a\x16.google.protobuf.Empty"_\x82\xd3\xe4\x93\x02\x42"=/v1beta1/{database=projects/*/databases/*}/documents:rollback:\x01*\xda\x41\x14\x64\x61tabase,transaction\x12\xf4\x01\n\x08RunQuery\x12).google.firestore.v1beta1.RunQueryRequest\x1a*.google.firestore.v1beta1.RunQueryResponse"\x8e\x01\x82\xd3\xe4\x93\x02\x87\x01";/v1beta1/{parent=projects/*/databases/*/documents}:runQuery:\x01*ZE"@/v1beta1/{parent=projects/*/databases/*/documents/*/**}:runQuery:\x01*0\x01\x12\xa3\x01\n\x05Write\x12&.google.firestore.v1beta1.WriteRequest\x1a\'.google.firestore.v1beta1.WriteResponse"E\x82\xd3\xe4\x93\x02?":/v1beta1/{database=projects/*/databases/*}/documents:write:\x01*(\x01\x30\x01\x12\xa7\x01\n\x06Listen\x12\'.google.firestore.v1beta1.ListenRequest\x1a(.google.firestore.v1beta1.ListenResponse"F\x82\xd3\xe4\x93\x02@";/v1beta1/{database=projects/*/databases/*}/documents:listen:\x01*(\x01\x30\x01\x12\xa8\x02\n\x11ListCollectionIds\x12\x32.google.firestore.v1beta1.ListCollectionIdsRequest\x1a\x33.google.firestore.v1beta1.ListCollectionIdsResponse"\xa9\x01\x82\xd3\xe4\x93\x02\x99\x01"D/v1beta1/{parent=projects/*/databases/*/documents}:listCollectionIds:\x01*ZN"I/v1beta1/{parent=projects/*/databases/*/documents/*/**}:listCollectionIds:\x01*\xda\x41\x06parent\x1av\xca\x41\x18\x66irestore.googleapis.com\xd2\x41Xhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastoreB\xbc\x01\n\x1c\x63om.google.firestore.v1beta1B\x0e\x46irestoreProtoP\x01ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\xa2\x02\x04GCFS\xaa\x02\x1eGoogle.Cloud.Firestore.V1Beta1\xca\x02\x1eGoogle\\Cloud\\Firestore\\V1beta1b\x06proto3' - ), + serialized_options=b"\n\034com.google.firestore.v1beta1B\016FirestoreProtoP\001ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\242\002\004GCFS\252\002\036Google.Cloud.Firestore.V1Beta1\312\002\036Google\\Cloud\\Firestore\\V1beta1\352\002!Google::Cloud::Firestore::V1beta1", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n4google/cloud/firestore_v1beta1/proto/firestore.proto\x12\x18google.firestore.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x31google/cloud/firestore_v1beta1/proto/common.proto\x1a\x33google/cloud/firestore_v1beta1/proto/document.proto\x1a\x30google/cloud/firestore_v1beta1/proto/query.proto\x1a\x30google/cloud/firestore_v1beta1/proto/write.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto"\xbd\x01\n\x12GetDocumentRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x04mask\x18\x02 \x01(\x0b\x32&.google.firestore.v1beta1.DocumentMask\x12\x15\n\x0btransaction\x18\x03 \x01(\x0cH\x00\x12/\n\tread_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x16\n\x14\x63onsistency_selector"\xac\x02\n\x14ListDocumentsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rcollection_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x06 \x01(\t\x12\x34\n\x04mask\x18\x07 \x01(\x0b\x32&.google.firestore.v1beta1.DocumentMask\x12\x15\n\x0btransaction\x18\x08 \x01(\x0cH\x00\x12/\n\tread_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x14\n\x0cshow_missing\x18\x0c \x01(\x08\x42\x16\n\x14\x63onsistency_selector"g\n\x15ListDocumentsResponse\x12\x35\n\tdocuments\x18\x01 \x03(\x0b\x32".google.firestore.v1beta1.Document\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\xce\x01\n\x15\x43reateDocumentRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rcollection_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64ocument_id\x18\x03 \x01(\t\x12\x39\n\x08\x64ocument\x18\x04 \x01(\x0b\x32".google.firestore.v1beta1.DocumentB\x03\xe0\x41\x02\x12\x34\n\x04mask\x18\x05 \x01(\x0b\x32&.google.firestore.v1beta1.DocumentMask"\x87\x02\n\x15UpdateDocumentRequest\x12\x39\n\x08\x64ocument\x18\x01 \x01(\x0b\x32".google.firestore.v1beta1.DocumentB\x03\xe0\x41\x02\x12;\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32&.google.firestore.v1beta1.DocumentMask\x12\x34\n\x04mask\x18\x03 \x01(\x0b\x32&.google.firestore.v1beta1.DocumentMask\x12@\n\x10\x63urrent_document\x18\x04 \x01(\x0b\x32&.google.firestore.v1beta1.Precondition"l\n\x15\x44\x65leteDocumentRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12@\n\x10\x63urrent_document\x18\x02 \x01(\x0b\x32&.google.firestore.v1beta1.Precondition"\xa3\x02\n\x18\x42\x61tchGetDocumentsRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tdocuments\x18\x02 \x03(\t\x12\x34\n\x04mask\x18\x03 \x01(\x0b\x32&.google.firestore.v1beta1.DocumentMask\x12\x15\n\x0btransaction\x18\x04 \x01(\x0cH\x00\x12G\n\x0fnew_transaction\x18\x05 \x01(\x0b\x32,.google.firestore.v1beta1.TransactionOptionsH\x00\x12/\n\tread_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x16\n\x14\x63onsistency_selector"\xb1\x01\n\x19\x42\x61tchGetDocumentsResponse\x12\x33\n\x05\x66ound\x18\x01 \x01(\x0b\x32".google.firestore.v1beta1.DocumentH\x00\x12\x11\n\x07missing\x18\x02 \x01(\tH\x00\x12\x13\n\x0btransaction\x18\x03 \x01(\x0c\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x08\n\x06result"o\n\x17\x42\x65ginTransactionRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12=\n\x07options\x18\x02 \x01(\x0b\x32,.google.firestore.v1beta1.TransactionOptions"/\n\x18\x42\x65ginTransactionResponse\x12\x13\n\x0btransaction\x18\x01 \x01(\x0c"l\n\rCommitRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12/\n\x06writes\x18\x02 \x03(\x0b\x32\x1f.google.firestore.v1beta1.Write\x12\x13\n\x0btransaction\x18\x03 \x01(\x0c"\x7f\n\x0e\x43ommitResponse\x12<\n\rwrite_results\x18\x01 \x03(\x0b\x32%.google.firestore.v1beta1.WriteResult\x12/\n\x0b\x63ommit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"B\n\x0fRollbackRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0btransaction\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02"\xa4\x02\n\x0fRunQueryRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x45\n\x10structured_query\x18\x02 \x01(\x0b\x32).google.firestore.v1beta1.StructuredQueryH\x00\x12\x15\n\x0btransaction\x18\x05 \x01(\x0cH\x01\x12G\n\x0fnew_transaction\x18\x06 \x01(\x0b\x32,.google.firestore.v1beta1.TransactionOptionsH\x01\x12/\n\tread_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x42\x0c\n\nquery_typeB\x16\n\x14\x63onsistency_selector"\xa5\x01\n\x10RunQueryResponse\x12\x13\n\x0btransaction\x18\x02 \x01(\x0c\x12\x34\n\x08\x64ocument\x18\x01 \x01(\x0b\x32".google.firestore.v1beta1.Document\x12-\n\tread_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fskipped_results\x18\x04 \x01(\x05"\xf2\x01\n\x0cWriteRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tstream_id\x18\x02 \x01(\t\x12/\n\x06writes\x18\x03 \x03(\x0b\x32\x1f.google.firestore.v1beta1.Write\x12\x14\n\x0cstream_token\x18\x04 \x01(\x0c\x12\x42\n\x06labels\x18\x05 \x03(\x0b\x32\x32.google.firestore.v1beta1.WriteRequest.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\xa7\x01\n\rWriteResponse\x12\x11\n\tstream_id\x18\x01 \x01(\t\x12\x14\n\x0cstream_token\x18\x02 \x01(\x0c\x12<\n\rwrite_results\x18\x03 \x03(\x0b\x32%.google.firestore.v1beta1.WriteResult\x12/\n\x0b\x63ommit_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\xfc\x01\n\rListenRequest\x12\x15\n\x08\x64\x61tabase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\nadd_target\x18\x02 \x01(\x0b\x32 .google.firestore.v1beta1.TargetH\x00\x12\x17\n\rremove_target\x18\x03 \x01(\x05H\x00\x12\x43\n\x06labels\x18\x04 \x03(\x0b\x32\x33.google.firestore.v1beta1.ListenRequest.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x0f\n\rtarget_change"\xee\x02\n\x0eListenResponse\x12?\n\rtarget_change\x18\x02 \x01(\x0b\x32&.google.firestore.v1beta1.TargetChangeH\x00\x12\x43\n\x0f\x64ocument_change\x18\x03 \x01(\x0b\x32(.google.firestore.v1beta1.DocumentChangeH\x00\x12\x43\n\x0f\x64ocument_delete\x18\x04 \x01(\x0b\x32(.google.firestore.v1beta1.DocumentDeleteH\x00\x12\x43\n\x0f\x64ocument_remove\x18\x06 \x01(\x0b\x32(.google.firestore.v1beta1.DocumentRemoveH\x00\x12;\n\x06\x66ilter\x18\x05 \x01(\x0b\x32).google.firestore.v1beta1.ExistenceFilterH\x00\x42\x0f\n\rresponse_type"\xb0\x03\n\x06Target\x12=\n\x05query\x18\x02 \x01(\x0b\x32,.google.firestore.v1beta1.Target.QueryTargetH\x00\x12\x45\n\tdocuments\x18\x03 \x01(\x0b\x32\x30.google.firestore.v1beta1.Target.DocumentsTargetH\x00\x12\x16\n\x0cresume_token\x18\x04 \x01(\x0cH\x01\x12/\n\tread_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x12\x11\n\ttarget_id\x18\x05 \x01(\x05\x12\x0c\n\x04once\x18\x06 \x01(\x08\x1a$\n\x0f\x44ocumentsTarget\x12\x11\n\tdocuments\x18\x02 \x03(\t\x1ar\n\x0bQueryTarget\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x45\n\x10structured_query\x18\x02 \x01(\x0b\x32).google.firestore.v1beta1.StructuredQueryH\x00\x42\x0c\n\nquery_typeB\r\n\x0btarget_typeB\r\n\x0bresume_type"\xaf\x02\n\x0cTargetChange\x12S\n\x12target_change_type\x18\x01 \x01(\x0e\x32\x37.google.firestore.v1beta1.TargetChange.TargetChangeType\x12\x12\n\ntarget_ids\x18\x02 \x03(\x05\x12!\n\x05\x63\x61use\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12\x14\n\x0cresume_token\x18\x04 \x01(\x0c\x12-\n\tread_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"N\n\x10TargetChangeType\x12\r\n\tNO_CHANGE\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x12\x0b\n\x07\x43URRENT\x10\x03\x12\t\n\x05RESET\x10\x04"V\n\x18ListCollectionIdsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"L\n\x19ListCollectionIdsResponse\x12\x16\n\x0e\x63ollection_ids\x18\x01 \x03(\t\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\x9b\x15\n\tFirestore\x12\x9e\x01\n\x0bGetDocument\x12,.google.firestore.v1beta1.GetDocumentRequest\x1a".google.firestore.v1beta1.Document"=\x82\xd3\xe4\x93\x02\x37\x12\x35/v1beta1/{name=projects/*/databases/*/documents/*/**}\x12\xc1\x01\n\rListDocuments\x12..google.firestore.v1beta1.ListDocumentsRequest\x1a/.google.firestore.v1beta1.ListDocumentsResponse"O\x82\xd3\xe4\x93\x02I\x12G/v1beta1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}\x12\xbe\x01\n\x0e\x43reateDocument\x12/.google.firestore.v1beta1.CreateDocumentRequest\x1a".google.firestore.v1beta1.Document"W\x82\xd3\xe4\x93\x02Q"E/v1beta1/{parent=projects/*/databases/*/documents/**}/{collection_id}:\x08\x64ocument\x12\xce\x01\n\x0eUpdateDocument\x12/.google.firestore.v1beta1.UpdateDocumentRequest\x1a".google.firestore.v1beta1.Document"g\x82\xd3\xe4\x93\x02J2>/v1beta1/{document.name=projects/*/databases/*/documents/*/**}:\x08\x64ocument\xda\x41\x14\x64ocument,update_mask\x12\x9f\x01\n\x0e\x44\x65leteDocument\x12/.google.firestore.v1beta1.DeleteDocumentRequest\x1a\x16.google.protobuf.Empty"D\x82\xd3\xe4\x93\x02\x37*5/v1beta1/{name=projects/*/databases/*/documents/*/**}\xda\x41\x04name\x12\xc8\x01\n\x11\x42\x61tchGetDocuments\x12\x32.google.firestore.v1beta1.BatchGetDocumentsRequest\x1a\x33.google.firestore.v1beta1.BatchGetDocumentsResponse"H\x82\xd3\xe4\x93\x02\x42"=/v1beta1/{database=projects/*/databases/*}/documents:batchGet:\x01*0\x01\x12\xd6\x01\n\x10\x42\x65ginTransaction\x12\x31.google.firestore.v1beta1.BeginTransactionRequest\x1a\x32.google.firestore.v1beta1.BeginTransactionResponse"[\x82\xd3\xe4\x93\x02J"E/v1beta1/{database=projects/*/databases/*}/documents:beginTransaction:\x01*\xda\x41\x08\x64\x61tabase\x12\xb5\x01\n\x06\x43ommit\x12\'.google.firestore.v1beta1.CommitRequest\x1a(.google.firestore.v1beta1.CommitResponse"X\x82\xd3\xe4\x93\x02@";/v1beta1/{database=projects/*/databases/*}/documents:commit:\x01*\xda\x41\x0f\x64\x61tabase,writes\x12\xae\x01\n\x08Rollback\x12).google.firestore.v1beta1.RollbackRequest\x1a\x16.google.protobuf.Empty"_\x82\xd3\xe4\x93\x02\x42"=/v1beta1/{database=projects/*/databases/*}/documents:rollback:\x01*\xda\x41\x14\x64\x61tabase,transaction\x12\xf4\x01\n\x08RunQuery\x12).google.firestore.v1beta1.RunQueryRequest\x1a*.google.firestore.v1beta1.RunQueryResponse"\x8e\x01\x82\xd3\xe4\x93\x02\x87\x01";/v1beta1/{parent=projects/*/databases/*/documents}:runQuery:\x01*ZE"@/v1beta1/{parent=projects/*/databases/*/documents/*/**}:runQuery:\x01*0\x01\x12\xa3\x01\n\x05Write\x12&.google.firestore.v1beta1.WriteRequest\x1a\'.google.firestore.v1beta1.WriteResponse"E\x82\xd3\xe4\x93\x02?":/v1beta1/{database=projects/*/databases/*}/documents:write:\x01*(\x01\x30\x01\x12\xa7\x01\n\x06Listen\x12\'.google.firestore.v1beta1.ListenRequest\x1a(.google.firestore.v1beta1.ListenResponse"F\x82\xd3\xe4\x93\x02@";/v1beta1/{database=projects/*/databases/*}/documents:listen:\x01*(\x01\x30\x01\x12\xa8\x02\n\x11ListCollectionIds\x12\x32.google.firestore.v1beta1.ListCollectionIdsRequest\x1a\x33.google.firestore.v1beta1.ListCollectionIdsResponse"\xa9\x01\x82\xd3\xe4\x93\x02\x99\x01"D/v1beta1/{parent=projects/*/databases/*/documents}:listCollectionIds:\x01*ZN"I/v1beta1/{parent=projects/*/databases/*/documents/*/**}:listCollectionIds:\x01*\xda\x41\x06parent\x1av\xca\x41\x18\x66irestore.googleapis.com\xd2\x41Xhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastoreB\xe0\x01\n\x1c\x63om.google.firestore.v1beta1B\x0e\x46irestoreProtoP\x01ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\xa2\x02\x04GCFS\xaa\x02\x1eGoogle.Cloud.Firestore.V1Beta1\xca\x02\x1eGoogle\\Cloud\\Firestore\\V1beta1\xea\x02!Google::Cloud::Firestore::V1beta1b\x06proto3', dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, google_dot_api_dot_client__pb2.DESCRIPTOR, @@ -65,21 +59,47 @@ full_name="google.firestore.v1beta1.TargetChange.TargetChangeType", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( - name="NO_CHANGE", index=0, number=0, serialized_options=None, type=None + name="NO_CHANGE", + index=0, + number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="ADD", index=1, number=1, serialized_options=None, type=None + name="ADD", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="REMOVE", index=2, number=2, serialized_options=None, type=None + name="REMOVE", + index=2, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="CURRENT", index=3, number=3, serialized_options=None, type=None + name="CURRENT", + index=3, + number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="RESET", index=4, number=4, serialized_options=None, type=None + name="RESET", + index=4, + number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -96,6 +116,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -106,14 +127,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="mask", @@ -132,6 +154,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="transaction", @@ -142,7 +165,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -150,6 +173,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="read_time", @@ -168,6 +192,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -183,8 +208,9 @@ full_name="google.firestore.v1beta1.GetDocumentRequest.consistency_selector", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=462, serialized_end=651, @@ -197,6 +223,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="parent", @@ -207,14 +234,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="collection_id", @@ -225,14 +253,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="page_size", @@ -251,6 +280,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="page_token", @@ -261,7 +291,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -269,6 +299,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="order_by", @@ -279,7 +310,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -287,6 +318,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="mask", @@ -305,6 +337,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="transaction", @@ -315,7 +348,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -323,6 +356,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="read_time", @@ -341,6 +375,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="show_missing", @@ -359,6 +394,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -374,8 +410,9 @@ full_name="google.firestore.v1beta1.ListDocumentsRequest.consistency_selector", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=654, serialized_end=954, @@ -388,6 +425,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="documents", @@ -406,6 +444,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="next_page_token", @@ -416,7 +455,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -424,6 +463,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -445,6 +485,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="parent", @@ -455,14 +496,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="collection_id", @@ -473,14 +515,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="document_id", @@ -491,7 +534,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -499,6 +542,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="document", @@ -515,8 +559,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="mask", @@ -535,6 +580,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -556,6 +602,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="document", @@ -572,8 +619,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="update_mask", @@ -592,6 +640,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="mask", @@ -610,6 +659,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="current_document", @@ -628,6 +678,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -649,6 +700,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -659,14 +711,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="current_document", @@ -685,6 +738,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -706,6 +760,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="database", @@ -716,14 +771,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="documents", @@ -742,6 +798,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="mask", @@ -760,6 +817,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="transaction", @@ -770,7 +828,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -778,6 +836,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="new_transaction", @@ -796,6 +855,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="read_time", @@ -814,6 +874,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -829,8 +890,9 @@ full_name="google.firestore.v1beta1.BatchGetDocumentsRequest.consistency_selector", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=1647, serialized_end=1938, @@ -843,6 +905,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="found", @@ -861,6 +924,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="missing", @@ -871,7 +935,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -879,6 +943,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="transaction", @@ -889,7 +954,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -897,6 +962,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="read_time", @@ -915,6 +981,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -930,8 +997,9 @@ full_name="google.firestore.v1beta1.BatchGetDocumentsResponse.result", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=1941, serialized_end=2118, @@ -944,6 +1012,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="database", @@ -954,14 +1023,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="options", @@ -980,6 +1050,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1001,6 +1072,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="transaction", @@ -1011,7 +1083,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -1019,7 +1091,8 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -1040,6 +1113,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="database", @@ -1050,14 +1124,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="writes", @@ -1076,6 +1151,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="transaction", @@ -1086,7 +1162,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -1094,6 +1170,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1115,6 +1192,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="write_results", @@ -1133,6 +1211,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="commit_time", @@ -1151,6 +1230,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1172,6 +1252,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="database", @@ -1182,14 +1263,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="transaction", @@ -1200,14 +1282,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1229,6 +1312,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="parent", @@ -1239,14 +1323,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="structured_query", @@ -1265,6 +1350,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="transaction", @@ -1275,7 +1361,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -1283,6 +1369,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="new_transaction", @@ -1301,6 +1388,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="read_time", @@ -1319,6 +1407,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1334,6 +1423,7 @@ full_name="google.firestore.v1beta1.RunQueryRequest.query_type", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], ), _descriptor.OneofDescriptor( @@ -1341,6 +1431,7 @@ full_name="google.firestore.v1beta1.RunQueryRequest.consistency_selector", index=1, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], ), ], @@ -1355,6 +1446,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="transaction", @@ -1365,7 +1457,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -1373,6 +1465,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="document", @@ -1391,6 +1484,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="read_time", @@ -1409,6 +1503,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="skipped_results", @@ -1427,6 +1522,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1448,6 +1544,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="key", @@ -1458,7 +1555,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -1466,6 +1563,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="value", @@ -1476,7 +1574,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -1484,12 +1582,13 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], nested_types=[], enum_types=[], - serialized_options=_b("8\001"), + serialized_options=b"8\001", is_extendable=False, syntax="proto3", extension_ranges=[], @@ -1504,6 +1603,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="database", @@ -1514,14 +1614,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="stream_id", @@ -1532,7 +1633,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -1540,6 +1641,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="writes", @@ -1558,6 +1660,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="stream_token", @@ -1568,7 +1671,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -1576,6 +1679,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="labels", @@ -1594,10 +1698,11 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], - nested_types=[_WRITEREQUEST_LABELSENTRY], + nested_types=[_WRITEREQUEST_LABELSENTRY,], enum_types=[], serialized_options=None, is_extendable=False, @@ -1615,6 +1720,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="stream_id", @@ -1625,7 +1731,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -1633,6 +1739,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="stream_token", @@ -1643,7 +1750,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -1651,6 +1758,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="write_results", @@ -1669,6 +1777,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="commit_time", @@ -1687,6 +1796,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1708,6 +1818,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="key", @@ -1718,7 +1829,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -1726,6 +1837,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="value", @@ -1736,7 +1848,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -1744,12 +1856,13 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], nested_types=[], enum_types=[], - serialized_options=_b("8\001"), + serialized_options=b"8\001", is_extendable=False, syntax="proto3", extension_ranges=[], @@ -1764,6 +1877,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="database", @@ -1774,14 +1888,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="add_target", @@ -1800,6 +1915,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="remove_target", @@ -1818,6 +1934,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="labels", @@ -1836,10 +1953,11 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], - nested_types=[_LISTENREQUEST_LABELSENTRY], + nested_types=[_LISTENREQUEST_LABELSENTRY,], enum_types=[], serialized_options=None, is_extendable=False, @@ -1851,8 +1969,9 @@ full_name="google.firestore.v1beta1.ListenRequest.target_change", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=3468, serialized_end=3720, @@ -1865,6 +1984,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="target_change", @@ -1883,6 +2003,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="document_change", @@ -1901,6 +2022,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="document_delete", @@ -1919,6 +2041,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="document_remove", @@ -1937,6 +2060,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="filter", @@ -1955,6 +2079,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1970,8 +2095,9 @@ full_name="google.firestore.v1beta1.ListenResponse.response_type", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=3723, serialized_end=4089, @@ -1984,6 +2110,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="documents", @@ -2002,7 +2129,8 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -2022,6 +2150,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="parent", @@ -2032,7 +2161,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -2040,6 +2169,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="structured_query", @@ -2058,6 +2188,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -2073,8 +2204,9 @@ full_name="google.firestore.v1beta1.Target.QueryTarget.query_type", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=4380, serialized_end=4494, @@ -2086,6 +2218,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="query", @@ -2104,6 +2237,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="documents", @@ -2122,6 +2256,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="resume_token", @@ -2132,7 +2267,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -2140,6 +2275,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="read_time", @@ -2158,6 +2294,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="target_id", @@ -2176,6 +2313,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="once", @@ -2194,10 +2332,11 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], - nested_types=[_TARGET_DOCUMENTSTARGET, _TARGET_QUERYTARGET], + nested_types=[_TARGET_DOCUMENTSTARGET, _TARGET_QUERYTARGET,], enum_types=[], serialized_options=None, is_extendable=False, @@ -2209,6 +2348,7 @@ full_name="google.firestore.v1beta1.Target.target_type", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], ), _descriptor.OneofDescriptor( @@ -2216,6 +2356,7 @@ full_name="google.firestore.v1beta1.Target.resume_type", index=1, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], ), ], @@ -2230,6 +2371,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="target_change_type", @@ -2248,6 +2390,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="target_ids", @@ -2266,6 +2409,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="cause", @@ -2284,6 +2428,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="resume_token", @@ -2294,7 +2439,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -2302,6 +2447,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="read_time", @@ -2320,11 +2466,12 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], nested_types=[], - enum_types=[_TARGETCHANGE_TARGETCHANGETYPE], + enum_types=[_TARGETCHANGE_TARGETCHANGETYPE,], serialized_options=None, is_extendable=False, syntax="proto3", @@ -2341,6 +2488,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="parent", @@ -2351,14 +2499,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="page_size", @@ -2377,6 +2526,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="page_token", @@ -2387,7 +2537,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -2395,6 +2545,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -2416,6 +2567,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="collection_ids", @@ -2434,6 +2586,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="next_page_token", @@ -2444,7 +2597,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -2452,6 +2605,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -2813,12 +2967,11 @@ GetDocumentRequest = _reflection.GeneratedProtocolMessageType( "GetDocumentRequest", (_message.Message,), - dict( - DESCRIPTOR=_GETDOCUMENTREQUEST, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The request for - [Firestore.GetDocument][google.firestore.v1beta1.Firestore.GetDocument]. - + { + "DESCRIPTOR": _GETDOCUMENTREQUEST, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The request for [Firestore.GetDocument][google.firestore.v1beta1.Fires + tore.GetDocument]. Attributes: name: @@ -2839,19 +2992,18 @@ not be older than 60 seconds. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.GetDocumentRequest) - ), + }, ) _sym_db.RegisterMessage(GetDocumentRequest) ListDocumentsRequest = _reflection.GeneratedProtocolMessageType( "ListDocumentsRequest", (_message.Message,), - dict( - DESCRIPTOR=_LISTDOCUMENTSREQUEST, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The request for - [Firestore.ListDocuments][google.firestore.v1beta1.Firestore.ListDocuments]. - + { + "DESCRIPTOR": _LISTDOCUMENTSREQUEST, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The request for [Firestore.ListDocuments][google.firestore.v1beta1.Fir + estore.ListDocuments]. Attributes: parent: @@ -2889,25 +3041,24 @@ If the list should show missing documents. A missing document is a document that does not exist but has sub-documents. These documents will be returned with a key but will not have - fields, [Document.create\_time][google.firestore.v1beta1.Docum - ent.create\_time], or [Document.update\_time][google.firestore - .v1beta1.Document.update\_time] set. Requests with + fields, [Document.create_time][google.firestore.v1beta1.Docume + nt.create_time], or [Document.update_time][google.firestore.v1 + beta1.Document.update_time] set. Requests with ``show_missing`` may not specify ``where`` or ``order_by``. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.ListDocumentsRequest) - ), + }, ) _sym_db.RegisterMessage(ListDocumentsRequest) ListDocumentsResponse = _reflection.GeneratedProtocolMessageType( "ListDocumentsResponse", (_message.Message,), - dict( - DESCRIPTOR=_LISTDOCUMENTSRESPONSE, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The response for - [Firestore.ListDocuments][google.firestore.v1beta1.Firestore.ListDocuments]. - + { + "DESCRIPTOR": _LISTDOCUMENTSRESPONSE, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The response for [Firestore.ListDocuments][google.firestore.v1beta1.Fi + restore.ListDocuments]. Attributes: documents: @@ -2916,19 +3067,18 @@ The next page token. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.ListDocumentsResponse) - ), + }, ) _sym_db.RegisterMessage(ListDocumentsResponse) CreateDocumentRequest = _reflection.GeneratedProtocolMessageType( "CreateDocumentRequest", (_message.Message,), - dict( - DESCRIPTOR=_CREATEDOCUMENTREQUEST, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The request for - [Firestore.CreateDocument][google.firestore.v1beta1.Firestore.CreateDocument]. - + { + "DESCRIPTOR": _CREATEDOCUMENTREQUEST, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The request for [Firestore.CreateDocument][google.firestore.v1beta1.Fi + restore.CreateDocument]. Attributes: parent: @@ -2951,19 +3101,18 @@ field will not be returned in the response. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.CreateDocumentRequest) - ), + }, ) _sym_db.RegisterMessage(CreateDocumentRequest) UpdateDocumentRequest = _reflection.GeneratedProtocolMessageType( "UpdateDocumentRequest", (_message.Message,), - dict( - DESCRIPTOR=_UPDATEDOCUMENTREQUEST, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The request for - [Firestore.UpdateDocument][google.firestore.v1beta1.Firestore.UpdateDocument]. - + { + "DESCRIPTOR": _UPDATEDOCUMENTREQUEST, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The request for [Firestore.UpdateDocument][google.firestore.v1beta1.Fi + restore.UpdateDocument]. Attributes: document: @@ -2985,19 +3134,18 @@ fail if this is set and not met by the target document. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.UpdateDocumentRequest) - ), + }, ) _sym_db.RegisterMessage(UpdateDocumentRequest) DeleteDocumentRequest = _reflection.GeneratedProtocolMessageType( "DeleteDocumentRequest", (_message.Message,), - dict( - DESCRIPTOR=_DELETEDOCUMENTREQUEST, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The request for - [Firestore.DeleteDocument][google.firestore.v1beta1.Firestore.DeleteDocument]. - + { + "DESCRIPTOR": _DELETEDOCUMENTREQUEST, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The request for [Firestore.DeleteDocument][google.firestore.v1beta1.Fi + restore.DeleteDocument]. Attributes: name: @@ -3009,19 +3157,18 @@ fail if this is set and not met by the target document. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.DeleteDocumentRequest) - ), + }, ) _sym_db.RegisterMessage(DeleteDocumentRequest) BatchGetDocumentsRequest = _reflection.GeneratedProtocolMessageType( "BatchGetDocumentsRequest", (_message.Message,), - dict( - DESCRIPTOR=_BATCHGETDOCUMENTSREQUEST, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The request for - [Firestore.BatchGetDocuments][google.firestore.v1beta1.Firestore.BatchGetDocuments]. - + { + "DESCRIPTOR": _BATCHGETDOCUMENTSREQUEST, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The request for [Firestore.BatchGetDocuments][google.firestore.v1beta1 + .Firestore.BatchGetDocuments]. Attributes: database: @@ -3051,19 +3198,18 @@ be older than 60 seconds. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.BatchGetDocumentsRequest) - ), + }, ) _sym_db.RegisterMessage(BatchGetDocumentsRequest) BatchGetDocumentsResponse = _reflection.GeneratedProtocolMessageType( "BatchGetDocumentsResponse", (_message.Message,), - dict( - DESCRIPTOR=_BATCHGETDOCUMENTSRESPONSE, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The streamed response for - [Firestore.BatchGetDocuments][google.firestore.v1beta1.Firestore.BatchGetDocuments]. - + { + "DESCRIPTOR": _BATCHGETDOCUMENTSRESPONSE, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The streamed response for [Firestore.BatchGetDocuments][google.firesto + re.v1beta1.Firestore.BatchGetDocuments]. Attributes: result: @@ -3078,28 +3224,27 @@ transaction: The transaction that was started as part of this request. Will only be set in the first response, and only if [BatchGetDocume - ntsRequest.new\_transaction][google.firestore.v1beta1.BatchGet - DocumentsRequest.new\_transaction] was set in the request. + ntsRequest.new_transaction][google.firestore.v1beta1.BatchGetD + ocumentsRequest.new_transaction] was set in the request. read_time: The time at which the document was read. This may be monotically increasing, in this case the previous documents in the result stream are guaranteed not to have changed between - their read\_time and this one. + their read_time and this one. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.BatchGetDocumentsResponse) - ), + }, ) _sym_db.RegisterMessage(BatchGetDocumentsResponse) BeginTransactionRequest = _reflection.GeneratedProtocolMessageType( "BeginTransactionRequest", (_message.Message,), - dict( - DESCRIPTOR=_BEGINTRANSACTIONREQUEST, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The request for - [Firestore.BeginTransaction][google.firestore.v1beta1.Firestore.BeginTransaction]. - + { + "DESCRIPTOR": _BEGINTRANSACTIONREQUEST, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The request for [Firestore.BeginTransaction][google.firestore.v1beta1. + Firestore.BeginTransaction]. Attributes: database: @@ -3110,39 +3255,37 @@ transaction. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.BeginTransactionRequest) - ), + }, ) _sym_db.RegisterMessage(BeginTransactionRequest) BeginTransactionResponse = _reflection.GeneratedProtocolMessageType( "BeginTransactionResponse", (_message.Message,), - dict( - DESCRIPTOR=_BEGINTRANSACTIONRESPONSE, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The response for - [Firestore.BeginTransaction][google.firestore.v1beta1.Firestore.BeginTransaction]. - + { + "DESCRIPTOR": _BEGINTRANSACTIONRESPONSE, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The response for [Firestore.BeginTransaction][google.firestore.v1beta1 + .Firestore.BeginTransaction]. Attributes: transaction: The transaction that was started. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.BeginTransactionResponse) - ), + }, ) _sym_db.RegisterMessage(BeginTransactionResponse) CommitRequest = _reflection.GeneratedProtocolMessageType( "CommitRequest", (_message.Message,), - dict( - DESCRIPTOR=_COMMITREQUEST, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The request for + { + "DESCRIPTOR": _COMMITREQUEST, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The request for [Firestore.Commit][google.firestore.v1beta1.Firestore.Commit]. - Attributes: database: Required. The database name. In the format: @@ -3154,20 +3297,19 @@ it. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.CommitRequest) - ), + }, ) _sym_db.RegisterMessage(CommitRequest) CommitResponse = _reflection.GeneratedProtocolMessageType( "CommitResponse", (_message.Message,), - dict( - DESCRIPTOR=_COMMITRESPONSE, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The response for + { + "DESCRIPTOR": _COMMITRESPONSE, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The response for [Firestore.Commit][google.firestore.v1beta1.Firestore.Commit]. - Attributes: write_results: The result of applying the writes. This i-th write result @@ -3176,20 +3318,19 @@ The time at which the commit occurred. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.CommitResponse) - ), + }, ) _sym_db.RegisterMessage(CommitResponse) RollbackRequest = _reflection.GeneratedProtocolMessageType( "RollbackRequest", (_message.Message,), - dict( - DESCRIPTOR=_ROLLBACKREQUEST, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The request for + { + "DESCRIPTOR": _ROLLBACKREQUEST, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The request for [Firestore.Rollback][google.firestore.v1beta1.Firestore.Rollback]. - Attributes: database: Required. The database name. In the format: @@ -3198,20 +3339,19 @@ Required. The transaction to roll back. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.RollbackRequest) - ), + }, ) _sym_db.RegisterMessage(RollbackRequest) RunQueryRequest = _reflection.GeneratedProtocolMessageType( "RunQueryRequest", (_message.Message,), - dict( - DESCRIPTOR=_RUNQUERYREQUEST, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The request for + { + "DESCRIPTOR": _RUNQUERYREQUEST, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The request for [Firestore.RunQuery][google.firestore.v1beta1.Firestore.RunQuery]. - Attributes: parent: Required. The parent resource name. In the format: @@ -3239,27 +3379,26 @@ be older than 60 seconds. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.RunQueryRequest) - ), + }, ) _sym_db.RegisterMessage(RunQueryRequest) RunQueryResponse = _reflection.GeneratedProtocolMessageType( "RunQueryResponse", (_message.Message,), - dict( - DESCRIPTOR=_RUNQUERYRESPONSE, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The response for + { + "DESCRIPTOR": _RUNQUERYRESPONSE, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The response for [Firestore.RunQuery][google.firestore.v1beta1.Firestore.RunQuery]. - Attributes: transaction: The transaction that was started as part of this request. Can only be set in the first response, and only if [RunQueryReques - t.new\_transaction][google.firestore.v1beta1.RunQueryRequest.n - ew\_transaction] was set in the request. If set, no other - fields will be set in this response. + t.new_transaction][google.firestore.v1beta1.RunQueryRequest.ne + w_transaction] was set in the request. If set, no other fields + will be set in this response. document: A query result. Not set when reporting partial progress. read_time: @@ -3275,38 +3414,33 @@ between the last response and the current response. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.RunQueryResponse) - ), + }, ) _sym_db.RegisterMessage(RunQueryResponse) WriteRequest = _reflection.GeneratedProtocolMessageType( "WriteRequest", (_message.Message,), - dict( - LabelsEntry=_reflection.GeneratedProtocolMessageType( + { + "LabelsEntry": _reflection.GeneratedProtocolMessageType( "LabelsEntry", (_message.Message,), - dict( - DESCRIPTOR=_WRITEREQUEST_LABELSENTRY, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2" + { + "DESCRIPTOR": _WRITEREQUEST_LABELSENTRY, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2" # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.WriteRequest.LabelsEntry) - ), - ), - DESCRIPTOR=_WRITEREQUEST, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The request for - [Firestore.Write][google.firestore.v1beta1.Firestore.Write]. - - The first request creates a stream, or resumes an existing one from a - token. - - When creating a new stream, the server replies with a response - containing only an ID and a token, to use in the next request. - - When resuming a stream, the server first streams any responses later - than the given token, then a response containing only an up-to-date - token, to use in the next request. - + }, + ), + "DESCRIPTOR": _WRITEREQUEST, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The request for + [Firestore.Write][google.firestore.v1beta1.Firestore.Write]. The + first request creates a stream, or resumes an existing one from a + token. When creating a new stream, the server replies with a response + containing only an ID and a token, to use in the next request. When + resuming a stream, the server first streams any responses later than + the given token, then a response containing only an up-to-date token, + to use in the next request. Attributes: database: @@ -3338,7 +3472,7 @@ Labels associated with this write request. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.WriteRequest) - ), + }, ) _sym_db.RegisterMessage(WriteRequest) _sym_db.RegisterMessage(WriteRequest.LabelsEntry) @@ -3346,13 +3480,12 @@ WriteResponse = _reflection.GeneratedProtocolMessageType( "WriteResponse", (_message.Message,), - dict( - DESCRIPTOR=_WRITERESPONSE, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The response for + { + "DESCRIPTOR": _WRITERESPONSE, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The response for [Firestore.Write][google.firestore.v1beta1.Firestore.Write]. - Attributes: stream_id: The ID of the stream. Only set on the first message, when a @@ -3368,29 +3501,28 @@ The time at which the commit occurred. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.WriteResponse) - ), + }, ) _sym_db.RegisterMessage(WriteResponse) ListenRequest = _reflection.GeneratedProtocolMessageType( "ListenRequest", (_message.Message,), - dict( - LabelsEntry=_reflection.GeneratedProtocolMessageType( + { + "LabelsEntry": _reflection.GeneratedProtocolMessageType( "LabelsEntry", (_message.Message,), - dict( - DESCRIPTOR=_LISTENREQUEST_LABELSENTRY, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2" + { + "DESCRIPTOR": _LISTENREQUEST_LABELSENTRY, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2" # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.ListenRequest.LabelsEntry) - ), + }, ), - DESCRIPTOR=_LISTENREQUEST, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""A request for + "DESCRIPTOR": _LISTENREQUEST, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """A request for [Firestore.Listen][google.firestore.v1beta1.Firestore.Listen] - Attributes: database: Required. The database name. In the format: @@ -3405,7 +3537,7 @@ Labels associated with this target change. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.ListenRequest) - ), + }, ) _sym_db.RegisterMessage(ListenRequest) _sym_db.RegisterMessage(ListenRequest.LabelsEntry) @@ -3413,13 +3545,12 @@ ListenResponse = _reflection.GeneratedProtocolMessageType( "ListenResponse", (_message.Message,), - dict( - DESCRIPTOR=_LISTENRESPONSE, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The response for + { + "DESCRIPTOR": _LISTENRESPONSE, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The response for [Firestore.Listen][google.firestore.v1beta1.Firestore.Listen]. - Attributes: response_type: The supported responses. @@ -3441,22 +3572,21 @@ unknown. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.ListenResponse) - ), + }, ) _sym_db.RegisterMessage(ListenResponse) Target = _reflection.GeneratedProtocolMessageType( "Target", (_message.Message,), - dict( - DocumentsTarget=_reflection.GeneratedProtocolMessageType( + { + "DocumentsTarget": _reflection.GeneratedProtocolMessageType( "DocumentsTarget", (_message.Message,), - dict( - DESCRIPTOR=_TARGET_DOCUMENTSTARGET, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""A target specified by a set of documents names. - + { + "DESCRIPTOR": _TARGET_DOCUMENTSTARGET, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """A target specified by a set of documents names. Attributes: documents: @@ -3467,16 +3597,15 @@ be elided. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.Target.DocumentsTarget) - ), + }, ), - QueryTarget=_reflection.GeneratedProtocolMessageType( + "QueryTarget": _reflection.GeneratedProtocolMessageType( "QueryTarget", (_message.Message,), - dict( - DESCRIPTOR=_TARGET_QUERYTARGET, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""A target specified by a query. - + { + "DESCRIPTOR": _TARGET_QUERYTARGET, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """A target specified by a query. Attributes: parent: @@ -3493,12 +3622,11 @@ A structured query. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.Target.QueryTarget) - ), + }, ), - DESCRIPTOR=_TARGET, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""A specification of a set of documents to listen to. - + "DESCRIPTOR": _TARGET, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """A specification of a set of documents to listen to. Attributes: target_type: @@ -3526,7 +3654,7 @@ consistent. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.Target) - ), + }, ) _sym_db.RegisterMessage(Target) _sym_db.RegisterMessage(Target.DocumentsTarget) @@ -3535,11 +3663,10 @@ TargetChange = _reflection.GeneratedProtocolMessageType( "TargetChange", (_message.Message,), - dict( - DESCRIPTOR=_TARGETCHANGE, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""Targets being watched have changed. - + { + "DESCRIPTOR": _TARGETCHANGE, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """Targets being watched have changed. Attributes: target_change_type: @@ -3556,29 +3683,28 @@ Not set on every target change. read_time: The consistent ``read_time`` for the given ``target_ids`` - (omitted when the target\_ids are not at a consistent + (omitted when the target_ids are not at a consistent snapshot). The stream is guaranteed to send a ``read_time`` with ``target_ids`` empty whenever the entire stream reaches a new consistent snapshot. ADD, CURRENT, and RESET messages are guaranteed to (eventually) result in a new consistent snapshot - (while NO\_CHANGE and REMOVE messages are not). For a given + (while NO_CHANGE and REMOVE messages are not). For a given stream, ``read_time`` is guaranteed to be monotonically increasing. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.TargetChange) - ), + }, ) _sym_db.RegisterMessage(TargetChange) ListCollectionIdsRequest = _reflection.GeneratedProtocolMessageType( "ListCollectionIdsRequest", (_message.Message,), - dict( - DESCRIPTOR=_LISTCOLLECTIONIDSREQUEST, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The request for - [Firestore.ListCollectionIds][google.firestore.v1beta1.Firestore.ListCollectionIds]. - + { + "DESCRIPTOR": _LISTCOLLECTIONIDSREQUEST, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The request for [Firestore.ListCollectionIds][google.firestore.v1beta1 + .Firestore.ListCollectionIds]. Attributes: parent: @@ -3593,19 +3719,18 @@ [google.firestore.v1beta1.ListCollectionIdsResponse]. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.ListCollectionIdsRequest) - ), + }, ) _sym_db.RegisterMessage(ListCollectionIdsRequest) ListCollectionIdsResponse = _reflection.GeneratedProtocolMessageType( "ListCollectionIdsResponse", (_message.Message,), - dict( - DESCRIPTOR=_LISTCOLLECTIONIDSRESPONSE, - __module__="google.cloud.firestore_v1beta1.proto.firestore_pb2", - __doc__="""The response from - [Firestore.ListCollectionIds][google.firestore.v1beta1.Firestore.ListCollectionIds]. - + { + "DESCRIPTOR": _LISTCOLLECTIONIDSRESPONSE, + "__module__": "google.cloud.firestore_v1beta1.proto.firestore_pb2", + "__doc__": """The response from [Firestore.ListCollectionIds][google.firestore.v1bet + a1.Firestore.ListCollectionIds]. Attributes: collection_ids: @@ -3614,7 +3739,7 @@ A page token that may be used to continue the list. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.ListCollectionIdsResponse) - ), + }, ) _sym_db.RegisterMessage(ListCollectionIdsResponse) @@ -3645,9 +3770,8 @@ full_name="google.firestore.v1beta1.Firestore", file=DESCRIPTOR, index=0, - serialized_options=_b( - "\312A\030firestore.googleapis.com\322AXhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastore" - ), + serialized_options=b"\312A\030firestore.googleapis.com\322AXhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastore", + create_key=_descriptor._internal_create_key, serialized_start=4999, serialized_end=7714, methods=[ @@ -3658,9 +3782,8 @@ containing_service=None, input_type=_GETDOCUMENTREQUEST, output_type=google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_document__pb2._DOCUMENT, - serialized_options=_b( - "\202\323\344\223\0027\0225/v1beta1/{name=projects/*/databases/*/documents/*/**}" - ), + serialized_options=b"\202\323\344\223\0027\0225/v1beta1/{name=projects/*/databases/*/documents/*/**}", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="ListDocuments", @@ -3669,9 +3792,8 @@ containing_service=None, input_type=_LISTDOCUMENTSREQUEST, output_type=_LISTDOCUMENTSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002I\022G/v1beta1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}" - ), + serialized_options=b"\202\323\344\223\002I\022G/v1beta1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="CreateDocument", @@ -3680,9 +3802,8 @@ containing_service=None, input_type=_CREATEDOCUMENTREQUEST, output_type=google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_document__pb2._DOCUMENT, - serialized_options=_b( - '\202\323\344\223\002Q"E/v1beta1/{parent=projects/*/databases/*/documents/**}/{collection_id}:\010document' - ), + serialized_options=b'\202\323\344\223\002Q"E/v1beta1/{parent=projects/*/databases/*/documents/**}/{collection_id}:\010document', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="UpdateDocument", @@ -3691,9 +3812,8 @@ containing_service=None, input_type=_UPDATEDOCUMENTREQUEST, output_type=google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_document__pb2._DOCUMENT, - serialized_options=_b( - "\202\323\344\223\002J2>/v1beta1/{document.name=projects/*/databases/*/documents/*/**}:\010document\332A\024document,update_mask" - ), + serialized_options=b"\202\323\344\223\002J2>/v1beta1/{document.name=projects/*/databases/*/documents/*/**}:\010document\332A\024document,update_mask", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="DeleteDocument", @@ -3702,9 +3822,8 @@ containing_service=None, input_type=_DELETEDOCUMENTREQUEST, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\0027*5/v1beta1/{name=projects/*/databases/*/documents/*/**}\332A\004name" - ), + serialized_options=b"\202\323\344\223\0027*5/v1beta1/{name=projects/*/databases/*/documents/*/**}\332A\004name", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="BatchGetDocuments", @@ -3713,9 +3832,8 @@ containing_service=None, input_type=_BATCHGETDOCUMENTSREQUEST, output_type=_BATCHGETDOCUMENTSRESPONSE, - serialized_options=_b( - '\202\323\344\223\002B"=/v1beta1/{database=projects/*/databases/*}/documents:batchGet:\001*' - ), + serialized_options=b'\202\323\344\223\002B"=/v1beta1/{database=projects/*/databases/*}/documents:batchGet:\001*', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="BeginTransaction", @@ -3724,9 +3842,8 @@ containing_service=None, input_type=_BEGINTRANSACTIONREQUEST, output_type=_BEGINTRANSACTIONRESPONSE, - serialized_options=_b( - '\202\323\344\223\002J"E/v1beta1/{database=projects/*/databases/*}/documents:beginTransaction:\001*\332A\010database' - ), + serialized_options=b'\202\323\344\223\002J"E/v1beta1/{database=projects/*/databases/*}/documents:beginTransaction:\001*\332A\010database', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="Commit", @@ -3735,9 +3852,8 @@ containing_service=None, input_type=_COMMITREQUEST, output_type=_COMMITRESPONSE, - serialized_options=_b( - '\202\323\344\223\002@";/v1beta1/{database=projects/*/databases/*}/documents:commit:\001*\332A\017database,writes' - ), + serialized_options=b'\202\323\344\223\002@";/v1beta1/{database=projects/*/databases/*}/documents:commit:\001*\332A\017database,writes', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="Rollback", @@ -3746,9 +3862,8 @@ containing_service=None, input_type=_ROLLBACKREQUEST, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - '\202\323\344\223\002B"=/v1beta1/{database=projects/*/databases/*}/documents:rollback:\001*\332A\024database,transaction' - ), + serialized_options=b'\202\323\344\223\002B"=/v1beta1/{database=projects/*/databases/*}/documents:rollback:\001*\332A\024database,transaction', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="RunQuery", @@ -3757,9 +3872,8 @@ containing_service=None, input_type=_RUNQUERYREQUEST, output_type=_RUNQUERYRESPONSE, - serialized_options=_b( - '\202\323\344\223\002\207\001";/v1beta1/{parent=projects/*/databases/*/documents}:runQuery:\001*ZE"@/v1beta1/{parent=projects/*/databases/*/documents/*/**}:runQuery:\001*' - ), + serialized_options=b'\202\323\344\223\002\207\001";/v1beta1/{parent=projects/*/databases/*/documents}:runQuery:\001*ZE"@/v1beta1/{parent=projects/*/databases/*/documents/*/**}:runQuery:\001*', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="Write", @@ -3768,9 +3882,8 @@ containing_service=None, input_type=_WRITEREQUEST, output_type=_WRITERESPONSE, - serialized_options=_b( - '\202\323\344\223\002?":/v1beta1/{database=projects/*/databases/*}/documents:write:\001*' - ), + serialized_options=b'\202\323\344\223\002?":/v1beta1/{database=projects/*/databases/*}/documents:write:\001*', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="Listen", @@ -3779,9 +3892,8 @@ containing_service=None, input_type=_LISTENREQUEST, output_type=_LISTENRESPONSE, - serialized_options=_b( - '\202\323\344\223\002@";/v1beta1/{database=projects/*/databases/*}/documents:listen:\001*' - ), + serialized_options=b'\202\323\344\223\002@";/v1beta1/{database=projects/*/databases/*}/documents:listen:\001*', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="ListCollectionIds", @@ -3790,9 +3902,8 @@ containing_service=None, input_type=_LISTCOLLECTIONIDSREQUEST, output_type=_LISTCOLLECTIONIDSRESPONSE, - serialized_options=_b( - '\202\323\344\223\002\231\001"D/v1beta1/{parent=projects/*/databases/*/documents}:listCollectionIds:\001*ZN"I/v1beta1/{parent=projects/*/databases/*/documents/*/**}:listCollectionIds:\001*\332A\006parent' - ), + serialized_options=b'\202\323\344\223\002\231\001"D/v1beta1/{parent=projects/*/databases/*/documents}:listCollectionIds:\001*ZN"I/v1beta1/{parent=projects/*/databases/*/documents/*/**}:listCollectionIds:\001*\332A\006parent', + create_key=_descriptor._internal_create_key, ), ], ) diff --git a/google/cloud/firestore_v1beta1/proto/firestore_pb2_grpc.py b/google/cloud/firestore_v1beta1/proto/firestore_pb2_grpc.py index cf23b20c3..88d0a3cf3 100644 --- a/google/cloud/firestore_v1beta1/proto/firestore_pb2_grpc.py +++ b/google/cloud/firestore_v1beta1/proto/firestore_pb2_grpc.py @@ -1,4 +1,5 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc from google.cloud.firestore_v1beta1.proto import ( @@ -13,30 +14,30 @@ class FirestoreStub(object): """Specification of the Firestore API. - The Cloud Firestore service. + The Cloud Firestore service. - This service exposes several types of comparable timestamps: + This service exposes several types of comparable timestamps: - * `create_time` - The time at which a document was created. Changes only - when a document is deleted, then re-created. Increases in a strict - monotonic fashion. - * `update_time` - The time at which a document was last updated. Changes - every time a document is modified. Does not change when a write results - in no modifications. Increases in a strict monotonic fashion. - * `read_time` - The time at which a particular state was observed. Used - to denote a consistent snapshot of the database or the time at which a - Document was observed to not exist. - * `commit_time` - The time at which the writes in a transaction were - committed. Any read with an equal or greater `read_time` is guaranteed - to see the effects of the transaction. - """ + * `create_time` - The time at which a document was created. Changes only + when a document is deleted, then re-created. Increases in a strict + monotonic fashion. + * `update_time` - The time at which a document was last updated. Changes + every time a document is modified. Does not change when a write results + in no modifications. Increases in a strict monotonic fashion. + * `read_time` - The time at which a particular state was observed. Used + to denote a consistent snapshot of the database or the time at which a + Document was observed to not exist. + * `commit_time` - The time at which the writes in a transaction were + committed. Any read with an equal or greater `read_time` is guaranteed + to see the effects of the transaction. + """ def __init__(self, channel): """Constructor. - Args: - channel: A grpc.Channel. - """ + Args: + channel: A grpc.Channel. + """ self.GetDocument = channel.unary_unary( "/google.firestore.v1beta1.Firestore/GetDocument", request_serializer=google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.GetDocumentRequest.SerializeToString, @@ -107,55 +108,55 @@ def __init__(self, channel): class FirestoreServicer(object): """Specification of the Firestore API. - The Cloud Firestore service. + The Cloud Firestore service. - This service exposes several types of comparable timestamps: + This service exposes several types of comparable timestamps: - * `create_time` - The time at which a document was created. Changes only - when a document is deleted, then re-created. Increases in a strict - monotonic fashion. - * `update_time` - The time at which a document was last updated. Changes - every time a document is modified. Does not change when a write results - in no modifications. Increases in a strict monotonic fashion. - * `read_time` - The time at which a particular state was observed. Used - to denote a consistent snapshot of the database or the time at which a - Document was observed to not exist. - * `commit_time` - The time at which the writes in a transaction were - committed. Any read with an equal or greater `read_time` is guaranteed - to see the effects of the transaction. - """ + * `create_time` - The time at which a document was created. Changes only + when a document is deleted, then re-created. Increases in a strict + monotonic fashion. + * `update_time` - The time at which a document was last updated. Changes + every time a document is modified. Does not change when a write results + in no modifications. Increases in a strict monotonic fashion. + * `read_time` - The time at which a particular state was observed. Used + to denote a consistent snapshot of the database or the time at which a + Document was observed to not exist. + * `commit_time` - The time at which the writes in a transaction were + committed. Any read with an equal or greater `read_time` is guaranteed + to see the effects of the transaction. + """ def GetDocument(self, request, context): """Gets a single document. - """ + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def ListDocuments(self, request, context): """Lists documents. - """ + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def CreateDocument(self, request, context): """Creates a new document. - """ + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def UpdateDocument(self, request, context): """Updates or inserts a document. - """ + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def DeleteDocument(self, request, context): """Deletes a document. - """ + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -163,58 +164,58 @@ def DeleteDocument(self, request, context): def BatchGetDocuments(self, request, context): """Gets multiple documents. - Documents returned by this method are not guaranteed to be returned in the - same order that they were requested. - """ + Documents returned by this method are not guaranteed to be returned in the + same order that they were requested. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def BeginTransaction(self, request, context): """Starts a new transaction. - """ + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def Commit(self, request, context): """Commits a transaction, while optionally updating documents. - """ + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def Rollback(self, request, context): """Rolls back a transaction. - """ + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def RunQuery(self, request, context): """Runs a query. - """ + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def Write(self, request_iterator, context): """Streams batches of document updates and deletes, in order. - """ + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def Listen(self, request_iterator, context): """Listens to changes. - """ + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def ListCollectionIds(self, request, context): """Lists all the collection IDs underneath a document. - """ + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -292,3 +293,377 @@ def add_FirestoreServicer_to_server(servicer, server): "google.firestore.v1beta1.Firestore", rpc_method_handlers ) server.add_generic_rpc_handlers((generic_handler,)) + + +# This class is part of an EXPERIMENTAL API. +class Firestore(object): + """Specification of the Firestore API. + + The Cloud Firestore service. + + This service exposes several types of comparable timestamps: + + * `create_time` - The time at which a document was created. Changes only + when a document is deleted, then re-created. Increases in a strict + monotonic fashion. + * `update_time` - The time at which a document was last updated. Changes + every time a document is modified. Does not change when a write results + in no modifications. Increases in a strict monotonic fashion. + * `read_time` - The time at which a particular state was observed. Used + to denote a consistent snapshot of the database or the time at which a + Document was observed to not exist. + * `commit_time` - The time at which the writes in a transaction were + committed. Any read with an equal or greater `read_time` is guaranteed + to see the effects of the transaction. + """ + + @staticmethod + def GetDocument( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.v1beta1.Firestore/GetDocument", + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.GetDocumentRequest.SerializeToString, + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_document__pb2.Document.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def ListDocuments( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.v1beta1.Firestore/ListDocuments", + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.ListDocumentsRequest.SerializeToString, + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.ListDocumentsResponse.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def CreateDocument( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.v1beta1.Firestore/CreateDocument", + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.CreateDocumentRequest.SerializeToString, + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_document__pb2.Document.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def UpdateDocument( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.v1beta1.Firestore/UpdateDocument", + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.UpdateDocumentRequest.SerializeToString, + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_document__pb2.Document.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def DeleteDocument( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.v1beta1.Firestore/DeleteDocument", + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.DeleteDocumentRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def BatchGetDocuments( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_stream( + request, + target, + "/google.firestore.v1beta1.Firestore/BatchGetDocuments", + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.BatchGetDocumentsRequest.SerializeToString, + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.BatchGetDocumentsResponse.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def BeginTransaction( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.v1beta1.Firestore/BeginTransaction", + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.BeginTransactionRequest.SerializeToString, + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.BeginTransactionResponse.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def Commit( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.v1beta1.Firestore/Commit", + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.CommitRequest.SerializeToString, + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.CommitResponse.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def Rollback( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.v1beta1.Firestore/Rollback", + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.RollbackRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def RunQuery( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_stream( + request, + target, + "/google.firestore.v1beta1.Firestore/RunQuery", + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.RunQueryRequest.SerializeToString, + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.RunQueryResponse.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def Write( + request_iterator, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.stream_stream( + request_iterator, + target, + "/google.firestore.v1beta1.Firestore/Write", + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.WriteRequest.SerializeToString, + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.WriteResponse.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def Listen( + request_iterator, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.stream_stream( + request_iterator, + target, + "/google.firestore.v1beta1.Firestore/Listen", + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.ListenRequest.SerializeToString, + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.ListenResponse.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def ListCollectionIds( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/google.firestore.v1beta1.Firestore/ListCollectionIds", + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.ListCollectionIdsRequest.SerializeToString, + google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_firestore__pb2.ListCollectionIdsResponse.FromString, + options, + channel_credentials, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) diff --git a/google/cloud/firestore_v1beta1/proto/query.proto b/google/cloud/firestore_v1beta1/proto/query.proto index 4f515fabe..5f9c3ab93 100644 --- a/google/cloud/firestore_v1beta1/proto/query.proto +++ b/google/cloud/firestore_v1beta1/proto/query.proto @@ -28,6 +28,7 @@ option java_outer_classname = "QueryProto"; option java_package = "com.google.firestore.v1beta1"; option objc_class_prefix = "GCFS"; option php_namespace = "Google\\Cloud\\Firestore\\V1beta1"; +option ruby_package = "Google::Cloud::Firestore::V1beta1"; // A Firestore query. message StructuredQuery { diff --git a/google/cloud/firestore_v1beta1/proto/query_pb2.py b/google/cloud/firestore_v1beta1/proto/query_pb2.py index 154aab0d2..67f1a7283 100644 --- a/google/cloud/firestore_v1beta1/proto/query_pb2.py +++ b/google/cloud/firestore_v1beta1/proto/query_pb2.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/firestore_v1beta1/proto/query.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -26,12 +23,9 @@ name="google/cloud/firestore_v1beta1/proto/query.proto", package="google.firestore.v1beta1", syntax="proto3", - serialized_options=_b( - "\n\034com.google.firestore.v1beta1B\nQueryProtoP\001ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\242\002\004GCFS\252\002\036Google.Cloud.Firestore.V1Beta1\312\002\036Google\\Cloud\\Firestore\\V1beta1" - ), - serialized_pb=_b( - '\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\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' - ), + serialized_options=b"\n\034com.google.firestore.v1beta1B\nQueryProtoP\001ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\242\002\004GCFS\252\002\036Google.Cloud.Firestore.V1Beta1\312\002\036Google\\Cloud\\Firestore\\V1beta1\352\002!Google::Cloud::Firestore::V1beta1", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\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\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\xdc\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\\V1beta1\xea\x02!Google::Cloud::Firestore::V1beta1b\x06proto3', dependencies=[ google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_document__pb2.DESCRIPTOR, google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR, @@ -45,6 +39,7 @@ full_name="google.firestore.v1beta1.StructuredQuery.CompositeFilter.Operator", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="OPERATOR_UNSPECIFIED", @@ -52,9 +47,15 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="AND", index=1, number=1, serialized_options=None, type=None + name="AND", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -69,6 +70,7 @@ full_name="google.firestore.v1beta1.StructuredQuery.FieldFilter.Operator", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="OPERATOR_UNSPECIFIED", @@ -76,9 +78,15 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="LESS_THAN", index=1, number=1, serialized_options=None, type=None + name="LESS_THAN", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( name="LESS_THAN_OR_EQUAL", @@ -86,9 +94,15 @@ number=2, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="GREATER_THAN", index=3, number=3, serialized_options=None, type=None + name="GREATER_THAN", + index=3, + number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( name="GREATER_THAN_OR_EQUAL", @@ -96,15 +110,31 @@ number=4, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="EQUAL", index=5, number=5, serialized_options=None, type=None + name="EQUAL", + index=5, + number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="ARRAY_CONTAINS", index=6, number=7, serialized_options=None, type=None + name="ARRAY_CONTAINS", + index=6, + number=7, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="IN", index=7, number=8, serialized_options=None, type=None + name="IN", + index=7, + number=8, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( name="ARRAY_CONTAINS_ANY", @@ -112,6 +142,7 @@ number=9, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -126,6 +157,7 @@ full_name="google.firestore.v1beta1.StructuredQuery.UnaryFilter.Operator", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="OPERATOR_UNSPECIFIED", @@ -133,12 +165,23 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="IS_NAN", index=1, number=2, serialized_options=None, type=None + name="IS_NAN", + index=1, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="IS_NULL", index=2, number=3, serialized_options=None, type=None + name="IS_NULL", + index=2, + number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -153,6 +196,7 @@ full_name="google.firestore.v1beta1.StructuredQuery.Direction", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="DIRECTION_UNSPECIFIED", @@ -160,12 +204,23 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="ASCENDING", index=1, number=1, serialized_options=None, type=None + name="ASCENDING", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="DESCENDING", index=2, number=2, serialized_options=None, type=None + name="DESCENDING", + index=2, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -182,6 +237,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="collection_id", @@ -192,7 +248,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -200,6 +256,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="all_descendants", @@ -218,6 +275,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -238,6 +296,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="composite_filter", @@ -256,6 +315,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="field_filter", @@ -274,6 +334,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="unary_filter", @@ -292,6 +353,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -307,8 +369,9 @@ full_name="google.firestore.v1beta1.StructuredQuery.Filter.filter_type", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=724, serialized_end=992, @@ -320,6 +383,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="op", @@ -338,6 +402,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="filters", @@ -356,11 +421,12 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], nested_types=[], - enum_types=[_STRUCTUREDQUERY_COMPOSITEFILTER_OPERATOR], + enum_types=[_STRUCTUREDQUERY_COMPOSITEFILTER_OPERATOR,], serialized_options=None, is_extendable=False, syntax="proto3", @@ -376,6 +442,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="field", @@ -394,6 +461,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="op", @@ -412,6 +480,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="value", @@ -430,11 +499,12 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], nested_types=[], - enum_types=[_STRUCTUREDQUERY_FIELDFILTER_OPERATOR], + enum_types=[_STRUCTUREDQUERY_FIELDFILTER_OPERATOR,], serialized_options=None, is_extendable=False, syntax="proto3", @@ -450,6 +520,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="op", @@ -468,6 +539,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="field", @@ -486,11 +558,12 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], nested_types=[], - enum_types=[_STRUCTUREDQUERY_UNARYFILTER_OPERATOR], + enum_types=[_STRUCTUREDQUERY_UNARYFILTER_OPERATOR,], serialized_options=None, is_extendable=False, syntax="proto3", @@ -501,8 +574,9 @@ full_name="google.firestore.v1beta1.StructuredQuery.UnaryFilter.operand_type", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=1608, serialized_end=1851, @@ -514,6 +588,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="field", @@ -532,6 +607,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="direction", @@ -550,6 +626,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -570,6 +647,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="field_path", @@ -580,7 +658,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -588,7 +666,8 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -608,6 +687,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="fields", @@ -626,7 +706,8 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -646,6 +727,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="select", @@ -664,6 +746,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="from", @@ -682,6 +765,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="where", @@ -700,6 +784,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="order_by", @@ -718,6 +803,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="start_at", @@ -736,6 +822,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="end_at", @@ -754,6 +841,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="offset", @@ -772,6 +860,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="limit", @@ -790,6 +879,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -803,7 +893,7 @@ _STRUCTUREDQUERY_FIELDREFERENCE, _STRUCTUREDQUERY_PROJECTION, ], - enum_types=[_STRUCTUREDQUERY_DIRECTION], + enum_types=[_STRUCTUREDQUERY_DIRECTION,], serialized_options=None, is_extendable=False, syntax="proto3", @@ -820,6 +910,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="values", @@ -838,6 +929,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="before", @@ -856,6 +948,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -972,15 +1065,14 @@ StructuredQuery = _reflection.GeneratedProtocolMessageType( "StructuredQuery", (_message.Message,), - dict( - CollectionSelector=_reflection.GeneratedProtocolMessageType( + { + "CollectionSelector": _reflection.GeneratedProtocolMessageType( "CollectionSelector", (_message.Message,), - dict( - DESCRIPTOR=_STRUCTUREDQUERY_COLLECTIONSELECTOR, - __module__="google.cloud.firestore_v1beta1.proto.query_pb2", - __doc__="""A selection of a collection, such as ``messages as m1``. - + { + "DESCRIPTOR": _STRUCTUREDQUERY_COLLECTIONSELECTOR, + "__module__": "google.cloud.firestore_v1beta1.proto.query_pb2", + "__doc__": """A selection of a collection, such as ``messages as m1``. Attributes: collection_id: @@ -993,16 +1085,15 @@ collections. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.StructuredQuery.CollectionSelector) - ), + }, ), - Filter=_reflection.GeneratedProtocolMessageType( + "Filter": _reflection.GeneratedProtocolMessageType( "Filter", (_message.Message,), - dict( - DESCRIPTOR=_STRUCTUREDQUERY_FILTER, - __module__="google.cloud.firestore_v1beta1.proto.query_pb2", - __doc__="""A filter. - + { + "DESCRIPTOR": _STRUCTUREDQUERY_FILTER, + "__module__": "google.cloud.firestore_v1beta1.proto.query_pb2", + "__doc__": """A filter. Attributes: filter_type: @@ -1015,17 +1106,15 @@ A filter that takes exactly one argument. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.StructuredQuery.Filter) - ), + }, ), - CompositeFilter=_reflection.GeneratedProtocolMessageType( + "CompositeFilter": _reflection.GeneratedProtocolMessageType( "CompositeFilter", (_message.Message,), - dict( - DESCRIPTOR=_STRUCTUREDQUERY_COMPOSITEFILTER, - __module__="google.cloud.firestore_v1beta1.proto.query_pb2", - __doc__="""A filter that merges multiple other filters using the - given operator. - + { + "DESCRIPTOR": _STRUCTUREDQUERY_COMPOSITEFILTER, + "__module__": "google.cloud.firestore_v1beta1.proto.query_pb2", + "__doc__": """A filter that merges multiple other filters using the given operator. Attributes: op: @@ -1035,16 +1124,15 @@ filter. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.StructuredQuery.CompositeFilter) - ), + }, ), - FieldFilter=_reflection.GeneratedProtocolMessageType( + "FieldFilter": _reflection.GeneratedProtocolMessageType( "FieldFilter", (_message.Message,), - dict( - DESCRIPTOR=_STRUCTUREDQUERY_FIELDFILTER, - __module__="google.cloud.firestore_v1beta1.proto.query_pb2", - __doc__="""A filter on a specific field. - + { + "DESCRIPTOR": _STRUCTUREDQUERY_FIELDFILTER, + "__module__": "google.cloud.firestore_v1beta1.proto.query_pb2", + "__doc__": """A filter on a specific field. Attributes: field: @@ -1055,16 +1143,15 @@ The value to compare to. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.StructuredQuery.FieldFilter) - ), + }, ), - UnaryFilter=_reflection.GeneratedProtocolMessageType( + "UnaryFilter": _reflection.GeneratedProtocolMessageType( "UnaryFilter", (_message.Message,), - dict( - DESCRIPTOR=_STRUCTUREDQUERY_UNARYFILTER, - __module__="google.cloud.firestore_v1beta1.proto.query_pb2", - __doc__="""A filter with a single operand. - + { + "DESCRIPTOR": _STRUCTUREDQUERY_UNARYFILTER, + "__module__": "google.cloud.firestore_v1beta1.proto.query_pb2", + "__doc__": """A filter with a single operand. Attributes: op: @@ -1075,16 +1162,15 @@ The field to which to apply the operator. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.StructuredQuery.UnaryFilter) - ), + }, ), - Order=_reflection.GeneratedProtocolMessageType( + "Order": _reflection.GeneratedProtocolMessageType( "Order", (_message.Message,), - dict( - DESCRIPTOR=_STRUCTUREDQUERY_ORDER, - __module__="google.cloud.firestore_v1beta1.proto.query_pb2", - __doc__="""An order on a field. - + { + "DESCRIPTOR": _STRUCTUREDQUERY_ORDER, + "__module__": "google.cloud.firestore_v1beta1.proto.query_pb2", + "__doc__": """An order on a field. Attributes: field: @@ -1093,29 +1179,25 @@ The direction to order by. Defaults to ``ASCENDING``. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.StructuredQuery.Order) - ), + }, ), - FieldReference=_reflection.GeneratedProtocolMessageType( + "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``. - - """, + { + "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": _reflection.GeneratedProtocolMessageType( "Projection", (_message.Message,), - dict( - DESCRIPTOR=_STRUCTUREDQUERY_PROJECTION, - __module__="google.cloud.firestore_v1beta1.proto.query_pb2", - __doc__="""The projection of document's fields to return. - + { + "DESCRIPTOR": _STRUCTUREDQUERY_PROJECTION, + "__module__": "google.cloud.firestore_v1beta1.proto.query_pb2", + "__doc__": """The projection of document’s fields to return. Attributes: fields: @@ -1123,12 +1205,11 @@ only return the name of the document, use ``['__name__']``. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.StructuredQuery.Projection) - ), + }, ), - DESCRIPTOR=_STRUCTUREDQUERY, - __module__="google.cloud.firestore_v1beta1.proto.query_pb2", - __doc__="""A Firestore query. - + "DESCRIPTOR": _STRUCTUREDQUERY, + "__module__": "google.cloud.firestore_v1beta1.proto.query_pb2", + "__doc__": """A Firestore query. Attributes: select: @@ -1145,7 +1226,7 @@ name order by default. - If an order on ``__name__`` is not specified, it is appended by default. Fields are appended with the same sort direction as the last order - specified, or 'ASCENDING' if no order was specified. For + specified, or ‘ASCENDING’ if no order was specified. For example: - ``SELECT * FROM Foo ORDER BY A`` becomes ``SELECT * FROM Foo ORDER BY A, __name__`` - ``SELECT * FROM Foo ORDER BY A DESC`` becomes ``SELECT * FROM Foo ORDER BY @@ -1164,7 +1245,7 @@ other constraints. Must be >= 0 if specified. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.StructuredQuery) - ), + }, ) _sym_db.RegisterMessage(StructuredQuery) _sym_db.RegisterMessage(StructuredQuery.CollectionSelector) @@ -1179,11 +1260,10 @@ Cursor = _reflection.GeneratedProtocolMessageType( "Cursor", (_message.Message,), - dict( - DESCRIPTOR=_CURSOR, - __module__="google.cloud.firestore_v1beta1.proto.query_pb2", - __doc__="""A position in a query result set. - + { + "DESCRIPTOR": _CURSOR, + "__module__": "google.cloud.firestore_v1beta1.proto.query_pb2", + "__doc__": """A position in a query result set. Attributes: values: @@ -1195,7 +1275,7 @@ relative to the sort order defined by the query. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.Cursor) - ), + }, ) _sym_db.RegisterMessage(Cursor) diff --git a/google/cloud/firestore_v1beta1/proto/query_pb2_grpc.py b/google/cloud/firestore_v1beta1/proto/query_pb2_grpc.py index 07cb78fe0..8a9393943 100644 --- a/google/cloud/firestore_v1beta1/proto/query_pb2_grpc.py +++ b/google/cloud/firestore_v1beta1/proto/query_pb2_grpc.py @@ -1,2 +1,3 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc diff --git a/google/cloud/firestore_v1beta1/proto/write.proto b/google/cloud/firestore_v1beta1/proto/write.proto index c02a2a8a1..ba75b42a0 100644 --- a/google/cloud/firestore_v1beta1/proto/write.proto +++ b/google/cloud/firestore_v1beta1/proto/write.proto @@ -29,6 +29,7 @@ option java_outer_classname = "WriteProto"; option java_package = "com.google.firestore.v1beta1"; option objc_class_prefix = "GCFS"; option php_namespace = "Google\\Cloud\\Firestore\\V1beta1"; +option ruby_package = "Google::Cloud::Firestore::V1beta1"; // A write on a document. message Write { diff --git a/google/cloud/firestore_v1beta1/proto/write_pb2.py b/google/cloud/firestore_v1beta1/proto/write_pb2.py index f9b0aa95c..c58dd47d5 100644 --- a/google/cloud/firestore_v1beta1/proto/write_pb2.py +++ b/google/cloud/firestore_v1beta1/proto/write_pb2.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/firestore_v1beta1/proto/write.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -29,12 +26,9 @@ name="google/cloud/firestore_v1beta1/proto/write.proto", package="google.firestore.v1beta1", syntax="proto3", - serialized_options=_b( - "\n\034com.google.firestore.v1beta1B\nWriteProtoP\001ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\242\002\004GCFS\252\002\036Google.Cloud.Firestore.V1Beta1\312\002\036Google\\Cloud\\Firestore\\V1beta1" - ), - serialized_pb=_b( - '\n0google/cloud/firestore_v1beta1/proto/write.proto\x12\x18google.firestore.v1beta1\x1a\x31google/cloud/firestore_v1beta1/proto/common.proto\x1a\x33google/cloud/firestore_v1beta1/proto/document.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"\x9d\x02\n\x05Write\x12\x34\n\x06update\x18\x01 \x01(\x0b\x32".google.firestore.v1beta1.DocumentH\x00\x12\x10\n\x06\x64\x65lete\x18\x02 \x01(\tH\x00\x12@\n\ttransform\x18\x06 \x01(\x0b\x32+.google.firestore.v1beta1.DocumentTransformH\x00\x12;\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32&.google.firestore.v1beta1.DocumentMask\x12@\n\x10\x63urrent_document\x18\x04 \x01(\x0b\x32&.google.firestore.v1beta1.PreconditionB\x0b\n\toperation"\x88\x05\n\x11\x44ocumentTransform\x12\x10\n\x08\x64ocument\x18\x01 \x01(\t\x12T\n\x10\x66ield_transforms\x18\x02 \x03(\x0b\x32:.google.firestore.v1beta1.DocumentTransform.FieldTransform\x1a\x8a\x04\n\x0e\x46ieldTransform\x12\x12\n\nfield_path\x18\x01 \x01(\t\x12\x65\n\x13set_to_server_value\x18\x02 \x01(\x0e\x32\x46.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValueH\x00\x12\x34\n\tincrement\x18\x03 \x01(\x0b\x32\x1f.google.firestore.v1beta1.ValueH\x00\x12\x32\n\x07maximum\x18\x04 \x01(\x0b\x32\x1f.google.firestore.v1beta1.ValueH\x00\x12\x32\n\x07minimum\x18\x05 \x01(\x0b\x32\x1f.google.firestore.v1beta1.ValueH\x00\x12G\n\x17\x61ppend_missing_elements\x18\x06 \x01(\x0b\x32$.google.firestore.v1beta1.ArrayValueH\x00\x12\x45\n\x15remove_all_from_array\x18\x07 \x01(\x0b\x32$.google.firestore.v1beta1.ArrayValueH\x00"=\n\x0bServerValue\x12\x1c\n\x18SERVER_VALUE_UNSPECIFIED\x10\x00\x12\x10\n\x0cREQUEST_TIME\x10\x01\x42\x10\n\x0etransform_type"z\n\x0bWriteResult\x12/\n\x0bupdate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12:\n\x11transform_results\x18\x02 \x03(\x0b\x32\x1f.google.firestore.v1beta1.Value"v\n\x0e\x44ocumentChange\x12\x34\n\x08\x64ocument\x18\x01 \x01(\x0b\x32".google.firestore.v1beta1.Document\x12\x12\n\ntarget_ids\x18\x05 \x03(\x05\x12\x1a\n\x12removed_target_ids\x18\x06 \x03(\x05"m\n\x0e\x44ocumentDelete\x12\x10\n\x08\x64ocument\x18\x01 \x01(\t\x12\x1a\n\x12removed_target_ids\x18\x06 \x03(\x05\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"m\n\x0e\x44ocumentRemove\x12\x10\n\x08\x64ocument\x18\x01 \x01(\t\x12\x1a\n\x12removed_target_ids\x18\x02 \x03(\x05\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"3\n\x0f\x45xistenceFilter\x12\x11\n\ttarget_id\x18\x01 \x01(\x05\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\x42\xb8\x01\n\x1c\x63om.google.firestore.v1beta1B\nWriteProtoP\x01ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\xa2\x02\x04GCFS\xaa\x02\x1eGoogle.Cloud.Firestore.V1Beta1\xca\x02\x1eGoogle\\Cloud\\Firestore\\V1beta1b\x06proto3' - ), + serialized_options=b"\n\034com.google.firestore.v1beta1B\nWriteProtoP\001ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\242\002\004GCFS\252\002\036Google.Cloud.Firestore.V1Beta1\312\002\036Google\\Cloud\\Firestore\\V1beta1\352\002!Google::Cloud::Firestore::V1beta1", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n0google/cloud/firestore_v1beta1/proto/write.proto\x12\x18google.firestore.v1beta1\x1a\x31google/cloud/firestore_v1beta1/proto/common.proto\x1a\x33google/cloud/firestore_v1beta1/proto/document.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"\x9d\x02\n\x05Write\x12\x34\n\x06update\x18\x01 \x01(\x0b\x32".google.firestore.v1beta1.DocumentH\x00\x12\x10\n\x06\x64\x65lete\x18\x02 \x01(\tH\x00\x12@\n\ttransform\x18\x06 \x01(\x0b\x32+.google.firestore.v1beta1.DocumentTransformH\x00\x12;\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32&.google.firestore.v1beta1.DocumentMask\x12@\n\x10\x63urrent_document\x18\x04 \x01(\x0b\x32&.google.firestore.v1beta1.PreconditionB\x0b\n\toperation"\x88\x05\n\x11\x44ocumentTransform\x12\x10\n\x08\x64ocument\x18\x01 \x01(\t\x12T\n\x10\x66ield_transforms\x18\x02 \x03(\x0b\x32:.google.firestore.v1beta1.DocumentTransform.FieldTransform\x1a\x8a\x04\n\x0e\x46ieldTransform\x12\x12\n\nfield_path\x18\x01 \x01(\t\x12\x65\n\x13set_to_server_value\x18\x02 \x01(\x0e\x32\x46.google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValueH\x00\x12\x34\n\tincrement\x18\x03 \x01(\x0b\x32\x1f.google.firestore.v1beta1.ValueH\x00\x12\x32\n\x07maximum\x18\x04 \x01(\x0b\x32\x1f.google.firestore.v1beta1.ValueH\x00\x12\x32\n\x07minimum\x18\x05 \x01(\x0b\x32\x1f.google.firestore.v1beta1.ValueH\x00\x12G\n\x17\x61ppend_missing_elements\x18\x06 \x01(\x0b\x32$.google.firestore.v1beta1.ArrayValueH\x00\x12\x45\n\x15remove_all_from_array\x18\x07 \x01(\x0b\x32$.google.firestore.v1beta1.ArrayValueH\x00"=\n\x0bServerValue\x12\x1c\n\x18SERVER_VALUE_UNSPECIFIED\x10\x00\x12\x10\n\x0cREQUEST_TIME\x10\x01\x42\x10\n\x0etransform_type"z\n\x0bWriteResult\x12/\n\x0bupdate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12:\n\x11transform_results\x18\x02 \x03(\x0b\x32\x1f.google.firestore.v1beta1.Value"v\n\x0e\x44ocumentChange\x12\x34\n\x08\x64ocument\x18\x01 \x01(\x0b\x32".google.firestore.v1beta1.Document\x12\x12\n\ntarget_ids\x18\x05 \x03(\x05\x12\x1a\n\x12removed_target_ids\x18\x06 \x03(\x05"m\n\x0e\x44ocumentDelete\x12\x10\n\x08\x64ocument\x18\x01 \x01(\t\x12\x1a\n\x12removed_target_ids\x18\x06 \x03(\x05\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"m\n\x0e\x44ocumentRemove\x12\x10\n\x08\x64ocument\x18\x01 \x01(\t\x12\x1a\n\x12removed_target_ids\x18\x02 \x03(\x05\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"3\n\x0f\x45xistenceFilter\x12\x11\n\ttarget_id\x18\x01 \x01(\x05\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\x42\xdc\x01\n\x1c\x63om.google.firestore.v1beta1B\nWriteProtoP\x01ZAgoogle.golang.org/genproto/googleapis/firestore/v1beta1;firestore\xa2\x02\x04GCFS\xaa\x02\x1eGoogle.Cloud.Firestore.V1Beta1\xca\x02\x1eGoogle\\Cloud\\Firestore\\V1beta1\xea\x02!Google::Cloud::Firestore::V1beta1b\x06proto3', dependencies=[ google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_common__pb2.DESCRIPTOR, google_dot_cloud_dot_firestore__v1beta1_dot_proto_dot_document__pb2.DESCRIPTOR, @@ -49,6 +43,7 @@ full_name="google.firestore.v1beta1.DocumentTransform.FieldTransform.ServerValue", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="SERVER_VALUE_UNSPECIFIED", @@ -56,9 +51,15 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="REQUEST_TIME", index=1, number=1, serialized_options=None, type=None + name="REQUEST_TIME", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -75,6 +76,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="update", @@ -93,6 +95,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="delete", @@ -103,7 +106,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -111,6 +114,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="transform", @@ -129,6 +133,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="update_mask", @@ -147,6 +152,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="current_document", @@ -165,6 +171,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -180,8 +187,9 @@ full_name="google.firestore.v1beta1.Write.operation", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=246, serialized_end=531, @@ -194,6 +202,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="field_path", @@ -204,7 +213,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -212,6 +221,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="set_to_server_value", @@ -230,6 +240,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="increment", @@ -248,6 +259,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="maximum", @@ -266,6 +278,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="minimum", @@ -284,6 +297,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="append_missing_elements", @@ -302,6 +316,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="remove_all_from_array", @@ -320,11 +335,12 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], nested_types=[], - enum_types=[_DOCUMENTTRANSFORM_FIELDTRANSFORM_SERVERVALUE], + enum_types=[_DOCUMENTTRANSFORM_FIELDTRANSFORM_SERVERVALUE,], serialized_options=None, is_extendable=False, syntax="proto3", @@ -335,8 +351,9 @@ full_name="google.firestore.v1beta1.DocumentTransform.FieldTransform.transform_type", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=660, serialized_end=1182, @@ -348,6 +365,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="document", @@ -358,7 +376,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -366,6 +384,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="field_transforms", @@ -384,10 +403,11 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], - nested_types=[_DOCUMENTTRANSFORM_FIELDTRANSFORM], + nested_types=[_DOCUMENTTRANSFORM_FIELDTRANSFORM,], enum_types=[], serialized_options=None, is_extendable=False, @@ -405,6 +425,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="update_time", @@ -423,6 +444,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="transform_results", @@ -441,6 +463,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -462,6 +485,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="document", @@ -480,6 +504,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="target_ids", @@ -498,6 +523,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="removed_target_ids", @@ -516,6 +542,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -537,6 +564,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="document", @@ -547,7 +575,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -555,6 +583,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="removed_target_ids", @@ -573,6 +602,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="read_time", @@ -591,6 +621,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -612,6 +643,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="document", @@ -622,7 +654,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -630,6 +662,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="removed_target_ids", @@ -648,6 +681,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="read_time", @@ -666,6 +700,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -687,6 +722,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="target_id", @@ -705,6 +741,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="count", @@ -723,6 +760,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -861,11 +899,10 @@ Write = _reflection.GeneratedProtocolMessageType( "Write", (_message.Message,), - dict( - DESCRIPTOR=_WRITE, - __module__="google.cloud.firestore_v1beta1.proto.write_pb2", - __doc__="""A write on a document. - + { + "DESCRIPTOR": _WRITE, + "__module__": "google.cloud.firestore_v1beta1.proto.write_pb2", + "__doc__": """A write on a document. Attributes: operation: @@ -895,22 +932,21 @@ if this is set and not met by the target document. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.Write) - ), + }, ) _sym_db.RegisterMessage(Write) DocumentTransform = _reflection.GeneratedProtocolMessageType( "DocumentTransform", (_message.Message,), - dict( - FieldTransform=_reflection.GeneratedProtocolMessageType( + { + "FieldTransform": _reflection.GeneratedProtocolMessageType( "FieldTransform", (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENTTRANSFORM_FIELDTRANSFORM, - __module__="google.cloud.firestore_v1beta1.proto.write_pb2", - __doc__="""A transformation of a field of the document. - + { + "DESCRIPTOR": _DOCUMENTTRANSFORM_FIELDTRANSFORM, + "__module__": "google.cloud.firestore_v1beta1.proto.write_pb2", + "__doc__": """A transformation of a field of the document. Attributes: field_path: @@ -922,7 +958,7 @@ set_to_server_value: Sets the field to the given server value. increment: - Adds the given value to the field's current value. This must + Adds the given value to the field’s current value. This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the given value. If @@ -940,7 +976,7 @@ given value. If a maximum operation is applied where the field and the input value are of mixed types (that is - one is an integer and one is a double) the field takes on the type of - the larger operand. If the operands are equivalent (e.g. 3 and + the larger operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and zero input value is always the stored value. The maximum of any numeric value x @@ -953,7 +989,7 @@ input value. If a minimum operation is applied where the field and the input value are of mixed types (that is - one is an integer and one is a double) the field takes on the type of - the smaller operand. If the operands are equivalent (e.g. 3 + the smaller operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and zero input value is always the stored value. The minimum of any numeric value x @@ -962,29 +998,28 @@ Append the given elements in order if they are not already present in the current field value. If the field is not an array, or if the field does not yet exist, it is first set to - the empty array. Equivalent numbers of different types (e.g. - 3L and 3.0) are considered equal when checking if a value is - missing. NaN is equal to NaN, and Null is equal to Null. If - the input contains multiple equivalent values, only the first - will be considered. The corresponding transform\_result will - be the null value. + the empty array. Equivalent numbers of different types + (e.g. 3L and 3.0) are considered equal when checking if a + value is missing. NaN is equal to NaN, and Null is equal to + Null. If the input contains multiple equivalent values, only + the first will be considered. The corresponding + transform_result will be the null value. remove_all_from_array: Remove all of the given elements from the array in the field. If the field is not an array, or if the field does not yet exist, it is set to the empty array. Equivalent numbers of - the different types (e.g. 3L and 3.0) are considered equal + the different types (e.g. 3L and 3.0) are considered equal when deciding whether an element should be removed. NaN is equal to NaN, and Null is equal to Null. This will remove all equivalent values if there are duplicates. The corresponding - transform\_result will be the null value. + transform_result will be the null value. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.DocumentTransform.FieldTransform) - ), + }, ), - DESCRIPTOR=_DOCUMENTTRANSFORM, - __module__="google.cloud.firestore_v1beta1.proto.write_pb2", - __doc__="""A transformation of a document. - + "DESCRIPTOR": _DOCUMENTTRANSFORM, + "__module__": "google.cloud.firestore_v1beta1.proto.write_pb2", + "__doc__": """A transformation of a document. Attributes: document: @@ -994,7 +1029,7 @@ document, in order. This must not be empty. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.DocumentTransform) - ), + }, ) _sym_db.RegisterMessage(DocumentTransform) _sym_db.RegisterMessage(DocumentTransform.FieldTransform) @@ -1002,44 +1037,39 @@ WriteResult = _reflection.GeneratedProtocolMessageType( "WriteResult", (_message.Message,), - dict( - DESCRIPTOR=_WRITERESULT, - __module__="google.cloud.firestore_v1beta1.proto.write_pb2", - __doc__="""The result of applying a write. - + { + "DESCRIPTOR": _WRITERESULT, + "__module__": "google.cloud.firestore_v1beta1.proto.write_pb2", + "__doc__": """The result of applying a write. Attributes: update_time: The last update time of the document after applying the write. Not set after a ``delete``. If the write did not actually - change the document, this will be the previous update\_time. + change the document, this will be the previous update_time. transform_results: The results of applying each [DocumentTransform.FieldTransform ][google.firestore.v1beta1.DocumentTransform.FieldTransform], in the same order. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.WriteResult) - ), + }, ) _sym_db.RegisterMessage(WriteResult) DocumentChange = _reflection.GeneratedProtocolMessageType( "DocumentChange", (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENTCHANGE, - __module__="google.cloud.firestore_v1beta1.proto.write_pb2", - __doc__="""A [Document][google.firestore.v1beta1.Document] has - changed. - - May be the result of multiple [writes][google.firestore.v1beta1.Write], + { + "DESCRIPTOR": _DOCUMENTCHANGE, + "__module__": "google.cloud.firestore_v1beta1.proto.write_pb2", + "__doc__": """A [Document][google.firestore.v1beta1.Document] has changed. May be + the result of multiple [writes][google.firestore.v1beta1.Write], including deletes, that ultimately resulted in a new value for the - [Document][google.firestore.v1beta1.Document]. - - Multiple [DocumentChange][google.firestore.v1beta1.DocumentChange] - messages may be returned for the same logical change, if multiple - targets are affected. - + [Document][google.firestore.v1beta1.Document]. Multiple + [DocumentChange][google.firestore.v1beta1.DocumentChange] messages may + be returned for the same logical change, if multiple targets are + affected. Attributes: document: @@ -1053,27 +1083,23 @@ document. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.DocumentChange) - ), + }, ) _sym_db.RegisterMessage(DocumentChange) DocumentDelete = _reflection.GeneratedProtocolMessageType( "DocumentDelete", (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENTDELETE, - __module__="google.cloud.firestore_v1beta1.proto.write_pb2", - __doc__="""A [Document][google.firestore.v1beta1.Document] has been - deleted. - - May be the result of multiple [writes][google.firestore.v1beta1.Write], + { + "DESCRIPTOR": _DOCUMENTDELETE, + "__module__": "google.cloud.firestore_v1beta1.proto.write_pb2", + "__doc__": """A [Document][google.firestore.v1beta1.Document] has been deleted. May + be the result of multiple [writes][google.firestore.v1beta1.Write], including updates, the last of which deleted the - [Document][google.firestore.v1beta1.Document]. - - Multiple [DocumentDelete][google.firestore.v1beta1.DocumentDelete] - messages may be returned for the same logical delete, if multiple - targets are affected. - + [Document][google.firestore.v1beta1.Document]. Multiple + [DocumentDelete][google.firestore.v1beta1.DocumentDelete] messages may + be returned for the same logical delete, if multiple targets are + affected. Attributes: document: @@ -1088,27 +1114,24 @@ or equal to the ``commit_time`` of the delete. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.DocumentDelete) - ), + }, ) _sym_db.RegisterMessage(DocumentDelete) DocumentRemove = _reflection.GeneratedProtocolMessageType( "DocumentRemove", (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENTREMOVE, - __module__="google.cloud.firestore_v1beta1.proto.write_pb2", - __doc__="""A [Document][google.firestore.v1beta1.Document] has been - removed from the view of the targets. - - Sent if the document is no longer relevant to a target and is out of - view. Can be sent instead of a DocumentDelete or a DocumentChange if the - server can not send the new value of the document. - - Multiple [DocumentRemove][google.firestore.v1beta1.DocumentRemove] - messages may be returned for the same logical write or delete, if - multiple targets are affected. - + { + "DESCRIPTOR": _DOCUMENTREMOVE, + "__module__": "google.cloud.firestore_v1beta1.proto.write_pb2", + "__doc__": """A [Document][google.firestore.v1beta1.Document] has been removed from + the view of the targets. Sent if the document is no longer relevant + to a target and is out of view. Can be sent instead of a + DocumentDelete or a DocumentChange if the server can not send the new + value of the document. Multiple + [DocumentRemove][google.firestore.v1beta1.DocumentRemove] messages may + be returned for the same logical write or delete, if multiple targets + are affected. Attributes: document: @@ -1123,31 +1146,30 @@ or equal to the ``commit_time`` of the change/delete/remove. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.DocumentRemove) - ), + }, ) _sym_db.RegisterMessage(DocumentRemove) ExistenceFilter = _reflection.GeneratedProtocolMessageType( "ExistenceFilter", (_message.Message,), - dict( - DESCRIPTOR=_EXISTENCEFILTER, - __module__="google.cloud.firestore_v1beta1.proto.write_pb2", - __doc__="""A digest of all the documents that match a given target. - + { + "DESCRIPTOR": _EXISTENCEFILTER, + "__module__": "google.cloud.firestore_v1beta1.proto.write_pb2", + "__doc__": """A digest of all the documents that match a given target. Attributes: target_id: The target ID to which this filter applies. count: - The total count of documents that match [target\_id][google.fi - restore.v1beta1.ExistenceFilter.target\_id]. If different - from the count of documents in the client that match, the - client must manually determine which documents no longer match - the target. + The total count of documents that match [target_id][google.fir + estore.v1beta1.ExistenceFilter.target_id]. If different from + the count of documents in the client that match, the client + must manually determine which documents no longer match the + target. """, # @@protoc_insertion_point(class_scope:google.firestore.v1beta1.ExistenceFilter) - ), + }, ) _sym_db.RegisterMessage(ExistenceFilter) diff --git a/google/cloud/firestore_v1beta1/proto/write_pb2_grpc.py b/google/cloud/firestore_v1beta1/proto/write_pb2_grpc.py index 07cb78fe0..8a9393943 100644 --- a/google/cloud/firestore_v1beta1/proto/write_pb2_grpc.py +++ b/google/cloud/firestore_v1beta1/proto/write_pb2_grpc.py @@ -1,2 +1,3 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" import grpc diff --git a/noxfile.py b/noxfile.py index facb0bb99..9b1412930 100644 --- a/noxfile.py +++ b/noxfile.py @@ -23,14 +23,15 @@ import nox -BLACK_VERSION = "black==19.3b0" +BLACK_VERSION = "black==19.10b0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] -if os.path.exists("samples"): - BLACK_PATHS.append("samples") +DEFAULT_PYTHON_VERSION = "3.8" +SYSTEM_TEST_PYTHON_VERSIONS = ["2.7", "3.8"] +UNIT_TEST_PYTHON_VERSIONS = ["2.7", "3.5", "3.6", "3.7", "3.8"] -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def lint(session): """Run linters. @@ -38,7 +39,9 @@ def lint(session): serious code quality issues. """ session.install("flake8", BLACK_VERSION) - session.run("black", "--check", *BLACK_PATHS) + session.run( + "black", "--check", *BLACK_PATHS, + ) session.run("flake8", "google", "tests") @@ -53,10 +56,12 @@ def blacken(session): check the state of the `gcp_ubuntu_config` we use for that Kokoro run. """ session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) + session.run( + "black", *BLACK_PATHS, + ) -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def lint_setup_py(session): """Verify that setup.py is valid (including RST check).""" session.install("docutils", "pygments") @@ -84,13 +89,13 @@ def default(session): ) -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) +@nox.session(python=UNIT_TEST_PYTHON_VERSIONS) def unit(session): """Run the unit test suite.""" default(session) -@nox.session(python=["2.7", "3.7"]) +@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) def system(session): """Run the system test suite.""" system_test_path = os.path.join("tests", "system.py") @@ -110,7 +115,9 @@ def system(session): # Install all test dependencies, then install this package into the # virtualenv's dist-packages. - session.install("mock", "pytest", "google-cloud-testutils") + session.install( + "mock", "pytest", "google-cloud-testutils", + ) session.install("-e", ".") # Run py.test against the system tests. @@ -120,7 +127,7 @@ def system(session): session.run("py.test", "--verbose", system_test_folder_path, *session.posargs) -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def cover(session): """Run the final coverage report. @@ -133,7 +140,7 @@ def cover(session): session.run("coverage", "erase") -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def docs(session): """Build the docs for this library.""" diff --git a/scripts/decrypt-secrets.sh b/scripts/decrypt-secrets.sh new file mode 100755 index 000000000..ff599eb2a --- /dev/null +++ b/scripts/decrypt-secrets.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Copyright 2015 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.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. + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +ROOT=$( dirname "$DIR" ) + +# Work from the project root. +cd $ROOT + +# Use SECRET_MANAGER_PROJECT if set, fallback to cloud-devrel-kokoro-resources. +PROJECT_ID="${SECRET_MANAGER_PROJECT:-cloud-devrel-kokoro-resources}" + +gcloud secrets versions access latest --secret="python-docs-samples-test-env" \ + > testing/test-env.sh +gcloud secrets versions access latest \ + --secret="python-docs-samples-service-account" \ + > testing/service-account.json +gcloud secrets versions access latest \ + --secret="python-docs-samples-client-secrets" \ + > testing/client-secrets.json \ No newline at end of file diff --git a/scripts/readme-gen/readme_gen.py b/scripts/readme-gen/readme_gen.py new file mode 100644 index 000000000..d309d6e97 --- /dev/null +++ b/scripts/readme-gen/readme_gen.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python + +# Copyright 2016 Google Inc +# +# Licensed under the Apache License, Version 2.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. + +"""Generates READMEs using configuration defined in yaml.""" + +import argparse +import io +import os +import subprocess + +import jinja2 +import yaml + + +jinja_env = jinja2.Environment( + trim_blocks=True, + loader=jinja2.FileSystemLoader( + os.path.abspath(os.path.join(os.path.dirname(__file__), 'templates')))) + +README_TMPL = jinja_env.get_template('README.tmpl.rst') + + +def get_help(file): + return subprocess.check_output(['python', file, '--help']).decode() + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('source') + parser.add_argument('--destination', default='README.rst') + + args = parser.parse_args() + + source = os.path.abspath(args.source) + root = os.path.dirname(source) + destination = os.path.join(root, args.destination) + + jinja_env.globals['get_help'] = get_help + + with io.open(source, 'r') as f: + config = yaml.load(f) + + # This allows get_help to execute in the right directory. + os.chdir(root) + + output = README_TMPL.render(config) + + with io.open(destination, 'w') as f: + f.write(output) + + +if __name__ == '__main__': + main() diff --git a/scripts/readme-gen/templates/README.tmpl.rst b/scripts/readme-gen/templates/README.tmpl.rst new file mode 100644 index 000000000..4fd239765 --- /dev/null +++ b/scripts/readme-gen/templates/README.tmpl.rst @@ -0,0 +1,87 @@ +{# The following line is a lie. BUT! Once jinja2 is done with it, it will + become truth! #} +.. This file is automatically generated. Do not edit this file directly. + +{{product.name}} Python Samples +=============================================================================== + +.. image:: https://gstatic.com/cloudssh/images/open-btn.png + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor={{folder}}/README.rst + + +This directory contains samples for {{product.name}}. {{product.description}} + +{{description}} + +.. _{{product.name}}: {{product.url}} + +{% if required_api_url %} +To run the sample, you need to enable the API at: {{required_api_url}} +{% endif %} + +{% if required_role %} +To run the sample, you need to have `{{required_role}}` role. +{% endif %} + +{{other_required_steps}} + +{% if setup %} +Setup +------------------------------------------------------------------------------- + +{% for section in setup %} + +{% include section + '.tmpl.rst' %} + +{% endfor %} +{% endif %} + +{% if samples %} +Samples +------------------------------------------------------------------------------- + +{% for sample in samples %} +{{sample.name}} ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +{% if not sample.hide_cloudshell_button %} +.. image:: https://gstatic.com/cloudssh/images/open-btn.png + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor={{folder}}/{{sample.file}},{{folder}}/README.rst +{% endif %} + + +{{sample.description}} + +To run this sample: + +.. code-block:: bash + + $ python {{sample.file}} +{% if sample.show_help %} + + {{get_help(sample.file)|indent}} +{% endif %} + + +{% endfor %} +{% endif %} + +{% if cloud_client_library %} + +The client library +------------------------------------------------------------------------------- + +This sample uses the `Google Cloud Client Library for Python`_. +You can read the documentation for more details on API usage and use GitHub +to `browse the source`_ and `report issues`_. + +.. _Google Cloud Client Library for Python: + https://googlecloudplatform.github.io/google-cloud-python/ +.. _browse the source: + https://github.com/GoogleCloudPlatform/google-cloud-python +.. _report issues: + https://github.com/GoogleCloudPlatform/google-cloud-python/issues + +{% endif %} + +.. _Google Cloud SDK: https://cloud.google.com/sdk/ \ No newline at end of file diff --git a/scripts/readme-gen/templates/auth.tmpl.rst b/scripts/readme-gen/templates/auth.tmpl.rst new file mode 100644 index 000000000..1446b94a5 --- /dev/null +++ b/scripts/readme-gen/templates/auth.tmpl.rst @@ -0,0 +1,9 @@ +Authentication +++++++++++++++ + +This sample requires you to have authentication setup. Refer to the +`Authentication Getting Started Guide`_ for instructions on setting up +credentials for applications. + +.. _Authentication Getting Started Guide: + https://cloud.google.com/docs/authentication/getting-started diff --git a/scripts/readme-gen/templates/auth_api_key.tmpl.rst b/scripts/readme-gen/templates/auth_api_key.tmpl.rst new file mode 100644 index 000000000..11957ce27 --- /dev/null +++ b/scripts/readme-gen/templates/auth_api_key.tmpl.rst @@ -0,0 +1,14 @@ +Authentication +++++++++++++++ + +Authentication for this service is done via an `API Key`_. To obtain an API +Key: + +1. Open the `Cloud Platform Console`_ +2. Make sure that billing is enabled for your project. +3. From the **Credentials** page, create a new **API Key** or use an existing + one for your project. + +.. _API Key: + https://developers.google.com/api-client-library/python/guide/aaa_apikeys +.. _Cloud Console: https://console.cloud.google.com/project?_ diff --git a/scripts/readme-gen/templates/install_deps.tmpl.rst b/scripts/readme-gen/templates/install_deps.tmpl.rst new file mode 100644 index 000000000..a0406dba8 --- /dev/null +++ b/scripts/readme-gen/templates/install_deps.tmpl.rst @@ -0,0 +1,29 @@ +Install Dependencies +++++++++++++++++++++ + +#. Clone python-docs-samples and change directory to the sample directory you want to use. + + .. code-block:: bash + + $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git + +#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions. + + .. _Python Development Environment Setup Guide: + https://cloud.google.com/python/setup + +#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. + + .. code-block:: bash + + $ virtualenv env + $ source env/bin/activate + +#. Install the dependencies needed to run the samples. + + .. code-block:: bash + + $ pip install -r requirements.txt + +.. _pip: https://pip.pypa.io/ +.. _virtualenv: https://virtualenv.pypa.io/ diff --git a/scripts/readme-gen/templates/install_portaudio.tmpl.rst b/scripts/readme-gen/templates/install_portaudio.tmpl.rst new file mode 100644 index 000000000..5ea33d18c --- /dev/null +++ b/scripts/readme-gen/templates/install_portaudio.tmpl.rst @@ -0,0 +1,35 @@ +Install PortAudio ++++++++++++++++++ + +Install `PortAudio`_. This is required by the `PyAudio`_ library to stream +audio from your computer's microphone. PyAudio depends on PortAudio for cross-platform compatibility, and is installed differently depending on the +platform. + +* For Mac OS X, you can use `Homebrew`_:: + + brew install portaudio + + **Note**: if you encounter an error when running `pip install` that indicates + it can't find `portaudio.h`, try running `pip install` with the following + flags:: + + pip install --global-option='build_ext' \ + --global-option='-I/usr/local/include' \ + --global-option='-L/usr/local/lib' \ + pyaudio + +* For Debian / Ubuntu Linux:: + + apt-get install portaudio19-dev python-all-dev + +* Windows may work without having to install PortAudio explicitly (it will get + installed with PyAudio). + +For more details, see the `PyAudio installation`_ page. + + +.. _PyAudio: https://people.csail.mit.edu/hubert/pyaudio/ +.. _PortAudio: http://www.portaudio.com/ +.. _PyAudio installation: + https://people.csail.mit.edu/hubert/pyaudio/#downloads +.. _Homebrew: http://brew.sh diff --git a/synth.metadata b/synth.metadata index 3740fc003..d78a42484 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,32 +1,25 @@ { "sources": [ - { - "generator": { - "name": "artman", - "version": "2.0.0", - "dockerImage": "googleapis/artman@sha256:b3b47805231a305d0f40c4bf069df20f6a2635574e6d4259fac651d3f9f6e098" - } - }, { "git": { "name": ".", "remote": "git@github.com:googleapis/python-firestore", - "sha": "30ca7962134dd534bbc2a00e40de7e0b35401464" + "sha": "6f9c325f5804f10d51fe711302a1fd18ca1807d9" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "756b174de4a122461993c1c583345533d819936d", - "internalRef": "308824110" + "sha": "a758393a3f77b11b0ddbf62d468454dd6492f48a", + "internalRef": "319296039" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "01b6f23d24b27878b48667ce597876d66b59780e" + "sha": "303271797a360f8a439203413f13a160f2f5b3b4" } } ], @@ -37,8 +30,7 @@ "apiName": "firestore", "apiVersion": "v1beta1", "language": "python", - "generator": "gapic", - "config": "google/firestore/artman_firestore.yaml" + "generator": "bazel" } }, { @@ -47,8 +39,7 @@ "apiName": "firestore", "apiVersion": "v1", "language": "python", - "generator": "gapic", - "config": "google/firestore/artman_firestore_v1.yaml" + "generator": "bazel" } }, { @@ -57,8 +48,7 @@ "apiName": "firestore_admin", "apiVersion": "v1", "language": "python", - "generator": "gapic", - "config": "google/firestore/admin/artman_firestore_v1.yaml" + "generator": "bazel" } } ] diff --git a/synth.py b/synth.py index d6302dd89..46f427201 100644 --- a/synth.py +++ b/synth.py @@ -52,7 +52,99 @@ "client = firestore_client.FirestoreClient", ) +# TODO(busunkim): remove during microgenerator transition +# This re-adds a resource helpers that were removed in a regeneration +n = s.replace( + "google/cloud/**/firestore_client.py", + """\s+def __init__\(""", + ''' + @classmethod + def any_path_path(cls, project, database, document, any_path): + """Return a fully-qualified any_path string.""" + return google.api_core.path_template.expand( + "projects/{project}/databases/{database}/documents/{document}/{any_path=**}", + project=project, + database=database, + document=document, + any_path=any_path, + ) + + @classmethod + def database_root_path(cls, project, database): + """Return a fully-qualified database_root string.""" + return google.api_core.path_template.expand( + "projects/{project}/databases/{database}", + project=project, + database=database, + ) + + @classmethod + def document_path_path(cls, project, database, document_path): + """Return a fully-qualified document_path string.""" + return google.api_core.path_template.expand( + "projects/{project}/databases/{database}/documents/{document_path=**}", + project=project, + database=database, + document_path=document_path, + ) + + @classmethod + def document_root_path(cls, project, database): + """Return a fully-qualified document_root string.""" + return google.api_core.path_template.expand( + "projects/{project}/databases/{database}/documents", + project=project, + database=database, + ) + + def __init__(''', +) + +if n != 2: + raise Exception("Required replacement in firestore_client.py not made.") + + +# TODO(busunkim): Remve during microgenerator transition +# Preserve parameter order +n = s.replace( + "google/cloud/**/firestore_client.py", + """def create_document\( +\s+self, +\s+parent, +\s+collection_id, +\s+document, +\s+document_id=None, +\s+mask=None, +\s+retry=google.api_core.gapic_v1.method.DEFAULT, +\s+timeout=google.api_core.gapic_v1.method.DEFAULT, +\s+metadata=None\):""", + """def create_document( + self, + parent, + collection_id, + document_id, + document, + mask=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None):""", +) + +if n != 2: + raise Exception("Required replacement was not made in firestore_client.py") +# Fix unit tests for replacement above +s.replace( + "tests/**/test_firestore_client_*.py", + """client\.create_document\(parent, collection_id, document\)""", + """client.create_document(parent, collection_id, "documentid", document)""", +) + +s.replace( + "tests/**/test_firestore_client_*.py", + """firestore_pb2\.CreateDocumentRequest\(parent=parent, collection_id=collection_id, document=document\)""", + """firestore_pb2.CreateDocumentRequest(parent=parent, collection_id=collection_id, document_id="documentid", document=document)""", +) # ---------------------------------------------------------------------------- # Generate firestore admin GAPIC layer # ---------------------------------------------------------------------------- @@ -72,6 +164,27 @@ "'google-cloud-firestore'", ) +# TODO(busunkim): remove during microgenerator transition +# This re-adds a resource helper that was removed in a regeneration +n = s.replace( + "google/cloud/**/firestore_admin_client.py", + """\s+def __init__\(""", + ''' + @classmethod + def parent_path(cls, project, database, collection_id): + """Return a fully-qualified parent string.""" + return google.api_core.path_template.expand( + "projects/{project}/databases/{database}/collectionGroups/{collection_id}", + project=project, + database=database, + collection_id=collection_id, + ) + + def __init__(''', +) + +if n != 1: + raise Exception("Required replacement was not made.") # ---------------------------------------------------------------------------- # Add templated files # ---------------------------------------------------------------------------- @@ -79,16 +192,17 @@ s.move(templated_files) s.replace( - "noxfile.py", - "GOOGLE_APPLICATION_CREDENTIALS", - "FIRESTORE_APPLICATION_CREDENTIALS", + "noxfile.py", "GOOGLE_APPLICATION_CREDENTIALS", "FIRESTORE_APPLICATION_CREDENTIALS", ) s.replace( - "noxfile.py", - '"--quiet", system_test', - '"--verbose", system_test', + "noxfile.py", '"--quiet", system_test', '"--verbose", system_test', ) +s.replace( + "noxfile.py", + """["']sphinx['"]""", + '''"sphinx<3.0.0"''', +) s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/testing/.gitignore b/testing/.gitignore new file mode 100644 index 000000000..b05fbd630 --- /dev/null +++ b/testing/.gitignore @@ -0,0 +1,3 @@ +test-env.sh +service-account.json +client-secrets.json \ No newline at end of file diff --git a/tests/unit/gapic/v1/test_firestore_admin_client_v1.py b/tests/unit/gapic/v1/test_firestore_admin_client_v1.py index 9a731130d..f0262b983 100644 --- a/tests/unit/gapic/v1/test_firestore_admin_client_v1.py +++ b/tests/unit/gapic/v1/test_firestore_admin_client_v1.py @@ -19,10 +19,13 @@ import mock import pytest +from google.rpc import status_pb2 + from google.cloud import firestore_admin_v1 from google.cloud.firestore_admin_v1.proto import field_pb2 from google.cloud.firestore_admin_v1.proto import firestore_admin_pb2 from google.cloud.firestore_admin_v1.proto import index_pb2 +from google.cloud.firestore_admin_v1.proto import operation_pb2 from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 @@ -64,35 +67,24 @@ class CustomException(Exception): class TestFirestoreAdminClient(object): - def test_create_index(self): - # Setup Expected Response - name = "name3373707" - done = True - expected_response = {"name": name, "done": done} - expected_response = operations_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) + def test_delete_index(self): + channel = ChannelStub() patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: create_channel.return_value = channel client = firestore_admin_v1.FirestoreAdminClient() # Setup Request - parent = client.parent_path("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]") - index = {} + name = client.index_path("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]") - response = client.create_index(parent, index) - assert expected_response == response + client.delete_index(name) assert len(channel.requests) == 1 - expected_request = firestore_admin_pb2.CreateIndexRequest( - parent=parent, index=index - ) + expected_request = firestore_admin_pb2.DeleteIndexRequest(name=name) actual_request = channel.requests[0][1] assert expected_request == actual_request - def test_create_index_exception(self): + def test_delete_index_exception(self): # Mock the API response channel = ChannelStub(responses=[CustomException()]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") @@ -101,138 +93,124 @@ def test_create_index_exception(self): client = firestore_admin_v1.FirestoreAdminClient() # Setup request - parent = client.parent_path("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]") - index = {} + name = client.index_path("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]") with pytest.raises(CustomException): - client.create_index(parent, index) + client.delete_index(name) - def test_list_indexes(self): + def test_update_field(self): # Setup Expected Response - next_page_token = "" - indexes_element = {} - indexes = [indexes_element] - expected_response = {"next_page_token": next_page_token, "indexes": indexes} - expected_response = firestore_admin_pb2.ListIndexesResponse(**expected_response) + name = "name3373707" + expected_response = {"name": name} + expected_response = field_pb2.Field(**expected_response) + operation = operations_pb2.Operation( + name="operations/test_update_field", done=True + ) + operation.response.Pack(expected_response) # Mock the API response - channel = ChannelStub(responses=[expected_response]) + channel = ChannelStub(responses=[operation]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: create_channel.return_value = channel client = firestore_admin_v1.FirestoreAdminClient() # Setup Request - parent = client.parent_path("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]") - - paged_list_response = client.list_indexes(parent) - resources = list(paged_list_response) - assert len(resources) == 1 + field = {} - assert expected_response.indexes[0] == resources[0] + response = client.update_field(field) + result = response.result() + assert expected_response == result assert len(channel.requests) == 1 - expected_request = firestore_admin_pb2.ListIndexesRequest(parent=parent) + expected_request = firestore_admin_pb2.UpdateFieldRequest(field=field) actual_request = channel.requests[0][1] assert expected_request == actual_request - def test_list_indexes_exception(self): - channel = ChannelStub(responses=[CustomException()]) + def test_update_field_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name="operations/test_update_field_exception", done=True + ) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: create_channel.return_value = channel client = firestore_admin_v1.FirestoreAdminClient() - # Setup request - parent = client.parent_path("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]") + # Setup Request + field = {} - paged_list_response = client.list_indexes(parent) - with pytest.raises(CustomException): - list(paged_list_response) + response = client.update_field(field) + exception = response.exception() + assert exception.errors[0] == error - def test_get_index(self): + def test_create_index(self): # Setup Expected Response - name_2 = "name2-1052831874" - expected_response = {"name": name_2} + name = "name3373707" + expected_response = {"name": name} expected_response = index_pb2.Index(**expected_response) + operation = operations_pb2.Operation( + name="operations/test_create_index", done=True + ) + operation.response.Pack(expected_response) # Mock the API response - channel = ChannelStub(responses=[expected_response]) + channel = ChannelStub(responses=[operation]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: create_channel.return_value = channel client = firestore_admin_v1.FirestoreAdminClient() # Setup Request - name = client.index_path( - "[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]" - ) + parent = client.collection_group_path("[PROJECT]", "[DATABASE]", "[COLLECTION]") + index = {} - response = client.get_index(name) - assert expected_response == response + response = client.create_index(parent, index) + result = response.result() + assert expected_response == result assert len(channel.requests) == 1 - expected_request = firestore_admin_pb2.GetIndexRequest(name=name) + expected_request = firestore_admin_pb2.CreateIndexRequest( + parent=parent, index=index + ) actual_request = channel.requests[0][1] assert expected_request == actual_request - def test_get_index_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = firestore_admin_v1.FirestoreAdminClient() - - # Setup request - name = client.index_path( - "[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]" - ) - - with pytest.raises(CustomException): - client.get_index(name) - - def test_delete_index(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = firestore_admin_v1.FirestoreAdminClient() - - # Setup Request - name = client.index_path( - "[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]" + def test_create_index_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name="operations/test_create_index_exception", done=True ) + operation.error.CopyFrom(error) - client.delete_index(name) - - assert len(channel.requests) == 1 - expected_request = firestore_admin_pb2.DeleteIndexRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_index_exception(self): # Mock the API response - channel = ChannelStub(responses=[CustomException()]) + channel = ChannelStub(responses=[operation]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: create_channel.return_value = channel client = firestore_admin_v1.FirestoreAdminClient() - # Setup request - name = client.index_path( - "[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]" - ) + # Setup Request + parent = client.collection_group_path("[PROJECT]", "[DATABASE]", "[COLLECTION]") + index = {} - with pytest.raises(CustomException): - client.delete_index(name) + response = client.create_index(parent, index) + exception = response.exception() + assert exception.errors[0] == error - def test_import_documents(self): + def test_list_indexes(self): # Setup Expected Response - name_2 = "name2-1052831874" - done = True - expected_response = {"name": name_2, "done": done} - expected_response = operations_pb2.Operation(**expected_response) + next_page_token = "" + indexes_element = {} + indexes = [indexes_element] + expected_response = {"next_page_token": next_page_token, "indexes": indexes} + expected_response = firestore_admin_pb2.ListIndexesResponse(**expected_response) # Mock the API response channel = ChannelStub(responses=[expected_response]) @@ -242,18 +220,20 @@ def test_import_documents(self): client = firestore_admin_v1.FirestoreAdminClient() # Setup Request - name = client.database_path("[PROJECT]", "[DATABASE]") + parent = client.collection_group_path("[PROJECT]", "[DATABASE]", "[COLLECTION]") - response = client.import_documents(name) - assert expected_response == response + paged_list_response = client.list_indexes(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.indexes[0] == resources[0] assert len(channel.requests) == 1 - expected_request = firestore_admin_pb2.ImportDocumentsRequest(name=name) + expected_request = firestore_admin_pb2.ListIndexesRequest(parent=parent) actual_request = channel.requests[0][1] assert expected_request == actual_request - def test_import_documents_exception(self): - # Mock the API response + def test_list_indexes_exception(self): channel = ChannelStub(responses=[CustomException()]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: @@ -261,17 +241,17 @@ def test_import_documents_exception(self): client = firestore_admin_v1.FirestoreAdminClient() # Setup request - name = client.database_path("[PROJECT]", "[DATABASE]") + parent = client.collection_group_path("[PROJECT]", "[DATABASE]", "[COLLECTION]") + paged_list_response = client.list_indexes(parent) with pytest.raises(CustomException): - client.import_documents(name) + list(paged_list_response) - def test_export_documents(self): + def test_get_index(self): # Setup Expected Response name_2 = "name2-1052831874" - done = True - expected_response = {"name": name_2, "done": done} - expected_response = operations_pb2.Operation(**expected_response) + expected_response = {"name": name_2} + expected_response = index_pb2.Index(**expected_response) # Mock the API response channel = ChannelStub(responses=[expected_response]) @@ -281,17 +261,17 @@ def test_export_documents(self): client = firestore_admin_v1.FirestoreAdminClient() # Setup Request - name = client.database_path("[PROJECT]", "[DATABASE]") + name = client.index_path("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]") - response = client.export_documents(name) + response = client.get_index(name) assert expected_response == response assert len(channel.requests) == 1 - expected_request = firestore_admin_pb2.ExportDocumentsRequest(name=name) + expected_request = firestore_admin_pb2.GetIndexRequest(name=name) actual_request = channel.requests[0][1] assert expected_request == actual_request - def test_export_documents_exception(self): + def test_get_index_exception(self): # Mock the API response channel = ChannelStub(responses=[CustomException()]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") @@ -300,10 +280,10 @@ def test_export_documents_exception(self): client = firestore_admin_v1.FirestoreAdminClient() # Setup request - name = client.database_path("[PROJECT]", "[DATABASE]") + name = client.index_path("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]") with pytest.raises(CustomException): - client.export_documents(name) + client.get_index(name) def test_get_field(self): # Setup Expected Response @@ -319,9 +299,7 @@ def test_get_field(self): client = firestore_admin_v1.FirestoreAdminClient() # Setup Request - name = client.field_path( - "[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[FIELD_ID]" - ) + name = client.field_path("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[FIELD]") response = client.get_field(name) assert expected_response == response @@ -340,9 +318,7 @@ def test_get_field_exception(self): client = firestore_admin_v1.FirestoreAdminClient() # Setup request - name = client.field_path( - "[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[FIELD_ID]" - ) + name = client.field_path("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[FIELD]") with pytest.raises(CustomException): client.get_field(name) @@ -363,7 +339,7 @@ def test_list_fields(self): client = firestore_admin_v1.FirestoreAdminClient() # Setup Request - parent = client.parent_path("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]") + parent = client.collection_group_path("[PROJECT]", "[DATABASE]", "[COLLECTION]") paged_list_response = client.list_fields(parent) resources = list(paged_list_response) @@ -384,47 +360,109 @@ def test_list_fields_exception(self): client = firestore_admin_v1.FirestoreAdminClient() # Setup request - parent = client.parent_path("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]") + parent = client.collection_group_path("[PROJECT]", "[DATABASE]", "[COLLECTION]") paged_list_response = client.list_fields(parent) with pytest.raises(CustomException): list(paged_list_response) - def test_update_field(self): + def test_export_documents(self): # Setup Expected Response - name = "name3373707" - done = True - expected_response = {"name": name, "done": done} - expected_response = operations_pb2.Operation(**expected_response) + output_uri_prefix = "outputUriPrefix124746435" + expected_response = {"output_uri_prefix": output_uri_prefix} + expected_response = operation_pb2.ExportDocumentsResponse(**expected_response) + operation = operations_pb2.Operation( + name="operations/test_export_documents", done=True + ) + operation.response.Pack(expected_response) # Mock the API response - channel = ChannelStub(responses=[expected_response]) + channel = ChannelStub(responses=[operation]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: create_channel.return_value = channel client = firestore_admin_v1.FirestoreAdminClient() # Setup Request - field = {} + name = client.database_path("[PROJECT]", "[DATABASE]") - response = client.update_field(field) - assert expected_response == response + response = client.export_documents(name) + result = response.result() + assert expected_response == result assert len(channel.requests) == 1 - expected_request = firestore_admin_pb2.UpdateFieldRequest(field=field) + expected_request = firestore_admin_pb2.ExportDocumentsRequest(name=name) actual_request = channel.requests[0][1] assert expected_request == actual_request - def test_update_field_exception(self): + def test_export_documents_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name="operations/test_export_documents_exception", done=True + ) + operation.error.CopyFrom(error) + # Mock the API response - channel = ChannelStub(responses=[CustomException()]) + channel = ChannelStub(responses=[operation]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: create_channel.return_value = channel client = firestore_admin_v1.FirestoreAdminClient() - # Setup request - field = {} + # Setup Request + name = client.database_path("[PROJECT]", "[DATABASE]") - with pytest.raises(CustomException): - client.update_field(field) + response = client.export_documents(name) + exception = response.exception() + assert exception.errors[0] == error + + def test_import_documents(self): + # Setup Expected Response + expected_response = {} + expected_response = empty_pb2.Empty(**expected_response) + operation = operations_pb2.Operation( + name="operations/test_import_documents", done=True + ) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = firestore_admin_v1.FirestoreAdminClient() + + # Setup Request + name = client.database_path("[PROJECT]", "[DATABASE]") + + response = client.import_documents(name) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = firestore_admin_pb2.ImportDocumentsRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_import_documents_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name="operations/test_import_documents_exception", done=True + ) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = firestore_admin_v1.FirestoreAdminClient() + + # Setup Request + name = client.database_path("[PROJECT]", "[DATABASE]") + + response = client.import_documents(name) + exception = response.exception() + assert exception.errors[0] == error diff --git a/tests/unit/gapic/v1/test_firestore_client_v1.py b/tests/unit/gapic/v1/test_firestore_client_v1.py index 8e345da1a..8a44160d8 100644 --- a/tests/unit/gapic/v1/test_firestore_client_v1.py +++ b/tests/unit/gapic/v1/test_firestore_client_v1.py @@ -20,9 +20,9 @@ import pytest from google.cloud.firestore_v1.gapic import firestore_client -from google.cloud.firestore_v1.proto import common_pb2 from google.cloud.firestore_v1.proto import document_pb2 from google.cloud.firestore_v1.proto import firestore_pb2 +from google.cloud.firestore_v1.proto import query_pb2 from google.protobuf import empty_pb2 @@ -85,9 +85,7 @@ def test_get_document(self): client = firestore_client.FirestoreClient() # Setup Request - name = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + name = "name3373707" response = client.get_document(name) assert expected_response == response @@ -106,9 +104,7 @@ def test_get_document_exception(self): client = firestore_client.FirestoreClient() # Setup request - name = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + name = "name3373707" with pytest.raises(CustomException): client.get_document(name) @@ -129,9 +125,7 @@ def test_list_documents(self): client = firestore_client.FirestoreClient() # Setup Request - parent = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + parent = "parent-995424086" collection_id = "collectionId-821242276" paged_list_response = client.list_documents(parent, collection_id) @@ -155,9 +149,7 @@ def test_list_documents_exception(self): client = firestore_client.FirestoreClient() # Setup request - parent = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + parent = "parent-995424086" collection_id = "collectionId-821242276" paged_list_response = client.list_documents(parent, collection_id) @@ -178,21 +170,18 @@ def test_create_document(self): client = firestore_client.FirestoreClient() # Setup Request - parent = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + parent = "parent-995424086" collection_id = "collectionId-821242276" - document_id = "documentId506676927" document = {} - response = client.create_document(parent, collection_id, document_id, document) + response = client.create_document(parent, collection_id, "documentid", document) assert expected_response == response assert len(channel.requests) == 1 expected_request = firestore_pb2.CreateDocumentRequest( parent=parent, collection_id=collection_id, - document_id=document_id, + document_id="documentid", document=document, ) actual_request = channel.requests[0][1] @@ -207,15 +196,12 @@ def test_create_document_exception(self): client = firestore_client.FirestoreClient() # Setup request - parent = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + parent = "parent-995424086" collection_id = "collectionId-821242276" - document_id = "documentId506676927" document = {} with pytest.raises(CustomException): - client.create_document(parent, collection_id, document_id, document) + client.create_document(parent, collection_id, "documentid", document) def test_update_document(self): # Setup Expected Response @@ -232,15 +218,12 @@ def test_update_document(self): # Setup Request document = {} - update_mask = {} - response = client.update_document(document, update_mask) + response = client.update_document(document) assert expected_response == response assert len(channel.requests) == 1 - expected_request = firestore_pb2.UpdateDocumentRequest( - document=document, update_mask=update_mask - ) + expected_request = firestore_pb2.UpdateDocumentRequest(document=document) actual_request = channel.requests[0][1] assert expected_request == actual_request @@ -254,10 +237,9 @@ def test_update_document_exception(self): # Setup request document = {} - update_mask = {} with pytest.raises(CustomException): - client.update_document(document, update_mask) + client.update_document(document) def test_delete_document(self): channel = ChannelStub() @@ -267,9 +249,7 @@ def test_delete_document(self): client = firestore_client.FirestoreClient() # Setup Request - name = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + name = "name3373707" client.delete_document(name) @@ -287,9 +267,7 @@ def test_delete_document_exception(self): client = firestore_client.FirestoreClient() # Setup request - name = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + name = "name3373707" with pytest.raises(CustomException): client.delete_document(name) @@ -309,18 +287,15 @@ def test_batch_get_documents(self): client = firestore_client.FirestoreClient() # Setup Request - database = client.database_root_path("[PROJECT]", "[DATABASE]") - documents = [] + database = "database1789464955" - response = client.batch_get_documents(database, documents) + response = client.batch_get_documents(database) resources = list(response) assert len(resources) == 1 assert expected_response == resources[0] assert len(channel.requests) == 1 - expected_request = firestore_pb2.BatchGetDocumentsRequest( - database=database, documents=documents - ) + expected_request = firestore_pb2.BatchGetDocumentsRequest(database=database) actual_request = channel.requests[0][1] assert expected_request == actual_request @@ -333,11 +308,47 @@ def test_batch_get_documents_exception(self): client = firestore_client.FirestoreClient() # Setup request - database = client.database_root_path("[PROJECT]", "[DATABASE]") - documents = [] + database = "database1789464955" with pytest.raises(CustomException): - client.batch_get_documents(database, documents) + client.batch_get_documents(database) + + def test_batch_write(self): + # Setup Expected Response + expected_response = {} + expected_response = firestore_pb2.BatchWriteResponse(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = firestore_client.FirestoreClient() + + # Setup Request + database = "database1789464955" + + response = client.batch_write(database) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = firestore_pb2.BatchWriteRequest(database=database) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_batch_write_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = firestore_client.FirestoreClient() + + # Setup request + database = "database1789464955" + + with pytest.raises(CustomException): + client.batch_write(database) def test_begin_transaction(self): # Setup Expected Response @@ -353,7 +364,7 @@ def test_begin_transaction(self): client = firestore_client.FirestoreClient() # Setup Request - database = client.database_root_path("[PROJECT]", "[DATABASE]") + database = "database1789464955" response = client.begin_transaction(database) assert expected_response == response @@ -372,7 +383,7 @@ def test_begin_transaction_exception(self): client = firestore_client.FirestoreClient() # Setup request - database = client.database_root_path("[PROJECT]", "[DATABASE]") + database = "database1789464955" with pytest.raises(CustomException): client.begin_transaction(database) @@ -390,14 +401,13 @@ def test_commit(self): client = firestore_client.FirestoreClient() # Setup Request - database = client.database_root_path("[PROJECT]", "[DATABASE]") - writes = [] + database = "database1789464955" - response = client.commit(database, writes) + response = client.commit(database) assert expected_response == response assert len(channel.requests) == 1 - expected_request = firestore_pb2.CommitRequest(database=database, writes=writes) + expected_request = firestore_pb2.CommitRequest(database=database) actual_request = channel.requests[0][1] assert expected_request == actual_request @@ -410,11 +420,10 @@ def test_commit_exception(self): client = firestore_client.FirestoreClient() # Setup request - database = client.database_root_path("[PROJECT]", "[DATABASE]") - writes = [] + database = "database1789464955" with pytest.raises(CustomException): - client.commit(database, writes) + client.commit(database) def test_rollback(self): channel = ChannelStub() @@ -424,7 +433,7 @@ def test_rollback(self): client = firestore_client.FirestoreClient() # Setup Request - database = client.database_root_path("[PROJECT]", "[DATABASE]") + database = "database1789464955" transaction = b"-34" client.rollback(database, transaction) @@ -445,7 +454,7 @@ def test_rollback_exception(self): client = firestore_client.FirestoreClient() # Setup request - database = client.database_root_path("[PROJECT]", "[DATABASE]") + database = "database1789464955" transaction = b"-34" with pytest.raises(CustomException): @@ -469,9 +478,7 @@ def test_run_query(self): client = firestore_client.FirestoreClient() # Setup Request - parent = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + parent = "parent-995424086" response = client.run_query(parent) resources = list(response) @@ -492,9 +499,7 @@ def test_run_query_exception(self): client = firestore_client.FirestoreClient() # Setup request - parent = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + parent = "parent-995424086" with pytest.raises(CustomException): client.run_query(parent) @@ -514,7 +519,7 @@ def test_write(self): client = firestore_client.FirestoreClient() # Setup Request - database = client.database_root_path("[PROJECT]", "[DATABASE]") + database = "database1789464955" request = {"database": database} request = firestore_pb2.WriteRequest(**request) requests = [request] @@ -539,7 +544,7 @@ def test_write_exception(self): client = firestore_client.FirestoreClient() # Setup request - database = client.database_root_path("[PROJECT]", "[DATABASE]") + database = "database1789464955" request = {"database": database} request = firestore_pb2.WriteRequest(**request) @@ -561,7 +566,7 @@ def test_listen(self): client = firestore_client.FirestoreClient() # Setup Request - database = client.database_root_path("[PROJECT]", "[DATABASE]") + database = "database1789464955" request = {"database": database} request = firestore_pb2.ListenRequest(**request) requests = [request] @@ -586,7 +591,7 @@ def test_listen_exception(self): client = firestore_client.FirestoreClient() # Setup request - database = client.database_root_path("[PROJECT]", "[DATABASE]") + database = "database1789464955" request = {"database": database} request = firestore_pb2.ListenRequest(**request) @@ -614,9 +619,7 @@ def test_list_collection_ids(self): client = firestore_client.FirestoreClient() # Setup Request - parent = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + parent = "parent-995424086" paged_list_response = client.list_collection_ids(parent) resources = list(paged_list_response) @@ -637,10 +640,54 @@ def test_list_collection_ids_exception(self): client = firestore_client.FirestoreClient() # Setup request - parent = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + parent = "parent-995424086" paged_list_response = client.list_collection_ids(parent) with pytest.raises(CustomException): list(paged_list_response) + + def test_partition_query(self): + # Setup Expected Response + next_page_token = "" + partitions_element = {} + partitions = [partitions_element] + expected_response = { + "next_page_token": next_page_token, + "partitions": partitions, + } + expected_response = firestore_pb2.PartitionQueryResponse(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = firestore_client.FirestoreClient() + + # Setup Request + parent = "parent-995424086" + + paged_list_response = client.partition_query(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.partitions[0] == resources[0] + + assert len(channel.requests) == 1 + expected_request = firestore_pb2.PartitionQueryRequest(parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_partition_query_exception(self): + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = firestore_client.FirestoreClient() + + # Setup request + parent = "parent-995424086" + + paged_list_response = client.partition_query(parent) + with pytest.raises(CustomException): + list(paged_list_response) diff --git a/tests/unit/gapic/v1beta1/test_firestore_client_v1beta1.py b/tests/unit/gapic/v1beta1/test_firestore_client_v1beta1.py index f7bf05814..12879db2f 100644 --- a/tests/unit/gapic/v1beta1/test_firestore_client_v1beta1.py +++ b/tests/unit/gapic/v1beta1/test_firestore_client_v1beta1.py @@ -20,7 +20,6 @@ import pytest from google.cloud.firestore_v1beta1.gapic import firestore_client -from google.cloud.firestore_v1beta1.proto import common_pb2 from google.cloud.firestore_v1beta1.proto import document_pb2 from google.cloud.firestore_v1beta1.proto import firestore_pb2 from google.protobuf import empty_pb2 @@ -71,33 +70,24 @@ class CustomException(Exception): class TestFirestoreClient(object): - def test_get_document(self): - # Setup Expected Response - name_2 = "name2-1052831874" - expected_response = {"name": name_2} - expected_response = document_pb2.Document(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) + def test_delete_document(self): + channel = ChannelStub() patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: create_channel.return_value = channel client = firestore_client.FirestoreClient() # Setup Request - name = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + name = "name3373707" - response = client.get_document(name) - assert expected_response == response + client.delete_document(name) assert len(channel.requests) == 1 - expected_request = firestore_pb2.GetDocumentRequest(name=name) + expected_request = firestore_pb2.DeleteDocumentRequest(name=name) actual_request = channel.requests[0][1] assert expected_request == actual_request - def test_get_document_exception(self): + def test_delete_document_exception(self): # Mock the API response channel = ChannelStub(responses=[CustomException()]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") @@ -106,48 +96,40 @@ def test_get_document_exception(self): client = firestore_client.FirestoreClient() # Setup request - name = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + name = "name3373707" with pytest.raises(CustomException): - client.get_document(name) + client.delete_document(name) - def test_list_documents(self): + def test_batch_get_documents(self): # Setup Expected Response - next_page_token = "" - documents_element = {} - documents = [documents_element] - expected_response = {"next_page_token": next_page_token, "documents": documents} - expected_response = firestore_pb2.ListDocumentsResponse(**expected_response) + missing = "missing1069449574" + transaction = b"-34" + expected_response = {"missing": missing, "transaction": transaction} + expected_response = firestore_pb2.BatchGetDocumentsResponse(**expected_response) # Mock the API response - channel = ChannelStub(responses=[expected_response]) + channel = ChannelStub(responses=[iter([expected_response])]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: create_channel.return_value = channel client = firestore_client.FirestoreClient() # Setup Request - parent = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) - collection_id = "collectionId-821242276" + database = "database1789464955" - paged_list_response = client.list_documents(parent, collection_id) - resources = list(paged_list_response) + response = client.batch_get_documents(database) + resources = list(response) assert len(resources) == 1 - - assert expected_response.documents[0] == resources[0] + assert expected_response == resources[0] assert len(channel.requests) == 1 - expected_request = firestore_pb2.ListDocumentsRequest( - parent=parent, collection_id=collection_id - ) + expected_request = firestore_pb2.BatchGetDocumentsRequest(database=database) actual_request = channel.requests[0][1] assert expected_request == actual_request - def test_list_documents_exception(self): + def test_batch_get_documents_exception(self): + # Mock the API response channel = ChannelStub(responses=[CustomException()]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: @@ -155,20 +137,16 @@ def test_list_documents_exception(self): client = firestore_client.FirestoreClient() # Setup request - parent = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) - collection_id = "collectionId-821242276" + database = "database1789464955" - paged_list_response = client.list_documents(parent, collection_id) with pytest.raises(CustomException): - list(paged_list_response) + client.batch_get_documents(database) - def test_create_document(self): + def test_begin_transaction(self): # Setup Expected Response - name = "name3373707" - expected_response = {"name": name} - expected_response = document_pb2.Document(**expected_response) + transaction = b"-34" + expected_response = {"transaction": transaction} + expected_response = firestore_pb2.BeginTransactionResponse(**expected_response) # Mock the API response channel = ChannelStub(responses=[expected_response]) @@ -178,27 +156,17 @@ def test_create_document(self): client = firestore_client.FirestoreClient() # Setup Request - parent = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) - collection_id = "collectionId-821242276" - document_id = "documentId506676927" - document = {} + database = "database1789464955" - response = client.create_document(parent, collection_id, document_id, document) + response = client.begin_transaction(database) assert expected_response == response assert len(channel.requests) == 1 - expected_request = firestore_pb2.CreateDocumentRequest( - parent=parent, - collection_id=collection_id, - document_id=document_id, - document=document, - ) + expected_request = firestore_pb2.BeginTransactionRequest(database=database) actual_request = channel.requests[0][1] assert expected_request == actual_request - def test_create_document_exception(self): + def test_begin_transaction_exception(self): # Mock the API response channel = ChannelStub(responses=[CustomException()]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") @@ -207,44 +175,32 @@ def test_create_document_exception(self): client = firestore_client.FirestoreClient() # Setup request - parent = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) - collection_id = "collectionId-821242276" - document_id = "documentId506676927" - document = {} + database = "database1789464955" with pytest.raises(CustomException): - client.create_document(parent, collection_id, document_id, document) - - def test_update_document(self): - # Setup Expected Response - name = "name3373707" - expected_response = {"name": name} - expected_response = document_pb2.Document(**expected_response) + client.begin_transaction(database) - # Mock the API response - channel = ChannelStub(responses=[expected_response]) + def test_rollback(self): + channel = ChannelStub() patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: create_channel.return_value = channel client = firestore_client.FirestoreClient() # Setup Request - document = {} - update_mask = {} + database = "database1789464955" + transaction = b"-34" - response = client.update_document(document, update_mask) - assert expected_response == response + client.rollback(database, transaction) assert len(channel.requests) == 1 - expected_request = firestore_pb2.UpdateDocumentRequest( - document=document, update_mask=update_mask + expected_request = firestore_pb2.RollbackRequest( + database=database, transaction=transaction ) actual_request = channel.requests[0][1] assert expected_request == actual_request - def test_update_document_exception(self): + def test_rollback_exception(self): # Mock the API response channel = ChannelStub(responses=[CustomException()]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") @@ -253,32 +209,43 @@ def test_update_document_exception(self): client = firestore_client.FirestoreClient() # Setup request - document = {} - update_mask = {} + database = "database1789464955" + transaction = b"-34" with pytest.raises(CustomException): - client.update_document(document, update_mask) + client.rollback(database, transaction) - def test_delete_document(self): - channel = ChannelStub() + def test_run_query(self): + # Setup Expected Response + transaction = b"-34" + skipped_results = 880286183 + expected_response = { + "transaction": transaction, + "skipped_results": skipped_results, + } + expected_response = firestore_pb2.RunQueryResponse(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[iter([expected_response])]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: create_channel.return_value = channel client = firestore_client.FirestoreClient() # Setup Request - name = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + parent = "parent-995424086" - client.delete_document(name) + response = client.run_query(parent) + resources = list(response) + assert len(resources) == 1 + assert expected_response == resources[0] assert len(channel.requests) == 1 - expected_request = firestore_pb2.DeleteDocumentRequest(name=name) + expected_request = firestore_pb2.RunQueryRequest(parent=parent) actual_request = channel.requests[0][1] assert expected_request == actual_request - def test_delete_document_exception(self): + def test_run_query_exception(self): # Mock the API response channel = ChannelStub(responses=[CustomException()]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") @@ -287,19 +254,17 @@ def test_delete_document_exception(self): client = firestore_client.FirestoreClient() # Setup request - name = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + parent = "parent-995424086" with pytest.raises(CustomException): - client.delete_document(name) + client.run_query(parent) - def test_batch_get_documents(self): + def test_write(self): # Setup Expected Response - missing = "missing1069449574" - transaction = b"-34" - expected_response = {"missing": missing, "transaction": transaction} - expected_response = firestore_pb2.BatchGetDocumentsResponse(**expected_response) + stream_id = "streamId-315624902" + stream_token = b"122" + expected_response = {"stream_id": stream_id, "stream_token": stream_token} + expected_response = firestore_pb2.WriteResponse(**expected_response) # Mock the API response channel = ChannelStub(responses=[iter([expected_response])]) @@ -309,22 +274,23 @@ def test_batch_get_documents(self): client = firestore_client.FirestoreClient() # Setup Request - database = client.database_root_path("[PROJECT]", "[DATABASE]") - documents = [] + database = "database1789464955" + request = {"database": database} + request = firestore_pb2.WriteRequest(**request) + requests = [request] - response = client.batch_get_documents(database, documents) + response = client.write(requests) resources = list(response) assert len(resources) == 1 assert expected_response == resources[0] assert len(channel.requests) == 1 - expected_request = firestore_pb2.BatchGetDocumentsRequest( - database=database, documents=documents - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request + actual_requests = channel.requests[0][1] + assert len(actual_requests) == 1 + actual_request = list(actual_requests)[0] + assert request == actual_request - def test_batch_get_documents_exception(self): + def test_write_exception(self): # Mock the API response channel = ChannelStub(responses=[CustomException()]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") @@ -333,37 +299,45 @@ def test_batch_get_documents_exception(self): client = firestore_client.FirestoreClient() # Setup request - database = client.database_root_path("[PROJECT]", "[DATABASE]") - documents = [] + database = "database1789464955" + request = {"database": database} + + request = firestore_pb2.WriteRequest(**request) + requests = [request] with pytest.raises(CustomException): - client.batch_get_documents(database, documents) + client.write(requests) - def test_begin_transaction(self): + def test_listen(self): # Setup Expected Response - transaction = b"-34" - expected_response = {"transaction": transaction} - expected_response = firestore_pb2.BeginTransactionResponse(**expected_response) + expected_response = {} + expected_response = firestore_pb2.ListenResponse(**expected_response) # Mock the API response - channel = ChannelStub(responses=[expected_response]) + channel = ChannelStub(responses=[iter([expected_response])]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: create_channel.return_value = channel client = firestore_client.FirestoreClient() # Setup Request - database = client.database_root_path("[PROJECT]", "[DATABASE]") + database = "database1789464955" + request = {"database": database} + request = firestore_pb2.ListenRequest(**request) + requests = [request] - response = client.begin_transaction(database) - assert expected_response == response + response = client.listen(requests) + resources = list(response) + assert len(resources) == 1 + assert expected_response == resources[0] assert len(channel.requests) == 1 - expected_request = firestore_pb2.BeginTransactionRequest(database=database) - actual_request = channel.requests[0][1] - assert expected_request == actual_request + actual_requests = channel.requests[0][1] + assert len(actual_requests) == 1 + actual_request = list(actual_requests)[0] + assert request == actual_request - def test_begin_transaction_exception(self): + def test_listen_exception(self): # Mock the API response channel = ChannelStub(responses=[CustomException()]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") @@ -372,15 +346,25 @@ def test_begin_transaction_exception(self): client = firestore_client.FirestoreClient() # Setup request - database = client.database_root_path("[PROJECT]", "[DATABASE]") + database = "database1789464955" + request = {"database": database} + + request = firestore_pb2.ListenRequest(**request) + requests = [request] with pytest.raises(CustomException): - client.begin_transaction(database) + client.listen(requests) - def test_commit(self): + def test_list_collection_ids(self): # Setup Expected Response - expected_response = {} - expected_response = firestore_pb2.CommitResponse(**expected_response) + next_page_token = "" + collection_ids_element = "collectionIdsElement1368994900" + collection_ids = [collection_ids_element] + expected_response = { + "next_page_token": next_page_token, + "collection_ids": collection_ids, + } + expected_response = firestore_pb2.ListCollectionIdsResponse(**expected_response) # Mock the API response channel = ChannelStub(responses=[expected_response]) @@ -390,19 +374,20 @@ def test_commit(self): client = firestore_client.FirestoreClient() # Setup Request - database = client.database_root_path("[PROJECT]", "[DATABASE]") - writes = [] + parent = "parent-995424086" - response = client.commit(database, writes) - assert expected_response == response + paged_list_response = client.list_collection_ids(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.collection_ids[0] == resources[0] assert len(channel.requests) == 1 - expected_request = firestore_pb2.CommitRequest(database=database, writes=writes) + expected_request = firestore_pb2.ListCollectionIdsRequest(parent=parent) actual_request = channel.requests[0][1] assert expected_request == actual_request - def test_commit_exception(self): - # Mock the API response + def test_list_collection_ids_exception(self): channel = ChannelStub(responses=[CustomException()]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: @@ -410,33 +395,37 @@ def test_commit_exception(self): client = firestore_client.FirestoreClient() # Setup request - database = client.database_root_path("[PROJECT]", "[DATABASE]") - writes = [] + parent = "parent-995424086" + paged_list_response = client.list_collection_ids(parent) with pytest.raises(CustomException): - client.commit(database, writes) + list(paged_list_response) - def test_rollback(self): - channel = ChannelStub() + def test_get_document(self): + # Setup Expected Response + name_2 = "name2-1052831874" + expected_response = {"name": name_2} + expected_response = document_pb2.Document(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: create_channel.return_value = channel client = firestore_client.FirestoreClient() # Setup Request - database = client.database_root_path("[PROJECT]", "[DATABASE]") - transaction = b"-34" + name = "name3373707" - client.rollback(database, transaction) + response = client.get_document(name) + assert expected_response == response assert len(channel.requests) == 1 - expected_request = firestore_pb2.RollbackRequest( - database=database, transaction=transaction - ) + expected_request = firestore_pb2.GetDocumentRequest(name=name) actual_request = channel.requests[0][1] assert expected_request == actual_request - def test_rollback_exception(self): + def test_get_document_exception(self): # Mock the API response channel = ChannelStub(responses=[CustomException()]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") @@ -445,46 +434,44 @@ def test_rollback_exception(self): client = firestore_client.FirestoreClient() # Setup request - database = client.database_root_path("[PROJECT]", "[DATABASE]") - transaction = b"-34" + name = "name3373707" with pytest.raises(CustomException): - client.rollback(database, transaction) + client.get_document(name) - def test_run_query(self): + def test_list_documents(self): # Setup Expected Response - transaction = b"-34" - skipped_results = 880286183 - expected_response = { - "transaction": transaction, - "skipped_results": skipped_results, - } - expected_response = firestore_pb2.RunQueryResponse(**expected_response) + next_page_token = "" + documents_element = {} + documents = [documents_element] + expected_response = {"next_page_token": next_page_token, "documents": documents} + expected_response = firestore_pb2.ListDocumentsResponse(**expected_response) # Mock the API response - channel = ChannelStub(responses=[iter([expected_response])]) + channel = ChannelStub(responses=[expected_response]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: create_channel.return_value = channel client = firestore_client.FirestoreClient() # Setup Request - parent = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + parent = "parent-995424086" + collection_id = "collectionId-821242276" - response = client.run_query(parent) - resources = list(response) + paged_list_response = client.list_documents(parent, collection_id) + resources = list(paged_list_response) assert len(resources) == 1 - assert expected_response == resources[0] + + assert expected_response.documents[0] == resources[0] assert len(channel.requests) == 1 - expected_request = firestore_pb2.RunQueryRequest(parent=parent) + expected_request = firestore_pb2.ListDocumentsRequest( + parent=parent, collection_id=collection_id + ) actual_request = channel.requests[0][1] assert expected_request == actual_request - def test_run_query_exception(self): - # Mock the API response + def test_list_documents_exception(self): channel = ChannelStub(responses=[CustomException()]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: @@ -492,45 +479,45 @@ def test_run_query_exception(self): client = firestore_client.FirestoreClient() # Setup request - parent = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + parent = "parent-995424086" + collection_id = "collectionId-821242276" + paged_list_response = client.list_documents(parent, collection_id) with pytest.raises(CustomException): - client.run_query(parent) + list(paged_list_response) - def test_write(self): + def test_create_document(self): # Setup Expected Response - stream_id = "streamId-315624902" - stream_token = b"122" - expected_response = {"stream_id": stream_id, "stream_token": stream_token} - expected_response = firestore_pb2.WriteResponse(**expected_response) + name = "name3373707" + expected_response = {"name": name} + expected_response = document_pb2.Document(**expected_response) # Mock the API response - channel = ChannelStub(responses=[iter([expected_response])]) + channel = ChannelStub(responses=[expected_response]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: create_channel.return_value = channel client = firestore_client.FirestoreClient() # Setup Request - database = client.database_root_path("[PROJECT]", "[DATABASE]") - request = {"database": database} - request = firestore_pb2.WriteRequest(**request) - requests = [request] + parent = "parent-995424086" + collection_id = "collectionId-821242276" + document = {} - response = client.write(requests) - resources = list(response) - assert len(resources) == 1 - assert expected_response == resources[0] + response = client.create_document(parent, collection_id, "documentid", document) + assert expected_response == response assert len(channel.requests) == 1 - actual_requests = channel.requests[0][1] - assert len(actual_requests) == 1 - actual_request = list(actual_requests)[0] - assert request == actual_request + expected_request = firestore_pb2.CreateDocumentRequest( + parent=parent, + collection_id=collection_id, + document_id="documentid", + document=document, + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request - def test_write_exception(self): + def test_create_document_exception(self): # Mock the API response channel = ChannelStub(responses=[CustomException()]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") @@ -539,45 +526,38 @@ def test_write_exception(self): client = firestore_client.FirestoreClient() # Setup request - database = client.database_root_path("[PROJECT]", "[DATABASE]") - request = {"database": database} - - request = firestore_pb2.WriteRequest(**request) - requests = [request] + parent = "parent-995424086" + collection_id = "collectionId-821242276" + document = {} with pytest.raises(CustomException): - client.write(requests) + client.create_document(parent, collection_id, "documentid", document) - def test_listen(self): + def test_update_document(self): # Setup Expected Response - expected_response = {} - expected_response = firestore_pb2.ListenResponse(**expected_response) + name = "name3373707" + expected_response = {"name": name} + expected_response = document_pb2.Document(**expected_response) # Mock the API response - channel = ChannelStub(responses=[iter([expected_response])]) + channel = ChannelStub(responses=[expected_response]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: create_channel.return_value = channel client = firestore_client.FirestoreClient() # Setup Request - database = client.database_root_path("[PROJECT]", "[DATABASE]") - request = {"database": database} - request = firestore_pb2.ListenRequest(**request) - requests = [request] + document = {} - response = client.listen(requests) - resources = list(response) - assert len(resources) == 1 - assert expected_response == resources[0] + response = client.update_document(document) + assert expected_response == response assert len(channel.requests) == 1 - actual_requests = channel.requests[0][1] - assert len(actual_requests) == 1 - actual_request = list(actual_requests)[0] - assert request == actual_request + expected_request = firestore_pb2.UpdateDocumentRequest(document=document) + actual_request = channel.requests[0][1] + assert expected_request == actual_request - def test_listen_exception(self): + def test_update_document_exception(self): # Mock the API response channel = ChannelStub(responses=[CustomException()]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") @@ -586,25 +566,15 @@ def test_listen_exception(self): client = firestore_client.FirestoreClient() # Setup request - database = client.database_root_path("[PROJECT]", "[DATABASE]") - request = {"database": database} - - request = firestore_pb2.ListenRequest(**request) - requests = [request] + document = {} with pytest.raises(CustomException): - client.listen(requests) + client.update_document(document) - def test_list_collection_ids(self): + def test_commit(self): # Setup Expected Response - next_page_token = "" - collection_ids_element = "collectionIdsElement1368994900" - collection_ids = [collection_ids_element] - expected_response = { - "next_page_token": next_page_token, - "collection_ids": collection_ids, - } - expected_response = firestore_pb2.ListCollectionIdsResponse(**expected_response) + expected_response = {} + expected_response = firestore_pb2.CommitResponse(**expected_response) # Mock the API response channel = ChannelStub(responses=[expected_response]) @@ -614,22 +584,18 @@ def test_list_collection_ids(self): client = firestore_client.FirestoreClient() # Setup Request - parent = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + database = "database1789464955" - paged_list_response = client.list_collection_ids(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.collection_ids[0] == resources[0] + response = client.commit(database) + assert expected_response == response assert len(channel.requests) == 1 - expected_request = firestore_pb2.ListCollectionIdsRequest(parent=parent) + expected_request = firestore_pb2.CommitRequest(database=database) actual_request = channel.requests[0][1] assert expected_request == actual_request - def test_list_collection_ids_exception(self): + def test_commit_exception(self): + # Mock the API response channel = ChannelStub(responses=[CustomException()]) patch = mock.patch("google.api_core.grpc_helpers.create_channel") with patch as create_channel: @@ -637,10 +603,7 @@ def test_list_collection_ids_exception(self): client = firestore_client.FirestoreClient() # Setup request - parent = client.any_path_path( - "[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]" - ) + database = "database1789464955" - paged_list_response = client.list_collection_ids(parent) with pytest.raises(CustomException): - list(paged_list_response) + client.commit(database)