@@ -134,8 +134,8 @@ def get(self, etag=False):
134
134
135
135
Returns:
136
136
object: If etag is False returns the decoded JSON value of the current database location.
137
- If etag is True, returns a 2-tuple consisting of the decoded JSON value and the Etag
138
- associated with the current database location.
137
+ If etag is True, returns a 2-tuple consisting of the decoded JSON value and the Etag
138
+ associated with the current database location.
139
139
140
140
Raises:
141
141
ApiCallError: If an error occurs while communicating with the remote database server.
@@ -147,7 +147,7 @@ def get(self, etag=False):
147
147
else :
148
148
return self ._client .body ('get' , self ._add_suffix ())
149
149
150
- def get_if_changed (self , etag ):
150
+ def _get_if_changed (self , etag ):
151
151
"""Gets data in this location only if the specified ETag does not match.
152
152
153
153
Args:
@@ -193,17 +193,17 @@ def set(self, value):
193
193
def set_if_unchanged (self , expected_etag , value ):
194
194
"""Conditonally sets the data at this location to the given value.
195
195
196
- Sets the data at this location to the given value, only if expected_etag is same as the
196
+ Sets the data at this location to the given value only if `` expected_etag`` is same as the
197
197
ETag value in the database.
198
198
199
199
Args:
200
200
expected_etag: Value of ETag we want to check.
201
201
value: JSON-serializable value to be set at this location.
202
202
203
203
Returns:
204
- object : A 3-tuple consisting of a boolean, a decoded JSON value and an ETag. The boolean
205
- indicates whether the set operation was successful or not. The decoded JSON and the
206
- ETag corresponds to the latest value in this database location.
204
+ tuple : A 3-tuple consisting of a boolean, a decoded JSON value and an ETag. The boolean
205
+ indicates whether the set operation was successful or not. The decoded JSON and the
206
+ ETag corresponds to the latest value in this database location.
207
207
208
208
Raises:
209
209
ValueError: If the value is None, or if expected_etag is not a string.
@@ -291,18 +291,18 @@ def transaction(self, transaction_update):
291
291
returning a value.
292
292
293
293
Args:
294
- transaction_update: A function which will be passed the current data stored at this
295
- location. The function should return the new value it would like written. If
296
- an exception is raised, the transaction will be aborted, and the data at this
297
- location will not be modified. The exceptions raised by this function are
298
- propagated to the caller of the transaction method.
294
+ transaction_update: A function which will be passed the current data stored at this
295
+ location. The function should return the new value it would like written. If
296
+ an exception is raised, the transaction will be aborted, and the data at this
297
+ location will not be modified. The exceptions raised by this function are
298
+ propagated to the caller of the transaction method.
299
299
300
300
Returns:
301
- object: New value of the current database Reference (only if the transaction commits).
301
+ object: New value of the current database Reference (only if the transaction commits).
302
302
303
303
Raises:
304
- TransactionError: If the transaction aborts after exhausting all retry attempts.
305
- ValueError: If transaction_update is not a function.
304
+ TransactionError: If the transaction aborts after exhausting all retry attempts.
305
+ ValueError: If transaction_update is not a function.
306
306
"""
307
307
if not callable (transaction_update ):
308
308
raise ValueError ('transaction_update must be a function.' )
0 commit comments