Python 3.10 is now available in preview.

google.appengine.datastore.datastore_stub_util.StubServiceConverter

Converter for v3/v4/v1 request/response protos suitable for use in stubs.

Inherits From: expected_type

Methods

v1_commit_req_to_v3_txn

View source

Converts a v1 CommitRequest to a v3 Transaction.

Args
v1_req a googledatastore.CommitRequest

Returns
a datastore_pb.Transaction()

v1_rollback_req_to_v3_txn

View source

Converts a v1 RollbackRequest to a v3 Transaction.

Args
v1_req a googledatastore.RollbackRequest

Returns
a datastore_pb.Transaction()

v1_run_query_req_to_v3_query

View source

Converts a v1 RunQueryRequest to a v3 Query.

GQL is not supported.

Args
v1_req a googledatastore.RunQueryRequest
new_txn a v1 transaction created ad-hoc for this query, or None.

Returns
a datastore_pb.Query

v1_run_query_resp_to_v3_query_result

View source

Converts a V4 RunQueryResponse to a v3 QueryResult.

Args
v1_resp a googledatastore.QueryResult

Returns
a datastore_pb.QueryResult

v1_to_v3_begin_transaction_req

View source

Converts a v1 BeginTransactionRequest to a v3 BeginTransactionRequest.

Args
app_id app id
v1_req a googledatastore.BeginTransactionRequest

Returns
a datastore_pb.BeginTransactionRequest

v1_to_v3_cursor

View source

Converts a v1 cursor string to a v3 Cursor.

Args
v1_query_handle a string representing a v1 query handle
v3_cursor a datastore_pb.Cursor to populate

v1_to_v3_get_req

View source

Converts a v1 LookupRequest to a v3 GetRequest.

Args
v1_req a googledatastore.LookupRequest
new_txn a v1 transaction created ad-hoc for this lookup, or None.

Returns
a datastore_pb.GetRequest

v1_to_v3_query_result

View source

Converts a v1 QueryResultBatch to a v3 QueryResult.

Args
v1_batch a googledatastore.QueryResultBatch

Returns
a datastore_pb.QueryResult

v1_to_v3_txn

View source

Converts a v1 transaction string to a v3 Transaction.

Args
v1_txn a string representing a v1 transaction
v3_txn a datastore_pb.Transaction() to populate

v3_to_v1_begin_transaction_resp

View source

Converts a v3 Transaction to a v1 BeginTransactionResponse.

Args
v3_resp a datastore_pb.Transaction()

Returns
a googledatastore.BeginTransactionResponse

v3_to_v1_lookup_resp

View source

Converts a v3 GetResponse to a v1 LookupResponse.

Args
v3_resp a datastore_pb.GetResponse
new_txn a v1 transaction created ad-hoc for this lookup, or None.

Returns
a googledatastore.LookupResponse

v3_to_v1_query_result_batch

View source

Converts a v3 QueryResult to a v1 QueryResultBatch.

Args
v3_result a datastore_pb.QueryResult
v1_batch a googledatastore.QueryResultBatch to populate

v3_to_v1_run_query_req

View source

Converts a v3 Query to a v1 RunQueryRequest.

Args
v3_req a datastore_pb.Query

Returns
a googledatastore.RunQueryRequest

v3_to_v1_run_query_resp

View source

Converts a v3 QueryResult to a V4 RunQueryResponse.

Args
v3_resp a datastore_pb.QueryResult
new_txn optional, a transaction that was created when processing the RunQueryRequest.

Returns
a googledatastore.RunQueryResponse

v3_to_v4_begin_transaction_resp

View source

Converts a v3 Transaction to a v4 BeginTransactionResponse.

Args
v3_resp a datastore_pb.Transaction()

Returns
a datastore_v4_pb2.BeginTransactionResponse

v3_to_v4_continue_query_resp

View source

Converts a v3 QueryResult to a v4 ContinueQueryResponse.

Args
v3_resp a datastore_pb.QueryResult

Returns
a datastore_v4_pb2.ContinueQueryResponse

v3_to_v4_lookup_resp

View source

Converts a v3 GetResponse to a v4 LookupResponse.

Args
v3_resp a datastore_pb.GetResponse

Returns
a datastore_v4_pb2.LookupResponse

v3_to_v4_query_result_batch

View source

Converts a v3 QueryResult to a v4 QueryResultBatch.

Args
v3_result a datastore_pb.QueryResult
v4_batch a datastore_v4_pb2.QueryResultBatch to populate

v3_to_v4_run_query_req

View source

Converts a v3 Query to a v4 RunQueryRequest.

Args
v3_req a datastore_pb.Query

Returns
a datastore_v4_pb2.RunQueryRequest

v3_to_v4_run_query_resp

View source

Converts a v3 QueryResult to a V4 RunQueryResponse.

Args
v3_resp a datastore_pb.QueryResult

Returns
a datastore_v4_pb2.RunQueryResponse

v4_commit_req_to_v3_txn

View source

Converts a v4 CommitRequest to a v3 Transaction.

Args
v4_req a datastore_v4_pb2.CommitRequest

Returns
a datastore_pb.Transaction()

v4_rollback_req_to_v3_txn

View source

Converts a v4 RollbackRequest to a v3 Transaction.

Args
v4_req a datastore_v4_pb2.RollbackRequest

Returns
a datastore_pb.Transaction()

v4_run_query_req_to_v3_query

View source

Converts a v4 RunQueryRequest to a v3 Query.

GQL is not supported.

Args
v4_req a datastore_v4_pb2.RunQueryRequest

Returns
a datastore_pb.Query

v4_run_query_resp_to_v3_query_result

View source

Converts a V4 RunQueryResponse to a v3 QueryResult.

Args
v4_resp a datastore_v4_pb2.QueryResult

Returns
a datastore_pb.QueryResult

v4_to_v3_begin_transaction_req

View source

Converts a v4 BeginTransactionRequest to a v3 BeginTransactionRequest.

Args
app_id app id
v4_req a datastore_v4_pb2.BeginTransactionRequest

Returns
a datastore_pb.BeginTransactionRequest

v4_to_v3_cursor

View source

Converts a v4 cursor string to a v3 Cursor.

Args
v4_query_handle a string representing a v4 query handle
v3_cursor a datastore_pb.Cursor to populate

v4_to_v3_get_req

View source

Converts a v4 LookupRequest to a v3 GetRequest.

Args
v4_req a datastore_v4_pb2.LookupRequest

Returns
a datastore_pb.GetRequest

v4_to_v3_next_req

View source

Converts a v4 ContinueQueryRequest to a v3 NextRequest.

Args
v4_req a datastore_v4_pb2.ContinueQueryRequest

Returns
a datastore_pb.NextRequest

v4_to_v3_query_result

View source

Converts a v4 QueryResultBatch to a v3 QueryResult.

Args
v4_batch a datastore_v4_pb2.QueryResultBatch

Returns
a datastore_pb.QueryResult

v4_to_v3_txn

View source

Converts a v4 transaction string to a v3 Transaction.

Args
v4_txn a string representing a v4 transaction
v3_txn a datastore_pb.Transaction() to populate