3 # Copyright 2007 Google Inc.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
20 from google
.net
.proto
import ProtocolBuffer
23 import dummy_thread
as thread
25 from google3
.net
.proto
import _net_proto___parse__python
27 _net_proto___parse__python
= None
30 __import__('google.net.rpc.python.rpc_internals_lite')
31 __import__('google.net.rpc.python.pywraprpc_lite')
32 rpc_internals
= sys
.modules
.get('google.net.rpc.python.rpc_internals_lite')
33 pywraprpc
= sys
.modules
.get('google.net.rpc.python.pywraprpc_lite')
34 _client_stub_base_class
= rpc_internals
.StubbyRPCBaseStub
36 _client_stub_base_class
= object
38 __import__('google.net.rpc.python.rpcserver')
39 rpcserver
= sys
.modules
.get('google.net.rpc.python.rpcserver')
40 _server_stub_base_class
= rpcserver
.BaseRpcServer
42 _server_stub_base_class
= object
44 __pychecker__
= """maxreturns=0 maxbranches=0 no-callinit
45 unusednames=printElemNumber,debug_strs no-special"""
47 if hasattr(ProtocolBuffer
, 'ExtendableProtocolMessage'):
48 _extension_runtime
= True
49 _ExtendableProtocolMessage
= ProtocolBuffer
.ExtendableProtocolMessage
51 _extension_runtime
= False
52 _ExtendableProtocolMessage
= ProtocolBuffer
.ProtocolMessage
54 from google
.appengine
.datastore
.entity_v4_pb
import *
55 import google
.appengine
.datastore
.entity_v4_pb
56 class Error(ProtocolBuffer
.ProtocolMessage
):
60 CONCURRENT_TRANSACTION
= 2
66 COMMITTED_BUT_STILL_APPLYING
= 8
67 CAPABILITY_DISABLED
= 9
68 TRY_ALTERNATE_BACKEND
= 10
69 SAFE_TIME_TOO_OLD
= 11
73 2: "CONCURRENT_TRANSACTION",
77 6: "PERMISSION_DENIED",
79 8: "COMMITTED_BUT_STILL_APPLYING",
80 9: "CAPABILITY_DISABLED",
81 10: "TRY_ALTERNATE_BACKEND",
82 11: "SAFE_TIME_TOO_OLD",
85 def ErrorCode_Name(cls
, x
): return cls
._ErrorCode
_NAMES
.get(x
, "")
86 ErrorCode_Name
= classmethod(ErrorCode_Name
)
89 def __init__(self
, contents
=None):
91 if contents
is not None: self
.MergeFromString(contents
)
94 def MergeFrom(self
, x
):
97 if _net_proto___parse__python
is not None:
98 def _CMergeFromString(self
, s
):
99 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.Error', s
)
101 if _net_proto___parse__python
is not None:
103 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.Error')
105 if _net_proto___parse__python
is not None:
106 def _CEncodePartial(self
):
107 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.Error')
109 if _net_proto___parse__python
is not None:
110 def _CToASCII(self
, output_format
):
111 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.Error', output_format
)
114 if _net_proto___parse__python
is not None:
115 def ParseASCII(self
, s
):
116 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.Error', s
)
119 if _net_proto___parse__python
is not None:
120 def ParseASCIIIgnoreUnknown(self
, s
):
121 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.Error', s
)
125 if x
is self
: return 1
128 def IsInitialized(self
, debug_strs
=None):
136 def ByteSizePartial(self
):
143 def OutputUnchecked(self
, out
):
146 def OutputPartial(self
, out
):
149 def TryMerge(self
, d
):
154 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
158 def __str__(self
, prefix
="", printElemNumber
=0):
163 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
164 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
167 _TEXT
= _BuildTagLookupTable({
171 _TYPES
= _BuildTagLookupTable({
172 0: ProtocolBuffer
.Encoder
.NUMERIC
,
173 }, 0, ProtocolBuffer
.Encoder
.MAX_TYPE
)
177 _STYLE_CONTENT_TYPE
= """"""
178 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.Error'
179 _SERIALIZED_DESCRIPTOR
= array
.array('B')
180 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9yc3oJRXJyb3JDb2RliwGSAQtCQURfUkVRVUVTVJgBAYwBiwGSARZDT05DVVJSRU5UX1RSQU5TQUNUSU9OmAECjAGLAZIBDklOVEVSTkFMX0VSUk9SmAEDjAGLAZIBCk5FRURfSU5ERViYAQSMAYsBkgEHVElNRU9VVJgBBYwBiwGSARFQRVJNSVNTSU9OX0RFTklFRJgBBowBiwGSAQ5CSUdUQUJMRV9FUlJPUpgBB4wBiwGSARxDT01NSVRURURfQlVUX1NUSUxMX0FQUExZSU5HmAEIjAGLAZIBE0NBUEFCSUxJVFlfRElTQUJMRUSYAQmMAYsBkgEVVFJZX0FMVEVSTkFURV9CQUNLRU5EmAEKjAGLAZIBEVNBRkVfVElNRV9UT09fT0xEmAELjAF0ugG4MgonYXBwaG9zdGluZy9kYXRhc3RvcmUvZGF0YXN0b3JlX3Y0LnByb3RvEhdhcHBob3N0aW5nLmRhdGFzdG9yZS52NBokYXBwaG9zdGluZy9kYXRhc3RvcmUvZW50aXR5X3Y0LnByb3RvIosCCgVFcnJvciKBAgoJRXJyb3JDb2RlEg8KC0JBRF9SRVFVRVNUEAESGgoWQ09OQ1VSUkVOVF9UUkFOU0FDVElPThACEhIKDklOVEVSTkFMX0VSUk9SEAMSDgoKTkVFRF9JTkRFWBAEEgsKB1RJTUVPVVQQBRIVChFQRVJNSVNTSU9OX0RFTklFRBAGEhIKDkJJR1RBQkxFX0VSUk9SEAcSIAocQ09NTUlUVEVEX0JVVF9TVElMTF9BUFBMWUlORxAIEhcKE0NBUEFCSUxJVFlfRElTQUJMRUQQCRIZChVUUllfQUxURVJOQVRFX0JBQ0tFTkQQChIVChFTQUZFX1RJTUVfVE9PX09MRBALIoYBCgxFbnRpdHlSZXN1bHQSLwoGZW50aXR5GAEgAigLMh8uYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5Eg8KB3ZlcnNpb24YAiABKAMiNAoKUmVzdWx0VHlwZRIICgRGVUxMEAESDgoKUFJPSkVDVElPThACEgwKCEtFWV9PTkxZEAMi8QIKBVF1ZXJ5Ej8KCnByb2plY3Rpb24YAiADKAsyKy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eUV4cHJlc3Npb24SNQoEa2luZBgDIAMoCzInLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktpbmRFeHByZXNzaW9uEi8KBmZpbHRlchgEIAEoCzIfLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkZpbHRlchI1CgVvcmRlchgFIAMoCzImLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5T3JkZXISPAoIZ3JvdXBfYnkYBiADKAsyKi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eVJlZmVyZW5jZRIUCgxzdGFydF9jdXJzb3IYByABKAwSEgoKZW5kX2N1cnNvchgIIAEoDBIRCgZvZmZzZXQYCiABKAU6ATASDQoFbGltaXQYCyABKAUiHgoOS2luZEV4cHJlc3Npb24SDAoEbmFtZRgBIAIoCSIhChFQcm9wZXJ0eVJlZmVyZW5jZRIMCgRuYW1lGAIgAigJItMBChJQcm9wZXJ0eUV4cHJlc3Npb24SPAoIcHJvcGVydHkYASACKAsyKi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eVJlZmVyZW5jZRJdChRhZ2dyZWdhdGlvbl9mdW5jdGlvbhgCIAEoDjI/LmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5RXhwcmVzc2lvbi5BZ2dyZWdhdGlvbkZ1bmN0aW9uIiAKE0FnZ3JlZ2F0aW9uRnVuY3Rpb24SCQoFRklSU1QQASLJAQoNUHJvcGVydHlPcmRlchI8Cghwcm9wZXJ0eRgBIAIoCzIqLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5UmVmZXJlbmNlEk4KCWRpcmVjdGlvbhgCIAEoDjIwLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5T3JkZXIuRGlyZWN0aW9uOglBU0NFTkRJTkciKgoJRGlyZWN0aW9uEg0KCUFTQ0VORElORxABEg4KCkRFU0NFTkRJTkcQAiKOAQoGRmlsdGVyEkIKEGNvbXBvc2l0ZV9maWx0ZXIYASABKAsyKC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Db21wb3NpdGVGaWx0ZXISQAoPcHJvcGVydHlfZmlsdGVyGAIgASgLMicuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlGaWx0ZXIinAEKD0NvbXBvc2l0ZUZpbHRlchJDCghvcGVyYXRvchgBIAIoDjIxLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbXBvc2l0ZUZpbHRlci5PcGVyYXRvchIvCgZmaWx0ZXIYAiADKAsyHy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5GaWx0ZXIiEwoIT3BlcmF0b3ISBwoDQU5EEAEivgIKDlByb3BlcnR5RmlsdGVyEjwKCHByb3BlcnR5GAEgAigLMiouYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlSZWZlcmVuY2USQgoIb3BlcmF0b3IYAiACKA4yMC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eUZpbHRlci5PcGVyYXRvchItCgV2YWx1ZRgDIAIoCzIeLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlZhbHVlInsKCE9wZXJhdG9yEg0KCUxFU1NfVEhBThABEhYKEkxFU1NfVEhBTl9PUl9FUVVBTBACEhAKDEdSRUFURVJfVEhBThADEhkKFUdSRUFURVJfVEhBTl9PUl9FUVVBTBAEEgkKBUVRVUFMEAUSEAoMSEFTX0FOQ0VTVE9SEAsisAEKCEdxbFF1ZXJ5EhQKDHF1ZXJ5X3N0cmluZxgBIAIoCRIcCg1hbGxvd19saXRlcmFsGAIgASgIOgVmYWxzZRI2CghuYW1lX2FyZxgDIAMoCzIkLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkdxbFF1ZXJ5QXJnEjgKCm51bWJlcl9hcmcYBCADKAsyJC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5HcWxRdWVyeUFyZyJaCgtHcWxRdWVyeUFyZxIMCgRuYW1lGAEgASgJEi0KBXZhbHVlGAIgASgLMh4uYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuVmFsdWUSDgoGY3Vyc29yGAMgASgMIvcCChBRdWVyeVJlc3VsdEJhdGNoEkwKEmVudGl0eV9yZXN1bHRfdHlwZRgBIAIoDjIwLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eVJlc3VsdC5SZXN1bHRUeXBlEjwKDWVudGl0eV9yZXN1bHQYAiADKAsyJS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FbnRpdHlSZXN1bHQSEgoKZW5kX2N1cnNvchgEIAEoDBJPCgxtb3JlX3Jlc3VsdHMYBSACKA4yOS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5RdWVyeVJlc3VsdEJhdGNoLk1vcmVSZXN1bHRzVHlwZRIaCg9za2lwcGVkX3Jlc3VsdHMYBiABKAU6ATAiVgoPTW9yZVJlc3VsdHNUeXBlEhAKDE5PVF9GSU5JU0hFRBABEhwKGE1PUkVfUkVTVUxUU19BRlRFUl9MSU1JVBACEhMKD05PX01PUkVfUkVTVUxUUxADItwBCghNdXRhdGlvbhI3CgJvcBgBIAIoDjIrLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uLk9wZXJhdGlvbhIpCgNrZXkYAiABKAsyHC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LZXkSLwoGZW50aXR5GAMgASgLMh8uYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5IjsKCU9wZXJhdGlvbhIKCgZJTlNFUlQQARIKCgZVUERBVEUQAhIKCgZVUFNFUlQQAxIKCgZERUxFVEUQBCJTCg5NdXRhdGlvblJlc3VsdBIpCgNrZXkYAyABKAsyHC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LZXkSFgoLbmV3X3ZlcnNpb24YBCABKAM6ATAipAIKEkRlcHJlY2F0ZWRNdXRhdGlvbhIvCgZ1cHNlcnQYASADKAsyHy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FbnRpdHkSLwoGdXBkYXRlGAIgAygLMh8uYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5Ei8KBmluc2VydBgDIAMoCzIfLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eRI3Cg5pbnNlcnRfYXV0b19pZBgEIAMoCzIfLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eRIsCgZkZWxldGUYBSADKAsyHC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LZXkSFAoFZm9yY2UYBiABKAg6BWZhbHNlIusBChhEZXByZWNhdGVkTXV0YXRpb25SZXN1bHQSFQoNaW5kZXhfdXBkYXRlcxgBIAIoBRI4ChJpbnNlcnRfYXV0b19pZF9rZXkYAiADKAsyHC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LZXkSFgoOdXBzZXJ0X3ZlcnNpb24YAyADKAMSFgoOdXBkYXRlX3ZlcnNpb24YBCADKAMSFgoOaW5zZXJ0X3ZlcnNpb24YBSADKAMSHgoWaW5zZXJ0X2F1dG9faWRfdmVyc2lvbhgGIAMoAxIWCg5kZWxldGVfdmVyc2lvbhgHIAMoAyK1AQoLUmVhZE9wdGlvbnMSVwoQcmVhZF9jb25zaXN0ZW5jeRgBIAEoDjI0LmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJlYWRPcHRpb25zLlJlYWRDb25zaXN0ZW5jeToHREVGQVVMVBITCgt0cmFuc2FjdGlvbhgCIAEoDCI4Cg9SZWFkQ29uc2lzdGVuY3kSCwoHREVGQVVMVBAAEgoKBlNUUk9ORxABEgwKCEVWRU5UVUFMEAIidgoNTG9va3VwUmVxdWVzdBI6CgxyZWFkX29wdGlvbnMYASABKAsyJC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5SZWFkT3B0aW9ucxIpCgNrZXkYAyADKAsyHC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LZXkirgEKDkxvb2t1cFJlc3BvbnNlEjQKBWZvdW5kGAEgAygLMiUuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5UmVzdWx0EjYKB21pc3NpbmcYAiADKAsyJS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FbnRpdHlSZXN1bHQSLgoIZGVmZXJyZWQYAyADKAsyHC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LZXkiqwIKD1J1blF1ZXJ5UmVxdWVzdBI6CgxyZWFkX29wdGlvbnMYASABKAsyJC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5SZWFkT3B0aW9ucxI6CgxwYXJ0aXRpb25faWQYAiABKAsyJC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5QYXJ0aXRpb25JZBItCgVxdWVyeRgDIAEoCzIeLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlF1ZXJ5EjQKCWdxbF9xdWVyeRgHIAEoCzIhLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkdxbFF1ZXJ5Eh0KFW1pbl9zYWZlX3RpbWVfc2Vjb25kcxgEIAEoAxIcChRzdWdnZXN0ZWRfYmF0Y2hfc2l6ZRgFIAEoBSJiChBSdW5RdWVyeVJlc3BvbnNlEjgKBWJhdGNoGAEgAigLMikuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUXVlcnlSZXN1bHRCYXRjaBIUCgxxdWVyeV9oYW5kbGUYAiABKAwiLAoUQ29udGludWVRdWVyeVJlcXVlc3QSFAoMcXVlcnlfaGFuZGxlGAEgAigMIlEKFUNvbnRpbnVlUXVlcnlSZXNwb25zZRI4CgViYXRjaBgBIAIoCzIpLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlF1ZXJ5UmVzdWx0QmF0Y2giUwoXQmVnaW5UcmFuc2FjdGlvblJlcXVlc3QSGgoLY3Jvc3NfZ3JvdXAYASABKAg6BWZhbHNlEhwKDWNyb3NzX3JlcXVlc3QYAiABKAg6BWZhbHNlIi8KGEJlZ2luVHJhbnNhY3Rpb25SZXNwb25zZRITCgt0cmFuc2FjdGlvbhgBIAIoDCImCg9Sb2xsYmFja1JlcXVlc3QSEwoLdHJhbnNhY3Rpb24YASACKAwiEgoQUm9sbGJhY2tSZXNwb25zZSLAAgoNQ29tbWl0UmVxdWVzdBITCgt0cmFuc2FjdGlvbhgBIAEoDBIzCghtdXRhdGlvbhgFIAMoCzIhLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uEkgKE2RlcHJlY2F0ZWRfbXV0YXRpb24YAiABKAsyKy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5EZXByZWNhdGVkTXV0YXRpb24SSAoEbW9kZRgEIAEoDjIrLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbW1pdFJlcXVlc3QuTW9kZToNVFJBTlNBQ1RJT05BTBIfChBpZ25vcmVfcmVhZF9vbmx5GAYgASgIOgVmYWxzZSIwCgRNb2RlEhEKDVRSQU5TQUNUSU9OQUwQARIVChFOT05fVFJBTlNBQ1RJT05BTBACIsABCg5Db21taXRSZXNwb25zZRJACg9tdXRhdGlvbl9yZXN1bHQYAyADKAsyJy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5NdXRhdGlvblJlc3VsdBJVChpkZXByZWNhdGVkX211dGF0aW9uX3Jlc3VsdBgBIAEoCzIxLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkRlcHJlY2F0ZWRNdXRhdGlvblJlc3VsdBIVCg1pbmRleF91cGRhdGVzGAQgASgFInMKEkFsbG9jYXRlSWRzUmVxdWVzdBIuCghhbGxvY2F0ZRgBIAMoCzIcLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleRItCgdyZXNlcnZlGAIgAygLMhwuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuS2V5IkYKE0FsbG9jYXRlSWRzUmVzcG9uc2USLwoJYWxsb2NhdGVkGAEgAygLMhwuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuS2V5IlgKDFdyaXRlUmVxdWVzdBJIChNkZXByZWNhdGVkX211dGF0aW9uGAEgAigLMisuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRGVwcmVjYXRlZE11dGF0aW9uMqIHChJEYXRhc3RvcmVWNFNlcnZpY2USeQoQQmVnaW5UcmFuc2FjdGlvbhIwLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkJlZ2luVHJhbnNhY3Rpb25SZXF1ZXN0GjEuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQmVnaW5UcmFuc2FjdGlvblJlc3BvbnNlIgASYQoIUm9sbGJhY2sSKC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Sb2xsYmFja1JlcXVlc3QaKS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Sb2xsYmFja1Jlc3BvbnNlIgASWwoGQ29tbWl0EiYuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQ29tbWl0UmVxdWVzdBonLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbW1pdFJlc3BvbnNlIgASYQoIUnVuUXVlcnkSKC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5SdW5RdWVyeVJlcXVlc3QaKS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5SdW5RdWVyeVJlc3BvbnNlIgAScAoNQ29udGludWVRdWVyeRItLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbnRpbnVlUXVlcnlSZXF1ZXN0Gi4uYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQ29udGludWVRdWVyeVJlc3BvbnNlIgASWwoGTG9va3VwEiYuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuTG9va3VwUmVxdWVzdBonLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lkxvb2t1cFJlc3BvbnNlIgASagoLQWxsb2NhdGVJZHMSKy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5BbGxvY2F0ZUlkc1JlcXVlc3QaLC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5BbGxvY2F0ZUlkc1Jlc3BvbnNlIgASWAoDR2V0EiYuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuTG9va3VwUmVxdWVzdBonLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lkxvb2t1cFJlc3BvbnNlIgASWQoFV3JpdGUSJS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Xcml0ZVJlcXVlc3QaJy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Db21taXRSZXNwb25zZSIAQiMKH2NvbS5nb29nbGUuYXBwaG9zdGluZy5kYXRhc3RvcmUgAQ=="))
181 if _net_proto___parse__python
is not None:
182 _net_proto___parse__python
.RegisterType(
183 _SERIALIZED_DESCRIPTOR
.tostring())
185 class EntityResult(ProtocolBuffer
.ProtocolMessage
):
192 _ResultType_NAMES
= {
198 def ResultType_Name(cls
, x
): return cls
._ResultType
_NAMES
.get(x
, "")
199 ResultType_Name
= classmethod(ResultType_Name
)
205 def __init__(self
, contents
=None):
206 self
.entity_
= google
.appengine
.datastore
.entity_v4_pb
.Entity()
207 if contents
is not None: self
.MergeFromString(contents
)
209 def entity(self
): return self
.entity_
211 def mutable_entity(self
): self
.has_entity_
= 1; return self
.entity_
213 def clear_entity(self
):self
.has_entity_
= 0; self
.entity_
.Clear()
215 def has_entity(self
): return self
.has_entity_
217 def version(self
): return self
.version_
219 def set_version(self
, x
):
220 self
.has_version_
= 1
223 def clear_version(self
):
224 if self
.has_version_
:
225 self
.has_version_
= 0
228 def has_version(self
): return self
.has_version_
231 def MergeFrom(self
, x
):
233 if (x
.has_entity()): self
.mutable_entity().MergeFrom(x
.entity())
234 if (x
.has_version()): self
.set_version(x
.version())
236 if _net_proto___parse__python
is not None:
237 def _CMergeFromString(self
, s
):
238 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.EntityResult', s
)
240 if _net_proto___parse__python
is not None:
242 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.EntityResult')
244 if _net_proto___parse__python
is not None:
245 def _CEncodePartial(self
):
246 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.EntityResult')
248 if _net_proto___parse__python
is not None:
249 def _CToASCII(self
, output_format
):
250 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.EntityResult', output_format
)
253 if _net_proto___parse__python
is not None:
254 def ParseASCII(self
, s
):
255 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.EntityResult', s
)
258 if _net_proto___parse__python
is not None:
259 def ParseASCIIIgnoreUnknown(self
, s
):
260 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.EntityResult', s
)
264 if x
is self
: return 1
265 if self
.has_entity_
!= x
.has_entity_
: return 0
266 if self
.has_entity_
and self
.entity_
!= x
.entity_
: return 0
267 if self
.has_version_
!= x
.has_version_
: return 0
268 if self
.has_version_
and self
.version_
!= x
.version_
: return 0
271 def IsInitialized(self
, debug_strs
=None):
273 if (not self
.has_entity_
):
275 if debug_strs
is not None:
276 debug_strs
.append('Required field: entity not set.')
277 elif not self
.entity_
.IsInitialized(debug_strs
): initialized
= 0
282 n
+= self
.lengthString(self
.entity_
.ByteSize())
283 if (self
.has_version_
): n
+= 1 + self
.lengthVarInt64(self
.version_
)
286 def ByteSizePartial(self
):
288 if (self
.has_entity_
):
290 n
+= self
.lengthString(self
.entity_
.ByteSizePartial())
291 if (self
.has_version_
): n
+= 1 + self
.lengthVarInt64(self
.version_
)
298 def OutputUnchecked(self
, out
):
300 out
.putVarInt32(self
.entity_
.ByteSize())
301 self
.entity_
.OutputUnchecked(out
)
302 if (self
.has_version_
):
304 out
.putVarInt64(self
.version_
)
306 def OutputPartial(self
, out
):
307 if (self
.has_entity_
):
309 out
.putVarInt32(self
.entity_
.ByteSizePartial())
310 self
.entity_
.OutputPartial(out
)
311 if (self
.has_version_
):
313 out
.putVarInt64(self
.version_
)
315 def TryMerge(self
, d
):
319 length
= d
.getVarInt32()
320 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
322 self
.mutable_entity().TryMerge(tmp
)
325 self
.set_version(d
.getVarInt64())
329 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
333 def __str__(self
, prefix
="", printElemNumber
=0):
336 res
+=prefix
+"entity <\n"
337 res
+=self
.entity_
.__str
__(prefix
+ " ", printElemNumber
)
339 if self
.has_version_
: res
+=prefix
+("version: %s\n" % self
.DebugFormatInt64(self
.version_
))
343 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
344 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
349 _TEXT
= _BuildTagLookupTable({
355 _TYPES
= _BuildTagLookupTable({
356 0: ProtocolBuffer
.Encoder
.NUMERIC
,
357 1: ProtocolBuffer
.Encoder
.STRING
,
358 2: ProtocolBuffer
.Encoder
.NUMERIC
,
359 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
363 _STYLE_CONTENT_TYPE
= """"""
364 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.EntityResult'
365 _SERIALIZED_DESCRIPTOR
= array
.array('B')
366 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eVJlc3VsdBMaBmVudGl0eSABKAIwCzgCSh5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FbnRpdHmjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoHdmVyc2lvbiACKAAwAzgBFHN6ClJlc3VsdFR5cGWLAZIBBEZVTEyYAQGMAYsBkgEKUFJPSkVDVElPTpgBAowBiwGSAQhLRVlfT05MWZgBA4wBdMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
367 if _net_proto___parse__python
is not None:
368 _net_proto___parse__python
.RegisterType(
369 _SERIALIZED_DESCRIPTOR
.tostring())
371 class Query(ProtocolBuffer
.ProtocolMessage
):
374 has_start_cursor_
= 0
383 def __init__(self
, contents
=None):
384 self
.projection_
= []
388 self
.lazy_init_lock_
= thread
.allocate_lock()
389 if contents
is not None: self
.MergeFromString(contents
)
391 def projection_size(self
): return len(self
.projection_
)
392 def projection_list(self
): return self
.projection_
394 def projection(self
, i
):
395 return self
.projection_
[i
]
397 def mutable_projection(self
, i
):
398 return self
.projection_
[i
]
400 def add_projection(self
):
401 x
= PropertyExpression()
402 self
.projection_
.append(x
)
405 def clear_projection(self
):
406 self
.projection_
= []
407 def kind_size(self
): return len(self
.kind_
)
408 def kind_list(self
): return self
.kind_
413 def mutable_kind(self
, i
):
421 def clear_kind(self
):
424 if self
.filter_
is None:
425 self
.lazy_init_lock_
.acquire()
427 if self
.filter_
is None: self
.filter_
= Filter()
429 self
.lazy_init_lock_
.release()
432 def mutable_filter(self
): self
.has_filter_
= 1; return self
.filter()
434 def clear_filter(self
):
437 self
.has_filter_
= 0;
438 if self
.filter_
is not None: self
.filter_
.Clear()
440 def has_filter(self
): return self
.has_filter_
442 def order_size(self
): return len(self
.order_
)
443 def order_list(self
): return self
.order_
446 return self
.order_
[i
]
448 def mutable_order(self
, i
):
449 return self
.order_
[i
]
453 self
.order_
.append(x
)
456 def clear_order(self
):
458 def group_by_size(self
): return len(self
.group_by_
)
459 def group_by_list(self
): return self
.group_by_
461 def group_by(self
, i
):
462 return self
.group_by_
[i
]
464 def mutable_group_by(self
, i
):
465 return self
.group_by_
[i
]
467 def add_group_by(self
):
468 x
= PropertyReference()
469 self
.group_by_
.append(x
)
472 def clear_group_by(self
):
474 def start_cursor(self
): return self
.start_cursor_
476 def set_start_cursor(self
, x
):
477 self
.has_start_cursor_
= 1
478 self
.start_cursor_
= x
480 def clear_start_cursor(self
):
481 if self
.has_start_cursor_
:
482 self
.has_start_cursor_
= 0
483 self
.start_cursor_
= ""
485 def has_start_cursor(self
): return self
.has_start_cursor_
487 def end_cursor(self
): return self
.end_cursor_
489 def set_end_cursor(self
, x
):
490 self
.has_end_cursor_
= 1
493 def clear_end_cursor(self
):
494 if self
.has_end_cursor_
:
495 self
.has_end_cursor_
= 0
496 self
.end_cursor_
= ""
498 def has_end_cursor(self
): return self
.has_end_cursor_
500 def offset(self
): return self
.offset_
502 def set_offset(self
, x
):
506 def clear_offset(self
):
511 def has_offset(self
): return self
.has_offset_
513 def limit(self
): return self
.limit_
515 def set_limit(self
, x
):
519 def clear_limit(self
):
524 def has_limit(self
): return self
.has_limit_
527 def MergeFrom(self
, x
):
529 for i
in xrange(x
.projection_size()): self
.add_projection().CopyFrom(x
.projection(i
))
530 for i
in xrange(x
.kind_size()): self
.add_kind().CopyFrom(x
.kind(i
))
531 if (x
.has_filter()): self
.mutable_filter().MergeFrom(x
.filter())
532 for i
in xrange(x
.order_size()): self
.add_order().CopyFrom(x
.order(i
))
533 for i
in xrange(x
.group_by_size()): self
.add_group_by().CopyFrom(x
.group_by(i
))
534 if (x
.has_start_cursor()): self
.set_start_cursor(x
.start_cursor())
535 if (x
.has_end_cursor()): self
.set_end_cursor(x
.end_cursor())
536 if (x
.has_offset()): self
.set_offset(x
.offset())
537 if (x
.has_limit()): self
.set_limit(x
.limit())
539 if _net_proto___parse__python
is not None:
540 def _CMergeFromString(self
, s
):
541 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.Query', s
)
543 if _net_proto___parse__python
is not None:
545 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.Query')
547 if _net_proto___parse__python
is not None:
548 def _CEncodePartial(self
):
549 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.Query')
551 if _net_proto___parse__python
is not None:
552 def _CToASCII(self
, output_format
):
553 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.Query', output_format
)
556 if _net_proto___parse__python
is not None:
557 def ParseASCII(self
, s
):
558 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.Query', s
)
561 if _net_proto___parse__python
is not None:
562 def ParseASCIIIgnoreUnknown(self
, s
):
563 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.Query', s
)
567 if x
is self
: return 1
568 if len(self
.projection_
) != len(x
.projection_
): return 0
569 for e1
, e2
in zip(self
.projection_
, x
.projection_
):
570 if e1
!= e2
: return 0
571 if len(self
.kind_
) != len(x
.kind_
): return 0
572 for e1
, e2
in zip(self
.kind_
, x
.kind_
):
573 if e1
!= e2
: return 0
574 if self
.has_filter_
!= x
.has_filter_
: return 0
575 if self
.has_filter_
and self
.filter_
!= x
.filter_
: return 0
576 if len(self
.order_
) != len(x
.order_
): return 0
577 for e1
, e2
in zip(self
.order_
, x
.order_
):
578 if e1
!= e2
: return 0
579 if len(self
.group_by_
) != len(x
.group_by_
): return 0
580 for e1
, e2
in zip(self
.group_by_
, x
.group_by_
):
581 if e1
!= e2
: return 0
582 if self
.has_start_cursor_
!= x
.has_start_cursor_
: return 0
583 if self
.has_start_cursor_
and self
.start_cursor_
!= x
.start_cursor_
: return 0
584 if self
.has_end_cursor_
!= x
.has_end_cursor_
: return 0
585 if self
.has_end_cursor_
and self
.end_cursor_
!= x
.end_cursor_
: return 0
586 if self
.has_offset_
!= x
.has_offset_
: return 0
587 if self
.has_offset_
and self
.offset_
!= x
.offset_
: return 0
588 if self
.has_limit_
!= x
.has_limit_
: return 0
589 if self
.has_limit_
and self
.limit_
!= x
.limit_
: return 0
592 def IsInitialized(self
, debug_strs
=None):
594 for p
in self
.projection_
:
595 if not p
.IsInitialized(debug_strs
): initialized
=0
597 if not p
.IsInitialized(debug_strs
): initialized
=0
598 if (self
.has_filter_
and not self
.filter_
.IsInitialized(debug_strs
)): initialized
= 0
599 for p
in self
.order_
:
600 if not p
.IsInitialized(debug_strs
): initialized
=0
601 for p
in self
.group_by_
:
602 if not p
.IsInitialized(debug_strs
): initialized
=0
607 n
+= 1 * len(self
.projection_
)
608 for i
in xrange(len(self
.projection_
)): n
+= self
.lengthString(self
.projection_
[i
].ByteSize())
609 n
+= 1 * len(self
.kind_
)
610 for i
in xrange(len(self
.kind_
)): n
+= self
.lengthString(self
.kind_
[i
].ByteSize())
611 if (self
.has_filter_
): n
+= 1 + self
.lengthString(self
.filter_
.ByteSize())
612 n
+= 1 * len(self
.order_
)
613 for i
in xrange(len(self
.order_
)): n
+= self
.lengthString(self
.order_
[i
].ByteSize())
614 n
+= 1 * len(self
.group_by_
)
615 for i
in xrange(len(self
.group_by_
)): n
+= self
.lengthString(self
.group_by_
[i
].ByteSize())
616 if (self
.has_start_cursor_
): n
+= 1 + self
.lengthString(len(self
.start_cursor_
))
617 if (self
.has_end_cursor_
): n
+= 1 + self
.lengthString(len(self
.end_cursor_
))
618 if (self
.has_offset_
): n
+= 1 + self
.lengthVarInt64(self
.offset_
)
619 if (self
.has_limit_
): n
+= 1 + self
.lengthVarInt64(self
.limit_
)
622 def ByteSizePartial(self
):
624 n
+= 1 * len(self
.projection_
)
625 for i
in xrange(len(self
.projection_
)): n
+= self
.lengthString(self
.projection_
[i
].ByteSizePartial())
626 n
+= 1 * len(self
.kind_
)
627 for i
in xrange(len(self
.kind_
)): n
+= self
.lengthString(self
.kind_
[i
].ByteSizePartial())
628 if (self
.has_filter_
): n
+= 1 + self
.lengthString(self
.filter_
.ByteSizePartial())
629 n
+= 1 * len(self
.order_
)
630 for i
in xrange(len(self
.order_
)): n
+= self
.lengthString(self
.order_
[i
].ByteSizePartial())
631 n
+= 1 * len(self
.group_by_
)
632 for i
in xrange(len(self
.group_by_
)): n
+= self
.lengthString(self
.group_by_
[i
].ByteSizePartial())
633 if (self
.has_start_cursor_
): n
+= 1 + self
.lengthString(len(self
.start_cursor_
))
634 if (self
.has_end_cursor_
): n
+= 1 + self
.lengthString(len(self
.end_cursor_
))
635 if (self
.has_offset_
): n
+= 1 + self
.lengthVarInt64(self
.offset_
)
636 if (self
.has_limit_
): n
+= 1 + self
.lengthVarInt64(self
.limit_
)
640 self
.clear_projection()
644 self
.clear_group_by()
645 self
.clear_start_cursor()
646 self
.clear_end_cursor()
650 def OutputUnchecked(self
, out
):
651 for i
in xrange(len(self
.projection_
)):
653 out
.putVarInt32(self
.projection_
[i
].ByteSize())
654 self
.projection_
[i
].OutputUnchecked(out
)
655 for i
in xrange(len(self
.kind_
)):
657 out
.putVarInt32(self
.kind_
[i
].ByteSize())
658 self
.kind_
[i
].OutputUnchecked(out
)
659 if (self
.has_filter_
):
661 out
.putVarInt32(self
.filter_
.ByteSize())
662 self
.filter_
.OutputUnchecked(out
)
663 for i
in xrange(len(self
.order_
)):
665 out
.putVarInt32(self
.order_
[i
].ByteSize())
666 self
.order_
[i
].OutputUnchecked(out
)
667 for i
in xrange(len(self
.group_by_
)):
669 out
.putVarInt32(self
.group_by_
[i
].ByteSize())
670 self
.group_by_
[i
].OutputUnchecked(out
)
671 if (self
.has_start_cursor_
):
673 out
.putPrefixedString(self
.start_cursor_
)
674 if (self
.has_end_cursor_
):
676 out
.putPrefixedString(self
.end_cursor_
)
677 if (self
.has_offset_
):
679 out
.putVarInt32(self
.offset_
)
680 if (self
.has_limit_
):
682 out
.putVarInt32(self
.limit_
)
684 def OutputPartial(self
, out
):
685 for i
in xrange(len(self
.projection_
)):
687 out
.putVarInt32(self
.projection_
[i
].ByteSizePartial())
688 self
.projection_
[i
].OutputPartial(out
)
689 for i
in xrange(len(self
.kind_
)):
691 out
.putVarInt32(self
.kind_
[i
].ByteSizePartial())
692 self
.kind_
[i
].OutputPartial(out
)
693 if (self
.has_filter_
):
695 out
.putVarInt32(self
.filter_
.ByteSizePartial())
696 self
.filter_
.OutputPartial(out
)
697 for i
in xrange(len(self
.order_
)):
699 out
.putVarInt32(self
.order_
[i
].ByteSizePartial())
700 self
.order_
[i
].OutputPartial(out
)
701 for i
in xrange(len(self
.group_by_
)):
703 out
.putVarInt32(self
.group_by_
[i
].ByteSizePartial())
704 self
.group_by_
[i
].OutputPartial(out
)
705 if (self
.has_start_cursor_
):
707 out
.putPrefixedString(self
.start_cursor_
)
708 if (self
.has_end_cursor_
):
710 out
.putPrefixedString(self
.end_cursor_
)
711 if (self
.has_offset_
):
713 out
.putVarInt32(self
.offset_
)
714 if (self
.has_limit_
):
716 out
.putVarInt32(self
.limit_
)
718 def TryMerge(self
, d
):
722 length
= d
.getVarInt32()
723 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
725 self
.add_projection().TryMerge(tmp
)
728 length
= d
.getVarInt32()
729 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
731 self
.add_kind().TryMerge(tmp
)
734 length
= d
.getVarInt32()
735 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
737 self
.mutable_filter().TryMerge(tmp
)
740 length
= d
.getVarInt32()
741 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
743 self
.add_order().TryMerge(tmp
)
746 length
= d
.getVarInt32()
747 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
749 self
.add_group_by().TryMerge(tmp
)
752 self
.set_start_cursor(d
.getPrefixedString())
755 self
.set_end_cursor(d
.getPrefixedString())
758 self
.set_offset(d
.getVarInt32())
761 self
.set_limit(d
.getVarInt32())
765 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
769 def __str__(self
, prefix
="", printElemNumber
=0):
772 for e
in self
.projection_
:
774 if printElemNumber
: elm
="(%d)" % cnt
775 res
+=prefix
+("projection%s <\n" % elm
)
776 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
782 if printElemNumber
: elm
="(%d)" % cnt
783 res
+=prefix
+("kind%s <\n" % elm
)
784 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
788 res
+=prefix
+"filter <\n"
789 res
+=self
.filter_
.__str
__(prefix
+ " ", printElemNumber
)
792 for e
in self
.order_
:
794 if printElemNumber
: elm
="(%d)" % cnt
795 res
+=prefix
+("order%s <\n" % elm
)
796 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
800 for e
in self
.group_by_
:
802 if printElemNumber
: elm
="(%d)" % cnt
803 res
+=prefix
+("group_by%s <\n" % elm
)
804 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
807 if self
.has_start_cursor_
: res
+=prefix
+("start_cursor: %s\n" % self
.DebugFormatString(self
.start_cursor_
))
808 if self
.has_end_cursor_
: res
+=prefix
+("end_cursor: %s\n" % self
.DebugFormatString(self
.end_cursor_
))
809 if self
.has_offset_
: res
+=prefix
+("offset: %s\n" % self
.DebugFormatInt32(self
.offset_
))
810 if self
.has_limit_
: res
+=prefix
+("limit: %s\n" % self
.DebugFormatInt32(self
.limit_
))
814 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
815 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
827 _TEXT
= _BuildTagLookupTable({
840 _TYPES
= _BuildTagLookupTable({
841 0: ProtocolBuffer
.Encoder
.NUMERIC
,
842 2: ProtocolBuffer
.Encoder
.STRING
,
843 3: ProtocolBuffer
.Encoder
.STRING
,
844 4: ProtocolBuffer
.Encoder
.STRING
,
845 5: ProtocolBuffer
.Encoder
.STRING
,
846 6: ProtocolBuffer
.Encoder
.STRING
,
847 7: ProtocolBuffer
.Encoder
.STRING
,
848 8: ProtocolBuffer
.Encoder
.STRING
,
849 10: ProtocolBuffer
.Encoder
.NUMERIC
,
850 11: ProtocolBuffer
.Encoder
.NUMERIC
,
851 }, 11, ProtocolBuffer
.Encoder
.MAX_TYPE
)
855 _STYLE_CONTENT_TYPE
= """"""
856 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.Query'
857 _SERIALIZED_DESCRIPTOR
= array
.array('B')
858 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlF1ZXJ5ExoKcHJvamVjdGlvbiACKAIwCzgDSiphcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eUV4cHJlc3Npb26jAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoEa2luZCADKAIwCzgDSiZhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LaW5kRXhwcmVzc2lvbqMBqgEFY3R5cGWyAQZwcm90bzKkARQTGgZmaWx0ZXIgBCgCMAs4AUoeYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRmlsdGVyowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaBW9yZGVyIAUoAjALOANKJWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5T3JkZXKjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoIZ3JvdXBfYnkgBigCMAs4A0opYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlSZWZlcmVuY2WjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoMc3RhcnRfY3Vyc29yIAcoAjAJOAEUExoKZW5kX2N1cnNvciAIKAIwCTgBFBMaBm9mZnNldCAKKAAwBTgBQgEwowGqAQdkZWZhdWx0sgEBMKQBFBMaBWxpbWl0IAsoADAFOAEUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
859 if _net_proto___parse__python
is not None:
860 _net_proto___parse__python
.RegisterType(
861 _SERIALIZED_DESCRIPTOR
.tostring())
863 class KindExpression(ProtocolBuffer
.ProtocolMessage
):
867 def __init__(self
, contents
=None):
868 if contents
is not None: self
.MergeFromString(contents
)
870 def name(self
): return self
.name_
872 def set_name(self
, x
):
876 def clear_name(self
):
881 def has_name(self
): return self
.has_name_
884 def MergeFrom(self
, x
):
886 if (x
.has_name()): self
.set_name(x
.name())
888 if _net_proto___parse__python
is not None:
889 def _CMergeFromString(self
, s
):
890 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.KindExpression', s
)
892 if _net_proto___parse__python
is not None:
894 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.KindExpression')
896 if _net_proto___parse__python
is not None:
897 def _CEncodePartial(self
):
898 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.KindExpression')
900 if _net_proto___parse__python
is not None:
901 def _CToASCII(self
, output_format
):
902 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.KindExpression', output_format
)
905 if _net_proto___parse__python
is not None:
906 def ParseASCII(self
, s
):
907 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.KindExpression', s
)
910 if _net_proto___parse__python
is not None:
911 def ParseASCIIIgnoreUnknown(self
, s
):
912 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.KindExpression', s
)
916 if x
is self
: return 1
917 if self
.has_name_
!= x
.has_name_
: return 0
918 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
921 def IsInitialized(self
, debug_strs
=None):
923 if (not self
.has_name_
):
925 if debug_strs
is not None:
926 debug_strs
.append('Required field: name not set.')
931 n
+= self
.lengthString(len(self
.name_
))
934 def ByteSizePartial(self
):
938 n
+= self
.lengthString(len(self
.name_
))
944 def OutputUnchecked(self
, out
):
946 out
.putPrefixedString(self
.name_
)
948 def OutputPartial(self
, out
):
951 out
.putPrefixedString(self
.name_
)
953 def TryMerge(self
, d
):
957 self
.set_name(d
.getPrefixedString())
961 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
965 def __str__(self
, prefix
="", printElemNumber
=0):
967 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
971 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
972 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
976 _TEXT
= _BuildTagLookupTable({
981 _TYPES
= _BuildTagLookupTable({
982 0: ProtocolBuffer
.Encoder
.NUMERIC
,
983 1: ProtocolBuffer
.Encoder
.STRING
,
984 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
988 _STYLE_CONTENT_TYPE
= """"""
989 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.KindExpression'
990 _SERIALIZED_DESCRIPTOR
= array
.array('B')
991 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktpbmRFeHByZXNzaW9uExoEbmFtZSABKAIwCTgCFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
992 if _net_proto___parse__python
is not None:
993 _net_proto___parse__python
.RegisterType(
994 _SERIALIZED_DESCRIPTOR
.tostring())
996 class PropertyReference(ProtocolBuffer
.ProtocolMessage
):
1000 def __init__(self
, contents
=None):
1001 if contents
is not None: self
.MergeFromString(contents
)
1003 def name(self
): return self
.name_
1005 def set_name(self
, x
):
1009 def clear_name(self
):
1014 def has_name(self
): return self
.has_name_
1017 def MergeFrom(self
, x
):
1018 assert x
is not self
1019 if (x
.has_name()): self
.set_name(x
.name())
1021 if _net_proto___parse__python
is not None:
1022 def _CMergeFromString(self
, s
):
1023 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.PropertyReference', s
)
1025 if _net_proto___parse__python
is not None:
1027 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.PropertyReference')
1029 if _net_proto___parse__python
is not None:
1030 def _CEncodePartial(self
):
1031 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.PropertyReference')
1033 if _net_proto___parse__python
is not None:
1034 def _CToASCII(self
, output_format
):
1035 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.PropertyReference', output_format
)
1038 if _net_proto___parse__python
is not None:
1039 def ParseASCII(self
, s
):
1040 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.PropertyReference', s
)
1043 if _net_proto___parse__python
is not None:
1044 def ParseASCIIIgnoreUnknown(self
, s
):
1045 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.PropertyReference', s
)
1048 def Equals(self
, x
):
1049 if x
is self
: return 1
1050 if self
.has_name_
!= x
.has_name_
: return 0
1051 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
1054 def IsInitialized(self
, debug_strs
=None):
1056 if (not self
.has_name_
):
1058 if debug_strs
is not None:
1059 debug_strs
.append('Required field: name not set.')
1064 n
+= self
.lengthString(len(self
.name_
))
1067 def ByteSizePartial(self
):
1069 if (self
.has_name_
):
1071 n
+= self
.lengthString(len(self
.name_
))
1077 def OutputUnchecked(self
, out
):
1079 out
.putPrefixedString(self
.name_
)
1081 def OutputPartial(self
, out
):
1082 if (self
.has_name_
):
1084 out
.putPrefixedString(self
.name_
)
1086 def TryMerge(self
, d
):
1087 while d
.avail() > 0:
1088 tt
= d
.getVarInt32()
1090 self
.set_name(d
.getPrefixedString())
1094 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1098 def __str__(self
, prefix
="", printElemNumber
=0):
1100 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
1104 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1105 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1109 _TEXT
= _BuildTagLookupTable({
1114 _TYPES
= _BuildTagLookupTable({
1115 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1116 2: ProtocolBuffer
.Encoder
.STRING
,
1117 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1121 _STYLE_CONTENT_TYPE
= """"""
1122 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.PropertyReference'
1123 _SERIALIZED_DESCRIPTOR
= array
.array('B')
1124 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5UmVmZXJlbmNlExoEbmFtZSACKAIwCTgCFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
1125 if _net_proto___parse__python
is not None:
1126 _net_proto___parse__python
.RegisterType(
1127 _SERIALIZED_DESCRIPTOR
.tostring())
1129 class PropertyExpression(ProtocolBuffer
.ProtocolMessage
):
1134 _AggregationFunction_NAMES
= {
1138 def AggregationFunction_Name(cls
, x
): return cls
._AggregationFunction
_NAMES
.get(x
, "")
1139 AggregationFunction_Name
= classmethod(AggregationFunction_Name
)
1142 has_aggregation_function_
= 0
1143 aggregation_function_
= 0
1145 def __init__(self
, contents
=None):
1146 self
.property_
= PropertyReference()
1147 if contents
is not None: self
.MergeFromString(contents
)
1149 def property(self
): return self
.property_
1151 def mutable_property(self
): self
.has_property_
= 1; return self
.property_
1153 def clear_property(self
):self
.has_property_
= 0; self
.property_
.Clear()
1155 def has_property(self
): return self
.has_property_
1157 def aggregation_function(self
): return self
.aggregation_function_
1159 def set_aggregation_function(self
, x
):
1160 self
.has_aggregation_function_
= 1
1161 self
.aggregation_function_
= x
1163 def clear_aggregation_function(self
):
1164 if self
.has_aggregation_function_
:
1165 self
.has_aggregation_function_
= 0
1166 self
.aggregation_function_
= 0
1168 def has_aggregation_function(self
): return self
.has_aggregation_function_
1171 def MergeFrom(self
, x
):
1172 assert x
is not self
1173 if (x
.has_property()): self
.mutable_property().MergeFrom(x
.property())
1174 if (x
.has_aggregation_function()): self
.set_aggregation_function(x
.aggregation_function())
1176 if _net_proto___parse__python
is not None:
1177 def _CMergeFromString(self
, s
):
1178 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.PropertyExpression', s
)
1180 if _net_proto___parse__python
is not None:
1182 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.PropertyExpression')
1184 if _net_proto___parse__python
is not None:
1185 def _CEncodePartial(self
):
1186 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.PropertyExpression')
1188 if _net_proto___parse__python
is not None:
1189 def _CToASCII(self
, output_format
):
1190 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.PropertyExpression', output_format
)
1193 if _net_proto___parse__python
is not None:
1194 def ParseASCII(self
, s
):
1195 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.PropertyExpression', s
)
1198 if _net_proto___parse__python
is not None:
1199 def ParseASCIIIgnoreUnknown(self
, s
):
1200 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.PropertyExpression', s
)
1203 def Equals(self
, x
):
1204 if x
is self
: return 1
1205 if self
.has_property_
!= x
.has_property_
: return 0
1206 if self
.has_property_
and self
.property_
!= x
.property_
: return 0
1207 if self
.has_aggregation_function_
!= x
.has_aggregation_function_
: return 0
1208 if self
.has_aggregation_function_
and self
.aggregation_function_
!= x
.aggregation_function_
: return 0
1211 def IsInitialized(self
, debug_strs
=None):
1213 if (not self
.has_property_
):
1215 if debug_strs
is not None:
1216 debug_strs
.append('Required field: property not set.')
1217 elif not self
.property_
.IsInitialized(debug_strs
): initialized
= 0
1222 n
+= self
.lengthString(self
.property_
.ByteSize())
1223 if (self
.has_aggregation_function_
): n
+= 1 + self
.lengthVarInt64(self
.aggregation_function_
)
1226 def ByteSizePartial(self
):
1228 if (self
.has_property_
):
1230 n
+= self
.lengthString(self
.property_
.ByteSizePartial())
1231 if (self
.has_aggregation_function_
): n
+= 1 + self
.lengthVarInt64(self
.aggregation_function_
)
1235 self
.clear_property()
1236 self
.clear_aggregation_function()
1238 def OutputUnchecked(self
, out
):
1240 out
.putVarInt32(self
.property_
.ByteSize())
1241 self
.property_
.OutputUnchecked(out
)
1242 if (self
.has_aggregation_function_
):
1244 out
.putVarInt32(self
.aggregation_function_
)
1246 def OutputPartial(self
, out
):
1247 if (self
.has_property_
):
1249 out
.putVarInt32(self
.property_
.ByteSizePartial())
1250 self
.property_
.OutputPartial(out
)
1251 if (self
.has_aggregation_function_
):
1253 out
.putVarInt32(self
.aggregation_function_
)
1255 def TryMerge(self
, d
):
1256 while d
.avail() > 0:
1257 tt
= d
.getVarInt32()
1259 length
= d
.getVarInt32()
1260 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1262 self
.mutable_property().TryMerge(tmp
)
1265 self
.set_aggregation_function(d
.getVarInt32())
1269 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1273 def __str__(self
, prefix
="", printElemNumber
=0):
1275 if self
.has_property_
:
1276 res
+=prefix
+"property <\n"
1277 res
+=self
.property_
.__str
__(prefix
+ " ", printElemNumber
)
1279 if self
.has_aggregation_function_
: res
+=prefix
+("aggregation_function: %s\n" % self
.DebugFormatInt32(self
.aggregation_function_
))
1283 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1284 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1287 kaggregation_function
= 2
1289 _TEXT
= _BuildTagLookupTable({
1292 2: "aggregation_function",
1295 _TYPES
= _BuildTagLookupTable({
1296 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1297 1: ProtocolBuffer
.Encoder
.STRING
,
1298 2: ProtocolBuffer
.Encoder
.NUMERIC
,
1299 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1303 _STYLE_CONTENT_TYPE
= """"""
1304 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.PropertyExpression'
1305 _SERIALIZED_DESCRIPTOR
= array
.array('B')
1306 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5RXhwcmVzc2lvbhMaCHByb3BlcnR5IAEoAjALOAJKKWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5UmVmZXJlbmNlowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaFGFnZ3JlZ2F0aW9uX2Z1bmN0aW9uIAIoADAFOAFoABRzehNBZ2dyZWdhdGlvbkZ1bmN0aW9uiwGSAQVGSVJTVJgBAYwBdMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
1307 if _net_proto___parse__python
is not None:
1308 _net_proto___parse__python
.RegisterType(
1309 _SERIALIZED_DESCRIPTOR
.tostring())
1311 class PropertyOrder(ProtocolBuffer
.ProtocolMessage
):
1317 _Direction_NAMES
= {
1322 def Direction_Name(cls
, x
): return cls
._Direction
_NAMES
.get(x
, "")
1323 Direction_Name
= classmethod(Direction_Name
)
1329 def __init__(self
, contents
=None):
1330 self
.property_
= PropertyReference()
1331 if contents
is not None: self
.MergeFromString(contents
)
1333 def property(self
): return self
.property_
1335 def mutable_property(self
): self
.has_property_
= 1; return self
.property_
1337 def clear_property(self
):self
.has_property_
= 0; self
.property_
.Clear()
1339 def has_property(self
): return self
.has_property_
1341 def direction(self
): return self
.direction_
1343 def set_direction(self
, x
):
1344 self
.has_direction_
= 1
1347 def clear_direction(self
):
1348 if self
.has_direction_
:
1349 self
.has_direction_
= 0
1352 def has_direction(self
): return self
.has_direction_
1355 def MergeFrom(self
, x
):
1356 assert x
is not self
1357 if (x
.has_property()): self
.mutable_property().MergeFrom(x
.property())
1358 if (x
.has_direction()): self
.set_direction(x
.direction())
1360 if _net_proto___parse__python
is not None:
1361 def _CMergeFromString(self
, s
):
1362 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.PropertyOrder', s
)
1364 if _net_proto___parse__python
is not None:
1366 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.PropertyOrder')
1368 if _net_proto___parse__python
is not None:
1369 def _CEncodePartial(self
):
1370 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.PropertyOrder')
1372 if _net_proto___parse__python
is not None:
1373 def _CToASCII(self
, output_format
):
1374 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.PropertyOrder', output_format
)
1377 if _net_proto___parse__python
is not None:
1378 def ParseASCII(self
, s
):
1379 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.PropertyOrder', s
)
1382 if _net_proto___parse__python
is not None:
1383 def ParseASCIIIgnoreUnknown(self
, s
):
1384 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.PropertyOrder', s
)
1387 def Equals(self
, x
):
1388 if x
is self
: return 1
1389 if self
.has_property_
!= x
.has_property_
: return 0
1390 if self
.has_property_
and self
.property_
!= x
.property_
: return 0
1391 if self
.has_direction_
!= x
.has_direction_
: return 0
1392 if self
.has_direction_
and self
.direction_
!= x
.direction_
: return 0
1395 def IsInitialized(self
, debug_strs
=None):
1397 if (not self
.has_property_
):
1399 if debug_strs
is not None:
1400 debug_strs
.append('Required field: property not set.')
1401 elif not self
.property_
.IsInitialized(debug_strs
): initialized
= 0
1406 n
+= self
.lengthString(self
.property_
.ByteSize())
1407 if (self
.has_direction_
): n
+= 1 + self
.lengthVarInt64(self
.direction_
)
1410 def ByteSizePartial(self
):
1412 if (self
.has_property_
):
1414 n
+= self
.lengthString(self
.property_
.ByteSizePartial())
1415 if (self
.has_direction_
): n
+= 1 + self
.lengthVarInt64(self
.direction_
)
1419 self
.clear_property()
1420 self
.clear_direction()
1422 def OutputUnchecked(self
, out
):
1424 out
.putVarInt32(self
.property_
.ByteSize())
1425 self
.property_
.OutputUnchecked(out
)
1426 if (self
.has_direction_
):
1428 out
.putVarInt32(self
.direction_
)
1430 def OutputPartial(self
, out
):
1431 if (self
.has_property_
):
1433 out
.putVarInt32(self
.property_
.ByteSizePartial())
1434 self
.property_
.OutputPartial(out
)
1435 if (self
.has_direction_
):
1437 out
.putVarInt32(self
.direction_
)
1439 def TryMerge(self
, d
):
1440 while d
.avail() > 0:
1441 tt
= d
.getVarInt32()
1443 length
= d
.getVarInt32()
1444 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1446 self
.mutable_property().TryMerge(tmp
)
1449 self
.set_direction(d
.getVarInt32())
1453 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1457 def __str__(self
, prefix
="", printElemNumber
=0):
1459 if self
.has_property_
:
1460 res
+=prefix
+"property <\n"
1461 res
+=self
.property_
.__str
__(prefix
+ " ", printElemNumber
)
1463 if self
.has_direction_
: res
+=prefix
+("direction: %s\n" % self
.DebugFormatInt32(self
.direction_
))
1467 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1468 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1473 _TEXT
= _BuildTagLookupTable({
1479 _TYPES
= _BuildTagLookupTable({
1480 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1481 1: ProtocolBuffer
.Encoder
.STRING
,
1482 2: ProtocolBuffer
.Encoder
.NUMERIC
,
1483 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1487 _STYLE_CONTENT_TYPE
= """"""
1488 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.PropertyOrder'
1489 _SERIALIZED_DESCRIPTOR
= array
.array('B')
1490 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5T3JkZXITGghwcm9wZXJ0eSABKAIwCzgCSilhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eVJlZmVyZW5jZaMBqgEFY3R5cGWyAQZwcm90bzKkARQTGglkaXJlY3Rpb24gAigAMAU4AUIBMWgAowGqAQdkZWZhdWx0sgEJQVNDRU5ESU5HpAEUc3oJRGlyZWN0aW9uiwGSAQlBU0NFTkRJTkeYAQGMAYsBkgEKREVTQ0VORElOR5gBAowBdMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
1491 if _net_proto___parse__python
is not None:
1492 _net_proto___parse__python
.RegisterType(
1493 _SERIALIZED_DESCRIPTOR
.tostring())
1495 class Filter(ProtocolBuffer
.ProtocolMessage
):
1496 has_composite_filter_
= 0
1497 composite_filter_
= None
1498 has_property_filter_
= 0
1499 property_filter_
= None
1501 def __init__(self
, contents
=None):
1502 self
.lazy_init_lock_
= thread
.allocate_lock()
1503 if contents
is not None: self
.MergeFromString(contents
)
1505 def composite_filter(self
):
1506 if self
.composite_filter_
is None:
1507 self
.lazy_init_lock_
.acquire()
1509 if self
.composite_filter_
is None: self
.composite_filter_
= CompositeFilter()
1511 self
.lazy_init_lock_
.release()
1512 return self
.composite_filter_
1514 def mutable_composite_filter(self
): self
.has_composite_filter_
= 1; return self
.composite_filter()
1516 def clear_composite_filter(self
):
1518 if self
.has_composite_filter_
:
1519 self
.has_composite_filter_
= 0;
1520 if self
.composite_filter_
is not None: self
.composite_filter_
.Clear()
1522 def has_composite_filter(self
): return self
.has_composite_filter_
1524 def property_filter(self
):
1525 if self
.property_filter_
is None:
1526 self
.lazy_init_lock_
.acquire()
1528 if self
.property_filter_
is None: self
.property_filter_
= PropertyFilter()
1530 self
.lazy_init_lock_
.release()
1531 return self
.property_filter_
1533 def mutable_property_filter(self
): self
.has_property_filter_
= 1; return self
.property_filter()
1535 def clear_property_filter(self
):
1537 if self
.has_property_filter_
:
1538 self
.has_property_filter_
= 0;
1539 if self
.property_filter_
is not None: self
.property_filter_
.Clear()
1541 def has_property_filter(self
): return self
.has_property_filter_
1544 def MergeFrom(self
, x
):
1545 assert x
is not self
1546 if (x
.has_composite_filter()): self
.mutable_composite_filter().MergeFrom(x
.composite_filter())
1547 if (x
.has_property_filter()): self
.mutable_property_filter().MergeFrom(x
.property_filter())
1549 if _net_proto___parse__python
is not None:
1550 def _CMergeFromString(self
, s
):
1551 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.Filter', s
)
1553 if _net_proto___parse__python
is not None:
1555 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.Filter')
1557 if _net_proto___parse__python
is not None:
1558 def _CEncodePartial(self
):
1559 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.Filter')
1561 if _net_proto___parse__python
is not None:
1562 def _CToASCII(self
, output_format
):
1563 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.Filter', output_format
)
1566 if _net_proto___parse__python
is not None:
1567 def ParseASCII(self
, s
):
1568 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.Filter', s
)
1571 if _net_proto___parse__python
is not None:
1572 def ParseASCIIIgnoreUnknown(self
, s
):
1573 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.Filter', s
)
1576 def Equals(self
, x
):
1577 if x
is self
: return 1
1578 if self
.has_composite_filter_
!= x
.has_composite_filter_
: return 0
1579 if self
.has_composite_filter_
and self
.composite_filter_
!= x
.composite_filter_
: return 0
1580 if self
.has_property_filter_
!= x
.has_property_filter_
: return 0
1581 if self
.has_property_filter_
and self
.property_filter_
!= x
.property_filter_
: return 0
1584 def IsInitialized(self
, debug_strs
=None):
1586 if (self
.has_composite_filter_
and not self
.composite_filter_
.IsInitialized(debug_strs
)): initialized
= 0
1587 if (self
.has_property_filter_
and not self
.property_filter_
.IsInitialized(debug_strs
)): initialized
= 0
1592 if (self
.has_composite_filter_
): n
+= 1 + self
.lengthString(self
.composite_filter_
.ByteSize())
1593 if (self
.has_property_filter_
): n
+= 1 + self
.lengthString(self
.property_filter_
.ByteSize())
1596 def ByteSizePartial(self
):
1598 if (self
.has_composite_filter_
): n
+= 1 + self
.lengthString(self
.composite_filter_
.ByteSizePartial())
1599 if (self
.has_property_filter_
): n
+= 1 + self
.lengthString(self
.property_filter_
.ByteSizePartial())
1603 self
.clear_composite_filter()
1604 self
.clear_property_filter()
1606 def OutputUnchecked(self
, out
):
1607 if (self
.has_composite_filter_
):
1609 out
.putVarInt32(self
.composite_filter_
.ByteSize())
1610 self
.composite_filter_
.OutputUnchecked(out
)
1611 if (self
.has_property_filter_
):
1613 out
.putVarInt32(self
.property_filter_
.ByteSize())
1614 self
.property_filter_
.OutputUnchecked(out
)
1616 def OutputPartial(self
, out
):
1617 if (self
.has_composite_filter_
):
1619 out
.putVarInt32(self
.composite_filter_
.ByteSizePartial())
1620 self
.composite_filter_
.OutputPartial(out
)
1621 if (self
.has_property_filter_
):
1623 out
.putVarInt32(self
.property_filter_
.ByteSizePartial())
1624 self
.property_filter_
.OutputPartial(out
)
1626 def TryMerge(self
, d
):
1627 while d
.avail() > 0:
1628 tt
= d
.getVarInt32()
1630 length
= d
.getVarInt32()
1631 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1633 self
.mutable_composite_filter().TryMerge(tmp
)
1636 length
= d
.getVarInt32()
1637 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1639 self
.mutable_property_filter().TryMerge(tmp
)
1643 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1647 def __str__(self
, prefix
="", printElemNumber
=0):
1649 if self
.has_composite_filter_
:
1650 res
+=prefix
+"composite_filter <\n"
1651 res
+=self
.composite_filter_
.__str
__(prefix
+ " ", printElemNumber
)
1653 if self
.has_property_filter_
:
1654 res
+=prefix
+"property_filter <\n"
1655 res
+=self
.property_filter_
.__str
__(prefix
+ " ", printElemNumber
)
1660 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1661 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1663 kcomposite_filter
= 1
1664 kproperty_filter
= 2
1666 _TEXT
= _BuildTagLookupTable({
1668 1: "composite_filter",
1669 2: "property_filter",
1672 _TYPES
= _BuildTagLookupTable({
1673 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1674 1: ProtocolBuffer
.Encoder
.STRING
,
1675 2: ProtocolBuffer
.Encoder
.STRING
,
1676 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1680 _STYLE_CONTENT_TYPE
= """"""
1681 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.Filter'
1682 _SERIALIZED_DESCRIPTOR
= array
.array('B')
1683 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KHmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkZpbHRlchMaEGNvbXBvc2l0ZV9maWx0ZXIgASgCMAs4AUonYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQ29tcG9zaXRlRmlsdGVyowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaD3Byb3BlcnR5X2ZpbHRlciACKAIwCzgBSiZhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eUZpbHRlcqMBqgEFY3R5cGWyAQZwcm90bzKkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
1684 if _net_proto___parse__python
is not None:
1685 _net_proto___parse__python
.RegisterType(
1686 _SERIALIZED_DESCRIPTOR
.tostring())
1688 class CompositeFilter(ProtocolBuffer
.ProtocolMessage
):
1697 def Operator_Name(cls
, x
): return cls
._Operator
_NAMES
.get(x
, "")
1698 Operator_Name
= classmethod(Operator_Name
)
1703 def __init__(self
, contents
=None):
1705 if contents
is not None: self
.MergeFromString(contents
)
1707 def operator(self
): return self
.operator_
1709 def set_operator(self
, x
):
1710 self
.has_operator_
= 1
1713 def clear_operator(self
):
1714 if self
.has_operator_
:
1715 self
.has_operator_
= 0
1718 def has_operator(self
): return self
.has_operator_
1720 def filter_size(self
): return len(self
.filter_
)
1721 def filter_list(self
): return self
.filter_
1723 def filter(self
, i
):
1724 return self
.filter_
[i
]
1726 def mutable_filter(self
, i
):
1727 return self
.filter_
[i
]
1729 def add_filter(self
):
1731 self
.filter_
.append(x
)
1734 def clear_filter(self
):
1737 def MergeFrom(self
, x
):
1738 assert x
is not self
1739 if (x
.has_operator()): self
.set_operator(x
.operator())
1740 for i
in xrange(x
.filter_size()): self
.add_filter().CopyFrom(x
.filter(i
))
1742 if _net_proto___parse__python
is not None:
1743 def _CMergeFromString(self
, s
):
1744 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.CompositeFilter', s
)
1746 if _net_proto___parse__python
is not None:
1748 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.CompositeFilter')
1750 if _net_proto___parse__python
is not None:
1751 def _CEncodePartial(self
):
1752 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.CompositeFilter')
1754 if _net_proto___parse__python
is not None:
1755 def _CToASCII(self
, output_format
):
1756 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.CompositeFilter', output_format
)
1759 if _net_proto___parse__python
is not None:
1760 def ParseASCII(self
, s
):
1761 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.CompositeFilter', s
)
1764 if _net_proto___parse__python
is not None:
1765 def ParseASCIIIgnoreUnknown(self
, s
):
1766 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.CompositeFilter', s
)
1769 def Equals(self
, x
):
1770 if x
is self
: return 1
1771 if self
.has_operator_
!= x
.has_operator_
: return 0
1772 if self
.has_operator_
and self
.operator_
!= x
.operator_
: return 0
1773 if len(self
.filter_
) != len(x
.filter_
): return 0
1774 for e1
, e2
in zip(self
.filter_
, x
.filter_
):
1775 if e1
!= e2
: return 0
1778 def IsInitialized(self
, debug_strs
=None):
1780 if (not self
.has_operator_
):
1782 if debug_strs
is not None:
1783 debug_strs
.append('Required field: operator not set.')
1784 for p
in self
.filter_
:
1785 if not p
.IsInitialized(debug_strs
): initialized
=0
1790 n
+= self
.lengthVarInt64(self
.operator_
)
1791 n
+= 1 * len(self
.filter_
)
1792 for i
in xrange(len(self
.filter_
)): n
+= self
.lengthString(self
.filter_
[i
].ByteSize())
1795 def ByteSizePartial(self
):
1797 if (self
.has_operator_
):
1799 n
+= self
.lengthVarInt64(self
.operator_
)
1800 n
+= 1 * len(self
.filter_
)
1801 for i
in xrange(len(self
.filter_
)): n
+= self
.lengthString(self
.filter_
[i
].ByteSizePartial())
1805 self
.clear_operator()
1808 def OutputUnchecked(self
, out
):
1810 out
.putVarInt32(self
.operator_
)
1811 for i
in xrange(len(self
.filter_
)):
1813 out
.putVarInt32(self
.filter_
[i
].ByteSize())
1814 self
.filter_
[i
].OutputUnchecked(out
)
1816 def OutputPartial(self
, out
):
1817 if (self
.has_operator_
):
1819 out
.putVarInt32(self
.operator_
)
1820 for i
in xrange(len(self
.filter_
)):
1822 out
.putVarInt32(self
.filter_
[i
].ByteSizePartial())
1823 self
.filter_
[i
].OutputPartial(out
)
1825 def TryMerge(self
, d
):
1826 while d
.avail() > 0:
1827 tt
= d
.getVarInt32()
1829 self
.set_operator(d
.getVarInt32())
1832 length
= d
.getVarInt32()
1833 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1835 self
.add_filter().TryMerge(tmp
)
1839 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1843 def __str__(self
, prefix
="", printElemNumber
=0):
1845 if self
.has_operator_
: res
+=prefix
+("operator: %s\n" % self
.DebugFormatInt32(self
.operator_
))
1847 for e
in self
.filter_
:
1849 if printElemNumber
: elm
="(%d)" % cnt
1850 res
+=prefix
+("filter%s <\n" % elm
)
1851 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
1857 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1858 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1863 _TEXT
= _BuildTagLookupTable({
1869 _TYPES
= _BuildTagLookupTable({
1870 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1871 1: ProtocolBuffer
.Encoder
.NUMERIC
,
1872 2: ProtocolBuffer
.Encoder
.STRING
,
1873 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1877 _STYLE_CONTENT_TYPE
= """"""
1878 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.CompositeFilter'
1879 _SERIALIZED_DESCRIPTOR
= array
.array('B')
1880 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJ2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbXBvc2l0ZUZpbHRlchMaCG9wZXJhdG9yIAEoADAFOAJoABQTGgZmaWx0ZXIgAigCMAs4A0oeYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRmlsdGVyowGqAQVjdHlwZbIBBnByb3RvMqQBFHN6CE9wZXJhdG9yiwGSAQNBTkSYAQGMAXTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
1881 if _net_proto___parse__python
is not None:
1882 _net_proto___parse__python
.RegisterType(
1883 _SERIALIZED_DESCRIPTOR
.tostring())
1885 class PropertyFilter(ProtocolBuffer
.ProtocolMessage
):
1889 LESS_THAN_OR_EQUAL
= 2
1891 GREATER_THAN_OR_EQUAL
= 4
1897 2: "LESS_THAN_OR_EQUAL",
1899 4: "GREATER_THAN_OR_EQUAL",
1904 def Operator_Name(cls
, x
): return cls
._Operator
_NAMES
.get(x
, "")
1905 Operator_Name
= classmethod(Operator_Name
)
1912 def __init__(self
, contents
=None):
1913 self
.property_
= PropertyReference()
1914 self
.value_
= google
.appengine
.datastore
.entity_v4_pb
.Value()
1915 if contents
is not None: self
.MergeFromString(contents
)
1917 def property(self
): return self
.property_
1919 def mutable_property(self
): self
.has_property_
= 1; return self
.property_
1921 def clear_property(self
):self
.has_property_
= 0; self
.property_
.Clear()
1923 def has_property(self
): return self
.has_property_
1925 def operator(self
): return self
.operator_
1927 def set_operator(self
, x
):
1928 self
.has_operator_
= 1
1931 def clear_operator(self
):
1932 if self
.has_operator_
:
1933 self
.has_operator_
= 0
1936 def has_operator(self
): return self
.has_operator_
1938 def value(self
): return self
.value_
1940 def mutable_value(self
): self
.has_value_
= 1; return self
.value_
1942 def clear_value(self
):self
.has_value_
= 0; self
.value_
.Clear()
1944 def has_value(self
): return self
.has_value_
1947 def MergeFrom(self
, x
):
1948 assert x
is not self
1949 if (x
.has_property()): self
.mutable_property().MergeFrom(x
.property())
1950 if (x
.has_operator()): self
.set_operator(x
.operator())
1951 if (x
.has_value()): self
.mutable_value().MergeFrom(x
.value())
1953 if _net_proto___parse__python
is not None:
1954 def _CMergeFromString(self
, s
):
1955 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.PropertyFilter', s
)
1957 if _net_proto___parse__python
is not None:
1959 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.PropertyFilter')
1961 if _net_proto___parse__python
is not None:
1962 def _CEncodePartial(self
):
1963 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.PropertyFilter')
1965 if _net_proto___parse__python
is not None:
1966 def _CToASCII(self
, output_format
):
1967 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.PropertyFilter', output_format
)
1970 if _net_proto___parse__python
is not None:
1971 def ParseASCII(self
, s
):
1972 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.PropertyFilter', s
)
1975 if _net_proto___parse__python
is not None:
1976 def ParseASCIIIgnoreUnknown(self
, s
):
1977 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.PropertyFilter', s
)
1980 def Equals(self
, x
):
1981 if x
is self
: return 1
1982 if self
.has_property_
!= x
.has_property_
: return 0
1983 if self
.has_property_
and self
.property_
!= x
.property_
: return 0
1984 if self
.has_operator_
!= x
.has_operator_
: return 0
1985 if self
.has_operator_
and self
.operator_
!= x
.operator_
: return 0
1986 if self
.has_value_
!= x
.has_value_
: return 0
1987 if self
.has_value_
and self
.value_
!= x
.value_
: return 0
1990 def IsInitialized(self
, debug_strs
=None):
1992 if (not self
.has_property_
):
1994 if debug_strs
is not None:
1995 debug_strs
.append('Required field: property not set.')
1996 elif not self
.property_
.IsInitialized(debug_strs
): initialized
= 0
1997 if (not self
.has_operator_
):
1999 if debug_strs
is not None:
2000 debug_strs
.append('Required field: operator not set.')
2001 if (not self
.has_value_
):
2003 if debug_strs
is not None:
2004 debug_strs
.append('Required field: value not set.')
2005 elif not self
.value_
.IsInitialized(debug_strs
): initialized
= 0
2010 n
+= self
.lengthString(self
.property_
.ByteSize())
2011 n
+= self
.lengthVarInt64(self
.operator_
)
2012 n
+= self
.lengthString(self
.value_
.ByteSize())
2015 def ByteSizePartial(self
):
2017 if (self
.has_property_
):
2019 n
+= self
.lengthString(self
.property_
.ByteSizePartial())
2020 if (self
.has_operator_
):
2022 n
+= self
.lengthVarInt64(self
.operator_
)
2023 if (self
.has_value_
):
2025 n
+= self
.lengthString(self
.value_
.ByteSizePartial())
2029 self
.clear_property()
2030 self
.clear_operator()
2033 def OutputUnchecked(self
, out
):
2035 out
.putVarInt32(self
.property_
.ByteSize())
2036 self
.property_
.OutputUnchecked(out
)
2038 out
.putVarInt32(self
.operator_
)
2040 out
.putVarInt32(self
.value_
.ByteSize())
2041 self
.value_
.OutputUnchecked(out
)
2043 def OutputPartial(self
, out
):
2044 if (self
.has_property_
):
2046 out
.putVarInt32(self
.property_
.ByteSizePartial())
2047 self
.property_
.OutputPartial(out
)
2048 if (self
.has_operator_
):
2050 out
.putVarInt32(self
.operator_
)
2051 if (self
.has_value_
):
2053 out
.putVarInt32(self
.value_
.ByteSizePartial())
2054 self
.value_
.OutputPartial(out
)
2056 def TryMerge(self
, d
):
2057 while d
.avail() > 0:
2058 tt
= d
.getVarInt32()
2060 length
= d
.getVarInt32()
2061 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2063 self
.mutable_property().TryMerge(tmp
)
2066 self
.set_operator(d
.getVarInt32())
2069 length
= d
.getVarInt32()
2070 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2072 self
.mutable_value().TryMerge(tmp
)
2076 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2080 def __str__(self
, prefix
="", printElemNumber
=0):
2082 if self
.has_property_
:
2083 res
+=prefix
+"property <\n"
2084 res
+=self
.property_
.__str
__(prefix
+ " ", printElemNumber
)
2086 if self
.has_operator_
: res
+=prefix
+("operator: %s\n" % self
.DebugFormatInt32(self
.operator_
))
2088 res
+=prefix
+"value <\n"
2089 res
+=self
.value_
.__str
__(prefix
+ " ", printElemNumber
)
2094 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2095 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2101 _TEXT
= _BuildTagLookupTable({
2108 _TYPES
= _BuildTagLookupTable({
2109 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2110 1: ProtocolBuffer
.Encoder
.STRING
,
2111 2: ProtocolBuffer
.Encoder
.NUMERIC
,
2112 3: ProtocolBuffer
.Encoder
.STRING
,
2113 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2117 _STYLE_CONTENT_TYPE
= """"""
2118 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.PropertyFilter'
2119 _SERIALIZED_DESCRIPTOR
= array
.array('B')
2120 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5RmlsdGVyExoIcHJvcGVydHkgASgCMAs4AkopYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlSZWZlcmVuY2WjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoIb3BlcmF0b3IgAigAMAU4AmgAFBMaBXZhbHVlIAMoAjALOAJKHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlZhbHVlowGqAQVjdHlwZbIBBnByb3RvMqQBFHN6CE9wZXJhdG9yiwGSAQlMRVNTX1RIQU6YAQGMAYsBkgESTEVTU19USEFOX09SX0VRVUFMmAECjAGLAZIBDEdSRUFURVJfVEhBTpgBA4wBiwGSARVHUkVBVEVSX1RIQU5fT1JfRVFVQUyYAQSMAYsBkgEFRVFVQUyYAQWMAYsBkgEMSEFTX0FOQ0VTVE9SmAELjAF0wgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
2121 if _net_proto___parse__python
is not None:
2122 _net_proto___parse__python
.RegisterType(
2123 _SERIALIZED_DESCRIPTOR
.tostring())
2125 class GqlQuery(ProtocolBuffer
.ProtocolMessage
):
2126 has_query_string_
= 0
2128 has_allow_literal_
= 0
2131 def __init__(self
, contents
=None):
2133 self
.number_arg_
= []
2134 if contents
is not None: self
.MergeFromString(contents
)
2136 def query_string(self
): return self
.query_string_
2138 def set_query_string(self
, x
):
2139 self
.has_query_string_
= 1
2140 self
.query_string_
= x
2142 def clear_query_string(self
):
2143 if self
.has_query_string_
:
2144 self
.has_query_string_
= 0
2145 self
.query_string_
= ""
2147 def has_query_string(self
): return self
.has_query_string_
2149 def allow_literal(self
): return self
.allow_literal_
2151 def set_allow_literal(self
, x
):
2152 self
.has_allow_literal_
= 1
2153 self
.allow_literal_
= x
2155 def clear_allow_literal(self
):
2156 if self
.has_allow_literal_
:
2157 self
.has_allow_literal_
= 0
2158 self
.allow_literal_
= 0
2160 def has_allow_literal(self
): return self
.has_allow_literal_
2162 def name_arg_size(self
): return len(self
.name_arg_
)
2163 def name_arg_list(self
): return self
.name_arg_
2165 def name_arg(self
, i
):
2166 return self
.name_arg_
[i
]
2168 def mutable_name_arg(self
, i
):
2169 return self
.name_arg_
[i
]
2171 def add_name_arg(self
):
2173 self
.name_arg_
.append(x
)
2176 def clear_name_arg(self
):
2178 def number_arg_size(self
): return len(self
.number_arg_
)
2179 def number_arg_list(self
): return self
.number_arg_
2181 def number_arg(self
, i
):
2182 return self
.number_arg_
[i
]
2184 def mutable_number_arg(self
, i
):
2185 return self
.number_arg_
[i
]
2187 def add_number_arg(self
):
2189 self
.number_arg_
.append(x
)
2192 def clear_number_arg(self
):
2193 self
.number_arg_
= []
2195 def MergeFrom(self
, x
):
2196 assert x
is not self
2197 if (x
.has_query_string()): self
.set_query_string(x
.query_string())
2198 if (x
.has_allow_literal()): self
.set_allow_literal(x
.allow_literal())
2199 for i
in xrange(x
.name_arg_size()): self
.add_name_arg().CopyFrom(x
.name_arg(i
))
2200 for i
in xrange(x
.number_arg_size()): self
.add_number_arg().CopyFrom(x
.number_arg(i
))
2202 if _net_proto___parse__python
is not None:
2203 def _CMergeFromString(self
, s
):
2204 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.GqlQuery', s
)
2206 if _net_proto___parse__python
is not None:
2208 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.GqlQuery')
2210 if _net_proto___parse__python
is not None:
2211 def _CEncodePartial(self
):
2212 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.GqlQuery')
2214 if _net_proto___parse__python
is not None:
2215 def _CToASCII(self
, output_format
):
2216 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.GqlQuery', output_format
)
2219 if _net_proto___parse__python
is not None:
2220 def ParseASCII(self
, s
):
2221 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.GqlQuery', s
)
2224 if _net_proto___parse__python
is not None:
2225 def ParseASCIIIgnoreUnknown(self
, s
):
2226 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.GqlQuery', s
)
2229 def Equals(self
, x
):
2230 if x
is self
: return 1
2231 if self
.has_query_string_
!= x
.has_query_string_
: return 0
2232 if self
.has_query_string_
and self
.query_string_
!= x
.query_string_
: return 0
2233 if self
.has_allow_literal_
!= x
.has_allow_literal_
: return 0
2234 if self
.has_allow_literal_
and self
.allow_literal_
!= x
.allow_literal_
: return 0
2235 if len(self
.name_arg_
) != len(x
.name_arg_
): return 0
2236 for e1
, e2
in zip(self
.name_arg_
, x
.name_arg_
):
2237 if e1
!= e2
: return 0
2238 if len(self
.number_arg_
) != len(x
.number_arg_
): return 0
2239 for e1
, e2
in zip(self
.number_arg_
, x
.number_arg_
):
2240 if e1
!= e2
: return 0
2243 def IsInitialized(self
, debug_strs
=None):
2245 if (not self
.has_query_string_
):
2247 if debug_strs
is not None:
2248 debug_strs
.append('Required field: query_string not set.')
2249 for p
in self
.name_arg_
:
2250 if not p
.IsInitialized(debug_strs
): initialized
=0
2251 for p
in self
.number_arg_
:
2252 if not p
.IsInitialized(debug_strs
): initialized
=0
2257 n
+= self
.lengthString(len(self
.query_string_
))
2258 if (self
.has_allow_literal_
): n
+= 2
2259 n
+= 1 * len(self
.name_arg_
)
2260 for i
in xrange(len(self
.name_arg_
)): n
+= self
.lengthString(self
.name_arg_
[i
].ByteSize())
2261 n
+= 1 * len(self
.number_arg_
)
2262 for i
in xrange(len(self
.number_arg_
)): n
+= self
.lengthString(self
.number_arg_
[i
].ByteSize())
2265 def ByteSizePartial(self
):
2267 if (self
.has_query_string_
):
2269 n
+= self
.lengthString(len(self
.query_string_
))
2270 if (self
.has_allow_literal_
): n
+= 2
2271 n
+= 1 * len(self
.name_arg_
)
2272 for i
in xrange(len(self
.name_arg_
)): n
+= self
.lengthString(self
.name_arg_
[i
].ByteSizePartial())
2273 n
+= 1 * len(self
.number_arg_
)
2274 for i
in xrange(len(self
.number_arg_
)): n
+= self
.lengthString(self
.number_arg_
[i
].ByteSizePartial())
2278 self
.clear_query_string()
2279 self
.clear_allow_literal()
2280 self
.clear_name_arg()
2281 self
.clear_number_arg()
2283 def OutputUnchecked(self
, out
):
2285 out
.putPrefixedString(self
.query_string_
)
2286 if (self
.has_allow_literal_
):
2288 out
.putBoolean(self
.allow_literal_
)
2289 for i
in xrange(len(self
.name_arg_
)):
2291 out
.putVarInt32(self
.name_arg_
[i
].ByteSize())
2292 self
.name_arg_
[i
].OutputUnchecked(out
)
2293 for i
in xrange(len(self
.number_arg_
)):
2295 out
.putVarInt32(self
.number_arg_
[i
].ByteSize())
2296 self
.number_arg_
[i
].OutputUnchecked(out
)
2298 def OutputPartial(self
, out
):
2299 if (self
.has_query_string_
):
2301 out
.putPrefixedString(self
.query_string_
)
2302 if (self
.has_allow_literal_
):
2304 out
.putBoolean(self
.allow_literal_
)
2305 for i
in xrange(len(self
.name_arg_
)):
2307 out
.putVarInt32(self
.name_arg_
[i
].ByteSizePartial())
2308 self
.name_arg_
[i
].OutputPartial(out
)
2309 for i
in xrange(len(self
.number_arg_
)):
2311 out
.putVarInt32(self
.number_arg_
[i
].ByteSizePartial())
2312 self
.number_arg_
[i
].OutputPartial(out
)
2314 def TryMerge(self
, d
):
2315 while d
.avail() > 0:
2316 tt
= d
.getVarInt32()
2318 self
.set_query_string(d
.getPrefixedString())
2321 self
.set_allow_literal(d
.getBoolean())
2324 length
= d
.getVarInt32()
2325 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2327 self
.add_name_arg().TryMerge(tmp
)
2330 length
= d
.getVarInt32()
2331 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2333 self
.add_number_arg().TryMerge(tmp
)
2337 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2341 def __str__(self
, prefix
="", printElemNumber
=0):
2343 if self
.has_query_string_
: res
+=prefix
+("query_string: %s\n" % self
.DebugFormatString(self
.query_string_
))
2344 if self
.has_allow_literal_
: res
+=prefix
+("allow_literal: %s\n" % self
.DebugFormatBool(self
.allow_literal_
))
2346 for e
in self
.name_arg_
:
2348 if printElemNumber
: elm
="(%d)" % cnt
2349 res
+=prefix
+("name_arg%s <\n" % elm
)
2350 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2354 for e
in self
.number_arg_
:
2356 if printElemNumber
: elm
="(%d)" % cnt
2357 res
+=prefix
+("number_arg%s <\n" % elm
)
2358 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2364 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2365 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2372 _TEXT
= _BuildTagLookupTable({
2380 _TYPES
= _BuildTagLookupTable({
2381 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2382 1: ProtocolBuffer
.Encoder
.STRING
,
2383 2: ProtocolBuffer
.Encoder
.NUMERIC
,
2384 3: ProtocolBuffer
.Encoder
.STRING
,
2385 4: ProtocolBuffer
.Encoder
.STRING
,
2386 }, 4, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2390 _STYLE_CONTENT_TYPE
= """"""
2391 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.GqlQuery'
2392 _SERIALIZED_DESCRIPTOR
= array
.array('B')
2393 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KIGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkdxbFF1ZXJ5ExoMcXVlcnlfc3RyaW5nIAEoAjAJOAIUExoNYWxsb3dfbGl0ZXJhbCACKAAwCDgBQgVmYWxzZaMBqgEHZGVmYXVsdLIBBWZhbHNlpAEUExoIbmFtZV9hcmcgAygCMAs4A0ojYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuR3FsUXVlcnlBcmejAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoKbnVtYmVyX2FyZyAEKAIwCzgDSiNhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5HcWxRdWVyeUFyZ6MBqgEFY3R5cGWyAQZwcm90bzKkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
2394 if _net_proto___parse__python
is not None:
2395 _net_proto___parse__python
.RegisterType(
2396 _SERIALIZED_DESCRIPTOR
.tostring())
2398 class GqlQueryArg(ProtocolBuffer
.ProtocolMessage
):
2406 def __init__(self
, contents
=None):
2407 self
.lazy_init_lock_
= thread
.allocate_lock()
2408 if contents
is not None: self
.MergeFromString(contents
)
2410 def name(self
): return self
.name_
2412 def set_name(self
, x
):
2416 def clear_name(self
):
2421 def has_name(self
): return self
.has_name_
2424 if self
.value_
is None:
2425 self
.lazy_init_lock_
.acquire()
2427 if self
.value_
is None: self
.value_
= google
.appengine
.datastore
.entity_v4_pb
.Value()
2429 self
.lazy_init_lock_
.release()
2432 def mutable_value(self
): self
.has_value_
= 1; return self
.value()
2434 def clear_value(self
):
2437 self
.has_value_
= 0;
2438 if self
.value_
is not None: self
.value_
.Clear()
2440 def has_value(self
): return self
.has_value_
2442 def cursor(self
): return self
.cursor_
2444 def set_cursor(self
, x
):
2445 self
.has_cursor_
= 1
2448 def clear_cursor(self
):
2449 if self
.has_cursor_
:
2450 self
.has_cursor_
= 0
2453 def has_cursor(self
): return self
.has_cursor_
2456 def MergeFrom(self
, x
):
2457 assert x
is not self
2458 if (x
.has_name()): self
.set_name(x
.name())
2459 if (x
.has_value()): self
.mutable_value().MergeFrom(x
.value())
2460 if (x
.has_cursor()): self
.set_cursor(x
.cursor())
2462 if _net_proto___parse__python
is not None:
2463 def _CMergeFromString(self
, s
):
2464 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.GqlQueryArg', s
)
2466 if _net_proto___parse__python
is not None:
2468 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.GqlQueryArg')
2470 if _net_proto___parse__python
is not None:
2471 def _CEncodePartial(self
):
2472 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.GqlQueryArg')
2474 if _net_proto___parse__python
is not None:
2475 def _CToASCII(self
, output_format
):
2476 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.GqlQueryArg', output_format
)
2479 if _net_proto___parse__python
is not None:
2480 def ParseASCII(self
, s
):
2481 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.GqlQueryArg', s
)
2484 if _net_proto___parse__python
is not None:
2485 def ParseASCIIIgnoreUnknown(self
, s
):
2486 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.GqlQueryArg', s
)
2489 def Equals(self
, x
):
2490 if x
is self
: return 1
2491 if self
.has_name_
!= x
.has_name_
: return 0
2492 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
2493 if self
.has_value_
!= x
.has_value_
: return 0
2494 if self
.has_value_
and self
.value_
!= x
.value_
: return 0
2495 if self
.has_cursor_
!= x
.has_cursor_
: return 0
2496 if self
.has_cursor_
and self
.cursor_
!= x
.cursor_
: return 0
2499 def IsInitialized(self
, debug_strs
=None):
2501 if (self
.has_value_
and not self
.value_
.IsInitialized(debug_strs
)): initialized
= 0
2506 if (self
.has_name_
): n
+= 1 + self
.lengthString(len(self
.name_
))
2507 if (self
.has_value_
): n
+= 1 + self
.lengthString(self
.value_
.ByteSize())
2508 if (self
.has_cursor_
): n
+= 1 + self
.lengthString(len(self
.cursor_
))
2511 def ByteSizePartial(self
):
2513 if (self
.has_name_
): n
+= 1 + self
.lengthString(len(self
.name_
))
2514 if (self
.has_value_
): n
+= 1 + self
.lengthString(self
.value_
.ByteSizePartial())
2515 if (self
.has_cursor_
): n
+= 1 + self
.lengthString(len(self
.cursor_
))
2523 def OutputUnchecked(self
, out
):
2524 if (self
.has_name_
):
2526 out
.putPrefixedString(self
.name_
)
2527 if (self
.has_value_
):
2529 out
.putVarInt32(self
.value_
.ByteSize())
2530 self
.value_
.OutputUnchecked(out
)
2531 if (self
.has_cursor_
):
2533 out
.putPrefixedString(self
.cursor_
)
2535 def OutputPartial(self
, out
):
2536 if (self
.has_name_
):
2538 out
.putPrefixedString(self
.name_
)
2539 if (self
.has_value_
):
2541 out
.putVarInt32(self
.value_
.ByteSizePartial())
2542 self
.value_
.OutputPartial(out
)
2543 if (self
.has_cursor_
):
2545 out
.putPrefixedString(self
.cursor_
)
2547 def TryMerge(self
, d
):
2548 while d
.avail() > 0:
2549 tt
= d
.getVarInt32()
2551 self
.set_name(d
.getPrefixedString())
2554 length
= d
.getVarInt32()
2555 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2557 self
.mutable_value().TryMerge(tmp
)
2560 self
.set_cursor(d
.getPrefixedString())
2564 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2568 def __str__(self
, prefix
="", printElemNumber
=0):
2570 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
2572 res
+=prefix
+"value <\n"
2573 res
+=self
.value_
.__str
__(prefix
+ " ", printElemNumber
)
2575 if self
.has_cursor_
: res
+=prefix
+("cursor: %s\n" % self
.DebugFormatString(self
.cursor_
))
2579 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2580 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2586 _TEXT
= _BuildTagLookupTable({
2593 _TYPES
= _BuildTagLookupTable({
2594 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2595 1: ProtocolBuffer
.Encoder
.STRING
,
2596 2: ProtocolBuffer
.Encoder
.STRING
,
2597 3: ProtocolBuffer
.Encoder
.STRING
,
2598 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2602 _STYLE_CONTENT_TYPE
= """"""
2603 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.GqlQueryArg'
2604 _SERIALIZED_DESCRIPTOR
= array
.array('B')
2605 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KI2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkdxbFF1ZXJ5QXJnExoEbmFtZSABKAIwCTgBFBMaBXZhbHVlIAIoAjALOAFKHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlZhbHVlowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaBmN1cnNvciADKAIwCTgBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
2606 if _net_proto___parse__python
is not None:
2607 _net_proto___parse__python
.RegisterType(
2608 _SERIALIZED_DESCRIPTOR
.tostring())
2610 class QueryResultBatch(ProtocolBuffer
.ProtocolMessage
):
2614 MORE_RESULTS_AFTER_LIMIT
= 2
2617 _MoreResultsType_NAMES
= {
2619 2: "MORE_RESULTS_AFTER_LIMIT",
2620 3: "NO_MORE_RESULTS",
2623 def MoreResultsType_Name(cls
, x
): return cls
._MoreResultsType
_NAMES
.get(x
, "")
2624 MoreResultsType_Name
= classmethod(MoreResultsType_Name
)
2626 has_entity_result_type_
= 0
2627 entity_result_type_
= 0
2630 has_more_results_
= 0
2632 has_skipped_results_
= 0
2633 skipped_results_
= 0
2635 def __init__(self
, contents
=None):
2636 self
.entity_result_
= []
2637 if contents
is not None: self
.MergeFromString(contents
)
2639 def entity_result_type(self
): return self
.entity_result_type_
2641 def set_entity_result_type(self
, x
):
2642 self
.has_entity_result_type_
= 1
2643 self
.entity_result_type_
= x
2645 def clear_entity_result_type(self
):
2646 if self
.has_entity_result_type_
:
2647 self
.has_entity_result_type_
= 0
2648 self
.entity_result_type_
= 0
2650 def has_entity_result_type(self
): return self
.has_entity_result_type_
2652 def entity_result_size(self
): return len(self
.entity_result_
)
2653 def entity_result_list(self
): return self
.entity_result_
2655 def entity_result(self
, i
):
2656 return self
.entity_result_
[i
]
2658 def mutable_entity_result(self
, i
):
2659 return self
.entity_result_
[i
]
2661 def add_entity_result(self
):
2663 self
.entity_result_
.append(x
)
2666 def clear_entity_result(self
):
2667 self
.entity_result_
= []
2668 def end_cursor(self
): return self
.end_cursor_
2670 def set_end_cursor(self
, x
):
2671 self
.has_end_cursor_
= 1
2672 self
.end_cursor_
= x
2674 def clear_end_cursor(self
):
2675 if self
.has_end_cursor_
:
2676 self
.has_end_cursor_
= 0
2677 self
.end_cursor_
= ""
2679 def has_end_cursor(self
): return self
.has_end_cursor_
2681 def more_results(self
): return self
.more_results_
2683 def set_more_results(self
, x
):
2684 self
.has_more_results_
= 1
2685 self
.more_results_
= x
2687 def clear_more_results(self
):
2688 if self
.has_more_results_
:
2689 self
.has_more_results_
= 0
2690 self
.more_results_
= 0
2692 def has_more_results(self
): return self
.has_more_results_
2694 def skipped_results(self
): return self
.skipped_results_
2696 def set_skipped_results(self
, x
):
2697 self
.has_skipped_results_
= 1
2698 self
.skipped_results_
= x
2700 def clear_skipped_results(self
):
2701 if self
.has_skipped_results_
:
2702 self
.has_skipped_results_
= 0
2703 self
.skipped_results_
= 0
2705 def has_skipped_results(self
): return self
.has_skipped_results_
2708 def MergeFrom(self
, x
):
2709 assert x
is not self
2710 if (x
.has_entity_result_type()): self
.set_entity_result_type(x
.entity_result_type())
2711 for i
in xrange(x
.entity_result_size()): self
.add_entity_result().CopyFrom(x
.entity_result(i
))
2712 if (x
.has_end_cursor()): self
.set_end_cursor(x
.end_cursor())
2713 if (x
.has_more_results()): self
.set_more_results(x
.more_results())
2714 if (x
.has_skipped_results()): self
.set_skipped_results(x
.skipped_results())
2716 if _net_proto___parse__python
is not None:
2717 def _CMergeFromString(self
, s
):
2718 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.QueryResultBatch', s
)
2720 if _net_proto___parse__python
is not None:
2722 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.QueryResultBatch')
2724 if _net_proto___parse__python
is not None:
2725 def _CEncodePartial(self
):
2726 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.QueryResultBatch')
2728 if _net_proto___parse__python
is not None:
2729 def _CToASCII(self
, output_format
):
2730 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.QueryResultBatch', output_format
)
2733 if _net_proto___parse__python
is not None:
2734 def ParseASCII(self
, s
):
2735 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.QueryResultBatch', s
)
2738 if _net_proto___parse__python
is not None:
2739 def ParseASCIIIgnoreUnknown(self
, s
):
2740 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.QueryResultBatch', s
)
2743 def Equals(self
, x
):
2744 if x
is self
: return 1
2745 if self
.has_entity_result_type_
!= x
.has_entity_result_type_
: return 0
2746 if self
.has_entity_result_type_
and self
.entity_result_type_
!= x
.entity_result_type_
: return 0
2747 if len(self
.entity_result_
) != len(x
.entity_result_
): return 0
2748 for e1
, e2
in zip(self
.entity_result_
, x
.entity_result_
):
2749 if e1
!= e2
: return 0
2750 if self
.has_end_cursor_
!= x
.has_end_cursor_
: return 0
2751 if self
.has_end_cursor_
and self
.end_cursor_
!= x
.end_cursor_
: return 0
2752 if self
.has_more_results_
!= x
.has_more_results_
: return 0
2753 if self
.has_more_results_
and self
.more_results_
!= x
.more_results_
: return 0
2754 if self
.has_skipped_results_
!= x
.has_skipped_results_
: return 0
2755 if self
.has_skipped_results_
and self
.skipped_results_
!= x
.skipped_results_
: return 0
2758 def IsInitialized(self
, debug_strs
=None):
2760 if (not self
.has_entity_result_type_
):
2762 if debug_strs
is not None:
2763 debug_strs
.append('Required field: entity_result_type not set.')
2764 for p
in self
.entity_result_
:
2765 if not p
.IsInitialized(debug_strs
): initialized
=0
2766 if (not self
.has_more_results_
):
2768 if debug_strs
is not None:
2769 debug_strs
.append('Required field: more_results not set.')
2774 n
+= self
.lengthVarInt64(self
.entity_result_type_
)
2775 n
+= 1 * len(self
.entity_result_
)
2776 for i
in xrange(len(self
.entity_result_
)): n
+= self
.lengthString(self
.entity_result_
[i
].ByteSize())
2777 if (self
.has_end_cursor_
): n
+= 1 + self
.lengthString(len(self
.end_cursor_
))
2778 n
+= self
.lengthVarInt64(self
.more_results_
)
2779 if (self
.has_skipped_results_
): n
+= 1 + self
.lengthVarInt64(self
.skipped_results_
)
2782 def ByteSizePartial(self
):
2784 if (self
.has_entity_result_type_
):
2786 n
+= self
.lengthVarInt64(self
.entity_result_type_
)
2787 n
+= 1 * len(self
.entity_result_
)
2788 for i
in xrange(len(self
.entity_result_
)): n
+= self
.lengthString(self
.entity_result_
[i
].ByteSizePartial())
2789 if (self
.has_end_cursor_
): n
+= 1 + self
.lengthString(len(self
.end_cursor_
))
2790 if (self
.has_more_results_
):
2792 n
+= self
.lengthVarInt64(self
.more_results_
)
2793 if (self
.has_skipped_results_
): n
+= 1 + self
.lengthVarInt64(self
.skipped_results_
)
2797 self
.clear_entity_result_type()
2798 self
.clear_entity_result()
2799 self
.clear_end_cursor()
2800 self
.clear_more_results()
2801 self
.clear_skipped_results()
2803 def OutputUnchecked(self
, out
):
2805 out
.putVarInt32(self
.entity_result_type_
)
2806 for i
in xrange(len(self
.entity_result_
)):
2808 out
.putVarInt32(self
.entity_result_
[i
].ByteSize())
2809 self
.entity_result_
[i
].OutputUnchecked(out
)
2810 if (self
.has_end_cursor_
):
2812 out
.putPrefixedString(self
.end_cursor_
)
2814 out
.putVarInt32(self
.more_results_
)
2815 if (self
.has_skipped_results_
):
2817 out
.putVarInt32(self
.skipped_results_
)
2819 def OutputPartial(self
, out
):
2820 if (self
.has_entity_result_type_
):
2822 out
.putVarInt32(self
.entity_result_type_
)
2823 for i
in xrange(len(self
.entity_result_
)):
2825 out
.putVarInt32(self
.entity_result_
[i
].ByteSizePartial())
2826 self
.entity_result_
[i
].OutputPartial(out
)
2827 if (self
.has_end_cursor_
):
2829 out
.putPrefixedString(self
.end_cursor_
)
2830 if (self
.has_more_results_
):
2832 out
.putVarInt32(self
.more_results_
)
2833 if (self
.has_skipped_results_
):
2835 out
.putVarInt32(self
.skipped_results_
)
2837 def TryMerge(self
, d
):
2838 while d
.avail() > 0:
2839 tt
= d
.getVarInt32()
2841 self
.set_entity_result_type(d
.getVarInt32())
2844 length
= d
.getVarInt32()
2845 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2847 self
.add_entity_result().TryMerge(tmp
)
2850 self
.set_end_cursor(d
.getPrefixedString())
2853 self
.set_more_results(d
.getVarInt32())
2856 self
.set_skipped_results(d
.getVarInt32())
2860 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2864 def __str__(self
, prefix
="", printElemNumber
=0):
2866 if self
.has_entity_result_type_
: res
+=prefix
+("entity_result_type: %s\n" % self
.DebugFormatInt32(self
.entity_result_type_
))
2868 for e
in self
.entity_result_
:
2870 if printElemNumber
: elm
="(%d)" % cnt
2871 res
+=prefix
+("entity_result%s <\n" % elm
)
2872 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2875 if self
.has_end_cursor_
: res
+=prefix
+("end_cursor: %s\n" % self
.DebugFormatString(self
.end_cursor_
))
2876 if self
.has_more_results_
: res
+=prefix
+("more_results: %s\n" % self
.DebugFormatInt32(self
.more_results_
))
2877 if self
.has_skipped_results_
: res
+=prefix
+("skipped_results: %s\n" % self
.DebugFormatInt32(self
.skipped_results_
))
2881 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2882 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2884 kentity_result_type
= 1
2888 kskipped_results
= 6
2890 _TEXT
= _BuildTagLookupTable({
2892 1: "entity_result_type",
2896 6: "skipped_results",
2899 _TYPES
= _BuildTagLookupTable({
2900 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2901 1: ProtocolBuffer
.Encoder
.NUMERIC
,
2902 2: ProtocolBuffer
.Encoder
.STRING
,
2903 4: ProtocolBuffer
.Encoder
.STRING
,
2904 5: ProtocolBuffer
.Encoder
.NUMERIC
,
2905 6: ProtocolBuffer
.Encoder
.NUMERIC
,
2906 }, 6, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2910 _STYLE_CONTENT_TYPE
= """"""
2911 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.QueryResultBatch'
2912 _SERIALIZED_DESCRIPTOR
= array
.array('B')
2913 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlF1ZXJ5UmVzdWx0QmF0Y2gTGhJlbnRpdHlfcmVzdWx0X3R5cGUgASgAMAU4AhQTGg1lbnRpdHlfcmVzdWx0IAIoAjALOANKJGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eVJlc3VsdKMBqgEFY3R5cGWyAQZwcm90bzKkARQTGgplbmRfY3Vyc29yIAQoAjAJOAEUExoMbW9yZV9yZXN1bHRzIAUoADAFOAJoABQTGg9za2lwcGVkX3Jlc3VsdHMgBigAMAU4AUIBMKMBqgEHZGVmYXVsdLIBATCkARRzeg9Nb3JlUmVzdWx0c1R5cGWLAZIBDE5PVF9GSU5JU0hFRJgBAYwBiwGSARhNT1JFX1JFU1VMVFNfQUZURVJfTElNSVSYAQKMAYsBkgEPTk9fTU9SRV9SRVNVTFRTmAEDjAF0wgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
2914 if _net_proto___parse__python
is not None:
2915 _net_proto___parse__python
.RegisterType(
2916 _SERIALIZED_DESCRIPTOR
.tostring())
2918 class Mutation(ProtocolBuffer
.ProtocolMessage
):
2926 _Operation_NAMES
= {
2933 def Operation_Name(cls
, x
): return cls
._Operation
_NAMES
.get(x
, "")
2934 Operation_Name
= classmethod(Operation_Name
)
2943 def __init__(self
, contents
=None):
2944 self
.lazy_init_lock_
= thread
.allocate_lock()
2945 if contents
is not None: self
.MergeFromString(contents
)
2947 def op(self
): return self
.op_
2949 def set_op(self
, x
):
2958 def has_op(self
): return self
.has_op_
2961 if self
.key_
is None:
2962 self
.lazy_init_lock_
.acquire()
2964 if self
.key_
is None: self
.key_
= google
.appengine
.datastore
.entity_v4_pb
.Key()
2966 self
.lazy_init_lock_
.release()
2969 def mutable_key(self
): self
.has_key_
= 1; return self
.key()
2971 def clear_key(self
):
2975 if self
.key_
is not None: self
.key_
.Clear()
2977 def has_key(self
): return self
.has_key_
2980 if self
.entity_
is None:
2981 self
.lazy_init_lock_
.acquire()
2983 if self
.entity_
is None: self
.entity_
= google
.appengine
.datastore
.entity_v4_pb
.Entity()
2985 self
.lazy_init_lock_
.release()
2988 def mutable_entity(self
): self
.has_entity_
= 1; return self
.entity()
2990 def clear_entity(self
):
2992 if self
.has_entity_
:
2993 self
.has_entity_
= 0;
2994 if self
.entity_
is not None: self
.entity_
.Clear()
2996 def has_entity(self
): return self
.has_entity_
2999 def MergeFrom(self
, x
):
3000 assert x
is not self
3001 if (x
.has_op()): self
.set_op(x
.op())
3002 if (x
.has_key()): self
.mutable_key().MergeFrom(x
.key())
3003 if (x
.has_entity()): self
.mutable_entity().MergeFrom(x
.entity())
3005 if _net_proto___parse__python
is not None:
3006 def _CMergeFromString(self
, s
):
3007 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.Mutation', s
)
3009 if _net_proto___parse__python
is not None:
3011 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.Mutation')
3013 if _net_proto___parse__python
is not None:
3014 def _CEncodePartial(self
):
3015 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.Mutation')
3017 if _net_proto___parse__python
is not None:
3018 def _CToASCII(self
, output_format
):
3019 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.Mutation', output_format
)
3022 if _net_proto___parse__python
is not None:
3023 def ParseASCII(self
, s
):
3024 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.Mutation', s
)
3027 if _net_proto___parse__python
is not None:
3028 def ParseASCIIIgnoreUnknown(self
, s
):
3029 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.Mutation', s
)
3032 def Equals(self
, x
):
3033 if x
is self
: return 1
3034 if self
.has_op_
!= x
.has_op_
: return 0
3035 if self
.has_op_
and self
.op_
!= x
.op_
: return 0
3036 if self
.has_key_
!= x
.has_key_
: return 0
3037 if self
.has_key_
and self
.key_
!= x
.key_
: return 0
3038 if self
.has_entity_
!= x
.has_entity_
: return 0
3039 if self
.has_entity_
and self
.entity_
!= x
.entity_
: return 0
3042 def IsInitialized(self
, debug_strs
=None):
3044 if (not self
.has_op_
):
3046 if debug_strs
is not None:
3047 debug_strs
.append('Required field: op not set.')
3048 if (self
.has_key_
and not self
.key_
.IsInitialized(debug_strs
)): initialized
= 0
3049 if (self
.has_entity_
and not self
.entity_
.IsInitialized(debug_strs
)): initialized
= 0
3054 n
+= self
.lengthVarInt64(self
.op_
)
3055 if (self
.has_key_
): n
+= 1 + self
.lengthString(self
.key_
.ByteSize())
3056 if (self
.has_entity_
): n
+= 1 + self
.lengthString(self
.entity_
.ByteSize())
3059 def ByteSizePartial(self
):
3063 n
+= self
.lengthVarInt64(self
.op_
)
3064 if (self
.has_key_
): n
+= 1 + self
.lengthString(self
.key_
.ByteSizePartial())
3065 if (self
.has_entity_
): n
+= 1 + self
.lengthString(self
.entity_
.ByteSizePartial())
3073 def OutputUnchecked(self
, out
):
3075 out
.putVarInt32(self
.op_
)
3078 out
.putVarInt32(self
.key_
.ByteSize())
3079 self
.key_
.OutputUnchecked(out
)
3080 if (self
.has_entity_
):
3082 out
.putVarInt32(self
.entity_
.ByteSize())
3083 self
.entity_
.OutputUnchecked(out
)
3085 def OutputPartial(self
, out
):
3088 out
.putVarInt32(self
.op_
)
3091 out
.putVarInt32(self
.key_
.ByteSizePartial())
3092 self
.key_
.OutputPartial(out
)
3093 if (self
.has_entity_
):
3095 out
.putVarInt32(self
.entity_
.ByteSizePartial())
3096 self
.entity_
.OutputPartial(out
)
3098 def TryMerge(self
, d
):
3099 while d
.avail() > 0:
3100 tt
= d
.getVarInt32()
3102 self
.set_op(d
.getVarInt32())
3105 length
= d
.getVarInt32()
3106 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3108 self
.mutable_key().TryMerge(tmp
)
3111 length
= d
.getVarInt32()
3112 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3114 self
.mutable_entity().TryMerge(tmp
)
3118 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3122 def __str__(self
, prefix
="", printElemNumber
=0):
3124 if self
.has_op_
: res
+=prefix
+("op: %s\n" % self
.DebugFormatInt32(self
.op_
))
3126 res
+=prefix
+"key <\n"
3127 res
+=self
.key_
.__str
__(prefix
+ " ", printElemNumber
)
3129 if self
.has_entity_
:
3130 res
+=prefix
+"entity <\n"
3131 res
+=self
.entity_
.__str
__(prefix
+ " ", printElemNumber
)
3136 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3137 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3143 _TEXT
= _BuildTagLookupTable({
3150 _TYPES
= _BuildTagLookupTable({
3151 0: ProtocolBuffer
.Encoder
.NUMERIC
,
3152 1: ProtocolBuffer
.Encoder
.NUMERIC
,
3153 2: ProtocolBuffer
.Encoder
.STRING
,
3154 3: ProtocolBuffer
.Encoder
.STRING
,
3155 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
3159 _STYLE_CONTENT_TYPE
= """"""
3160 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.Mutation'
3161 _SERIALIZED_DESCRIPTOR
= array
.array('B')
3162 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KIGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uExoCb3AgASgAMAU4AmgAFBMaA2tleSACKAIwCzgBShthcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LZXmjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoGZW50aXR5IAMoAjALOAFKHmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eaMBqgEFY3R5cGWyAQZwcm90bzKkARRzeglPcGVyYXRpb26LAZIBBklOU0VSVJgBAYwBiwGSAQZVUERBVEWYAQKMAYsBkgEGVVBTRVJUmAEDjAGLAZIBBkRFTEVURZgBBIwBdMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
3163 if _net_proto___parse__python
is not None:
3164 _net_proto___parse__python
.RegisterType(
3165 _SERIALIZED_DESCRIPTOR
.tostring())
3167 class MutationResult(ProtocolBuffer
.ProtocolMessage
):
3170 has_new_version_
= 0
3173 def __init__(self
, contents
=None):
3174 self
.lazy_init_lock_
= thread
.allocate_lock()
3175 if contents
is not None: self
.MergeFromString(contents
)
3178 if self
.key_
is None:
3179 self
.lazy_init_lock_
.acquire()
3181 if self
.key_
is None: self
.key_
= google
.appengine
.datastore
.entity_v4_pb
.Key()
3183 self
.lazy_init_lock_
.release()
3186 def mutable_key(self
): self
.has_key_
= 1; return self
.key()
3188 def clear_key(self
):
3192 if self
.key_
is not None: self
.key_
.Clear()
3194 def has_key(self
): return self
.has_key_
3196 def new_version(self
): return self
.new_version_
3198 def set_new_version(self
, x
):
3199 self
.has_new_version_
= 1
3200 self
.new_version_
= x
3202 def clear_new_version(self
):
3203 if self
.has_new_version_
:
3204 self
.has_new_version_
= 0
3205 self
.new_version_
= 0
3207 def has_new_version(self
): return self
.has_new_version_
3210 def MergeFrom(self
, x
):
3211 assert x
is not self
3212 if (x
.has_key()): self
.mutable_key().MergeFrom(x
.key())
3213 if (x
.has_new_version()): self
.set_new_version(x
.new_version())
3215 if _net_proto___parse__python
is not None:
3216 def _CMergeFromString(self
, s
):
3217 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.MutationResult', s
)
3219 if _net_proto___parse__python
is not None:
3221 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.MutationResult')
3223 if _net_proto___parse__python
is not None:
3224 def _CEncodePartial(self
):
3225 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.MutationResult')
3227 if _net_proto___parse__python
is not None:
3228 def _CToASCII(self
, output_format
):
3229 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.MutationResult', output_format
)
3232 if _net_proto___parse__python
is not None:
3233 def ParseASCII(self
, s
):
3234 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.MutationResult', s
)
3237 if _net_proto___parse__python
is not None:
3238 def ParseASCIIIgnoreUnknown(self
, s
):
3239 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.MutationResult', s
)
3242 def Equals(self
, x
):
3243 if x
is self
: return 1
3244 if self
.has_key_
!= x
.has_key_
: return 0
3245 if self
.has_key_
and self
.key_
!= x
.key_
: return 0
3246 if self
.has_new_version_
!= x
.has_new_version_
: return 0
3247 if self
.has_new_version_
and self
.new_version_
!= x
.new_version_
: return 0
3250 def IsInitialized(self
, debug_strs
=None):
3252 if (self
.has_key_
and not self
.key_
.IsInitialized(debug_strs
)): initialized
= 0
3257 if (self
.has_key_
): n
+= 1 + self
.lengthString(self
.key_
.ByteSize())
3258 if (self
.has_new_version_
): n
+= 1 + self
.lengthVarInt64(self
.new_version_
)
3261 def ByteSizePartial(self
):
3263 if (self
.has_key_
): n
+= 1 + self
.lengthString(self
.key_
.ByteSizePartial())
3264 if (self
.has_new_version_
): n
+= 1 + self
.lengthVarInt64(self
.new_version_
)
3269 self
.clear_new_version()
3271 def OutputUnchecked(self
, out
):
3274 out
.putVarInt32(self
.key_
.ByteSize())
3275 self
.key_
.OutputUnchecked(out
)
3276 if (self
.has_new_version_
):
3278 out
.putVarInt64(self
.new_version_
)
3280 def OutputPartial(self
, out
):
3283 out
.putVarInt32(self
.key_
.ByteSizePartial())
3284 self
.key_
.OutputPartial(out
)
3285 if (self
.has_new_version_
):
3287 out
.putVarInt64(self
.new_version_
)
3289 def TryMerge(self
, d
):
3290 while d
.avail() > 0:
3291 tt
= d
.getVarInt32()
3293 length
= d
.getVarInt32()
3294 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3296 self
.mutable_key().TryMerge(tmp
)
3299 self
.set_new_version(d
.getVarInt64())
3303 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3307 def __str__(self
, prefix
="", printElemNumber
=0):
3310 res
+=prefix
+"key <\n"
3311 res
+=self
.key_
.__str
__(prefix
+ " ", printElemNumber
)
3313 if self
.has_new_version_
: res
+=prefix
+("new_version: %s\n" % self
.DebugFormatInt64(self
.new_version_
))
3317 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3318 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3323 _TEXT
= _BuildTagLookupTable({
3329 _TYPES
= _BuildTagLookupTable({
3330 0: ProtocolBuffer
.Encoder
.NUMERIC
,
3331 3: ProtocolBuffer
.Encoder
.STRING
,
3332 4: ProtocolBuffer
.Encoder
.NUMERIC
,
3333 }, 4, ProtocolBuffer
.Encoder
.MAX_TYPE
)
3337 _STYLE_CONTENT_TYPE
= """"""
3338 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.MutationResult'
3339 _SERIALIZED_DESCRIPTOR
= array
.array('B')
3340 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uUmVzdWx0ExoDa2V5IAMoAjALOAFKG2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleaMBqgEFY3R5cGWyAQZwcm90bzKkARQTGgtuZXdfdmVyc2lvbiAEKAAwAzgBQgEwowGqAQdkZWZhdWx0sgEBMKQBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
3341 if _net_proto___parse__python
is not None:
3342 _net_proto___parse__python
.RegisterType(
3343 _SERIALIZED_DESCRIPTOR
.tostring())
3345 class DeprecatedMutation(ProtocolBuffer
.ProtocolMessage
):
3349 def __init__(self
, contents
=None):
3353 self
.insert_auto_id_
= []
3355 if contents
is not None: self
.MergeFromString(contents
)
3357 def upsert_size(self
): return len(self
.upsert_
)
3358 def upsert_list(self
): return self
.upsert_
3360 def upsert(self
, i
):
3361 return self
.upsert_
[i
]
3363 def mutable_upsert(self
, i
):
3364 return self
.upsert_
[i
]
3366 def add_upsert(self
):
3367 x
= google
.appengine
.datastore
.entity_v4_pb
.Entity()
3368 self
.upsert_
.append(x
)
3371 def clear_upsert(self
):
3373 def update_size(self
): return len(self
.update_
)
3374 def update_list(self
): return self
.update_
3376 def update(self
, i
):
3377 return self
.update_
[i
]
3379 def mutable_update(self
, i
):
3380 return self
.update_
[i
]
3382 def add_update(self
):
3383 x
= google
.appengine
.datastore
.entity_v4_pb
.Entity()
3384 self
.update_
.append(x
)
3387 def clear_update(self
):
3389 def insert_size(self
): return len(self
.insert_
)
3390 def insert_list(self
): return self
.insert_
3392 def insert(self
, i
):
3393 return self
.insert_
[i
]
3395 def mutable_insert(self
, i
):
3396 return self
.insert_
[i
]
3398 def add_insert(self
):
3399 x
= google
.appengine
.datastore
.entity_v4_pb
.Entity()
3400 self
.insert_
.append(x
)
3403 def clear_insert(self
):
3405 def insert_auto_id_size(self
): return len(self
.insert_auto_id_
)
3406 def insert_auto_id_list(self
): return self
.insert_auto_id_
3408 def insert_auto_id(self
, i
):
3409 return self
.insert_auto_id_
[i
]
3411 def mutable_insert_auto_id(self
, i
):
3412 return self
.insert_auto_id_
[i
]
3414 def add_insert_auto_id(self
):
3415 x
= google
.appengine
.datastore
.entity_v4_pb
.Entity()
3416 self
.insert_auto_id_
.append(x
)
3419 def clear_insert_auto_id(self
):
3420 self
.insert_auto_id_
= []
3421 def delete_size(self
): return len(self
.delete_
)
3422 def delete_list(self
): return self
.delete_
3424 def delete(self
, i
):
3425 return self
.delete_
[i
]
3427 def mutable_delete(self
, i
):
3428 return self
.delete_
[i
]
3430 def add_delete(self
):
3431 x
= google
.appengine
.datastore
.entity_v4_pb
.Key()
3432 self
.delete_
.append(x
)
3435 def clear_delete(self
):
3437 def force(self
): return self
.force_
3439 def set_force(self
, x
):
3443 def clear_force(self
):
3448 def has_force(self
): return self
.has_force_
3451 def MergeFrom(self
, x
):
3452 assert x
is not self
3453 for i
in xrange(x
.upsert_size()): self
.add_upsert().CopyFrom(x
.upsert(i
))
3454 for i
in xrange(x
.update_size()): self
.add_update().CopyFrom(x
.update(i
))
3455 for i
in xrange(x
.insert_size()): self
.add_insert().CopyFrom(x
.insert(i
))
3456 for i
in xrange(x
.insert_auto_id_size()): self
.add_insert_auto_id().CopyFrom(x
.insert_auto_id(i
))
3457 for i
in xrange(x
.delete_size()): self
.add_delete().CopyFrom(x
.delete(i
))
3458 if (x
.has_force()): self
.set_force(x
.force())
3460 if _net_proto___parse__python
is not None:
3461 def _CMergeFromString(self
, s
):
3462 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.DeprecatedMutation', s
)
3464 if _net_proto___parse__python
is not None:
3466 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.DeprecatedMutation')
3468 if _net_proto___parse__python
is not None:
3469 def _CEncodePartial(self
):
3470 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.DeprecatedMutation')
3472 if _net_proto___parse__python
is not None:
3473 def _CToASCII(self
, output_format
):
3474 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.DeprecatedMutation', output_format
)
3477 if _net_proto___parse__python
is not None:
3478 def ParseASCII(self
, s
):
3479 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.DeprecatedMutation', s
)
3482 if _net_proto___parse__python
is not None:
3483 def ParseASCIIIgnoreUnknown(self
, s
):
3484 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.DeprecatedMutation', s
)
3487 def Equals(self
, x
):
3488 if x
is self
: return 1
3489 if len(self
.upsert_
) != len(x
.upsert_
): return 0
3490 for e1
, e2
in zip(self
.upsert_
, x
.upsert_
):
3491 if e1
!= e2
: return 0
3492 if len(self
.update_
) != len(x
.update_
): return 0
3493 for e1
, e2
in zip(self
.update_
, x
.update_
):
3494 if e1
!= e2
: return 0
3495 if len(self
.insert_
) != len(x
.insert_
): return 0
3496 for e1
, e2
in zip(self
.insert_
, x
.insert_
):
3497 if e1
!= e2
: return 0
3498 if len(self
.insert_auto_id_
) != len(x
.insert_auto_id_
): return 0
3499 for e1
, e2
in zip(self
.insert_auto_id_
, x
.insert_auto_id_
):
3500 if e1
!= e2
: return 0
3501 if len(self
.delete_
) != len(x
.delete_
): return 0
3502 for e1
, e2
in zip(self
.delete_
, x
.delete_
):
3503 if e1
!= e2
: return 0
3504 if self
.has_force_
!= x
.has_force_
: return 0
3505 if self
.has_force_
and self
.force_
!= x
.force_
: return 0
3508 def IsInitialized(self
, debug_strs
=None):
3510 for p
in self
.upsert_
:
3511 if not p
.IsInitialized(debug_strs
): initialized
=0
3512 for p
in self
.update_
:
3513 if not p
.IsInitialized(debug_strs
): initialized
=0
3514 for p
in self
.insert_
:
3515 if not p
.IsInitialized(debug_strs
): initialized
=0
3516 for p
in self
.insert_auto_id_
:
3517 if not p
.IsInitialized(debug_strs
): initialized
=0
3518 for p
in self
.delete_
:
3519 if not p
.IsInitialized(debug_strs
): initialized
=0
3524 n
+= 1 * len(self
.upsert_
)
3525 for i
in xrange(len(self
.upsert_
)): n
+= self
.lengthString(self
.upsert_
[i
].ByteSize())
3526 n
+= 1 * len(self
.update_
)
3527 for i
in xrange(len(self
.update_
)): n
+= self
.lengthString(self
.update_
[i
].ByteSize())
3528 n
+= 1 * len(self
.insert_
)
3529 for i
in xrange(len(self
.insert_
)): n
+= self
.lengthString(self
.insert_
[i
].ByteSize())
3530 n
+= 1 * len(self
.insert_auto_id_
)
3531 for i
in xrange(len(self
.insert_auto_id_
)): n
+= self
.lengthString(self
.insert_auto_id_
[i
].ByteSize())
3532 n
+= 1 * len(self
.delete_
)
3533 for i
in xrange(len(self
.delete_
)): n
+= self
.lengthString(self
.delete_
[i
].ByteSize())
3534 if (self
.has_force_
): n
+= 2
3537 def ByteSizePartial(self
):
3539 n
+= 1 * len(self
.upsert_
)
3540 for i
in xrange(len(self
.upsert_
)): n
+= self
.lengthString(self
.upsert_
[i
].ByteSizePartial())
3541 n
+= 1 * len(self
.update_
)
3542 for i
in xrange(len(self
.update_
)): n
+= self
.lengthString(self
.update_
[i
].ByteSizePartial())
3543 n
+= 1 * len(self
.insert_
)
3544 for i
in xrange(len(self
.insert_
)): n
+= self
.lengthString(self
.insert_
[i
].ByteSizePartial())
3545 n
+= 1 * len(self
.insert_auto_id_
)
3546 for i
in xrange(len(self
.insert_auto_id_
)): n
+= self
.lengthString(self
.insert_auto_id_
[i
].ByteSizePartial())
3547 n
+= 1 * len(self
.delete_
)
3548 for i
in xrange(len(self
.delete_
)): n
+= self
.lengthString(self
.delete_
[i
].ByteSizePartial())
3549 if (self
.has_force_
): n
+= 2
3556 self
.clear_insert_auto_id()
3560 def OutputUnchecked(self
, out
):
3561 for i
in xrange(len(self
.upsert_
)):
3563 out
.putVarInt32(self
.upsert_
[i
].ByteSize())
3564 self
.upsert_
[i
].OutputUnchecked(out
)
3565 for i
in xrange(len(self
.update_
)):
3567 out
.putVarInt32(self
.update_
[i
].ByteSize())
3568 self
.update_
[i
].OutputUnchecked(out
)
3569 for i
in xrange(len(self
.insert_
)):
3571 out
.putVarInt32(self
.insert_
[i
].ByteSize())
3572 self
.insert_
[i
].OutputUnchecked(out
)
3573 for i
in xrange(len(self
.insert_auto_id_
)):
3575 out
.putVarInt32(self
.insert_auto_id_
[i
].ByteSize())
3576 self
.insert_auto_id_
[i
].OutputUnchecked(out
)
3577 for i
in xrange(len(self
.delete_
)):
3579 out
.putVarInt32(self
.delete_
[i
].ByteSize())
3580 self
.delete_
[i
].OutputUnchecked(out
)
3581 if (self
.has_force_
):
3583 out
.putBoolean(self
.force_
)
3585 def OutputPartial(self
, out
):
3586 for i
in xrange(len(self
.upsert_
)):
3588 out
.putVarInt32(self
.upsert_
[i
].ByteSizePartial())
3589 self
.upsert_
[i
].OutputPartial(out
)
3590 for i
in xrange(len(self
.update_
)):
3592 out
.putVarInt32(self
.update_
[i
].ByteSizePartial())
3593 self
.update_
[i
].OutputPartial(out
)
3594 for i
in xrange(len(self
.insert_
)):
3596 out
.putVarInt32(self
.insert_
[i
].ByteSizePartial())
3597 self
.insert_
[i
].OutputPartial(out
)
3598 for i
in xrange(len(self
.insert_auto_id_
)):
3600 out
.putVarInt32(self
.insert_auto_id_
[i
].ByteSizePartial())
3601 self
.insert_auto_id_
[i
].OutputPartial(out
)
3602 for i
in xrange(len(self
.delete_
)):
3604 out
.putVarInt32(self
.delete_
[i
].ByteSizePartial())
3605 self
.delete_
[i
].OutputPartial(out
)
3606 if (self
.has_force_
):
3608 out
.putBoolean(self
.force_
)
3610 def TryMerge(self
, d
):
3611 while d
.avail() > 0:
3612 tt
= d
.getVarInt32()
3614 length
= d
.getVarInt32()
3615 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3617 self
.add_upsert().TryMerge(tmp
)
3620 length
= d
.getVarInt32()
3621 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3623 self
.add_update().TryMerge(tmp
)
3626 length
= d
.getVarInt32()
3627 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3629 self
.add_insert().TryMerge(tmp
)
3632 length
= d
.getVarInt32()
3633 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3635 self
.add_insert_auto_id().TryMerge(tmp
)
3638 length
= d
.getVarInt32()
3639 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3641 self
.add_delete().TryMerge(tmp
)
3644 self
.set_force(d
.getBoolean())
3648 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3652 def __str__(self
, prefix
="", printElemNumber
=0):
3655 for e
in self
.upsert_
:
3657 if printElemNumber
: elm
="(%d)" % cnt
3658 res
+=prefix
+("upsert%s <\n" % elm
)
3659 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
3663 for e
in self
.update_
:
3665 if printElemNumber
: elm
="(%d)" % cnt
3666 res
+=prefix
+("update%s <\n" % elm
)
3667 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
3671 for e
in self
.insert_
:
3673 if printElemNumber
: elm
="(%d)" % cnt
3674 res
+=prefix
+("insert%s <\n" % elm
)
3675 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
3679 for e
in self
.insert_auto_id_
:
3681 if printElemNumber
: elm
="(%d)" % cnt
3682 res
+=prefix
+("insert_auto_id%s <\n" % elm
)
3683 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
3687 for e
in self
.delete_
:
3689 if printElemNumber
: elm
="(%d)" % cnt
3690 res
+=prefix
+("delete%s <\n" % elm
)
3691 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
3694 if self
.has_force_
: res
+=prefix
+("force: %s\n" % self
.DebugFormatBool(self
.force_
))
3698 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3699 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3708 _TEXT
= _BuildTagLookupTable({
3713 4: "insert_auto_id",
3718 _TYPES
= _BuildTagLookupTable({
3719 0: ProtocolBuffer
.Encoder
.NUMERIC
,
3720 1: ProtocolBuffer
.Encoder
.STRING
,
3721 2: ProtocolBuffer
.Encoder
.STRING
,
3722 3: ProtocolBuffer
.Encoder
.STRING
,
3723 4: ProtocolBuffer
.Encoder
.STRING
,
3724 5: ProtocolBuffer
.Encoder
.STRING
,
3725 6: ProtocolBuffer
.Encoder
.NUMERIC
,
3726 }, 6, ProtocolBuffer
.Encoder
.MAX_TYPE
)
3730 _STYLE_CONTENT_TYPE
= """"""
3731 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.DeprecatedMutation'
3732 _SERIALIZED_DESCRIPTOR
= array
.array('B')
3733 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkRlcHJlY2F0ZWRNdXRhdGlvbhMaBnVwc2VydCABKAIwCzgDSh5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FbnRpdHmjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoGdXBkYXRlIAIoAjALOANKHmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eaMBqgEFY3R5cGWyAQZwcm90bzKkARQTGgZpbnNlcnQgAygCMAs4A0oeYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaDmluc2VydF9hdXRvX2lkIAQoAjALOANKHmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eaMBqgEFY3R5cGWyAQZwcm90bzKkARQTGgZkZWxldGUgBSgCMAs4A0obYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuS2V5owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaBWZvcmNlIAYoADAIOAFCBWZhbHNlowGqAQdkZWZhdWx0sgEFZmFsc2WkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
3734 if _net_proto___parse__python
is not None:
3735 _net_proto___parse__python
.RegisterType(
3736 _SERIALIZED_DESCRIPTOR
.tostring())
3738 class DeprecatedMutationResult(ProtocolBuffer
.ProtocolMessage
):
3739 has_index_updates_
= 0
3742 def __init__(self
, contents
=None):
3743 self
.insert_auto_id_key_
= []
3744 self
.upsert_version_
= []
3745 self
.update_version_
= []
3746 self
.insert_version_
= []
3747 self
.insert_auto_id_version_
= []
3748 self
.delete_version_
= []
3749 if contents
is not None: self
.MergeFromString(contents
)
3751 def index_updates(self
): return self
.index_updates_
3753 def set_index_updates(self
, x
):
3754 self
.has_index_updates_
= 1
3755 self
.index_updates_
= x
3757 def clear_index_updates(self
):
3758 if self
.has_index_updates_
:
3759 self
.has_index_updates_
= 0
3760 self
.index_updates_
= 0
3762 def has_index_updates(self
): return self
.has_index_updates_
3764 def insert_auto_id_key_size(self
): return len(self
.insert_auto_id_key_
)
3765 def insert_auto_id_key_list(self
): return self
.insert_auto_id_key_
3767 def insert_auto_id_key(self
, i
):
3768 return self
.insert_auto_id_key_
[i
]
3770 def mutable_insert_auto_id_key(self
, i
):
3771 return self
.insert_auto_id_key_
[i
]
3773 def add_insert_auto_id_key(self
):
3774 x
= google
.appengine
.datastore
.entity_v4_pb
.Key()
3775 self
.insert_auto_id_key_
.append(x
)
3778 def clear_insert_auto_id_key(self
):
3779 self
.insert_auto_id_key_
= []
3780 def upsert_version_size(self
): return len(self
.upsert_version_
)
3781 def upsert_version_list(self
): return self
.upsert_version_
3783 def upsert_version(self
, i
):
3784 return self
.upsert_version_
[i
]
3786 def set_upsert_version(self
, i
, x
):
3787 self
.upsert_version_
[i
] = x
3789 def add_upsert_version(self
, x
):
3790 self
.upsert_version_
.append(x
)
3792 def clear_upsert_version(self
):
3793 self
.upsert_version_
= []
3795 def update_version_size(self
): return len(self
.update_version_
)
3796 def update_version_list(self
): return self
.update_version_
3798 def update_version(self
, i
):
3799 return self
.update_version_
[i
]
3801 def set_update_version(self
, i
, x
):
3802 self
.update_version_
[i
] = x
3804 def add_update_version(self
, x
):
3805 self
.update_version_
.append(x
)
3807 def clear_update_version(self
):
3808 self
.update_version_
= []
3810 def insert_version_size(self
): return len(self
.insert_version_
)
3811 def insert_version_list(self
): return self
.insert_version_
3813 def insert_version(self
, i
):
3814 return self
.insert_version_
[i
]
3816 def set_insert_version(self
, i
, x
):
3817 self
.insert_version_
[i
] = x
3819 def add_insert_version(self
, x
):
3820 self
.insert_version_
.append(x
)
3822 def clear_insert_version(self
):
3823 self
.insert_version_
= []
3825 def insert_auto_id_version_size(self
): return len(self
.insert_auto_id_version_
)
3826 def insert_auto_id_version_list(self
): return self
.insert_auto_id_version_
3828 def insert_auto_id_version(self
, i
):
3829 return self
.insert_auto_id_version_
[i
]
3831 def set_insert_auto_id_version(self
, i
, x
):
3832 self
.insert_auto_id_version_
[i
] = x
3834 def add_insert_auto_id_version(self
, x
):
3835 self
.insert_auto_id_version_
.append(x
)
3837 def clear_insert_auto_id_version(self
):
3838 self
.insert_auto_id_version_
= []
3840 def delete_version_size(self
): return len(self
.delete_version_
)
3841 def delete_version_list(self
): return self
.delete_version_
3843 def delete_version(self
, i
):
3844 return self
.delete_version_
[i
]
3846 def set_delete_version(self
, i
, x
):
3847 self
.delete_version_
[i
] = x
3849 def add_delete_version(self
, x
):
3850 self
.delete_version_
.append(x
)
3852 def clear_delete_version(self
):
3853 self
.delete_version_
= []
3856 def MergeFrom(self
, x
):
3857 assert x
is not self
3858 if (x
.has_index_updates()): self
.set_index_updates(x
.index_updates())
3859 for i
in xrange(x
.insert_auto_id_key_size()): self
.add_insert_auto_id_key().CopyFrom(x
.insert_auto_id_key(i
))
3860 for i
in xrange(x
.upsert_version_size()): self
.add_upsert_version(x
.upsert_version(i
))
3861 for i
in xrange(x
.update_version_size()): self
.add_update_version(x
.update_version(i
))
3862 for i
in xrange(x
.insert_version_size()): self
.add_insert_version(x
.insert_version(i
))
3863 for i
in xrange(x
.insert_auto_id_version_size()): self
.add_insert_auto_id_version(x
.insert_auto_id_version(i
))
3864 for i
in xrange(x
.delete_version_size()): self
.add_delete_version(x
.delete_version(i
))
3866 if _net_proto___parse__python
is not None:
3867 def _CMergeFromString(self
, s
):
3868 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.DeprecatedMutationResult', s
)
3870 if _net_proto___parse__python
is not None:
3872 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.DeprecatedMutationResult')
3874 if _net_proto___parse__python
is not None:
3875 def _CEncodePartial(self
):
3876 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.DeprecatedMutationResult')
3878 if _net_proto___parse__python
is not None:
3879 def _CToASCII(self
, output_format
):
3880 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.DeprecatedMutationResult', output_format
)
3883 if _net_proto___parse__python
is not None:
3884 def ParseASCII(self
, s
):
3885 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.DeprecatedMutationResult', s
)
3888 if _net_proto___parse__python
is not None:
3889 def ParseASCIIIgnoreUnknown(self
, s
):
3890 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.DeprecatedMutationResult', s
)
3893 def Equals(self
, x
):
3894 if x
is self
: return 1
3895 if self
.has_index_updates_
!= x
.has_index_updates_
: return 0
3896 if self
.has_index_updates_
and self
.index_updates_
!= x
.index_updates_
: return 0
3897 if len(self
.insert_auto_id_key_
) != len(x
.insert_auto_id_key_
): return 0
3898 for e1
, e2
in zip(self
.insert_auto_id_key_
, x
.insert_auto_id_key_
):
3899 if e1
!= e2
: return 0
3900 if len(self
.upsert_version_
) != len(x
.upsert_version_
): return 0
3901 for e1
, e2
in zip(self
.upsert_version_
, x
.upsert_version_
):
3902 if e1
!= e2
: return 0
3903 if len(self
.update_version_
) != len(x
.update_version_
): return 0
3904 for e1
, e2
in zip(self
.update_version_
, x
.update_version_
):
3905 if e1
!= e2
: return 0
3906 if len(self
.insert_version_
) != len(x
.insert_version_
): return 0
3907 for e1
, e2
in zip(self
.insert_version_
, x
.insert_version_
):
3908 if e1
!= e2
: return 0
3909 if len(self
.insert_auto_id_version_
) != len(x
.insert_auto_id_version_
): return 0
3910 for e1
, e2
in zip(self
.insert_auto_id_version_
, x
.insert_auto_id_version_
):
3911 if e1
!= e2
: return 0
3912 if len(self
.delete_version_
) != len(x
.delete_version_
): return 0
3913 for e1
, e2
in zip(self
.delete_version_
, x
.delete_version_
):
3914 if e1
!= e2
: return 0
3917 def IsInitialized(self
, debug_strs
=None):
3919 if (not self
.has_index_updates_
):
3921 if debug_strs
is not None:
3922 debug_strs
.append('Required field: index_updates not set.')
3923 for p
in self
.insert_auto_id_key_
:
3924 if not p
.IsInitialized(debug_strs
): initialized
=0
3929 n
+= self
.lengthVarInt64(self
.index_updates_
)
3930 n
+= 1 * len(self
.insert_auto_id_key_
)
3931 for i
in xrange(len(self
.insert_auto_id_key_
)): n
+= self
.lengthString(self
.insert_auto_id_key_
[i
].ByteSize())
3932 n
+= 1 * len(self
.upsert_version_
)
3933 for i
in xrange(len(self
.upsert_version_
)): n
+= self
.lengthVarInt64(self
.upsert_version_
[i
])
3934 n
+= 1 * len(self
.update_version_
)
3935 for i
in xrange(len(self
.update_version_
)): n
+= self
.lengthVarInt64(self
.update_version_
[i
])
3936 n
+= 1 * len(self
.insert_version_
)
3937 for i
in xrange(len(self
.insert_version_
)): n
+= self
.lengthVarInt64(self
.insert_version_
[i
])
3938 n
+= 1 * len(self
.insert_auto_id_version_
)
3939 for i
in xrange(len(self
.insert_auto_id_version_
)): n
+= self
.lengthVarInt64(self
.insert_auto_id_version_
[i
])
3940 n
+= 1 * len(self
.delete_version_
)
3941 for i
in xrange(len(self
.delete_version_
)): n
+= self
.lengthVarInt64(self
.delete_version_
[i
])
3944 def ByteSizePartial(self
):
3946 if (self
.has_index_updates_
):
3948 n
+= self
.lengthVarInt64(self
.index_updates_
)
3949 n
+= 1 * len(self
.insert_auto_id_key_
)
3950 for i
in xrange(len(self
.insert_auto_id_key_
)): n
+= self
.lengthString(self
.insert_auto_id_key_
[i
].ByteSizePartial())
3951 n
+= 1 * len(self
.upsert_version_
)
3952 for i
in xrange(len(self
.upsert_version_
)): n
+= self
.lengthVarInt64(self
.upsert_version_
[i
])
3953 n
+= 1 * len(self
.update_version_
)
3954 for i
in xrange(len(self
.update_version_
)): n
+= self
.lengthVarInt64(self
.update_version_
[i
])
3955 n
+= 1 * len(self
.insert_version_
)
3956 for i
in xrange(len(self
.insert_version_
)): n
+= self
.lengthVarInt64(self
.insert_version_
[i
])
3957 n
+= 1 * len(self
.insert_auto_id_version_
)
3958 for i
in xrange(len(self
.insert_auto_id_version_
)): n
+= self
.lengthVarInt64(self
.insert_auto_id_version_
[i
])
3959 n
+= 1 * len(self
.delete_version_
)
3960 for i
in xrange(len(self
.delete_version_
)): n
+= self
.lengthVarInt64(self
.delete_version_
[i
])
3964 self
.clear_index_updates()
3965 self
.clear_insert_auto_id_key()
3966 self
.clear_upsert_version()
3967 self
.clear_update_version()
3968 self
.clear_insert_version()
3969 self
.clear_insert_auto_id_version()
3970 self
.clear_delete_version()
3972 def OutputUnchecked(self
, out
):
3974 out
.putVarInt32(self
.index_updates_
)
3975 for i
in xrange(len(self
.insert_auto_id_key_
)):
3977 out
.putVarInt32(self
.insert_auto_id_key_
[i
].ByteSize())
3978 self
.insert_auto_id_key_
[i
].OutputUnchecked(out
)
3979 for i
in xrange(len(self
.upsert_version_
)):
3981 out
.putVarInt64(self
.upsert_version_
[i
])
3982 for i
in xrange(len(self
.update_version_
)):
3984 out
.putVarInt64(self
.update_version_
[i
])
3985 for i
in xrange(len(self
.insert_version_
)):
3987 out
.putVarInt64(self
.insert_version_
[i
])
3988 for i
in xrange(len(self
.insert_auto_id_version_
)):
3990 out
.putVarInt64(self
.insert_auto_id_version_
[i
])
3991 for i
in xrange(len(self
.delete_version_
)):
3993 out
.putVarInt64(self
.delete_version_
[i
])
3995 def OutputPartial(self
, out
):
3996 if (self
.has_index_updates_
):
3998 out
.putVarInt32(self
.index_updates_
)
3999 for i
in xrange(len(self
.insert_auto_id_key_
)):
4001 out
.putVarInt32(self
.insert_auto_id_key_
[i
].ByteSizePartial())
4002 self
.insert_auto_id_key_
[i
].OutputPartial(out
)
4003 for i
in xrange(len(self
.upsert_version_
)):
4005 out
.putVarInt64(self
.upsert_version_
[i
])
4006 for i
in xrange(len(self
.update_version_
)):
4008 out
.putVarInt64(self
.update_version_
[i
])
4009 for i
in xrange(len(self
.insert_version_
)):
4011 out
.putVarInt64(self
.insert_version_
[i
])
4012 for i
in xrange(len(self
.insert_auto_id_version_
)):
4014 out
.putVarInt64(self
.insert_auto_id_version_
[i
])
4015 for i
in xrange(len(self
.delete_version_
)):
4017 out
.putVarInt64(self
.delete_version_
[i
])
4019 def TryMerge(self
, d
):
4020 while d
.avail() > 0:
4021 tt
= d
.getVarInt32()
4023 self
.set_index_updates(d
.getVarInt32())
4026 length
= d
.getVarInt32()
4027 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4029 self
.add_insert_auto_id_key().TryMerge(tmp
)
4032 self
.add_upsert_version(d
.getVarInt64())
4035 self
.add_update_version(d
.getVarInt64())
4038 self
.add_insert_version(d
.getVarInt64())
4041 self
.add_insert_auto_id_version(d
.getVarInt64())
4044 self
.add_delete_version(d
.getVarInt64())
4048 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
4052 def __str__(self
, prefix
="", printElemNumber
=0):
4054 if self
.has_index_updates_
: res
+=prefix
+("index_updates: %s\n" % self
.DebugFormatInt32(self
.index_updates_
))
4056 for e
in self
.insert_auto_id_key_
:
4058 if printElemNumber
: elm
="(%d)" % cnt
4059 res
+=prefix
+("insert_auto_id_key%s <\n" % elm
)
4060 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
4064 for e
in self
.upsert_version_
:
4066 if printElemNumber
: elm
="(%d)" % cnt
4067 res
+=prefix
+("upsert_version%s: %s\n" % (elm
, self
.DebugFormatInt64(e
)))
4070 for e
in self
.update_version_
:
4072 if printElemNumber
: elm
="(%d)" % cnt
4073 res
+=prefix
+("update_version%s: %s\n" % (elm
, self
.DebugFormatInt64(e
)))
4076 for e
in self
.insert_version_
:
4078 if printElemNumber
: elm
="(%d)" % cnt
4079 res
+=prefix
+("insert_version%s: %s\n" % (elm
, self
.DebugFormatInt64(e
)))
4082 for e
in self
.insert_auto_id_version_
:
4084 if printElemNumber
: elm
="(%d)" % cnt
4085 res
+=prefix
+("insert_auto_id_version%s: %s\n" % (elm
, self
.DebugFormatInt64(e
)))
4088 for e
in self
.delete_version_
:
4090 if printElemNumber
: elm
="(%d)" % cnt
4091 res
+=prefix
+("delete_version%s: %s\n" % (elm
, self
.DebugFormatInt64(e
)))
4096 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
4097 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
4100 kinsert_auto_id_key
= 2
4104 kinsert_auto_id_version
= 6
4107 _TEXT
= _BuildTagLookupTable({
4110 2: "insert_auto_id_key",
4111 3: "upsert_version",
4112 4: "update_version",
4113 5: "insert_version",
4114 6: "insert_auto_id_version",
4115 7: "delete_version",
4118 _TYPES
= _BuildTagLookupTable({
4119 0: ProtocolBuffer
.Encoder
.NUMERIC
,
4120 1: ProtocolBuffer
.Encoder
.NUMERIC
,
4121 2: ProtocolBuffer
.Encoder
.STRING
,
4122 3: ProtocolBuffer
.Encoder
.NUMERIC
,
4123 4: ProtocolBuffer
.Encoder
.NUMERIC
,
4124 5: ProtocolBuffer
.Encoder
.NUMERIC
,
4125 6: ProtocolBuffer
.Encoder
.NUMERIC
,
4126 7: ProtocolBuffer
.Encoder
.NUMERIC
,
4127 }, 7, ProtocolBuffer
.Encoder
.MAX_TYPE
)
4131 _STYLE_CONTENT_TYPE
= """"""
4132 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.DeprecatedMutationResult'
4133 _SERIALIZED_DESCRIPTOR
= array
.array('B')
4134 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KMGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkRlcHJlY2F0ZWRNdXRhdGlvblJlc3VsdBMaDWluZGV4X3VwZGF0ZXMgASgAMAU4AhQTGhJpbnNlcnRfYXV0b19pZF9rZXkgAigCMAs4A0obYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuS2V5owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaDnVwc2VydF92ZXJzaW9uIAMoADADOAMUExoOdXBkYXRlX3ZlcnNpb24gBCgAMAM4AxQTGg5pbnNlcnRfdmVyc2lvbiAFKAAwAzgDFBMaFmluc2VydF9hdXRvX2lkX3ZlcnNpb24gBigAMAM4AxQTGg5kZWxldGVfdmVyc2lvbiAHKAAwAzgDFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
4135 if _net_proto___parse__python
is not None:
4136 _net_proto___parse__python
.RegisterType(
4137 _SERIALIZED_DESCRIPTOR
.tostring())
4139 class ReadOptions(ProtocolBuffer
.ProtocolMessage
):
4146 _ReadConsistency_NAMES
= {
4152 def ReadConsistency_Name(cls
, x
): return cls
._ReadConsistency
_NAMES
.get(x
, "")
4153 ReadConsistency_Name
= classmethod(ReadConsistency_Name
)
4155 has_read_consistency_
= 0
4156 read_consistency_
= 0
4157 has_transaction_
= 0
4160 def __init__(self
, contents
=None):
4161 if contents
is not None: self
.MergeFromString(contents
)
4163 def read_consistency(self
): return self
.read_consistency_
4165 def set_read_consistency(self
, x
):
4166 self
.has_read_consistency_
= 1
4167 self
.read_consistency_
= x
4169 def clear_read_consistency(self
):
4170 if self
.has_read_consistency_
:
4171 self
.has_read_consistency_
= 0
4172 self
.read_consistency_
= 0
4174 def has_read_consistency(self
): return self
.has_read_consistency_
4176 def transaction(self
): return self
.transaction_
4178 def set_transaction(self
, x
):
4179 self
.has_transaction_
= 1
4180 self
.transaction_
= x
4182 def clear_transaction(self
):
4183 if self
.has_transaction_
:
4184 self
.has_transaction_
= 0
4185 self
.transaction_
= ""
4187 def has_transaction(self
): return self
.has_transaction_
4190 def MergeFrom(self
, x
):
4191 assert x
is not self
4192 if (x
.has_read_consistency()): self
.set_read_consistency(x
.read_consistency())
4193 if (x
.has_transaction()): self
.set_transaction(x
.transaction())
4195 if _net_proto___parse__python
is not None:
4196 def _CMergeFromString(self
, s
):
4197 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.ReadOptions', s
)
4199 if _net_proto___parse__python
is not None:
4201 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.ReadOptions')
4203 if _net_proto___parse__python
is not None:
4204 def _CEncodePartial(self
):
4205 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.ReadOptions')
4207 if _net_proto___parse__python
is not None:
4208 def _CToASCII(self
, output_format
):
4209 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.ReadOptions', output_format
)
4212 if _net_proto___parse__python
is not None:
4213 def ParseASCII(self
, s
):
4214 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.ReadOptions', s
)
4217 if _net_proto___parse__python
is not None:
4218 def ParseASCIIIgnoreUnknown(self
, s
):
4219 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.ReadOptions', s
)
4222 def Equals(self
, x
):
4223 if x
is self
: return 1
4224 if self
.has_read_consistency_
!= x
.has_read_consistency_
: return 0
4225 if self
.has_read_consistency_
and self
.read_consistency_
!= x
.read_consistency_
: return 0
4226 if self
.has_transaction_
!= x
.has_transaction_
: return 0
4227 if self
.has_transaction_
and self
.transaction_
!= x
.transaction_
: return 0
4230 def IsInitialized(self
, debug_strs
=None):
4236 if (self
.has_read_consistency_
): n
+= 1 + self
.lengthVarInt64(self
.read_consistency_
)
4237 if (self
.has_transaction_
): n
+= 1 + self
.lengthString(len(self
.transaction_
))
4240 def ByteSizePartial(self
):
4242 if (self
.has_read_consistency_
): n
+= 1 + self
.lengthVarInt64(self
.read_consistency_
)
4243 if (self
.has_transaction_
): n
+= 1 + self
.lengthString(len(self
.transaction_
))
4247 self
.clear_read_consistency()
4248 self
.clear_transaction()
4250 def OutputUnchecked(self
, out
):
4251 if (self
.has_read_consistency_
):
4253 out
.putVarInt32(self
.read_consistency_
)
4254 if (self
.has_transaction_
):
4256 out
.putPrefixedString(self
.transaction_
)
4258 def OutputPartial(self
, out
):
4259 if (self
.has_read_consistency_
):
4261 out
.putVarInt32(self
.read_consistency_
)
4262 if (self
.has_transaction_
):
4264 out
.putPrefixedString(self
.transaction_
)
4266 def TryMerge(self
, d
):
4267 while d
.avail() > 0:
4268 tt
= d
.getVarInt32()
4270 self
.set_read_consistency(d
.getVarInt32())
4273 self
.set_transaction(d
.getPrefixedString())
4277 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
4281 def __str__(self
, prefix
="", printElemNumber
=0):
4283 if self
.has_read_consistency_
: res
+=prefix
+("read_consistency: %s\n" % self
.DebugFormatInt32(self
.read_consistency_
))
4284 if self
.has_transaction_
: res
+=prefix
+("transaction: %s\n" % self
.DebugFormatString(self
.transaction_
))
4288 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
4289 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
4291 kread_consistency
= 1
4294 _TEXT
= _BuildTagLookupTable({
4296 1: "read_consistency",
4300 _TYPES
= _BuildTagLookupTable({
4301 0: ProtocolBuffer
.Encoder
.NUMERIC
,
4302 1: ProtocolBuffer
.Encoder
.NUMERIC
,
4303 2: ProtocolBuffer
.Encoder
.STRING
,
4304 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
4308 _STYLE_CONTENT_TYPE
= """"""
4309 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.ReadOptions'
4310 _SERIALIZED_DESCRIPTOR
= array
.array('B')
4311 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KI2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJlYWRPcHRpb25zExoQcmVhZF9jb25zaXN0ZW5jeSABKAAwBTgBQgEwaACjAaoBB2RlZmF1bHSyAQdERUZBVUxUpAEUExoLdHJhbnNhY3Rpb24gAigCMAk4ARRzeg9SZWFkQ29uc2lzdGVuY3mLAZIBB0RFRkFVTFSYAQCMAYsBkgEGU1RST05HmAEBjAGLAZIBCEVWRU5UVUFMmAECjAF0wgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
4312 if _net_proto___parse__python
is not None:
4313 _net_proto___parse__python
.RegisterType(
4314 _SERIALIZED_DESCRIPTOR
.tostring())
4316 class LookupRequest(ProtocolBuffer
.ProtocolMessage
):
4317 has_read_options_
= 0
4318 read_options_
= None
4320 def __init__(self
, contents
=None):
4322 self
.lazy_init_lock_
= thread
.allocate_lock()
4323 if contents
is not None: self
.MergeFromString(contents
)
4325 def read_options(self
):
4326 if self
.read_options_
is None:
4327 self
.lazy_init_lock_
.acquire()
4329 if self
.read_options_
is None: self
.read_options_
= ReadOptions()
4331 self
.lazy_init_lock_
.release()
4332 return self
.read_options_
4334 def mutable_read_options(self
): self
.has_read_options_
= 1; return self
.read_options()
4336 def clear_read_options(self
):
4338 if self
.has_read_options_
:
4339 self
.has_read_options_
= 0;
4340 if self
.read_options_
is not None: self
.read_options_
.Clear()
4342 def has_read_options(self
): return self
.has_read_options_
4344 def key_size(self
): return len(self
.key_
)
4345 def key_list(self
): return self
.key_
4350 def mutable_key(self
, i
):
4354 x
= google
.appengine
.datastore
.entity_v4_pb
.Key()
4358 def clear_key(self
):
4361 def MergeFrom(self
, x
):
4362 assert x
is not self
4363 if (x
.has_read_options()): self
.mutable_read_options().MergeFrom(x
.read_options())
4364 for i
in xrange(x
.key_size()): self
.add_key().CopyFrom(x
.key(i
))
4366 if _net_proto___parse__python
is not None:
4367 def _CMergeFromString(self
, s
):
4368 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.LookupRequest', s
)
4370 if _net_proto___parse__python
is not None:
4372 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.LookupRequest')
4374 if _net_proto___parse__python
is not None:
4375 def _CEncodePartial(self
):
4376 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.LookupRequest')
4378 if _net_proto___parse__python
is not None:
4379 def _CToASCII(self
, output_format
):
4380 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.LookupRequest', output_format
)
4383 if _net_proto___parse__python
is not None:
4384 def ParseASCII(self
, s
):
4385 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.LookupRequest', s
)
4388 if _net_proto___parse__python
is not None:
4389 def ParseASCIIIgnoreUnknown(self
, s
):
4390 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.LookupRequest', s
)
4393 def Equals(self
, x
):
4394 if x
is self
: return 1
4395 if self
.has_read_options_
!= x
.has_read_options_
: return 0
4396 if self
.has_read_options_
and self
.read_options_
!= x
.read_options_
: return 0
4397 if len(self
.key_
) != len(x
.key_
): return 0
4398 for e1
, e2
in zip(self
.key_
, x
.key_
):
4399 if e1
!= e2
: return 0
4402 def IsInitialized(self
, debug_strs
=None):
4404 if (self
.has_read_options_
and not self
.read_options_
.IsInitialized(debug_strs
)): initialized
= 0
4406 if not p
.IsInitialized(debug_strs
): initialized
=0
4411 if (self
.has_read_options_
): n
+= 1 + self
.lengthString(self
.read_options_
.ByteSize())
4412 n
+= 1 * len(self
.key_
)
4413 for i
in xrange(len(self
.key_
)): n
+= self
.lengthString(self
.key_
[i
].ByteSize())
4416 def ByteSizePartial(self
):
4418 if (self
.has_read_options_
): n
+= 1 + self
.lengthString(self
.read_options_
.ByteSizePartial())
4419 n
+= 1 * len(self
.key_
)
4420 for i
in xrange(len(self
.key_
)): n
+= self
.lengthString(self
.key_
[i
].ByteSizePartial())
4424 self
.clear_read_options()
4427 def OutputUnchecked(self
, out
):
4428 if (self
.has_read_options_
):
4430 out
.putVarInt32(self
.read_options_
.ByteSize())
4431 self
.read_options_
.OutputUnchecked(out
)
4432 for i
in xrange(len(self
.key_
)):
4434 out
.putVarInt32(self
.key_
[i
].ByteSize())
4435 self
.key_
[i
].OutputUnchecked(out
)
4437 def OutputPartial(self
, out
):
4438 if (self
.has_read_options_
):
4440 out
.putVarInt32(self
.read_options_
.ByteSizePartial())
4441 self
.read_options_
.OutputPartial(out
)
4442 for i
in xrange(len(self
.key_
)):
4444 out
.putVarInt32(self
.key_
[i
].ByteSizePartial())
4445 self
.key_
[i
].OutputPartial(out
)
4447 def TryMerge(self
, d
):
4448 while d
.avail() > 0:
4449 tt
= d
.getVarInt32()
4451 length
= d
.getVarInt32()
4452 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4454 self
.mutable_read_options().TryMerge(tmp
)
4457 length
= d
.getVarInt32()
4458 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4460 self
.add_key().TryMerge(tmp
)
4464 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
4468 def __str__(self
, prefix
="", printElemNumber
=0):
4470 if self
.has_read_options_
:
4471 res
+=prefix
+"read_options <\n"
4472 res
+=self
.read_options_
.__str
__(prefix
+ " ", printElemNumber
)
4477 if printElemNumber
: elm
="(%d)" % cnt
4478 res
+=prefix
+("key%s <\n" % elm
)
4479 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
4485 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
4486 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
4491 _TEXT
= _BuildTagLookupTable({
4497 _TYPES
= _BuildTagLookupTable({
4498 0: ProtocolBuffer
.Encoder
.NUMERIC
,
4499 1: ProtocolBuffer
.Encoder
.STRING
,
4500 3: ProtocolBuffer
.Encoder
.STRING
,
4501 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
4505 _STYLE_CONTENT_TYPE
= """"""
4506 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.LookupRequest'
4507 _SERIALIZED_DESCRIPTOR
= array
.array('B')
4508 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lkxvb2t1cFJlcXVlc3QTGgxyZWFkX29wdGlvbnMgASgCMAs4AUojYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUmVhZE9wdGlvbnOjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoDa2V5IAMoAjALOANKG2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleaMBqgEFY3R5cGWyAQZwcm90bzKkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
4509 if _net_proto___parse__python
is not None:
4510 _net_proto___parse__python
.RegisterType(
4511 _SERIALIZED_DESCRIPTOR
.tostring())
4513 class LookupResponse(ProtocolBuffer
.ProtocolMessage
):
4515 def __init__(self
, contents
=None):
4519 if contents
is not None: self
.MergeFromString(contents
)
4521 def found_size(self
): return len(self
.found_
)
4522 def found_list(self
): return self
.found_
4525 return self
.found_
[i
]
4527 def mutable_found(self
, i
):
4528 return self
.found_
[i
]
4530 def add_found(self
):
4532 self
.found_
.append(x
)
4535 def clear_found(self
):
4537 def missing_size(self
): return len(self
.missing_
)
4538 def missing_list(self
): return self
.missing_
4540 def missing(self
, i
):
4541 return self
.missing_
[i
]
4543 def mutable_missing(self
, i
):
4544 return self
.missing_
[i
]
4546 def add_missing(self
):
4548 self
.missing_
.append(x
)
4551 def clear_missing(self
):
4553 def deferred_size(self
): return len(self
.deferred_
)
4554 def deferred_list(self
): return self
.deferred_
4556 def deferred(self
, i
):
4557 return self
.deferred_
[i
]
4559 def mutable_deferred(self
, i
):
4560 return self
.deferred_
[i
]
4562 def add_deferred(self
):
4563 x
= google
.appengine
.datastore
.entity_v4_pb
.Key()
4564 self
.deferred_
.append(x
)
4567 def clear_deferred(self
):
4570 def MergeFrom(self
, x
):
4571 assert x
is not self
4572 for i
in xrange(x
.found_size()): self
.add_found().CopyFrom(x
.found(i
))
4573 for i
in xrange(x
.missing_size()): self
.add_missing().CopyFrom(x
.missing(i
))
4574 for i
in xrange(x
.deferred_size()): self
.add_deferred().CopyFrom(x
.deferred(i
))
4576 if _net_proto___parse__python
is not None:
4577 def _CMergeFromString(self
, s
):
4578 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.LookupResponse', s
)
4580 if _net_proto___parse__python
is not None:
4582 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.LookupResponse')
4584 if _net_proto___parse__python
is not None:
4585 def _CEncodePartial(self
):
4586 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.LookupResponse')
4588 if _net_proto___parse__python
is not None:
4589 def _CToASCII(self
, output_format
):
4590 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.LookupResponse', output_format
)
4593 if _net_proto___parse__python
is not None:
4594 def ParseASCII(self
, s
):
4595 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.LookupResponse', s
)
4598 if _net_proto___parse__python
is not None:
4599 def ParseASCIIIgnoreUnknown(self
, s
):
4600 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.LookupResponse', s
)
4603 def Equals(self
, x
):
4604 if x
is self
: return 1
4605 if len(self
.found_
) != len(x
.found_
): return 0
4606 for e1
, e2
in zip(self
.found_
, x
.found_
):
4607 if e1
!= e2
: return 0
4608 if len(self
.missing_
) != len(x
.missing_
): return 0
4609 for e1
, e2
in zip(self
.missing_
, x
.missing_
):
4610 if e1
!= e2
: return 0
4611 if len(self
.deferred_
) != len(x
.deferred_
): return 0
4612 for e1
, e2
in zip(self
.deferred_
, x
.deferred_
):
4613 if e1
!= e2
: return 0
4616 def IsInitialized(self
, debug_strs
=None):
4618 for p
in self
.found_
:
4619 if not p
.IsInitialized(debug_strs
): initialized
=0
4620 for p
in self
.missing_
:
4621 if not p
.IsInitialized(debug_strs
): initialized
=0
4622 for p
in self
.deferred_
:
4623 if not p
.IsInitialized(debug_strs
): initialized
=0
4628 n
+= 1 * len(self
.found_
)
4629 for i
in xrange(len(self
.found_
)): n
+= self
.lengthString(self
.found_
[i
].ByteSize())
4630 n
+= 1 * len(self
.missing_
)
4631 for i
in xrange(len(self
.missing_
)): n
+= self
.lengthString(self
.missing_
[i
].ByteSize())
4632 n
+= 1 * len(self
.deferred_
)
4633 for i
in xrange(len(self
.deferred_
)): n
+= self
.lengthString(self
.deferred_
[i
].ByteSize())
4636 def ByteSizePartial(self
):
4638 n
+= 1 * len(self
.found_
)
4639 for i
in xrange(len(self
.found_
)): n
+= self
.lengthString(self
.found_
[i
].ByteSizePartial())
4640 n
+= 1 * len(self
.missing_
)
4641 for i
in xrange(len(self
.missing_
)): n
+= self
.lengthString(self
.missing_
[i
].ByteSizePartial())
4642 n
+= 1 * len(self
.deferred_
)
4643 for i
in xrange(len(self
.deferred_
)): n
+= self
.lengthString(self
.deferred_
[i
].ByteSizePartial())
4648 self
.clear_missing()
4649 self
.clear_deferred()
4651 def OutputUnchecked(self
, out
):
4652 for i
in xrange(len(self
.found_
)):
4654 out
.putVarInt32(self
.found_
[i
].ByteSize())
4655 self
.found_
[i
].OutputUnchecked(out
)
4656 for i
in xrange(len(self
.missing_
)):
4658 out
.putVarInt32(self
.missing_
[i
].ByteSize())
4659 self
.missing_
[i
].OutputUnchecked(out
)
4660 for i
in xrange(len(self
.deferred_
)):
4662 out
.putVarInt32(self
.deferred_
[i
].ByteSize())
4663 self
.deferred_
[i
].OutputUnchecked(out
)
4665 def OutputPartial(self
, out
):
4666 for i
in xrange(len(self
.found_
)):
4668 out
.putVarInt32(self
.found_
[i
].ByteSizePartial())
4669 self
.found_
[i
].OutputPartial(out
)
4670 for i
in xrange(len(self
.missing_
)):
4672 out
.putVarInt32(self
.missing_
[i
].ByteSizePartial())
4673 self
.missing_
[i
].OutputPartial(out
)
4674 for i
in xrange(len(self
.deferred_
)):
4676 out
.putVarInt32(self
.deferred_
[i
].ByteSizePartial())
4677 self
.deferred_
[i
].OutputPartial(out
)
4679 def TryMerge(self
, d
):
4680 while d
.avail() > 0:
4681 tt
= d
.getVarInt32()
4683 length
= d
.getVarInt32()
4684 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4686 self
.add_found().TryMerge(tmp
)
4689 length
= d
.getVarInt32()
4690 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4692 self
.add_missing().TryMerge(tmp
)
4695 length
= d
.getVarInt32()
4696 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4698 self
.add_deferred().TryMerge(tmp
)
4702 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
4706 def __str__(self
, prefix
="", printElemNumber
=0):
4709 for e
in self
.found_
:
4711 if printElemNumber
: elm
="(%d)" % cnt
4712 res
+=prefix
+("found%s <\n" % elm
)
4713 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
4717 for e
in self
.missing_
:
4719 if printElemNumber
: elm
="(%d)" % cnt
4720 res
+=prefix
+("missing%s <\n" % elm
)
4721 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
4725 for e
in self
.deferred_
:
4727 if printElemNumber
: elm
="(%d)" % cnt
4728 res
+=prefix
+("deferred%s <\n" % elm
)
4729 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
4735 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
4736 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
4742 _TEXT
= _BuildTagLookupTable({
4749 _TYPES
= _BuildTagLookupTable({
4750 0: ProtocolBuffer
.Encoder
.NUMERIC
,
4751 1: ProtocolBuffer
.Encoder
.STRING
,
4752 2: ProtocolBuffer
.Encoder
.STRING
,
4753 3: ProtocolBuffer
.Encoder
.STRING
,
4754 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
4758 _STYLE_CONTENT_TYPE
= """"""
4759 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.LookupResponse'
4760 _SERIALIZED_DESCRIPTOR
= array
.array('B')
4761 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lkxvb2t1cFJlc3BvbnNlExoFZm91bmQgASgCMAs4A0okYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5UmVzdWx0owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaB21pc3NpbmcgAigCMAs4A0okYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5UmVzdWx0owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaCGRlZmVycmVkIAMoAjALOANKG2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleaMBqgEFY3R5cGWyAQZwcm90bzKkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
4762 if _net_proto___parse__python
is not None:
4763 _net_proto___parse__python
.RegisterType(
4764 _SERIALIZED_DESCRIPTOR
.tostring())
4766 class RunQueryRequest(ProtocolBuffer
.ProtocolMessage
):
4767 has_read_options_
= 0
4768 read_options_
= None
4769 has_partition_id_
= 0
4770 partition_id_
= None
4775 has_min_safe_time_seconds_
= 0
4776 min_safe_time_seconds_
= 0
4777 has_suggested_batch_size_
= 0
4778 suggested_batch_size_
= 0
4780 def __init__(self
, contents
=None):
4781 self
.lazy_init_lock_
= thread
.allocate_lock()
4782 if contents
is not None: self
.MergeFromString(contents
)
4784 def read_options(self
):
4785 if self
.read_options_
is None:
4786 self
.lazy_init_lock_
.acquire()
4788 if self
.read_options_
is None: self
.read_options_
= ReadOptions()
4790 self
.lazy_init_lock_
.release()
4791 return self
.read_options_
4793 def mutable_read_options(self
): self
.has_read_options_
= 1; return self
.read_options()
4795 def clear_read_options(self
):
4797 if self
.has_read_options_
:
4798 self
.has_read_options_
= 0;
4799 if self
.read_options_
is not None: self
.read_options_
.Clear()
4801 def has_read_options(self
): return self
.has_read_options_
4803 def partition_id(self
):
4804 if self
.partition_id_
is None:
4805 self
.lazy_init_lock_
.acquire()
4807 if self
.partition_id_
is None: self
.partition_id_
= google
.appengine
.datastore
.entity_v4_pb
.PartitionId()
4809 self
.lazy_init_lock_
.release()
4810 return self
.partition_id_
4812 def mutable_partition_id(self
): self
.has_partition_id_
= 1; return self
.partition_id()
4814 def clear_partition_id(self
):
4816 if self
.has_partition_id_
:
4817 self
.has_partition_id_
= 0;
4818 if self
.partition_id_
is not None: self
.partition_id_
.Clear()
4820 def has_partition_id(self
): return self
.has_partition_id_
4823 if self
.query_
is None:
4824 self
.lazy_init_lock_
.acquire()
4826 if self
.query_
is None: self
.query_
= Query()
4828 self
.lazy_init_lock_
.release()
4831 def mutable_query(self
): self
.has_query_
= 1; return self
.query()
4833 def clear_query(self
):
4836 self
.has_query_
= 0;
4837 if self
.query_
is not None: self
.query_
.Clear()
4839 def has_query(self
): return self
.has_query_
4841 def gql_query(self
):
4842 if self
.gql_query_
is None:
4843 self
.lazy_init_lock_
.acquire()
4845 if self
.gql_query_
is None: self
.gql_query_
= GqlQuery()
4847 self
.lazy_init_lock_
.release()
4848 return self
.gql_query_
4850 def mutable_gql_query(self
): self
.has_gql_query_
= 1; return self
.gql_query()
4852 def clear_gql_query(self
):
4854 if self
.has_gql_query_
:
4855 self
.has_gql_query_
= 0;
4856 if self
.gql_query_
is not None: self
.gql_query_
.Clear()
4858 def has_gql_query(self
): return self
.has_gql_query_
4860 def min_safe_time_seconds(self
): return self
.min_safe_time_seconds_
4862 def set_min_safe_time_seconds(self
, x
):
4863 self
.has_min_safe_time_seconds_
= 1
4864 self
.min_safe_time_seconds_
= x
4866 def clear_min_safe_time_seconds(self
):
4867 if self
.has_min_safe_time_seconds_
:
4868 self
.has_min_safe_time_seconds_
= 0
4869 self
.min_safe_time_seconds_
= 0
4871 def has_min_safe_time_seconds(self
): return self
.has_min_safe_time_seconds_
4873 def suggested_batch_size(self
): return self
.suggested_batch_size_
4875 def set_suggested_batch_size(self
, x
):
4876 self
.has_suggested_batch_size_
= 1
4877 self
.suggested_batch_size_
= x
4879 def clear_suggested_batch_size(self
):
4880 if self
.has_suggested_batch_size_
:
4881 self
.has_suggested_batch_size_
= 0
4882 self
.suggested_batch_size_
= 0
4884 def has_suggested_batch_size(self
): return self
.has_suggested_batch_size_
4887 def MergeFrom(self
, x
):
4888 assert x
is not self
4889 if (x
.has_read_options()): self
.mutable_read_options().MergeFrom(x
.read_options())
4890 if (x
.has_partition_id()): self
.mutable_partition_id().MergeFrom(x
.partition_id())
4891 if (x
.has_query()): self
.mutable_query().MergeFrom(x
.query())
4892 if (x
.has_gql_query()): self
.mutable_gql_query().MergeFrom(x
.gql_query())
4893 if (x
.has_min_safe_time_seconds()): self
.set_min_safe_time_seconds(x
.min_safe_time_seconds())
4894 if (x
.has_suggested_batch_size()): self
.set_suggested_batch_size(x
.suggested_batch_size())
4896 if _net_proto___parse__python
is not None:
4897 def _CMergeFromString(self
, s
):
4898 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.RunQueryRequest', s
)
4900 if _net_proto___parse__python
is not None:
4902 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.RunQueryRequest')
4904 if _net_proto___parse__python
is not None:
4905 def _CEncodePartial(self
):
4906 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.RunQueryRequest')
4908 if _net_proto___parse__python
is not None:
4909 def _CToASCII(self
, output_format
):
4910 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.RunQueryRequest', output_format
)
4913 if _net_proto___parse__python
is not None:
4914 def ParseASCII(self
, s
):
4915 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.RunQueryRequest', s
)
4918 if _net_proto___parse__python
is not None:
4919 def ParseASCIIIgnoreUnknown(self
, s
):
4920 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.RunQueryRequest', s
)
4923 def Equals(self
, x
):
4924 if x
is self
: return 1
4925 if self
.has_read_options_
!= x
.has_read_options_
: return 0
4926 if self
.has_read_options_
and self
.read_options_
!= x
.read_options_
: return 0
4927 if self
.has_partition_id_
!= x
.has_partition_id_
: return 0
4928 if self
.has_partition_id_
and self
.partition_id_
!= x
.partition_id_
: return 0
4929 if self
.has_query_
!= x
.has_query_
: return 0
4930 if self
.has_query_
and self
.query_
!= x
.query_
: return 0
4931 if self
.has_gql_query_
!= x
.has_gql_query_
: return 0
4932 if self
.has_gql_query_
and self
.gql_query_
!= x
.gql_query_
: return 0
4933 if self
.has_min_safe_time_seconds_
!= x
.has_min_safe_time_seconds_
: return 0
4934 if self
.has_min_safe_time_seconds_
and self
.min_safe_time_seconds_
!= x
.min_safe_time_seconds_
: return 0
4935 if self
.has_suggested_batch_size_
!= x
.has_suggested_batch_size_
: return 0
4936 if self
.has_suggested_batch_size_
and self
.suggested_batch_size_
!= x
.suggested_batch_size_
: return 0
4939 def IsInitialized(self
, debug_strs
=None):
4941 if (self
.has_read_options_
and not self
.read_options_
.IsInitialized(debug_strs
)): initialized
= 0
4942 if (self
.has_partition_id_
and not self
.partition_id_
.IsInitialized(debug_strs
)): initialized
= 0
4943 if (self
.has_query_
and not self
.query_
.IsInitialized(debug_strs
)): initialized
= 0
4944 if (self
.has_gql_query_
and not self
.gql_query_
.IsInitialized(debug_strs
)): initialized
= 0
4949 if (self
.has_read_options_
): n
+= 1 + self
.lengthString(self
.read_options_
.ByteSize())
4950 if (self
.has_partition_id_
): n
+= 1 + self
.lengthString(self
.partition_id_
.ByteSize())
4951 if (self
.has_query_
): n
+= 1 + self
.lengthString(self
.query_
.ByteSize())
4952 if (self
.has_gql_query_
): n
+= 1 + self
.lengthString(self
.gql_query_
.ByteSize())
4953 if (self
.has_min_safe_time_seconds_
): n
+= 1 + self
.lengthVarInt64(self
.min_safe_time_seconds_
)
4954 if (self
.has_suggested_batch_size_
): n
+= 1 + self
.lengthVarInt64(self
.suggested_batch_size_
)
4957 def ByteSizePartial(self
):
4959 if (self
.has_read_options_
): n
+= 1 + self
.lengthString(self
.read_options_
.ByteSizePartial())
4960 if (self
.has_partition_id_
): n
+= 1 + self
.lengthString(self
.partition_id_
.ByteSizePartial())
4961 if (self
.has_query_
): n
+= 1 + self
.lengthString(self
.query_
.ByteSizePartial())
4962 if (self
.has_gql_query_
): n
+= 1 + self
.lengthString(self
.gql_query_
.ByteSizePartial())
4963 if (self
.has_min_safe_time_seconds_
): n
+= 1 + self
.lengthVarInt64(self
.min_safe_time_seconds_
)
4964 if (self
.has_suggested_batch_size_
): n
+= 1 + self
.lengthVarInt64(self
.suggested_batch_size_
)
4968 self
.clear_read_options()
4969 self
.clear_partition_id()
4971 self
.clear_gql_query()
4972 self
.clear_min_safe_time_seconds()
4973 self
.clear_suggested_batch_size()
4975 def OutputUnchecked(self
, out
):
4976 if (self
.has_read_options_
):
4978 out
.putVarInt32(self
.read_options_
.ByteSize())
4979 self
.read_options_
.OutputUnchecked(out
)
4980 if (self
.has_partition_id_
):
4982 out
.putVarInt32(self
.partition_id_
.ByteSize())
4983 self
.partition_id_
.OutputUnchecked(out
)
4984 if (self
.has_query_
):
4986 out
.putVarInt32(self
.query_
.ByteSize())
4987 self
.query_
.OutputUnchecked(out
)
4988 if (self
.has_min_safe_time_seconds_
):
4990 out
.putVarInt64(self
.min_safe_time_seconds_
)
4991 if (self
.has_suggested_batch_size_
):
4993 out
.putVarInt32(self
.suggested_batch_size_
)
4994 if (self
.has_gql_query_
):
4996 out
.putVarInt32(self
.gql_query_
.ByteSize())
4997 self
.gql_query_
.OutputUnchecked(out
)
4999 def OutputPartial(self
, out
):
5000 if (self
.has_read_options_
):
5002 out
.putVarInt32(self
.read_options_
.ByteSizePartial())
5003 self
.read_options_
.OutputPartial(out
)
5004 if (self
.has_partition_id_
):
5006 out
.putVarInt32(self
.partition_id_
.ByteSizePartial())
5007 self
.partition_id_
.OutputPartial(out
)
5008 if (self
.has_query_
):
5010 out
.putVarInt32(self
.query_
.ByteSizePartial())
5011 self
.query_
.OutputPartial(out
)
5012 if (self
.has_min_safe_time_seconds_
):
5014 out
.putVarInt64(self
.min_safe_time_seconds_
)
5015 if (self
.has_suggested_batch_size_
):
5017 out
.putVarInt32(self
.suggested_batch_size_
)
5018 if (self
.has_gql_query_
):
5020 out
.putVarInt32(self
.gql_query_
.ByteSizePartial())
5021 self
.gql_query_
.OutputPartial(out
)
5023 def TryMerge(self
, d
):
5024 while d
.avail() > 0:
5025 tt
= d
.getVarInt32()
5027 length
= d
.getVarInt32()
5028 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5030 self
.mutable_read_options().TryMerge(tmp
)
5033 length
= d
.getVarInt32()
5034 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5036 self
.mutable_partition_id().TryMerge(tmp
)
5039 length
= d
.getVarInt32()
5040 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5042 self
.mutable_query().TryMerge(tmp
)
5045 self
.set_min_safe_time_seconds(d
.getVarInt64())
5048 self
.set_suggested_batch_size(d
.getVarInt32())
5051 length
= d
.getVarInt32()
5052 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5054 self
.mutable_gql_query().TryMerge(tmp
)
5058 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
5062 def __str__(self
, prefix
="", printElemNumber
=0):
5064 if self
.has_read_options_
:
5065 res
+=prefix
+"read_options <\n"
5066 res
+=self
.read_options_
.__str
__(prefix
+ " ", printElemNumber
)
5068 if self
.has_partition_id_
:
5069 res
+=prefix
+"partition_id <\n"
5070 res
+=self
.partition_id_
.__str
__(prefix
+ " ", printElemNumber
)
5073 res
+=prefix
+"query <\n"
5074 res
+=self
.query_
.__str
__(prefix
+ " ", printElemNumber
)
5076 if self
.has_gql_query_
:
5077 res
+=prefix
+"gql_query <\n"
5078 res
+=self
.gql_query_
.__str
__(prefix
+ " ", printElemNumber
)
5080 if self
.has_min_safe_time_seconds_
: res
+=prefix
+("min_safe_time_seconds: %s\n" % self
.DebugFormatInt64(self
.min_safe_time_seconds_
))
5081 if self
.has_suggested_batch_size_
: res
+=prefix
+("suggested_batch_size: %s\n" % self
.DebugFormatInt32(self
.suggested_batch_size_
))
5085 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
5086 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
5092 kmin_safe_time_seconds
= 4
5093 ksuggested_batch_size
= 5
5095 _TEXT
= _BuildTagLookupTable({
5100 4: "min_safe_time_seconds",
5101 5: "suggested_batch_size",
5105 _TYPES
= _BuildTagLookupTable({
5106 0: ProtocolBuffer
.Encoder
.NUMERIC
,
5107 1: ProtocolBuffer
.Encoder
.STRING
,
5108 2: ProtocolBuffer
.Encoder
.STRING
,
5109 3: ProtocolBuffer
.Encoder
.STRING
,
5110 4: ProtocolBuffer
.Encoder
.NUMERIC
,
5111 5: ProtocolBuffer
.Encoder
.NUMERIC
,
5112 7: ProtocolBuffer
.Encoder
.STRING
,
5113 }, 7, ProtocolBuffer
.Encoder
.MAX_TYPE
)
5117 _STYLE_CONTENT_TYPE
= """"""
5118 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.RunQueryRequest'
5119 _SERIALIZED_DESCRIPTOR
= array
.array('B')
5120 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJ2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJ1blF1ZXJ5UmVxdWVzdBMaDHJlYWRfb3B0aW9ucyABKAIwCzgBSiNhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5SZWFkT3B0aW9uc6MBqgEFY3R5cGWyAQZwcm90bzKkARQTGgxwYXJ0aXRpb25faWQgAigCMAs4AUojYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUGFydGl0aW9uSWSjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoFcXVlcnkgAygCMAs4AUodYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUXVlcnmjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoJZ3FsX3F1ZXJ5IAcoAjALOAFKIGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkdxbFF1ZXJ5owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaFW1pbl9zYWZlX3RpbWVfc2Vjb25kcyAEKAAwAzgBFBMaFHN1Z2dlc3RlZF9iYXRjaF9zaXplIAUoADAFOAEUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
5121 if _net_proto___parse__python
is not None:
5122 _net_proto___parse__python
.RegisterType(
5123 _SERIALIZED_DESCRIPTOR
.tostring())
5125 class RunQueryResponse(ProtocolBuffer
.ProtocolMessage
):
5127 has_query_handle_
= 0
5130 def __init__(self
, contents
=None):
5131 self
.batch_
= QueryResultBatch()
5132 if contents
is not None: self
.MergeFromString(contents
)
5134 def batch(self
): return self
.batch_
5136 def mutable_batch(self
): self
.has_batch_
= 1; return self
.batch_
5138 def clear_batch(self
):self
.has_batch_
= 0; self
.batch_
.Clear()
5140 def has_batch(self
): return self
.has_batch_
5142 def query_handle(self
): return self
.query_handle_
5144 def set_query_handle(self
, x
):
5145 self
.has_query_handle_
= 1
5146 self
.query_handle_
= x
5148 def clear_query_handle(self
):
5149 if self
.has_query_handle_
:
5150 self
.has_query_handle_
= 0
5151 self
.query_handle_
= ""
5153 def has_query_handle(self
): return self
.has_query_handle_
5156 def MergeFrom(self
, x
):
5157 assert x
is not self
5158 if (x
.has_batch()): self
.mutable_batch().MergeFrom(x
.batch())
5159 if (x
.has_query_handle()): self
.set_query_handle(x
.query_handle())
5161 if _net_proto___parse__python
is not None:
5162 def _CMergeFromString(self
, s
):
5163 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.RunQueryResponse', s
)
5165 if _net_proto___parse__python
is not None:
5167 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.RunQueryResponse')
5169 if _net_proto___parse__python
is not None:
5170 def _CEncodePartial(self
):
5171 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.RunQueryResponse')
5173 if _net_proto___parse__python
is not None:
5174 def _CToASCII(self
, output_format
):
5175 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.RunQueryResponse', output_format
)
5178 if _net_proto___parse__python
is not None:
5179 def ParseASCII(self
, s
):
5180 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.RunQueryResponse', s
)
5183 if _net_proto___parse__python
is not None:
5184 def ParseASCIIIgnoreUnknown(self
, s
):
5185 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.RunQueryResponse', s
)
5188 def Equals(self
, x
):
5189 if x
is self
: return 1
5190 if self
.has_batch_
!= x
.has_batch_
: return 0
5191 if self
.has_batch_
and self
.batch_
!= x
.batch_
: return 0
5192 if self
.has_query_handle_
!= x
.has_query_handle_
: return 0
5193 if self
.has_query_handle_
and self
.query_handle_
!= x
.query_handle_
: return 0
5196 def IsInitialized(self
, debug_strs
=None):
5198 if (not self
.has_batch_
):
5200 if debug_strs
is not None:
5201 debug_strs
.append('Required field: batch not set.')
5202 elif not self
.batch_
.IsInitialized(debug_strs
): initialized
= 0
5207 n
+= self
.lengthString(self
.batch_
.ByteSize())
5208 if (self
.has_query_handle_
): n
+= 1 + self
.lengthString(len(self
.query_handle_
))
5211 def ByteSizePartial(self
):
5213 if (self
.has_batch_
):
5215 n
+= self
.lengthString(self
.batch_
.ByteSizePartial())
5216 if (self
.has_query_handle_
): n
+= 1 + self
.lengthString(len(self
.query_handle_
))
5221 self
.clear_query_handle()
5223 def OutputUnchecked(self
, out
):
5225 out
.putVarInt32(self
.batch_
.ByteSize())
5226 self
.batch_
.OutputUnchecked(out
)
5227 if (self
.has_query_handle_
):
5229 out
.putPrefixedString(self
.query_handle_
)
5231 def OutputPartial(self
, out
):
5232 if (self
.has_batch_
):
5234 out
.putVarInt32(self
.batch_
.ByteSizePartial())
5235 self
.batch_
.OutputPartial(out
)
5236 if (self
.has_query_handle_
):
5238 out
.putPrefixedString(self
.query_handle_
)
5240 def TryMerge(self
, d
):
5241 while d
.avail() > 0:
5242 tt
= d
.getVarInt32()
5244 length
= d
.getVarInt32()
5245 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5247 self
.mutable_batch().TryMerge(tmp
)
5250 self
.set_query_handle(d
.getPrefixedString())
5254 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
5258 def __str__(self
, prefix
="", printElemNumber
=0):
5261 res
+=prefix
+"batch <\n"
5262 res
+=self
.batch_
.__str
__(prefix
+ " ", printElemNumber
)
5264 if self
.has_query_handle_
: res
+=prefix
+("query_handle: %s\n" % self
.DebugFormatString(self
.query_handle_
))
5268 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
5269 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
5274 _TEXT
= _BuildTagLookupTable({
5280 _TYPES
= _BuildTagLookupTable({
5281 0: ProtocolBuffer
.Encoder
.NUMERIC
,
5282 1: ProtocolBuffer
.Encoder
.STRING
,
5283 2: ProtocolBuffer
.Encoder
.STRING
,
5284 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
5288 _STYLE_CONTENT_TYPE
= """"""
5289 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.RunQueryResponse'
5290 _SERIALIZED_DESCRIPTOR
= array
.array('B')
5291 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJ1blF1ZXJ5UmVzcG9uc2UTGgViYXRjaCABKAIwCzgCSihhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5RdWVyeVJlc3VsdEJhdGNoowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaDHF1ZXJ5X2hhbmRsZSACKAIwCTgBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
5292 if _net_proto___parse__python
is not None:
5293 _net_proto___parse__python
.RegisterType(
5294 _SERIALIZED_DESCRIPTOR
.tostring())
5296 class ContinueQueryRequest(ProtocolBuffer
.ProtocolMessage
):
5297 has_query_handle_
= 0
5300 def __init__(self
, contents
=None):
5301 if contents
is not None: self
.MergeFromString(contents
)
5303 def query_handle(self
): return self
.query_handle_
5305 def set_query_handle(self
, x
):
5306 self
.has_query_handle_
= 1
5307 self
.query_handle_
= x
5309 def clear_query_handle(self
):
5310 if self
.has_query_handle_
:
5311 self
.has_query_handle_
= 0
5312 self
.query_handle_
= ""
5314 def has_query_handle(self
): return self
.has_query_handle_
5317 def MergeFrom(self
, x
):
5318 assert x
is not self
5319 if (x
.has_query_handle()): self
.set_query_handle(x
.query_handle())
5321 if _net_proto___parse__python
is not None:
5322 def _CMergeFromString(self
, s
):
5323 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.ContinueQueryRequest', s
)
5325 if _net_proto___parse__python
is not None:
5327 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.ContinueQueryRequest')
5329 if _net_proto___parse__python
is not None:
5330 def _CEncodePartial(self
):
5331 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.ContinueQueryRequest')
5333 if _net_proto___parse__python
is not None:
5334 def _CToASCII(self
, output_format
):
5335 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.ContinueQueryRequest', output_format
)
5338 if _net_proto___parse__python
is not None:
5339 def ParseASCII(self
, s
):
5340 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.ContinueQueryRequest', s
)
5343 if _net_proto___parse__python
is not None:
5344 def ParseASCIIIgnoreUnknown(self
, s
):
5345 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.ContinueQueryRequest', s
)
5348 def Equals(self
, x
):
5349 if x
is self
: return 1
5350 if self
.has_query_handle_
!= x
.has_query_handle_
: return 0
5351 if self
.has_query_handle_
and self
.query_handle_
!= x
.query_handle_
: return 0
5354 def IsInitialized(self
, debug_strs
=None):
5356 if (not self
.has_query_handle_
):
5358 if debug_strs
is not None:
5359 debug_strs
.append('Required field: query_handle not set.')
5364 n
+= self
.lengthString(len(self
.query_handle_
))
5367 def ByteSizePartial(self
):
5369 if (self
.has_query_handle_
):
5371 n
+= self
.lengthString(len(self
.query_handle_
))
5375 self
.clear_query_handle()
5377 def OutputUnchecked(self
, out
):
5379 out
.putPrefixedString(self
.query_handle_
)
5381 def OutputPartial(self
, out
):
5382 if (self
.has_query_handle_
):
5384 out
.putPrefixedString(self
.query_handle_
)
5386 def TryMerge(self
, d
):
5387 while d
.avail() > 0:
5388 tt
= d
.getVarInt32()
5390 self
.set_query_handle(d
.getPrefixedString())
5394 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
5398 def __str__(self
, prefix
="", printElemNumber
=0):
5400 if self
.has_query_handle_
: res
+=prefix
+("query_handle: %s\n" % self
.DebugFormatString(self
.query_handle_
))
5404 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
5405 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
5409 _TEXT
= _BuildTagLookupTable({
5414 _TYPES
= _BuildTagLookupTable({
5415 0: ProtocolBuffer
.Encoder
.NUMERIC
,
5416 1: ProtocolBuffer
.Encoder
.STRING
,
5417 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
5421 _STYLE_CONTENT_TYPE
= """"""
5422 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.ContinueQueryRequest'
5423 _SERIALIZED_DESCRIPTOR
= array
.array('B')
5424 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KLGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbnRpbnVlUXVlcnlSZXF1ZXN0ExoMcXVlcnlfaGFuZGxlIAEoAjAJOAIUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
5425 if _net_proto___parse__python
is not None:
5426 _net_proto___parse__python
.RegisterType(
5427 _SERIALIZED_DESCRIPTOR
.tostring())
5429 class ContinueQueryResponse(ProtocolBuffer
.ProtocolMessage
):
5432 def __init__(self
, contents
=None):
5433 self
.batch_
= QueryResultBatch()
5434 if contents
is not None: self
.MergeFromString(contents
)
5436 def batch(self
): return self
.batch_
5438 def mutable_batch(self
): self
.has_batch_
= 1; return self
.batch_
5440 def clear_batch(self
):self
.has_batch_
= 0; self
.batch_
.Clear()
5442 def has_batch(self
): return self
.has_batch_
5445 def MergeFrom(self
, x
):
5446 assert x
is not self
5447 if (x
.has_batch()): self
.mutable_batch().MergeFrom(x
.batch())
5449 if _net_proto___parse__python
is not None:
5450 def _CMergeFromString(self
, s
):
5451 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.ContinueQueryResponse', s
)
5453 if _net_proto___parse__python
is not None:
5455 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.ContinueQueryResponse')
5457 if _net_proto___parse__python
is not None:
5458 def _CEncodePartial(self
):
5459 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.ContinueQueryResponse')
5461 if _net_proto___parse__python
is not None:
5462 def _CToASCII(self
, output_format
):
5463 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.ContinueQueryResponse', output_format
)
5466 if _net_proto___parse__python
is not None:
5467 def ParseASCII(self
, s
):
5468 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.ContinueQueryResponse', s
)
5471 if _net_proto___parse__python
is not None:
5472 def ParseASCIIIgnoreUnknown(self
, s
):
5473 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.ContinueQueryResponse', s
)
5476 def Equals(self
, x
):
5477 if x
is self
: return 1
5478 if self
.has_batch_
!= x
.has_batch_
: return 0
5479 if self
.has_batch_
and self
.batch_
!= x
.batch_
: return 0
5482 def IsInitialized(self
, debug_strs
=None):
5484 if (not self
.has_batch_
):
5486 if debug_strs
is not None:
5487 debug_strs
.append('Required field: batch not set.')
5488 elif not self
.batch_
.IsInitialized(debug_strs
): initialized
= 0
5493 n
+= self
.lengthString(self
.batch_
.ByteSize())
5496 def ByteSizePartial(self
):
5498 if (self
.has_batch_
):
5500 n
+= self
.lengthString(self
.batch_
.ByteSizePartial())
5506 def OutputUnchecked(self
, out
):
5508 out
.putVarInt32(self
.batch_
.ByteSize())
5509 self
.batch_
.OutputUnchecked(out
)
5511 def OutputPartial(self
, out
):
5512 if (self
.has_batch_
):
5514 out
.putVarInt32(self
.batch_
.ByteSizePartial())
5515 self
.batch_
.OutputPartial(out
)
5517 def TryMerge(self
, d
):
5518 while d
.avail() > 0:
5519 tt
= d
.getVarInt32()
5521 length
= d
.getVarInt32()
5522 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5524 self
.mutable_batch().TryMerge(tmp
)
5528 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
5532 def __str__(self
, prefix
="", printElemNumber
=0):
5535 res
+=prefix
+"batch <\n"
5536 res
+=self
.batch_
.__str
__(prefix
+ " ", printElemNumber
)
5541 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
5542 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
5546 _TEXT
= _BuildTagLookupTable({
5551 _TYPES
= _BuildTagLookupTable({
5552 0: ProtocolBuffer
.Encoder
.NUMERIC
,
5553 1: ProtocolBuffer
.Encoder
.STRING
,
5554 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
5558 _STYLE_CONTENT_TYPE
= """"""
5559 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.ContinueQueryResponse'
5560 _SERIALIZED_DESCRIPTOR
= array
.array('B')
5561 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KLWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbnRpbnVlUXVlcnlSZXNwb25zZRMaBWJhdGNoIAEoAjALOAJKKGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlF1ZXJ5UmVzdWx0QmF0Y2ijAaoBBWN0eXBlsgEGcHJvdG8ypAEUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
5562 if _net_proto___parse__python
is not None:
5563 _net_proto___parse__python
.RegisterType(
5564 _SERIALIZED_DESCRIPTOR
.tostring())
5566 class BeginTransactionRequest(ProtocolBuffer
.ProtocolMessage
):
5567 has_cross_group_
= 0
5569 has_cross_request_
= 0
5572 def __init__(self
, contents
=None):
5573 if contents
is not None: self
.MergeFromString(contents
)
5575 def cross_group(self
): return self
.cross_group_
5577 def set_cross_group(self
, x
):
5578 self
.has_cross_group_
= 1
5579 self
.cross_group_
= x
5581 def clear_cross_group(self
):
5582 if self
.has_cross_group_
:
5583 self
.has_cross_group_
= 0
5584 self
.cross_group_
= 0
5586 def has_cross_group(self
): return self
.has_cross_group_
5588 def cross_request(self
): return self
.cross_request_
5590 def set_cross_request(self
, x
):
5591 self
.has_cross_request_
= 1
5592 self
.cross_request_
= x
5594 def clear_cross_request(self
):
5595 if self
.has_cross_request_
:
5596 self
.has_cross_request_
= 0
5597 self
.cross_request_
= 0
5599 def has_cross_request(self
): return self
.has_cross_request_
5602 def MergeFrom(self
, x
):
5603 assert x
is not self
5604 if (x
.has_cross_group()): self
.set_cross_group(x
.cross_group())
5605 if (x
.has_cross_request()): self
.set_cross_request(x
.cross_request())
5607 if _net_proto___parse__python
is not None:
5608 def _CMergeFromString(self
, s
):
5609 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.BeginTransactionRequest', s
)
5611 if _net_proto___parse__python
is not None:
5613 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.BeginTransactionRequest')
5615 if _net_proto___parse__python
is not None:
5616 def _CEncodePartial(self
):
5617 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.BeginTransactionRequest')
5619 if _net_proto___parse__python
is not None:
5620 def _CToASCII(self
, output_format
):
5621 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.BeginTransactionRequest', output_format
)
5624 if _net_proto___parse__python
is not None:
5625 def ParseASCII(self
, s
):
5626 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.BeginTransactionRequest', s
)
5629 if _net_proto___parse__python
is not None:
5630 def ParseASCIIIgnoreUnknown(self
, s
):
5631 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.BeginTransactionRequest', s
)
5634 def Equals(self
, x
):
5635 if x
is self
: return 1
5636 if self
.has_cross_group_
!= x
.has_cross_group_
: return 0
5637 if self
.has_cross_group_
and self
.cross_group_
!= x
.cross_group_
: return 0
5638 if self
.has_cross_request_
!= x
.has_cross_request_
: return 0
5639 if self
.has_cross_request_
and self
.cross_request_
!= x
.cross_request_
: return 0
5642 def IsInitialized(self
, debug_strs
=None):
5648 if (self
.has_cross_group_
): n
+= 2
5649 if (self
.has_cross_request_
): n
+= 2
5652 def ByteSizePartial(self
):
5654 if (self
.has_cross_group_
): n
+= 2
5655 if (self
.has_cross_request_
): n
+= 2
5659 self
.clear_cross_group()
5660 self
.clear_cross_request()
5662 def OutputUnchecked(self
, out
):
5663 if (self
.has_cross_group_
):
5665 out
.putBoolean(self
.cross_group_
)
5666 if (self
.has_cross_request_
):
5668 out
.putBoolean(self
.cross_request_
)
5670 def OutputPartial(self
, out
):
5671 if (self
.has_cross_group_
):
5673 out
.putBoolean(self
.cross_group_
)
5674 if (self
.has_cross_request_
):
5676 out
.putBoolean(self
.cross_request_
)
5678 def TryMerge(self
, d
):
5679 while d
.avail() > 0:
5680 tt
= d
.getVarInt32()
5682 self
.set_cross_group(d
.getBoolean())
5685 self
.set_cross_request(d
.getBoolean())
5689 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
5693 def __str__(self
, prefix
="", printElemNumber
=0):
5695 if self
.has_cross_group_
: res
+=prefix
+("cross_group: %s\n" % self
.DebugFormatBool(self
.cross_group_
))
5696 if self
.has_cross_request_
: res
+=prefix
+("cross_request: %s\n" % self
.DebugFormatBool(self
.cross_request_
))
5700 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
5701 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
5706 _TEXT
= _BuildTagLookupTable({
5712 _TYPES
= _BuildTagLookupTable({
5713 0: ProtocolBuffer
.Encoder
.NUMERIC
,
5714 1: ProtocolBuffer
.Encoder
.NUMERIC
,
5715 2: ProtocolBuffer
.Encoder
.NUMERIC
,
5716 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
5720 _STYLE_CONTENT_TYPE
= """"""
5721 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.BeginTransactionRequest'
5722 _SERIALIZED_DESCRIPTOR
= array
.array('B')
5723 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KL2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkJlZ2luVHJhbnNhY3Rpb25SZXF1ZXN0ExoLY3Jvc3NfZ3JvdXAgASgAMAg4AUIFZmFsc2WjAaoBB2RlZmF1bHSyAQVmYWxzZaQBFBMaDWNyb3NzX3JlcXVlc3QgAigAMAg4AUIFZmFsc2WjAaoBB2RlZmF1bHSyAQVmYWxzZaQBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
5724 if _net_proto___parse__python
is not None:
5725 _net_proto___parse__python
.RegisterType(
5726 _SERIALIZED_DESCRIPTOR
.tostring())
5728 class BeginTransactionResponse(ProtocolBuffer
.ProtocolMessage
):
5729 has_transaction_
= 0
5732 def __init__(self
, contents
=None):
5733 if contents
is not None: self
.MergeFromString(contents
)
5735 def transaction(self
): return self
.transaction_
5737 def set_transaction(self
, x
):
5738 self
.has_transaction_
= 1
5739 self
.transaction_
= x
5741 def clear_transaction(self
):
5742 if self
.has_transaction_
:
5743 self
.has_transaction_
= 0
5744 self
.transaction_
= ""
5746 def has_transaction(self
): return self
.has_transaction_
5749 def MergeFrom(self
, x
):
5750 assert x
is not self
5751 if (x
.has_transaction()): self
.set_transaction(x
.transaction())
5753 if _net_proto___parse__python
is not None:
5754 def _CMergeFromString(self
, s
):
5755 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.BeginTransactionResponse', s
)
5757 if _net_proto___parse__python
is not None:
5759 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.BeginTransactionResponse')
5761 if _net_proto___parse__python
is not None:
5762 def _CEncodePartial(self
):
5763 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.BeginTransactionResponse')
5765 if _net_proto___parse__python
is not None:
5766 def _CToASCII(self
, output_format
):
5767 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.BeginTransactionResponse', output_format
)
5770 if _net_proto___parse__python
is not None:
5771 def ParseASCII(self
, s
):
5772 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.BeginTransactionResponse', s
)
5775 if _net_proto___parse__python
is not None:
5776 def ParseASCIIIgnoreUnknown(self
, s
):
5777 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.BeginTransactionResponse', s
)
5780 def Equals(self
, x
):
5781 if x
is self
: return 1
5782 if self
.has_transaction_
!= x
.has_transaction_
: return 0
5783 if self
.has_transaction_
and self
.transaction_
!= x
.transaction_
: return 0
5786 def IsInitialized(self
, debug_strs
=None):
5788 if (not self
.has_transaction_
):
5790 if debug_strs
is not None:
5791 debug_strs
.append('Required field: transaction not set.')
5796 n
+= self
.lengthString(len(self
.transaction_
))
5799 def ByteSizePartial(self
):
5801 if (self
.has_transaction_
):
5803 n
+= self
.lengthString(len(self
.transaction_
))
5807 self
.clear_transaction()
5809 def OutputUnchecked(self
, out
):
5811 out
.putPrefixedString(self
.transaction_
)
5813 def OutputPartial(self
, out
):
5814 if (self
.has_transaction_
):
5816 out
.putPrefixedString(self
.transaction_
)
5818 def TryMerge(self
, d
):
5819 while d
.avail() > 0:
5820 tt
= d
.getVarInt32()
5822 self
.set_transaction(d
.getPrefixedString())
5826 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
5830 def __str__(self
, prefix
="", printElemNumber
=0):
5832 if self
.has_transaction_
: res
+=prefix
+("transaction: %s\n" % self
.DebugFormatString(self
.transaction_
))
5836 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
5837 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
5841 _TEXT
= _BuildTagLookupTable({
5846 _TYPES
= _BuildTagLookupTable({
5847 0: ProtocolBuffer
.Encoder
.NUMERIC
,
5848 1: ProtocolBuffer
.Encoder
.STRING
,
5849 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
5853 _STYLE_CONTENT_TYPE
= """"""
5854 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.BeginTransactionResponse'
5855 _SERIALIZED_DESCRIPTOR
= array
.array('B')
5856 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KMGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkJlZ2luVHJhbnNhY3Rpb25SZXNwb25zZRMaC3RyYW5zYWN0aW9uIAEoAjAJOAIUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
5857 if _net_proto___parse__python
is not None:
5858 _net_proto___parse__python
.RegisterType(
5859 _SERIALIZED_DESCRIPTOR
.tostring())
5861 class RollbackRequest(ProtocolBuffer
.ProtocolMessage
):
5862 has_transaction_
= 0
5865 def __init__(self
, contents
=None):
5866 if contents
is not None: self
.MergeFromString(contents
)
5868 def transaction(self
): return self
.transaction_
5870 def set_transaction(self
, x
):
5871 self
.has_transaction_
= 1
5872 self
.transaction_
= x
5874 def clear_transaction(self
):
5875 if self
.has_transaction_
:
5876 self
.has_transaction_
= 0
5877 self
.transaction_
= ""
5879 def has_transaction(self
): return self
.has_transaction_
5882 def MergeFrom(self
, x
):
5883 assert x
is not self
5884 if (x
.has_transaction()): self
.set_transaction(x
.transaction())
5886 if _net_proto___parse__python
is not None:
5887 def _CMergeFromString(self
, s
):
5888 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.RollbackRequest', s
)
5890 if _net_proto___parse__python
is not None:
5892 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.RollbackRequest')
5894 if _net_proto___parse__python
is not None:
5895 def _CEncodePartial(self
):
5896 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.RollbackRequest')
5898 if _net_proto___parse__python
is not None:
5899 def _CToASCII(self
, output_format
):
5900 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.RollbackRequest', output_format
)
5903 if _net_proto___parse__python
is not None:
5904 def ParseASCII(self
, s
):
5905 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.RollbackRequest', s
)
5908 if _net_proto___parse__python
is not None:
5909 def ParseASCIIIgnoreUnknown(self
, s
):
5910 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.RollbackRequest', s
)
5913 def Equals(self
, x
):
5914 if x
is self
: return 1
5915 if self
.has_transaction_
!= x
.has_transaction_
: return 0
5916 if self
.has_transaction_
and self
.transaction_
!= x
.transaction_
: return 0
5919 def IsInitialized(self
, debug_strs
=None):
5921 if (not self
.has_transaction_
):
5923 if debug_strs
is not None:
5924 debug_strs
.append('Required field: transaction not set.')
5929 n
+= self
.lengthString(len(self
.transaction_
))
5932 def ByteSizePartial(self
):
5934 if (self
.has_transaction_
):
5936 n
+= self
.lengthString(len(self
.transaction_
))
5940 self
.clear_transaction()
5942 def OutputUnchecked(self
, out
):
5944 out
.putPrefixedString(self
.transaction_
)
5946 def OutputPartial(self
, out
):
5947 if (self
.has_transaction_
):
5949 out
.putPrefixedString(self
.transaction_
)
5951 def TryMerge(self
, d
):
5952 while d
.avail() > 0:
5953 tt
= d
.getVarInt32()
5955 self
.set_transaction(d
.getPrefixedString())
5959 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
5963 def __str__(self
, prefix
="", printElemNumber
=0):
5965 if self
.has_transaction_
: res
+=prefix
+("transaction: %s\n" % self
.DebugFormatString(self
.transaction_
))
5969 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
5970 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
5974 _TEXT
= _BuildTagLookupTable({
5979 _TYPES
= _BuildTagLookupTable({
5980 0: ProtocolBuffer
.Encoder
.NUMERIC
,
5981 1: ProtocolBuffer
.Encoder
.STRING
,
5982 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
5986 _STYLE_CONTENT_TYPE
= """"""
5987 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.RollbackRequest'
5988 _SERIALIZED_DESCRIPTOR
= array
.array('B')
5989 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJ2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJvbGxiYWNrUmVxdWVzdBMaC3RyYW5zYWN0aW9uIAEoAjAJOAIUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
5990 if _net_proto___parse__python
is not None:
5991 _net_proto___parse__python
.RegisterType(
5992 _SERIALIZED_DESCRIPTOR
.tostring())
5994 class RollbackResponse(ProtocolBuffer
.ProtocolMessage
):
5996 def __init__(self
, contents
=None):
5998 if contents
is not None: self
.MergeFromString(contents
)
6001 def MergeFrom(self
, x
):
6002 assert x
is not self
6004 if _net_proto___parse__python
is not None:
6005 def _CMergeFromString(self
, s
):
6006 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.RollbackResponse', s
)
6008 if _net_proto___parse__python
is not None:
6010 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.RollbackResponse')
6012 if _net_proto___parse__python
is not None:
6013 def _CEncodePartial(self
):
6014 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.RollbackResponse')
6016 if _net_proto___parse__python
is not None:
6017 def _CToASCII(self
, output_format
):
6018 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.RollbackResponse', output_format
)
6021 if _net_proto___parse__python
is not None:
6022 def ParseASCII(self
, s
):
6023 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.RollbackResponse', s
)
6026 if _net_proto___parse__python
is not None:
6027 def ParseASCIIIgnoreUnknown(self
, s
):
6028 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.RollbackResponse', s
)
6031 def Equals(self
, x
):
6032 if x
is self
: return 1
6035 def IsInitialized(self
, debug_strs
=None):
6043 def ByteSizePartial(self
):
6050 def OutputUnchecked(self
, out
):
6053 def OutputPartial(self
, out
):
6056 def TryMerge(self
, d
):
6057 while d
.avail() > 0:
6058 tt
= d
.getVarInt32()
6061 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6065 def __str__(self
, prefix
="", printElemNumber
=0):
6070 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6071 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6074 _TEXT
= _BuildTagLookupTable({
6078 _TYPES
= _BuildTagLookupTable({
6079 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6080 }, 0, ProtocolBuffer
.Encoder
.MAX_TYPE
)
6084 _STYLE_CONTENT_TYPE
= """"""
6085 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.RollbackResponse'
6086 _SERIALIZED_DESCRIPTOR
= array
.array('B')
6087 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJvbGxiYWNrUmVzcG9uc2XCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
6088 if _net_proto___parse__python
is not None:
6089 _net_proto___parse__python
.RegisterType(
6090 _SERIALIZED_DESCRIPTOR
.tostring())
6092 class CommitRequest(ProtocolBuffer
.ProtocolMessage
):
6096 NON_TRANSACTIONAL
= 2
6100 2: "NON_TRANSACTIONAL",
6103 def Mode_Name(cls
, x
): return cls
._Mode
_NAMES
.get(x
, "")
6104 Mode_Name
= classmethod(Mode_Name
)
6106 has_transaction_
= 0
6108 has_deprecated_mutation_
= 0
6109 deprecated_mutation_
= None
6112 has_ignore_read_only_
= 0
6113 ignore_read_only_
= 0
6115 def __init__(self
, contents
=None):
6117 self
.lazy_init_lock_
= thread
.allocate_lock()
6118 if contents
is not None: self
.MergeFromString(contents
)
6120 def transaction(self
): return self
.transaction_
6122 def set_transaction(self
, x
):
6123 self
.has_transaction_
= 1
6124 self
.transaction_
= x
6126 def clear_transaction(self
):
6127 if self
.has_transaction_
:
6128 self
.has_transaction_
= 0
6129 self
.transaction_
= ""
6131 def has_transaction(self
): return self
.has_transaction_
6133 def mutation_size(self
): return len(self
.mutation_
)
6134 def mutation_list(self
): return self
.mutation_
6136 def mutation(self
, i
):
6137 return self
.mutation_
[i
]
6139 def mutable_mutation(self
, i
):
6140 return self
.mutation_
[i
]
6142 def add_mutation(self
):
6144 self
.mutation_
.append(x
)
6147 def clear_mutation(self
):
6149 def deprecated_mutation(self
):
6150 if self
.deprecated_mutation_
is None:
6151 self
.lazy_init_lock_
.acquire()
6153 if self
.deprecated_mutation_
is None: self
.deprecated_mutation_
= DeprecatedMutation()
6155 self
.lazy_init_lock_
.release()
6156 return self
.deprecated_mutation_
6158 def mutable_deprecated_mutation(self
): self
.has_deprecated_mutation_
= 1; return self
.deprecated_mutation()
6160 def clear_deprecated_mutation(self
):
6162 if self
.has_deprecated_mutation_
:
6163 self
.has_deprecated_mutation_
= 0;
6164 if self
.deprecated_mutation_
is not None: self
.deprecated_mutation_
.Clear()
6166 def has_deprecated_mutation(self
): return self
.has_deprecated_mutation_
6168 def mode(self
): return self
.mode_
6170 def set_mode(self
, x
):
6174 def clear_mode(self
):
6179 def has_mode(self
): return self
.has_mode_
6181 def ignore_read_only(self
): return self
.ignore_read_only_
6183 def set_ignore_read_only(self
, x
):
6184 self
.has_ignore_read_only_
= 1
6185 self
.ignore_read_only_
= x
6187 def clear_ignore_read_only(self
):
6188 if self
.has_ignore_read_only_
:
6189 self
.has_ignore_read_only_
= 0
6190 self
.ignore_read_only_
= 0
6192 def has_ignore_read_only(self
): return self
.has_ignore_read_only_
6195 def MergeFrom(self
, x
):
6196 assert x
is not self
6197 if (x
.has_transaction()): self
.set_transaction(x
.transaction())
6198 for i
in xrange(x
.mutation_size()): self
.add_mutation().CopyFrom(x
.mutation(i
))
6199 if (x
.has_deprecated_mutation()): self
.mutable_deprecated_mutation().MergeFrom(x
.deprecated_mutation())
6200 if (x
.has_mode()): self
.set_mode(x
.mode())
6201 if (x
.has_ignore_read_only()): self
.set_ignore_read_only(x
.ignore_read_only())
6203 if _net_proto___parse__python
is not None:
6204 def _CMergeFromString(self
, s
):
6205 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.CommitRequest', s
)
6207 if _net_proto___parse__python
is not None:
6209 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.CommitRequest')
6211 if _net_proto___parse__python
is not None:
6212 def _CEncodePartial(self
):
6213 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.CommitRequest')
6215 if _net_proto___parse__python
is not None:
6216 def _CToASCII(self
, output_format
):
6217 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.CommitRequest', output_format
)
6220 if _net_proto___parse__python
is not None:
6221 def ParseASCII(self
, s
):
6222 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.CommitRequest', s
)
6225 if _net_proto___parse__python
is not None:
6226 def ParseASCIIIgnoreUnknown(self
, s
):
6227 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.CommitRequest', s
)
6230 def Equals(self
, x
):
6231 if x
is self
: return 1
6232 if self
.has_transaction_
!= x
.has_transaction_
: return 0
6233 if self
.has_transaction_
and self
.transaction_
!= x
.transaction_
: return 0
6234 if len(self
.mutation_
) != len(x
.mutation_
): return 0
6235 for e1
, e2
in zip(self
.mutation_
, x
.mutation_
):
6236 if e1
!= e2
: return 0
6237 if self
.has_deprecated_mutation_
!= x
.has_deprecated_mutation_
: return 0
6238 if self
.has_deprecated_mutation_
and self
.deprecated_mutation_
!= x
.deprecated_mutation_
: return 0
6239 if self
.has_mode_
!= x
.has_mode_
: return 0
6240 if self
.has_mode_
and self
.mode_
!= x
.mode_
: return 0
6241 if self
.has_ignore_read_only_
!= x
.has_ignore_read_only_
: return 0
6242 if self
.has_ignore_read_only_
and self
.ignore_read_only_
!= x
.ignore_read_only_
: return 0
6245 def IsInitialized(self
, debug_strs
=None):
6247 for p
in self
.mutation_
:
6248 if not p
.IsInitialized(debug_strs
): initialized
=0
6249 if (self
.has_deprecated_mutation_
and not self
.deprecated_mutation_
.IsInitialized(debug_strs
)): initialized
= 0
6254 if (self
.has_transaction_
): n
+= 1 + self
.lengthString(len(self
.transaction_
))
6255 n
+= 1 * len(self
.mutation_
)
6256 for i
in xrange(len(self
.mutation_
)): n
+= self
.lengthString(self
.mutation_
[i
].ByteSize())
6257 if (self
.has_deprecated_mutation_
): n
+= 1 + self
.lengthString(self
.deprecated_mutation_
.ByteSize())
6258 if (self
.has_mode_
): n
+= 1 + self
.lengthVarInt64(self
.mode_
)
6259 if (self
.has_ignore_read_only_
): n
+= 2
6262 def ByteSizePartial(self
):
6264 if (self
.has_transaction_
): n
+= 1 + self
.lengthString(len(self
.transaction_
))
6265 n
+= 1 * len(self
.mutation_
)
6266 for i
in xrange(len(self
.mutation_
)): n
+= self
.lengthString(self
.mutation_
[i
].ByteSizePartial())
6267 if (self
.has_deprecated_mutation_
): n
+= 1 + self
.lengthString(self
.deprecated_mutation_
.ByteSizePartial())
6268 if (self
.has_mode_
): n
+= 1 + self
.lengthVarInt64(self
.mode_
)
6269 if (self
.has_ignore_read_only_
): n
+= 2
6273 self
.clear_transaction()
6274 self
.clear_mutation()
6275 self
.clear_deprecated_mutation()
6277 self
.clear_ignore_read_only()
6279 def OutputUnchecked(self
, out
):
6280 if (self
.has_transaction_
):
6282 out
.putPrefixedString(self
.transaction_
)
6283 if (self
.has_deprecated_mutation_
):
6285 out
.putVarInt32(self
.deprecated_mutation_
.ByteSize())
6286 self
.deprecated_mutation_
.OutputUnchecked(out
)
6287 if (self
.has_mode_
):
6289 out
.putVarInt32(self
.mode_
)
6290 for i
in xrange(len(self
.mutation_
)):
6292 out
.putVarInt32(self
.mutation_
[i
].ByteSize())
6293 self
.mutation_
[i
].OutputUnchecked(out
)
6294 if (self
.has_ignore_read_only_
):
6296 out
.putBoolean(self
.ignore_read_only_
)
6298 def OutputPartial(self
, out
):
6299 if (self
.has_transaction_
):
6301 out
.putPrefixedString(self
.transaction_
)
6302 if (self
.has_deprecated_mutation_
):
6304 out
.putVarInt32(self
.deprecated_mutation_
.ByteSizePartial())
6305 self
.deprecated_mutation_
.OutputPartial(out
)
6306 if (self
.has_mode_
):
6308 out
.putVarInt32(self
.mode_
)
6309 for i
in xrange(len(self
.mutation_
)):
6311 out
.putVarInt32(self
.mutation_
[i
].ByteSizePartial())
6312 self
.mutation_
[i
].OutputPartial(out
)
6313 if (self
.has_ignore_read_only_
):
6315 out
.putBoolean(self
.ignore_read_only_
)
6317 def TryMerge(self
, d
):
6318 while d
.avail() > 0:
6319 tt
= d
.getVarInt32()
6321 self
.set_transaction(d
.getPrefixedString())
6324 length
= d
.getVarInt32()
6325 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6327 self
.mutable_deprecated_mutation().TryMerge(tmp
)
6330 self
.set_mode(d
.getVarInt32())
6333 length
= d
.getVarInt32()
6334 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6336 self
.add_mutation().TryMerge(tmp
)
6339 self
.set_ignore_read_only(d
.getBoolean())
6343 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6347 def __str__(self
, prefix
="", printElemNumber
=0):
6349 if self
.has_transaction_
: res
+=prefix
+("transaction: %s\n" % self
.DebugFormatString(self
.transaction_
))
6351 for e
in self
.mutation_
:
6353 if printElemNumber
: elm
="(%d)" % cnt
6354 res
+=prefix
+("mutation%s <\n" % elm
)
6355 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
6358 if self
.has_deprecated_mutation_
:
6359 res
+=prefix
+"deprecated_mutation <\n"
6360 res
+=self
.deprecated_mutation_
.__str
__(prefix
+ " ", printElemNumber
)
6362 if self
.has_mode_
: res
+=prefix
+("mode: %s\n" % self
.DebugFormatInt32(self
.mode_
))
6363 if self
.has_ignore_read_only_
: res
+=prefix
+("ignore_read_only: %s\n" % self
.DebugFormatBool(self
.ignore_read_only_
))
6367 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6368 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6372 kdeprecated_mutation
= 2
6374 kignore_read_only
= 6
6376 _TEXT
= _BuildTagLookupTable({
6379 2: "deprecated_mutation",
6382 6: "ignore_read_only",
6385 _TYPES
= _BuildTagLookupTable({
6386 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6387 1: ProtocolBuffer
.Encoder
.STRING
,
6388 2: ProtocolBuffer
.Encoder
.STRING
,
6389 4: ProtocolBuffer
.Encoder
.NUMERIC
,
6390 5: ProtocolBuffer
.Encoder
.STRING
,
6391 6: ProtocolBuffer
.Encoder
.NUMERIC
,
6392 }, 6, ProtocolBuffer
.Encoder
.MAX_TYPE
)
6396 _STYLE_CONTENT_TYPE
= """"""
6397 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.CommitRequest'
6398 _SERIALIZED_DESCRIPTOR
= array
.array('B')
6399 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbW1pdFJlcXVlc3QTGgt0cmFuc2FjdGlvbiABKAIwCTgBFBMaCG11dGF0aW9uIAUoAjALOANKIGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaE2RlcHJlY2F0ZWRfbXV0YXRpb24gAigCMAs4AUoqYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRGVwcmVjYXRlZE11dGF0aW9uowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaBG1vZGUgBCgAMAU4AUIBMWgAowGqAQdkZWZhdWx0sgENVFJBTlNBQ1RJT05BTKQBFBMaEGlnbm9yZV9yZWFkX29ubHkgBigAMAg4AUIFZmFsc2WjAaoBB2RlZmF1bHSyAQVmYWxzZaQBFHN6BE1vZGWLAZIBDVRSQU5TQUNUSU9OQUyYAQGMAYsBkgERTk9OX1RSQU5TQUNUSU9OQUyYAQKMAXTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
6400 if _net_proto___parse__python
is not None:
6401 _net_proto___parse__python
.RegisterType(
6402 _SERIALIZED_DESCRIPTOR
.tostring())
6404 class CommitResponse(ProtocolBuffer
.ProtocolMessage
):
6405 has_deprecated_mutation_result_
= 0
6406 deprecated_mutation_result_
= None
6407 has_index_updates_
= 0
6410 def __init__(self
, contents
=None):
6411 self
.mutation_result_
= []
6412 self
.lazy_init_lock_
= thread
.allocate_lock()
6413 if contents
is not None: self
.MergeFromString(contents
)
6415 def mutation_result_size(self
): return len(self
.mutation_result_
)
6416 def mutation_result_list(self
): return self
.mutation_result_
6418 def mutation_result(self
, i
):
6419 return self
.mutation_result_
[i
]
6421 def mutable_mutation_result(self
, i
):
6422 return self
.mutation_result_
[i
]
6424 def add_mutation_result(self
):
6425 x
= MutationResult()
6426 self
.mutation_result_
.append(x
)
6429 def clear_mutation_result(self
):
6430 self
.mutation_result_
= []
6431 def deprecated_mutation_result(self
):
6432 if self
.deprecated_mutation_result_
is None:
6433 self
.lazy_init_lock_
.acquire()
6435 if self
.deprecated_mutation_result_
is None: self
.deprecated_mutation_result_
= DeprecatedMutationResult()
6437 self
.lazy_init_lock_
.release()
6438 return self
.deprecated_mutation_result_
6440 def mutable_deprecated_mutation_result(self
): self
.has_deprecated_mutation_result_
= 1; return self
.deprecated_mutation_result()
6442 def clear_deprecated_mutation_result(self
):
6444 if self
.has_deprecated_mutation_result_
:
6445 self
.has_deprecated_mutation_result_
= 0;
6446 if self
.deprecated_mutation_result_
is not None: self
.deprecated_mutation_result_
.Clear()
6448 def has_deprecated_mutation_result(self
): return self
.has_deprecated_mutation_result_
6450 def index_updates(self
): return self
.index_updates_
6452 def set_index_updates(self
, x
):
6453 self
.has_index_updates_
= 1
6454 self
.index_updates_
= x
6456 def clear_index_updates(self
):
6457 if self
.has_index_updates_
:
6458 self
.has_index_updates_
= 0
6459 self
.index_updates_
= 0
6461 def has_index_updates(self
): return self
.has_index_updates_
6464 def MergeFrom(self
, x
):
6465 assert x
is not self
6466 for i
in xrange(x
.mutation_result_size()): self
.add_mutation_result().CopyFrom(x
.mutation_result(i
))
6467 if (x
.has_deprecated_mutation_result()): self
.mutable_deprecated_mutation_result().MergeFrom(x
.deprecated_mutation_result())
6468 if (x
.has_index_updates()): self
.set_index_updates(x
.index_updates())
6470 if _net_proto___parse__python
is not None:
6471 def _CMergeFromString(self
, s
):
6472 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.CommitResponse', s
)
6474 if _net_proto___parse__python
is not None:
6476 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.CommitResponse')
6478 if _net_proto___parse__python
is not None:
6479 def _CEncodePartial(self
):
6480 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.CommitResponse')
6482 if _net_proto___parse__python
is not None:
6483 def _CToASCII(self
, output_format
):
6484 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.CommitResponse', output_format
)
6487 if _net_proto___parse__python
is not None:
6488 def ParseASCII(self
, s
):
6489 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.CommitResponse', s
)
6492 if _net_proto___parse__python
is not None:
6493 def ParseASCIIIgnoreUnknown(self
, s
):
6494 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.CommitResponse', s
)
6497 def Equals(self
, x
):
6498 if x
is self
: return 1
6499 if len(self
.mutation_result_
) != len(x
.mutation_result_
): return 0
6500 for e1
, e2
in zip(self
.mutation_result_
, x
.mutation_result_
):
6501 if e1
!= e2
: return 0
6502 if self
.has_deprecated_mutation_result_
!= x
.has_deprecated_mutation_result_
: return 0
6503 if self
.has_deprecated_mutation_result_
and self
.deprecated_mutation_result_
!= x
.deprecated_mutation_result_
: return 0
6504 if self
.has_index_updates_
!= x
.has_index_updates_
: return 0
6505 if self
.has_index_updates_
and self
.index_updates_
!= x
.index_updates_
: return 0
6508 def IsInitialized(self
, debug_strs
=None):
6510 for p
in self
.mutation_result_
:
6511 if not p
.IsInitialized(debug_strs
): initialized
=0
6512 if (self
.has_deprecated_mutation_result_
and not self
.deprecated_mutation_result_
.IsInitialized(debug_strs
)): initialized
= 0
6517 n
+= 1 * len(self
.mutation_result_
)
6518 for i
in xrange(len(self
.mutation_result_
)): n
+= self
.lengthString(self
.mutation_result_
[i
].ByteSize())
6519 if (self
.has_deprecated_mutation_result_
): n
+= 1 + self
.lengthString(self
.deprecated_mutation_result_
.ByteSize())
6520 if (self
.has_index_updates_
): n
+= 1 + self
.lengthVarInt64(self
.index_updates_
)
6523 def ByteSizePartial(self
):
6525 n
+= 1 * len(self
.mutation_result_
)
6526 for i
in xrange(len(self
.mutation_result_
)): n
+= self
.lengthString(self
.mutation_result_
[i
].ByteSizePartial())
6527 if (self
.has_deprecated_mutation_result_
): n
+= 1 + self
.lengthString(self
.deprecated_mutation_result_
.ByteSizePartial())
6528 if (self
.has_index_updates_
): n
+= 1 + self
.lengthVarInt64(self
.index_updates_
)
6532 self
.clear_mutation_result()
6533 self
.clear_deprecated_mutation_result()
6534 self
.clear_index_updates()
6536 def OutputUnchecked(self
, out
):
6537 if (self
.has_deprecated_mutation_result_
):
6539 out
.putVarInt32(self
.deprecated_mutation_result_
.ByteSize())
6540 self
.deprecated_mutation_result_
.OutputUnchecked(out
)
6541 for i
in xrange(len(self
.mutation_result_
)):
6543 out
.putVarInt32(self
.mutation_result_
[i
].ByteSize())
6544 self
.mutation_result_
[i
].OutputUnchecked(out
)
6545 if (self
.has_index_updates_
):
6547 out
.putVarInt32(self
.index_updates_
)
6549 def OutputPartial(self
, out
):
6550 if (self
.has_deprecated_mutation_result_
):
6552 out
.putVarInt32(self
.deprecated_mutation_result_
.ByteSizePartial())
6553 self
.deprecated_mutation_result_
.OutputPartial(out
)
6554 for i
in xrange(len(self
.mutation_result_
)):
6556 out
.putVarInt32(self
.mutation_result_
[i
].ByteSizePartial())
6557 self
.mutation_result_
[i
].OutputPartial(out
)
6558 if (self
.has_index_updates_
):
6560 out
.putVarInt32(self
.index_updates_
)
6562 def TryMerge(self
, d
):
6563 while d
.avail() > 0:
6564 tt
= d
.getVarInt32()
6566 length
= d
.getVarInt32()
6567 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6569 self
.mutable_deprecated_mutation_result().TryMerge(tmp
)
6572 length
= d
.getVarInt32()
6573 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6575 self
.add_mutation_result().TryMerge(tmp
)
6578 self
.set_index_updates(d
.getVarInt32())
6582 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6586 def __str__(self
, prefix
="", printElemNumber
=0):
6589 for e
in self
.mutation_result_
:
6591 if printElemNumber
: elm
="(%d)" % cnt
6592 res
+=prefix
+("mutation_result%s <\n" % elm
)
6593 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
6596 if self
.has_deprecated_mutation_result_
:
6597 res
+=prefix
+"deprecated_mutation_result <\n"
6598 res
+=self
.deprecated_mutation_result_
.__str
__(prefix
+ " ", printElemNumber
)
6600 if self
.has_index_updates_
: res
+=prefix
+("index_updates: %s\n" % self
.DebugFormatInt32(self
.index_updates_
))
6604 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6605 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6607 kmutation_result
= 3
6608 kdeprecated_mutation_result
= 1
6611 _TEXT
= _BuildTagLookupTable({
6613 1: "deprecated_mutation_result",
6614 3: "mutation_result",
6618 _TYPES
= _BuildTagLookupTable({
6619 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6620 1: ProtocolBuffer
.Encoder
.STRING
,
6621 3: ProtocolBuffer
.Encoder
.STRING
,
6622 4: ProtocolBuffer
.Encoder
.NUMERIC
,
6623 }, 4, ProtocolBuffer
.Encoder
.MAX_TYPE
)
6627 _STYLE_CONTENT_TYPE
= """"""
6628 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.CommitResponse'
6629 _SERIALIZED_DESCRIPTOR
= array
.array('B')
6630 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbW1pdFJlc3BvbnNlExoPbXV0YXRpb25fcmVzdWx0IAMoAjALOANKJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uUmVzdWx0owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaGmRlcHJlY2F0ZWRfbXV0YXRpb25fcmVzdWx0IAEoAjALOAFKMGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkRlcHJlY2F0ZWRNdXRhdGlvblJlc3VsdKMBqgEFY3R5cGWyAQZwcm90bzKkARQTGg1pbmRleF91cGRhdGVzIAQoADAFOAEUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
6631 if _net_proto___parse__python
is not None:
6632 _net_proto___parse__python
.RegisterType(
6633 _SERIALIZED_DESCRIPTOR
.tostring())
6635 class AllocateIdsRequest(ProtocolBuffer
.ProtocolMessage
):
6637 def __init__(self
, contents
=None):
6640 if contents
is not None: self
.MergeFromString(contents
)
6642 def allocate_size(self
): return len(self
.allocate_
)
6643 def allocate_list(self
): return self
.allocate_
6645 def allocate(self
, i
):
6646 return self
.allocate_
[i
]
6648 def mutable_allocate(self
, i
):
6649 return self
.allocate_
[i
]
6651 def add_allocate(self
):
6652 x
= google
.appengine
.datastore
.entity_v4_pb
.Key()
6653 self
.allocate_
.append(x
)
6656 def clear_allocate(self
):
6658 def reserve_size(self
): return len(self
.reserve_
)
6659 def reserve_list(self
): return self
.reserve_
6661 def reserve(self
, i
):
6662 return self
.reserve_
[i
]
6664 def mutable_reserve(self
, i
):
6665 return self
.reserve_
[i
]
6667 def add_reserve(self
):
6668 x
= google
.appengine
.datastore
.entity_v4_pb
.Key()
6669 self
.reserve_
.append(x
)
6672 def clear_reserve(self
):
6675 def MergeFrom(self
, x
):
6676 assert x
is not self
6677 for i
in xrange(x
.allocate_size()): self
.add_allocate().CopyFrom(x
.allocate(i
))
6678 for i
in xrange(x
.reserve_size()): self
.add_reserve().CopyFrom(x
.reserve(i
))
6680 if _net_proto___parse__python
is not None:
6681 def _CMergeFromString(self
, s
):
6682 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.AllocateIdsRequest', s
)
6684 if _net_proto___parse__python
is not None:
6686 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.AllocateIdsRequest')
6688 if _net_proto___parse__python
is not None:
6689 def _CEncodePartial(self
):
6690 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.AllocateIdsRequest')
6692 if _net_proto___parse__python
is not None:
6693 def _CToASCII(self
, output_format
):
6694 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.AllocateIdsRequest', output_format
)
6697 if _net_proto___parse__python
is not None:
6698 def ParseASCII(self
, s
):
6699 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.AllocateIdsRequest', s
)
6702 if _net_proto___parse__python
is not None:
6703 def ParseASCIIIgnoreUnknown(self
, s
):
6704 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.AllocateIdsRequest', s
)
6707 def Equals(self
, x
):
6708 if x
is self
: return 1
6709 if len(self
.allocate_
) != len(x
.allocate_
): return 0
6710 for e1
, e2
in zip(self
.allocate_
, x
.allocate_
):
6711 if e1
!= e2
: return 0
6712 if len(self
.reserve_
) != len(x
.reserve_
): return 0
6713 for e1
, e2
in zip(self
.reserve_
, x
.reserve_
):
6714 if e1
!= e2
: return 0
6717 def IsInitialized(self
, debug_strs
=None):
6719 for p
in self
.allocate_
:
6720 if not p
.IsInitialized(debug_strs
): initialized
=0
6721 for p
in self
.reserve_
:
6722 if not p
.IsInitialized(debug_strs
): initialized
=0
6727 n
+= 1 * len(self
.allocate_
)
6728 for i
in xrange(len(self
.allocate_
)): n
+= self
.lengthString(self
.allocate_
[i
].ByteSize())
6729 n
+= 1 * len(self
.reserve_
)
6730 for i
in xrange(len(self
.reserve_
)): n
+= self
.lengthString(self
.reserve_
[i
].ByteSize())
6733 def ByteSizePartial(self
):
6735 n
+= 1 * len(self
.allocate_
)
6736 for i
in xrange(len(self
.allocate_
)): n
+= self
.lengthString(self
.allocate_
[i
].ByteSizePartial())
6737 n
+= 1 * len(self
.reserve_
)
6738 for i
in xrange(len(self
.reserve_
)): n
+= self
.lengthString(self
.reserve_
[i
].ByteSizePartial())
6742 self
.clear_allocate()
6743 self
.clear_reserve()
6745 def OutputUnchecked(self
, out
):
6746 for i
in xrange(len(self
.allocate_
)):
6748 out
.putVarInt32(self
.allocate_
[i
].ByteSize())
6749 self
.allocate_
[i
].OutputUnchecked(out
)
6750 for i
in xrange(len(self
.reserve_
)):
6752 out
.putVarInt32(self
.reserve_
[i
].ByteSize())
6753 self
.reserve_
[i
].OutputUnchecked(out
)
6755 def OutputPartial(self
, out
):
6756 for i
in xrange(len(self
.allocate_
)):
6758 out
.putVarInt32(self
.allocate_
[i
].ByteSizePartial())
6759 self
.allocate_
[i
].OutputPartial(out
)
6760 for i
in xrange(len(self
.reserve_
)):
6762 out
.putVarInt32(self
.reserve_
[i
].ByteSizePartial())
6763 self
.reserve_
[i
].OutputPartial(out
)
6765 def TryMerge(self
, d
):
6766 while d
.avail() > 0:
6767 tt
= d
.getVarInt32()
6769 length
= d
.getVarInt32()
6770 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6772 self
.add_allocate().TryMerge(tmp
)
6775 length
= d
.getVarInt32()
6776 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6778 self
.add_reserve().TryMerge(tmp
)
6782 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6786 def __str__(self
, prefix
="", printElemNumber
=0):
6789 for e
in self
.allocate_
:
6791 if printElemNumber
: elm
="(%d)" % cnt
6792 res
+=prefix
+("allocate%s <\n" % elm
)
6793 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
6797 for e
in self
.reserve_
:
6799 if printElemNumber
: elm
="(%d)" % cnt
6800 res
+=prefix
+("reserve%s <\n" % elm
)
6801 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
6807 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6808 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6813 _TEXT
= _BuildTagLookupTable({
6819 _TYPES
= _BuildTagLookupTable({
6820 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6821 1: ProtocolBuffer
.Encoder
.STRING
,
6822 2: ProtocolBuffer
.Encoder
.STRING
,
6823 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
6827 _STYLE_CONTENT_TYPE
= """"""
6828 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.AllocateIdsRequest'
6829 _SERIALIZED_DESCRIPTOR
= array
.array('B')
6830 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkFsbG9jYXRlSWRzUmVxdWVzdBMaCGFsbG9jYXRlIAEoAjALOANKG2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleaMBqgEFY3R5cGWyAQZwcm90bzKkARQTGgdyZXNlcnZlIAIoAjALOANKG2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleaMBqgEFY3R5cGWyAQZwcm90bzKkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
6831 if _net_proto___parse__python
is not None:
6832 _net_proto___parse__python
.RegisterType(
6833 _SERIALIZED_DESCRIPTOR
.tostring())
6835 class AllocateIdsResponse(ProtocolBuffer
.ProtocolMessage
):
6837 def __init__(self
, contents
=None):
6838 self
.allocated_
= []
6839 if contents
is not None: self
.MergeFromString(contents
)
6841 def allocated_size(self
): return len(self
.allocated_
)
6842 def allocated_list(self
): return self
.allocated_
6844 def allocated(self
, i
):
6845 return self
.allocated_
[i
]
6847 def mutable_allocated(self
, i
):
6848 return self
.allocated_
[i
]
6850 def add_allocated(self
):
6851 x
= google
.appengine
.datastore
.entity_v4_pb
.Key()
6852 self
.allocated_
.append(x
)
6855 def clear_allocated(self
):
6856 self
.allocated_
= []
6858 def MergeFrom(self
, x
):
6859 assert x
is not self
6860 for i
in xrange(x
.allocated_size()): self
.add_allocated().CopyFrom(x
.allocated(i
))
6862 if _net_proto___parse__python
is not None:
6863 def _CMergeFromString(self
, s
):
6864 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.AllocateIdsResponse', s
)
6866 if _net_proto___parse__python
is not None:
6868 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.AllocateIdsResponse')
6870 if _net_proto___parse__python
is not None:
6871 def _CEncodePartial(self
):
6872 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.AllocateIdsResponse')
6874 if _net_proto___parse__python
is not None:
6875 def _CToASCII(self
, output_format
):
6876 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.AllocateIdsResponse', output_format
)
6879 if _net_proto___parse__python
is not None:
6880 def ParseASCII(self
, s
):
6881 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.AllocateIdsResponse', s
)
6884 if _net_proto___parse__python
is not None:
6885 def ParseASCIIIgnoreUnknown(self
, s
):
6886 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.AllocateIdsResponse', s
)
6889 def Equals(self
, x
):
6890 if x
is self
: return 1
6891 if len(self
.allocated_
) != len(x
.allocated_
): return 0
6892 for e1
, e2
in zip(self
.allocated_
, x
.allocated_
):
6893 if e1
!= e2
: return 0
6896 def IsInitialized(self
, debug_strs
=None):
6898 for p
in self
.allocated_
:
6899 if not p
.IsInitialized(debug_strs
): initialized
=0
6904 n
+= 1 * len(self
.allocated_
)
6905 for i
in xrange(len(self
.allocated_
)): n
+= self
.lengthString(self
.allocated_
[i
].ByteSize())
6908 def ByteSizePartial(self
):
6910 n
+= 1 * len(self
.allocated_
)
6911 for i
in xrange(len(self
.allocated_
)): n
+= self
.lengthString(self
.allocated_
[i
].ByteSizePartial())
6915 self
.clear_allocated()
6917 def OutputUnchecked(self
, out
):
6918 for i
in xrange(len(self
.allocated_
)):
6920 out
.putVarInt32(self
.allocated_
[i
].ByteSize())
6921 self
.allocated_
[i
].OutputUnchecked(out
)
6923 def OutputPartial(self
, out
):
6924 for i
in xrange(len(self
.allocated_
)):
6926 out
.putVarInt32(self
.allocated_
[i
].ByteSizePartial())
6927 self
.allocated_
[i
].OutputPartial(out
)
6929 def TryMerge(self
, d
):
6930 while d
.avail() > 0:
6931 tt
= d
.getVarInt32()
6933 length
= d
.getVarInt32()
6934 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6936 self
.add_allocated().TryMerge(tmp
)
6940 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6944 def __str__(self
, prefix
="", printElemNumber
=0):
6947 for e
in self
.allocated_
:
6949 if printElemNumber
: elm
="(%d)" % cnt
6950 res
+=prefix
+("allocated%s <\n" % elm
)
6951 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
6957 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6958 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6962 _TEXT
= _BuildTagLookupTable({
6967 _TYPES
= _BuildTagLookupTable({
6968 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6969 1: ProtocolBuffer
.Encoder
.STRING
,
6970 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
6974 _STYLE_CONTENT_TYPE
= """"""
6975 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.AllocateIdsResponse'
6976 _SERIALIZED_DESCRIPTOR
= array
.array('B')
6977 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KK2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkFsbG9jYXRlSWRzUmVzcG9uc2UTGglhbGxvY2F0ZWQgASgCMAs4A0obYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuS2V5owGqAQVjdHlwZbIBBnByb3RvMqQBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
6978 if _net_proto___parse__python
is not None:
6979 _net_proto___parse__python
.RegisterType(
6980 _SERIALIZED_DESCRIPTOR
.tostring())
6982 class WriteRequest(ProtocolBuffer
.ProtocolMessage
):
6983 has_deprecated_mutation_
= 0
6985 def __init__(self
, contents
=None):
6986 self
.deprecated_mutation_
= DeprecatedMutation()
6987 if contents
is not None: self
.MergeFromString(contents
)
6989 def deprecated_mutation(self
): return self
.deprecated_mutation_
6991 def mutable_deprecated_mutation(self
): self
.has_deprecated_mutation_
= 1; return self
.deprecated_mutation_
6993 def clear_deprecated_mutation(self
):self
.has_deprecated_mutation_
= 0; self
.deprecated_mutation_
.Clear()
6995 def has_deprecated_mutation(self
): return self
.has_deprecated_mutation_
6998 def MergeFrom(self
, x
):
6999 assert x
is not self
7000 if (x
.has_deprecated_mutation()): self
.mutable_deprecated_mutation().MergeFrom(x
.deprecated_mutation())
7002 if _net_proto___parse__python
is not None:
7003 def _CMergeFromString(self
, s
):
7004 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.WriteRequest', s
)
7006 if _net_proto___parse__python
is not None:
7008 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.WriteRequest')
7010 if _net_proto___parse__python
is not None:
7011 def _CEncodePartial(self
):
7012 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.WriteRequest')
7014 if _net_proto___parse__python
is not None:
7015 def _CToASCII(self
, output_format
):
7016 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.WriteRequest', output_format
)
7019 if _net_proto___parse__python
is not None:
7020 def ParseASCII(self
, s
):
7021 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.WriteRequest', s
)
7024 if _net_proto___parse__python
is not None:
7025 def ParseASCIIIgnoreUnknown(self
, s
):
7026 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.WriteRequest', s
)
7029 def Equals(self
, x
):
7030 if x
is self
: return 1
7031 if self
.has_deprecated_mutation_
!= x
.has_deprecated_mutation_
: return 0
7032 if self
.has_deprecated_mutation_
and self
.deprecated_mutation_
!= x
.deprecated_mutation_
: return 0
7035 def IsInitialized(self
, debug_strs
=None):
7037 if (not self
.has_deprecated_mutation_
):
7039 if debug_strs
is not None:
7040 debug_strs
.append('Required field: deprecated_mutation not set.')
7041 elif not self
.deprecated_mutation_
.IsInitialized(debug_strs
): initialized
= 0
7046 n
+= self
.lengthString(self
.deprecated_mutation_
.ByteSize())
7049 def ByteSizePartial(self
):
7051 if (self
.has_deprecated_mutation_
):
7053 n
+= self
.lengthString(self
.deprecated_mutation_
.ByteSizePartial())
7057 self
.clear_deprecated_mutation()
7059 def OutputUnchecked(self
, out
):
7061 out
.putVarInt32(self
.deprecated_mutation_
.ByteSize())
7062 self
.deprecated_mutation_
.OutputUnchecked(out
)
7064 def OutputPartial(self
, out
):
7065 if (self
.has_deprecated_mutation_
):
7067 out
.putVarInt32(self
.deprecated_mutation_
.ByteSizePartial())
7068 self
.deprecated_mutation_
.OutputPartial(out
)
7070 def TryMerge(self
, d
):
7071 while d
.avail() > 0:
7072 tt
= d
.getVarInt32()
7074 length
= d
.getVarInt32()
7075 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
7077 self
.mutable_deprecated_mutation().TryMerge(tmp
)
7081 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
7085 def __str__(self
, prefix
="", printElemNumber
=0):
7087 if self
.has_deprecated_mutation_
:
7088 res
+=prefix
+"deprecated_mutation <\n"
7089 res
+=self
.deprecated_mutation_
.__str
__(prefix
+ " ", printElemNumber
)
7094 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
7095 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
7097 kdeprecated_mutation
= 1
7099 _TEXT
= _BuildTagLookupTable({
7101 1: "deprecated_mutation",
7104 _TYPES
= _BuildTagLookupTable({
7105 0: ProtocolBuffer
.Encoder
.NUMERIC
,
7106 1: ProtocolBuffer
.Encoder
.STRING
,
7107 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
7111 _STYLE_CONTENT_TYPE
= """"""
7112 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.WriteRequest'
7113 _SERIALIZED_DESCRIPTOR
= array
.array('B')
7114 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LldyaXRlUmVxdWVzdBMaE2RlcHJlY2F0ZWRfbXV0YXRpb24gASgCMAs4AkoqYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRGVwcmVjYXRlZE11dGF0aW9uowGqAQVjdHlwZbIBBnByb3RvMqQBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
7115 if _net_proto___parse__python
is not None:
7116 _net_proto___parse__python
.RegisterType(
7117 _SERIALIZED_DESCRIPTOR
.tostring())
7121 class _DatastoreV4Service_ClientBaseStub(_client_stub_base_class
):
7122 """Makes Stubby RPC calls to a DatastoreV4Service server."""
7125 '_protorpc_BeginTransaction', '_full_name_BeginTransaction',
7126 '_protorpc_Rollback', '_full_name_Rollback',
7127 '_protorpc_Commit', '_full_name_Commit',
7128 '_protorpc_RunQuery', '_full_name_RunQuery',
7129 '_protorpc_ContinueQuery', '_full_name_ContinueQuery',
7130 '_protorpc_Lookup', '_full_name_Lookup',
7131 '_protorpc_AllocateIds', '_full_name_AllocateIds',
7132 '_protorpc_Get', '_full_name_Get',
7133 '_protorpc_Write', '_full_name_Write',
7136 def __init__(self
, rpc_stub
):
7137 self
._stub
= rpc_stub
7139 self
._protorpc
_BeginTransaction
= pywraprpc
.RPC()
7140 self
._full
_name
_BeginTransaction
= self
._stub
.GetFullMethodName(
7143 self
._protorpc
_Rollback
= pywraprpc
.RPC()
7144 self
._full
_name
_Rollback
= self
._stub
.GetFullMethodName(
7147 self
._protorpc
_Commit
= pywraprpc
.RPC()
7148 self
._full
_name
_Commit
= self
._stub
.GetFullMethodName(
7151 self
._protorpc
_RunQuery
= pywraprpc
.RPC()
7152 self
._full
_name
_RunQuery
= self
._stub
.GetFullMethodName(
7155 self
._protorpc
_ContinueQuery
= pywraprpc
.RPC()
7156 self
._full
_name
_ContinueQuery
= self
._stub
.GetFullMethodName(
7159 self
._protorpc
_Lookup
= pywraprpc
.RPC()
7160 self
._full
_name
_Lookup
= self
._stub
.GetFullMethodName(
7163 self
._protorpc
_AllocateIds
= pywraprpc
.RPC()
7164 self
._full
_name
_AllocateIds
= self
._stub
.GetFullMethodName(
7167 self
._protorpc
_Get
= pywraprpc
.RPC()
7168 self
._full
_name
_Get
= self
._stub
.GetFullMethodName(
7171 self
._protorpc
_Write
= pywraprpc
.RPC()
7172 self
._full
_name
_Write
= self
._stub
.GetFullMethodName(
7175 def BeginTransaction(self
, request
, rpc
=None, callback
=None, response
=None):
7176 """Make a BeginTransaction RPC call.
7179 request: a BeginTransactionRequest instance.
7180 rpc: Optional RPC instance to use for the call.
7181 callback: Optional final callback. Will be called as
7182 callback(rpc, result) when the rpc completes. If None, the
7183 call is synchronous.
7184 response: Optional ProtocolMessage to be filled in with response.
7187 The BeginTransactionResponse if callback is None. Otherwise, returns None.
7190 if response
is None:
7191 response
= BeginTransactionResponse
7192 return self
._MakeCall
(rpc
,
7193 self
._full
_name
_BeginTransaction
,
7198 self
._protorpc
_BeginTransaction
)
7200 def Rollback(self
, request
, rpc
=None, callback
=None, response
=None):
7201 """Make a Rollback RPC call.
7204 request: a RollbackRequest instance.
7205 rpc: Optional RPC instance to use for the call.
7206 callback: Optional final callback. Will be called as
7207 callback(rpc, result) when the rpc completes. If None, the
7208 call is synchronous.
7209 response: Optional ProtocolMessage to be filled in with response.
7212 The RollbackResponse if callback is None. Otherwise, returns None.
7215 if response
is None:
7216 response
= RollbackResponse
7217 return self
._MakeCall
(rpc
,
7218 self
._full
_name
_Rollback
,
7223 self
._protorpc
_Rollback
)
7225 def Commit(self
, request
, rpc
=None, callback
=None, response
=None):
7226 """Make a Commit RPC call.
7229 request: a CommitRequest instance.
7230 rpc: Optional RPC instance to use for the call.
7231 callback: Optional final callback. Will be called as
7232 callback(rpc, result) when the rpc completes. If None, the
7233 call is synchronous.
7234 response: Optional ProtocolMessage to be filled in with response.
7237 The CommitResponse if callback is None. Otherwise, returns None.
7240 if response
is None:
7241 response
= CommitResponse
7242 return self
._MakeCall
(rpc
,
7243 self
._full
_name
_Commit
,
7248 self
._protorpc
_Commit
)
7250 def RunQuery(self
, request
, rpc
=None, callback
=None, response
=None):
7251 """Make a RunQuery RPC call.
7254 request: a RunQueryRequest instance.
7255 rpc: Optional RPC instance to use for the call.
7256 callback: Optional final callback. Will be called as
7257 callback(rpc, result) when the rpc completes. If None, the
7258 call is synchronous.
7259 response: Optional ProtocolMessage to be filled in with response.
7262 The RunQueryResponse if callback is None. Otherwise, returns None.
7265 if response
is None:
7266 response
= RunQueryResponse
7267 return self
._MakeCall
(rpc
,
7268 self
._full
_name
_RunQuery
,
7273 self
._protorpc
_RunQuery
)
7275 def ContinueQuery(self
, request
, rpc
=None, callback
=None, response
=None):
7276 """Make a ContinueQuery RPC call.
7279 request: a ContinueQueryRequest instance.
7280 rpc: Optional RPC instance to use for the call.
7281 callback: Optional final callback. Will be called as
7282 callback(rpc, result) when the rpc completes. If None, the
7283 call is synchronous.
7284 response: Optional ProtocolMessage to be filled in with response.
7287 The ContinueQueryResponse if callback is None. Otherwise, returns None.
7290 if response
is None:
7291 response
= ContinueQueryResponse
7292 return self
._MakeCall
(rpc
,
7293 self
._full
_name
_ContinueQuery
,
7298 self
._protorpc
_ContinueQuery
)
7300 def Lookup(self
, request
, rpc
=None, callback
=None, response
=None):
7301 """Make a Lookup RPC call.
7304 request: a LookupRequest instance.
7305 rpc: Optional RPC instance to use for the call.
7306 callback: Optional final callback. Will be called as
7307 callback(rpc, result) when the rpc completes. If None, the
7308 call is synchronous.
7309 response: Optional ProtocolMessage to be filled in with response.
7312 The LookupResponse if callback is None. Otherwise, returns None.
7315 if response
is None:
7316 response
= LookupResponse
7317 return self
._MakeCall
(rpc
,
7318 self
._full
_name
_Lookup
,
7323 self
._protorpc
_Lookup
)
7325 def AllocateIds(self
, request
, rpc
=None, callback
=None, response
=None):
7326 """Make a AllocateIds RPC call.
7329 request: a AllocateIdsRequest instance.
7330 rpc: Optional RPC instance to use for the call.
7331 callback: Optional final callback. Will be called as
7332 callback(rpc, result) when the rpc completes. If None, the
7333 call is synchronous.
7334 response: Optional ProtocolMessage to be filled in with response.
7337 The AllocateIdsResponse if callback is None. Otherwise, returns None.
7340 if response
is None:
7341 response
= AllocateIdsResponse
7342 return self
._MakeCall
(rpc
,
7343 self
._full
_name
_AllocateIds
,
7348 self
._protorpc
_AllocateIds
)
7350 def Get(self
, request
, rpc
=None, callback
=None, response
=None):
7351 """Make a Get RPC call.
7354 request: a LookupRequest instance.
7355 rpc: Optional RPC instance to use for the call.
7356 callback: Optional final callback. Will be called as
7357 callback(rpc, result) when the rpc completes. If None, the
7358 call is synchronous.
7359 response: Optional ProtocolMessage to be filled in with response.
7362 The LookupResponse if callback is None. Otherwise, returns None.
7365 if response
is None:
7366 response
= LookupResponse
7367 return self
._MakeCall
(rpc
,
7368 self
._full
_name
_Get
,
7375 def Write(self
, request
, rpc
=None, callback
=None, response
=None):
7376 """Make a Write RPC call.
7379 request: a WriteRequest instance.
7380 rpc: Optional RPC instance to use for the call.
7381 callback: Optional final callback. Will be called as
7382 callback(rpc, result) when the rpc completes. If None, the
7383 call is synchronous.
7384 response: Optional ProtocolMessage to be filled in with response.
7387 The CommitResponse if callback is None. Otherwise, returns None.
7390 if response
is None:
7391 response
= CommitResponse
7392 return self
._MakeCall
(rpc
,
7393 self
._full
_name
_Write
,
7398 self
._protorpc
_Write
)
7401 class _DatastoreV4Service_ClientStub(_DatastoreV4Service_ClientBaseStub
):
7402 __slots__
= ('_params',)
7403 def __init__(self
, rpc_stub_parameters
, service_name
):
7404 if service_name
is None:
7405 service_name
= 'DatastoreV4Service'
7406 _DatastoreV4Service_ClientBaseStub
.__init
__(self
, pywraprpc
.RPC_GenericStub(service_name
, rpc_stub_parameters
))
7407 self
._params
= rpc_stub_parameters
7410 class _DatastoreV4Service_RPC2ClientStub(_DatastoreV4Service_ClientBaseStub
):
7412 def __init__(self
, server
, channel
, service_name
):
7413 if service_name
is None:
7414 service_name
= 'DatastoreV4Service'
7415 if channel
is not None:
7416 if channel
.version() == 1:
7417 raise RuntimeError('Expecting an RPC2 channel to create the stub')
7418 _DatastoreV4Service_ClientBaseStub
.__init
__(self
, pywraprpc
.RPC_GenericStub(service_name
, channel
))
7419 elif server
is not None:
7420 _DatastoreV4Service_ClientBaseStub
.__init
__(self
, pywraprpc
.RPC_GenericStub(service_name
, pywraprpc
.NewClientChannel(server
)))
7422 raise RuntimeError('Invalid argument combination to create a stub')
7425 class DatastoreV4Service(_server_stub_base_class
):
7426 """Base class for DatastoreV4Service Stubby servers."""
7429 def _MethodSignatures(cls
):
7430 """Returns a dict of {<method-name>: (<request-type>, <response-type>)}."""
7432 'BeginTransaction': (BeginTransactionRequest
, BeginTransactionResponse
),
7433 'Rollback': (RollbackRequest
, RollbackResponse
),
7434 'Commit': (CommitRequest
, CommitResponse
),
7435 'RunQuery': (RunQueryRequest
, RunQueryResponse
),
7436 'ContinueQuery': (ContinueQueryRequest
, ContinueQueryResponse
),
7437 'Lookup': (LookupRequest
, LookupResponse
),
7438 'AllocateIds': (AllocateIdsRequest
, AllocateIdsResponse
),
7439 'Get': (LookupRequest
, LookupResponse
),
7440 'Write': (WriteRequest
, CommitResponse
),
7444 def _StreamMethodSignatures(cls
):
7445 """Returns a dict of {<method-name>: (<request-type>, <stream-type>, <response-type>)}."""
7449 def __init__(self
, *args
, **kwargs
):
7450 """Creates a Stubby RPC server.
7452 See BaseRpcServer.__init__ in rpcserver.py for detail on arguments.
7454 if _server_stub_base_class
is object:
7455 raise NotImplementedError('Add //net/rpc/python:rpcserver as a '
7456 'dependency for Stubby server support.')
7457 _server_stub_base_class
.__init
__(self
, 'apphosting.datastore.v4.DatastoreV4Service', *args
, **kwargs
)
7460 def NewStub(rpc_stub_parameters
, service_name
=None):
7461 """Creates a new DatastoreV4Service Stubby client stub.
7464 rpc_stub_parameters: an RPC_StubParameter instance.
7465 service_name: the service name used by the Stubby server.
7468 if _client_stub_base_class
is object:
7469 raise RuntimeError('Add //net/rpc/python as a dependency to use Stubby')
7470 return _DatastoreV4Service_ClientStub(rpc_stub_parameters
, service_name
)
7473 def NewRPC2Stub(server
=None, channel
=None, service_name
=None):
7474 """Creates a new DatastoreV4Service Stubby2 client stub.
7477 server: host:port or bns address.
7478 channel: directly use a channel to create a stub. Will ignore server
7479 argument if this is specified.
7480 service_name: the service name used by the Stubby server.
7483 if _client_stub_base_class
is object:
7484 raise RuntimeError('Add //net/rpc/python as a dependency to use Stubby')
7485 return _DatastoreV4Service_RPC2ClientStub(server
, channel
, service_name
)
7487 def BeginTransaction(self
, rpc
, request
, response
):
7488 """Handles a BeginTransaction RPC call. You should override this.
7491 rpc: a Stubby RPC object
7492 request: a BeginTransactionRequest that contains the client request
7493 response: a BeginTransactionResponse that should be modified to send the response
7495 raise NotImplementedError
7498 def Rollback(self
, rpc
, request
, response
):
7499 """Handles a Rollback RPC call. You should override this.
7502 rpc: a Stubby RPC object
7503 request: a RollbackRequest that contains the client request
7504 response: a RollbackResponse that should be modified to send the response
7506 raise NotImplementedError
7509 def Commit(self
, rpc
, request
, response
):
7510 """Handles a Commit RPC call. You should override this.
7513 rpc: a Stubby RPC object
7514 request: a CommitRequest that contains the client request
7515 response: a CommitResponse that should be modified to send the response
7517 raise NotImplementedError
7520 def RunQuery(self
, rpc
, request
, response
):
7521 """Handles a RunQuery RPC call. You should override this.
7524 rpc: a Stubby RPC object
7525 request: a RunQueryRequest that contains the client request
7526 response: a RunQueryResponse that should be modified to send the response
7528 raise NotImplementedError
7531 def ContinueQuery(self
, rpc
, request
, response
):
7532 """Handles a ContinueQuery RPC call. You should override this.
7535 rpc: a Stubby RPC object
7536 request: a ContinueQueryRequest that contains the client request
7537 response: a ContinueQueryResponse that should be modified to send the response
7539 raise NotImplementedError
7542 def Lookup(self
, rpc
, request
, response
):
7543 """Handles a Lookup RPC call. You should override this.
7546 rpc: a Stubby RPC object
7547 request: a LookupRequest that contains the client request
7548 response: a LookupResponse that should be modified to send the response
7550 raise NotImplementedError
7553 def AllocateIds(self
, rpc
, request
, response
):
7554 """Handles a AllocateIds RPC call. You should override this.
7557 rpc: a Stubby RPC object
7558 request: a AllocateIdsRequest that contains the client request
7559 response: a AllocateIdsResponse that should be modified to send the response
7561 raise NotImplementedError
7564 def Get(self
, rpc
, request
, response
):
7565 """Handles a Get RPC call. You should override this.
7568 rpc: a Stubby RPC object
7569 request: a LookupRequest that contains the client request
7570 response: a LookupResponse that should be modified to send the response
7572 raise NotImplementedError
7575 def Write(self
, rpc
, request
, response
):
7576 """Handles a Write RPC call. You should override this.
7579 rpc: a Stubby RPC object
7580 request: a WriteRequest that contains the client request
7581 response: a CommitResponse that should be modified to send the response
7583 raise NotImplementedError
7585 def _AddMethodAttributes(self
):
7586 """Sets attributes on Python RPC handlers.
7588 See BaseRpcServer in rpcserver.py for details.
7590 rpcserver
._GetHandlerDecorator
(
7591 getattr(self
.BeginTransaction
, 'im_func' if str is bytes
else '__func__'),
7592 BeginTransactionRequest
,
7593 BeginTransactionResponse
,
7596 rpcserver
._GetHandlerDecorator
(
7597 getattr(self
.Rollback
, 'im_func' if str is bytes
else '__func__'),
7602 rpcserver
._GetHandlerDecorator
(
7603 getattr(self
.Commit
, 'im_func' if str is bytes
else '__func__'),
7608 rpcserver
._GetHandlerDecorator
(
7609 getattr(self
.RunQuery
, 'im_func' if str is bytes
else '__func__'),
7614 rpcserver
._GetHandlerDecorator
(
7615 getattr(self
.ContinueQuery
, 'im_func' if str is bytes
else '__func__'),
7616 ContinueQueryRequest
,
7617 ContinueQueryResponse
,
7620 rpcserver
._GetHandlerDecorator
(
7621 getattr(self
.Lookup
, 'im_func' if str is bytes
else '__func__'),
7626 rpcserver
._GetHandlerDecorator
(
7627 getattr(self
.AllocateIds
, 'im_func' if str is bytes
else '__func__'),
7629 AllocateIdsResponse
,
7632 rpcserver
._GetHandlerDecorator
(
7633 getattr(self
.Get
, 'im_func' if str is bytes
else '__func__'),
7638 rpcserver
._GetHandlerDecorator
(
7639 getattr(self
.Write
, 'im_func' if str is bytes
else '__func__'),
7645 if _extension_runtime
:
7648 __all__
= ['Error','EntityResult','Query','KindExpression','PropertyReference','PropertyExpression','PropertyOrder','Filter','CompositeFilter','PropertyFilter','GqlQuery','GqlQueryArg','QueryResultBatch','Mutation','MutationResult','DeprecatedMutation','DeprecatedMutationResult','ReadOptions','LookupRequest','LookupResponse','RunQueryRequest','RunQueryResponse','ContinueQueryRequest','ContinueQueryResponse','BeginTransactionRequest','BeginTransactionResponse','RollbackRequest','RollbackResponse','CommitRequest','CommitResponse','AllocateIdsRequest','AllocateIdsResponse','WriteRequest','DatastoreV4Service']