@@ -198,24 +198,6 @@ def run_query(self, project, request_pb):
198198 self .connection .api_base_url ,
199199 request_pb , _datastore_pb2 .RunQueryResponse )
200200
201- def begin_transaction (self , project , request_pb ):
202- """Perform a ``beginTransaction`` request.
203-
204- :type project: str
205- :param project: The project to connect to. This is
206- usually your project name in the cloud console.
207-
208- :type request_pb:
209- :class:`.datastore_pb2.BeginTransactionRequest`
210- :param request_pb: The request protobuf object.
211-
212- :rtype: :class:`.datastore_pb2.BeginTransactionResponse`
213- :returns: The returned protobuf response object.
214- """
215- return _rpc (self .connection .http , project , 'beginTransaction' ,
216- self .connection .api_base_url ,
217- request_pb , _datastore_pb2 .BeginTransactionResponse )
218-
219201
220202class Connection (connection_module .Connection ):
221203 """A connection to the Google Cloud Datastore via the Protobuf API.
@@ -335,20 +317,6 @@ def run_query(self, project, query_pb, namespace=None,
335317 request .query .CopyFrom (query_pb )
336318 return self ._datastore_api .run_query (project , request )
337319
338- def begin_transaction (self , project ):
339- """Begin a transaction.
340-
341- Maps the ``DatastoreService.BeginTransaction`` protobuf RPC.
342-
343- :type project: str
344- :param project: The project to which the transaction applies.
345-
346- :rtype: :class:`.datastore_pb2.BeginTransactionResponse`
347- :returns: The serialized transaction that was begun.
348- """
349- request = _datastore_pb2 .BeginTransactionRequest ()
350- return self ._datastore_api .begin_transaction (project , request )
351-
352320
353321class HTTPDatastoreAPI (object ):
354322 """An API object that sends proto-over-HTTP requests.
@@ -362,6 +330,21 @@ class HTTPDatastoreAPI(object):
362330 def __init__ (self , client ):
363331 self .client = client
364332
333+ def begin_transaction (self , project ):
334+ """Perform a ``beginTransaction`` request.
335+
336+ :type project: str
337+ :param project: The project to connect to. This is
338+ usually your project name in the cloud console.
339+
340+ :rtype: :class:`.datastore_pb2.BeginTransactionResponse`
341+ :returns: The returned protobuf response object.
342+ """
343+ request_pb = _datastore_pb2 .BeginTransactionRequest ()
344+ return _rpc (self .client ._http , project , 'beginTransaction' ,
345+ self .client ._base_url ,
346+ request_pb , _datastore_pb2 .BeginTransactionResponse )
347+
365348 def commit (self , project , mode , mutations , transaction = None ):
366349 """Perform a ``commit`` request.
367350
0 commit comments