Skip to content

Commit 92752ad

Browse files
committed
Firestore: replace gax and regenerate gapic
1 parent ebaa65e commit 92752ad

13 files changed

Lines changed: 1851 additions & 773 deletions

File tree

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,31 @@
1-
# Copyright 2017 Google LLC All rights reserved.
1+
# Copyright 2018 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
55
# You may obtain a copy of the License at
66
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
7+
# https://www.apache.org/licenses/LICENSE-2.0
88
#
99
# Unless required by applicable law or agreed to in writing, software
1010
# distributed under the License is distributed on an "AS IS" BASIS,
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Python idiomatic client for Google Cloud Firestore."""
16-
17-
from pkg_resources import get_distribution
18-
__version__ = get_distribution('google-cloud-firestore').version
15+
from __future__ import absolute_import
1916

2017
from google.cloud.firestore_v1beta1 import types
21-
from google.cloud.firestore_v1beta1._helpers import GeoPoint
22-
from google.cloud.firestore_v1beta1._helpers import ReadAfterWriteError
23-
from google.cloud.firestore_v1beta1.batch import WriteBatch
24-
from google.cloud.firestore_v1beta1.client import Client
25-
from google.cloud.firestore_v1beta1.client import CreateIfMissingOption
26-
from google.cloud.firestore_v1beta1.client import ExistsOption
27-
from google.cloud.firestore_v1beta1.client import LastUpdateOption
28-
from google.cloud.firestore_v1beta1.client import WriteOption
29-
from google.cloud.firestore_v1beta1.collection import CollectionReference
30-
from google.cloud.firestore_v1beta1.constants import DELETE_FIELD
31-
from google.cloud.firestore_v1beta1.constants import SERVER_TIMESTAMP
32-
from google.cloud.firestore_v1beta1.document import DocumentReference
33-
from google.cloud.firestore_v1beta1.document import DocumentSnapshot
3418
from google.cloud.firestore_v1beta1.gapic import enums
35-
from google.cloud.firestore_v1beta1.gapic import firestore_admin_client
36-
from google.cloud.firestore_v1beta1.query import Query
37-
from google.cloud.firestore_v1beta1.transaction import Transaction
38-
from google.cloud.firestore_v1beta1.transaction import transactional
19+
from google.cloud.firestore_v1beta1.gapic import firestore_client
3920

4021

41-
AdminClient = firestore_admin_client.FirestoreAdminClient
22+
class FirestoreClient(firestore_client.FirestoreClient):
23+
__doc__ = firestore_client.FirestoreClient.__doc__
24+
enums = enums
4225

4326

44-
__all__ = [
45-
'__version__',
46-
'AdminClient',
47-
'Client',
48-
'CollectionReference',
49-
'CreateIfMissingOption',
50-
'DELETE_FIELD',
51-
'DocumentReference',
52-
'DocumentSnapshot',
27+
__all__ = (
5328
'enums',
54-
'ExistsOption',
55-
'GeoPoint',
56-
'LastUpdateOption',
57-
'Query',
58-
'ReadAfterWriteError',
59-
'SERVER_TIMESTAMP',
60-
'Transaction',
61-
'transactional',
6229
'types',
63-
'WriteBatch',
64-
'WriteOption',
65-
]
30+
'FirestoreClient',
31+
)

firestore/google/cloud/firestore_v1beta1/gapic/enums.py

Lines changed: 17 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Copyright 2017, Google LLC All rights reserved.
1+
# Copyright 2018 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
55
# You may obtain a copy of the License at
66
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
7+
# https://www.apache.org/licenses/LICENSE-2.0
88
#
99
# Unless required by applicable law or agreed to in writing, software
1010
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,79 +27,6 @@ class NullValue(object):
2727
NULL_VALUE = 0
2828

2929

30-
class IndexField(object):
31-
class Mode(object):
32-
"""
33-
The mode determines how a field is indexed.
34-
35-
Attributes:
36-
MODE_UNSPECIFIED (int): The mode is unspecified.
37-
ASCENDING (int): The field's values are indexed so as to support sequencing in
38-
ascending order and also query by <, >, <=, >=, and =.
39-
DESCENDING (int): The field's values are indexed so as to support sequencing in
40-
descending order and also query by <, >, <=, >=, and =.
41-
"""
42-
MODE_UNSPECIFIED = 0
43-
ASCENDING = 2
44-
DESCENDING = 3
45-
46-
47-
class Index(object):
48-
class State(object):
49-
"""
50-
The state of an index. During index creation, an index will be in the
51-
``CREATING`` state. If the index is created successfully, it will transition
52-
to the ``READY`` state. If the index is not able to be created, it will
53-
transition to the ``ERROR`` state.
54-
55-
Attributes:
56-
STATE_UNSPECIFIED (int): The state is unspecified.
57-
CREATING (int): The index is being created.
58-
There is an active long-running operation for the index.
59-
The index is updated when writing a document.
60-
Some index data may exist.
61-
READY (int): The index is ready to be used.
62-
The index is updated when writing a document.
63-
The index is fully populated from all stored documents it applies to.
64-
ERROR (int): The index was being created, but something went wrong.
65-
There is no active long-running operation for the index,
66-
and the most recently finished long-running operation failed.
67-
The index is not updated when writing a document.
68-
Some index data may exist.
69-
"""
70-
STATE_UNSPECIFIED = 0
71-
CREATING = 3
72-
READY = 2
73-
ERROR = 5
74-
75-
76-
class IndexOperationMetadata(object):
77-
class OperationType(object):
78-
"""
79-
The type of index operation.
80-
81-
Attributes:
82-
OPERATION_TYPE_UNSPECIFIED (int): Unspecified. Never set by server.
83-
CREATING_INDEX (int): The operation is creating the index. Initiated by a ``CreateIndex`` call.
84-
"""
85-
OPERATION_TYPE_UNSPECIFIED = 0
86-
CREATING_INDEX = 1
87-
88-
89-
class DocumentTransform(object):
90-
class FieldTransform(object):
91-
class ServerValue(object):
92-
"""
93-
A value that is calculated by the server.
94-
95-
Attributes:
96-
SERVER_VALUE_UNSPECIFIED (int): Unspecified. This value must not be used.
97-
REQUEST_TIME (int): The time at which the server processed the request.
98-
"""
99-
SERVER_VALUE_UNSPECIFIED = 0
100-
REQUEST_TIME = 1
101-
102-
10330
class StructuredQuery(object):
10431
class Direction(object):
10532
"""
@@ -162,6 +89,21 @@ class Operator(object):
16289
IS_NULL = 3
16390

16491

92+
class DocumentTransform(object):
93+
class FieldTransform(object):
94+
class ServerValue(object):
95+
"""
96+
A value that is calculated by the server.
97+
98+
Attributes:
99+
SERVER_VALUE_UNSPECIFIED (int): Unspecified. This value must not be used.
100+
REQUEST_TIME (int): The time at which the server processed the request, with millisecond
101+
precision.
102+
"""
103+
SERVER_VALUE_UNSPECIFIED = 0
104+
REQUEST_TIME = 1
105+
106+
165107
class TargetChange(object):
166108
class TargetChangeType(object):
167109
"""

0 commit comments

Comments
 (0)