App Engine Python SDK version 1.8.9
[gae.git] / python / google / appengine / datastore / datastore_v4_pb.py
blobcd70a37e9dae362b202985a49dc0ebdd047aa948
1 #!/usr/bin/env python
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
21 import array
22 import base64
23 import dummy_thread as thread
24 try:
25 from google3.net.proto import _net_proto___parse__python
26 except ImportError:
27 _net_proto___parse__python = None
28 import sys
29 try:
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
35 except ImportError:
36 _client_stub_base_class = object
37 try:
38 __import__('google.net.rpc.python.rpcserver')
39 rpcserver = sys.modules.get('google.net.rpc.python.rpcserver')
40 _server_stub_base_class = rpcserver.BaseRpcServer
41 except ImportError:
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
50 else:
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):
59 BAD_REQUEST = 1
60 CONCURRENT_TRANSACTION = 2
61 INTERNAL_ERROR = 3
62 NEED_INDEX = 4
63 TIMEOUT = 5
64 PERMISSION_DENIED = 6
65 BIGTABLE_ERROR = 7
66 COMMITTED_BUT_STILL_APPLYING = 8
67 CAPABILITY_DISABLED = 9
68 TRY_ALTERNATE_BACKEND = 10
69 SAFE_TIME_TOO_OLD = 11
71 _ErrorCode_NAMES = {
72 1: "BAD_REQUEST",
73 2: "CONCURRENT_TRANSACTION",
74 3: "INTERNAL_ERROR",
75 4: "NEED_INDEX",
76 5: "TIMEOUT",
77 6: "PERMISSION_DENIED",
78 7: "BIGTABLE_ERROR",
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):
90 pass
91 if contents is not None: self.MergeFromString(contents)
94 def MergeFrom(self, x):
95 assert x is not self
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:
102 def _CEncode(self):
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)
124 def Equals(self, x):
125 if x is self: return 1
126 return 1
128 def IsInitialized(self, debug_strs=None):
129 initialized = 1
130 return initialized
132 def ByteSize(self):
133 n = 0
134 return n
136 def ByteSizePartial(self):
137 n = 0
138 return n
140 def Clear(self):
141 pass
143 def OutputUnchecked(self, out):
144 pass
146 def OutputPartial(self, out):
147 pass
149 def TryMerge(self, d):
150 while d.avail() > 0:
151 tt = d.getVarInt32()
154 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
155 d.skipData(tt)
158 def __str__(self, prefix="", printElemNumber=0):
159 res=""
160 return res
163 def _BuildTagLookupTable(sparse, maxtag, default=None):
164 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
167 _TEXT = _BuildTagLookupTable({
168 0: "ErrorCode",
169 }, 0)
171 _TYPES = _BuildTagLookupTable({
172 0: ProtocolBuffer.Encoder.NUMERIC,
173 }, 0, ProtocolBuffer.Encoder.MAX_TYPE)
176 _STYLE = """"""
177 _STYLE_CONTENT_TYPE = """"""
178 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.Error'
179 _SERIALIZED_DESCRIPTOR = array.array('B')
180 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9yc3oJRXJyb3JDb2RliwGSAQtCQURfUkVRVUVTVJgBAYwBiwGSARZDT05DVVJSRU5UX1RSQU5TQUNUSU9OmAECjAGLAZIBDklOVEVSTkFMX0VSUk9SmAEDjAGLAZIBCk5FRURfSU5ERViYAQSMAYsBkgEHVElNRU9VVJgBBYwBiwGSARFQRVJNSVNTSU9OX0RFTklFRJgBBowBiwGSAQ5CSUdUQUJMRV9FUlJPUpgBB4wBiwGSARxDT01NSVRURURfQlVUX1NUSUxMX0FQUExZSU5HmAEIjAGLAZIBE0NBUEFCSUxJVFlfRElTQUJMRUSYAQmMAYsBkgEVVFJZX0FMVEVSTkFURV9CQUNLRU5EmAEKjAGLAZIBEVNBRkVfVElNRV9UT09fT0xEmAELjAF0ugH4LQonYXBwaG9zdGluZy9kYXRhc3RvcmUvZGF0YXN0b3JlX3Y0LnByb3RvEhdhcHBob3N0aW5nLmRhdGFzdG9yZS52NBokYXBwaG9zdGluZy9kYXRhc3RvcmUvZW50aXR5X3Y0LnByb3RvIosCCgVFcnJvciKBAgoJRXJyb3JDb2RlEg8KC0JBRF9SRVFVRVNUEAESGgoWQ09OQ1VSUkVOVF9UUkFOU0FDVElPThACEhIKDklOVEVSTkFMX0VSUk9SEAMSDgoKTkVFRF9JTkRFWBAEEgsKB1RJTUVPVVQQBRIVChFQRVJNSVNTSU9OX0RFTklFRBAGEhIKDkJJR1RBQkxFX0VSUk9SEAcSIAocQ09NTUlUVEVEX0JVVF9TVElMTF9BUFBMWUlORxAIEhcKE0NBUEFCSUxJVFlfRElTQUJMRUQQCRIZChVUUllfQUxURVJOQVRFX0JBQ0tFTkQQChIVChFTQUZFX1RJTUVfVE9PX09MRBALIoYBCgxFbnRpdHlSZXN1bHQSLwoGZW50aXR5GAEgAigLMh8uYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5Eg8KB3ZlcnNpb24YAiABKAMiNAoKUmVzdWx0VHlwZRIICgRGVUxMEAESDgoKUFJPSkVDVElPThACEgwKCEtFWV9PTkxZEAMi8QIKBVF1ZXJ5Ej8KCnByb2plY3Rpb24YAiADKAsyKy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eUV4cHJlc3Npb24SNQoEa2luZBgDIAMoCzInLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktpbmRFeHByZXNzaW9uEi8KBmZpbHRlchgEIAEoCzIfLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkZpbHRlchI1CgVvcmRlchgFIAMoCzImLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5T3JkZXISPAoIZ3JvdXBfYnkYBiADKAsyKi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eVJlZmVyZW5jZRIUCgxzdGFydF9jdXJzb3IYByABKAwSEgoKZW5kX2N1cnNvchgIIAEoDBIRCgZvZmZzZXQYCiABKAU6ATASDQoFbGltaXQYCyABKAUiHgoOS2luZEV4cHJlc3Npb24SDAoEbmFtZRgBIAIoCSIhChFQcm9wZXJ0eVJlZmVyZW5jZRIMCgRuYW1lGAIgAigJItMBChJQcm9wZXJ0eUV4cHJlc3Npb24SPAoIcHJvcGVydHkYASACKAsyKi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eVJlZmVyZW5jZRJdChRhZ2dyZWdhdGlvbl9mdW5jdGlvbhgCIAEoDjI/LmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5RXhwcmVzc2lvbi5BZ2dyZWdhdGlvbkZ1bmN0aW9uIiAKE0FnZ3JlZ2F0aW9uRnVuY3Rpb24SCQoFRklSU1QQASLJAQoNUHJvcGVydHlPcmRlchI8Cghwcm9wZXJ0eRgBIAIoCzIqLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5UmVmZXJlbmNlEk4KCWRpcmVjdGlvbhgCIAEoDjIwLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5T3JkZXIuRGlyZWN0aW9uOglBU0NFTkRJTkciKgoJRGlyZWN0aW9uEg0KCUFTQ0VORElORxABEg4KCkRFU0NFTkRJTkcQAiKOAQoGRmlsdGVyEkIKEGNvbXBvc2l0ZV9maWx0ZXIYASABKAsyKC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Db21wb3NpdGVGaWx0ZXISQAoPcHJvcGVydHlfZmlsdGVyGAIgASgLMicuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlGaWx0ZXIinAEKD0NvbXBvc2l0ZUZpbHRlchJDCghvcGVyYXRvchgBIAIoDjIxLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbXBvc2l0ZUZpbHRlci5PcGVyYXRvchIvCgZmaWx0ZXIYAiADKAsyHy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5GaWx0ZXIiEwoIT3BlcmF0b3ISBwoDQU5EEAEivgIKDlByb3BlcnR5RmlsdGVyEjwKCHByb3BlcnR5GAEgAigLMiouYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlSZWZlcmVuY2USQgoIb3BlcmF0b3IYAiACKA4yMC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eUZpbHRlci5PcGVyYXRvchItCgV2YWx1ZRgDIAIoCzIeLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlZhbHVlInsKCE9wZXJhdG9yEg0KCUxFU1NfVEhBThABEhYKEkxFU1NfVEhBTl9PUl9FUVVBTBACEhAKDEdSRUFURVJfVEhBThADEhkKFUdSRUFURVJfVEhBTl9PUl9FUVVBTBAEEgkKBUVRVUFMEAUSEAoMSEFTX0FOQ0VTVE9SEAsisAEKCEdxbFF1ZXJ5EhQKDHF1ZXJ5X3N0cmluZxgBIAIoCRIcCg1hbGxvd19saXRlcmFsGAIgASgIOgVmYWxzZRI2CghuYW1lX2FyZxgDIAMoCzIkLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkdxbFF1ZXJ5QXJnEjgKCm51bWJlcl9hcmcYBCADKAsyJC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5HcWxRdWVyeUFyZyJaCgtHcWxRdWVyeUFyZxIMCgRuYW1lGAEgASgJEi0KBXZhbHVlGAIgASgLMh4uYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuVmFsdWUSDgoGY3Vyc29yGAMgASgMIvcCChBRdWVyeVJlc3VsdEJhdGNoEkwKEmVudGl0eV9yZXN1bHRfdHlwZRgBIAIoDjIwLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eVJlc3VsdC5SZXN1bHRUeXBlEjwKDWVudGl0eV9yZXN1bHQYAiADKAsyJS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FbnRpdHlSZXN1bHQSEgoKZW5kX2N1cnNvchgEIAEoDBJPCgxtb3JlX3Jlc3VsdHMYBSACKA4yOS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5RdWVyeVJlc3VsdEJhdGNoLk1vcmVSZXN1bHRzVHlwZRIaCg9za2lwcGVkX3Jlc3VsdHMYBiABKAU6ATAiVgoPTW9yZVJlc3VsdHNUeXBlEhAKDE5PVF9GSU5JU0hFRBABEhwKGE1PUkVfUkVTVUxUU19BRlRFUl9MSU1JVBACEhMKD05PX01PUkVfUkVTVUxUUxADIpMCCghNdXRhdGlvbhIvCgZ1cHNlcnQYASADKAsyHy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FbnRpdHkSLwoGdXBkYXRlGAIgAygLMh8uYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5Ei8KBmluc2VydBgDIAMoCzIfLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eRI3Cg5pbnNlcnRfYXV0b19pZBgEIAMoCzIfLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eRIsCgZkZWxldGUYBSADKAsyHC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LZXkSDQoFZm9yY2UYBiABKAgi4QEKDk11dGF0aW9uUmVzdWx0EhUKDWluZGV4X3VwZGF0ZXMYASACKAUSOAoSaW5zZXJ0X2F1dG9faWRfa2V5GAIgAygLMhwuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuS2V5EhYKDnVwc2VydF92ZXJzaW9uGAMgAygDEhYKDnVwZGF0ZV92ZXJzaW9uGAQgAygDEhYKDmluc2VydF92ZXJzaW9uGAUgAygDEh4KFmluc2VydF9hdXRvX2lkX3ZlcnNpb24YBiADKAMSFgoOZGVsZXRlX3ZlcnNpb24YByADKAMitQEKC1JlYWRPcHRpb25zElcKEHJlYWRfY29uc2lzdGVuY3kYASABKA4yNC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5SZWFkT3B0aW9ucy5SZWFkQ29uc2lzdGVuY3k6B0RFRkFVTFQSEwoLdHJhbnNhY3Rpb24YAiABKAwiOAoPUmVhZENvbnNpc3RlbmN5EgsKB0RFRkFVTFQQABIKCgZTVFJPTkcQARIMCghFVkVOVFVBTBACInYKDUxvb2t1cFJlcXVlc3QSOgoMcmVhZF9vcHRpb25zGAEgASgLMiQuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUmVhZE9wdGlvbnMSKQoDa2V5GAMgAygLMhwuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuS2V5Iq4BCg5Mb29rdXBSZXNwb25zZRI0CgVmb3VuZBgBIAMoCzIlLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eVJlc3VsdBI2CgdtaXNzaW5nGAIgAygLMiUuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5UmVzdWx0Ei4KCGRlZmVycmVkGAMgAygLMhwuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuS2V5IqsCCg9SdW5RdWVyeVJlcXVlc3QSOgoMcmVhZF9vcHRpb25zGAEgASgLMiQuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUmVhZE9wdGlvbnMSOgoMcGFydGl0aW9uX2lkGAIgASgLMiQuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUGFydGl0aW9uSWQSLQoFcXVlcnkYAyABKAsyHi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5RdWVyeRI0CglncWxfcXVlcnkYByABKAsyIS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5HcWxRdWVyeRIdChVtaW5fc2FmZV90aW1lX3NlY29uZHMYBCABKAMSHAoUc3VnZ2VzdGVkX2JhdGNoX3NpemUYBSABKAUiYgoQUnVuUXVlcnlSZXNwb25zZRI4CgViYXRjaBgBIAIoCzIpLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlF1ZXJ5UmVzdWx0QmF0Y2gSFAoMcXVlcnlfaGFuZGxlGAIgASgMIiwKFENvbnRpbnVlUXVlcnlSZXF1ZXN0EhQKDHF1ZXJ5X2hhbmRsZRgBIAIoDCJRChVDb250aW51ZVF1ZXJ5UmVzcG9uc2USOAoFYmF0Y2gYASACKAsyKS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5RdWVyeVJlc3VsdEJhdGNoIlMKF0JlZ2luVHJhbnNhY3Rpb25SZXF1ZXN0EhoKC2Nyb3NzX2dyb3VwGAEgASgIOgVmYWxzZRIcCg1jcm9zc19yZXF1ZXN0GAIgASgIOgVmYWxzZSIvChhCZWdpblRyYW5zYWN0aW9uUmVzcG9uc2USEwoLdHJhbnNhY3Rpb24YASACKAwiJgoPUm9sbGJhY2tSZXF1ZXN0EhMKC3RyYW5zYWN0aW9uGAEgAigMIhIKEFJvbGxiYWNrUmVzcG9uc2Ui1QEKDUNvbW1pdFJlcXVlc3QSEwoLdHJhbnNhY3Rpb24YASABKAwSMwoIbXV0YXRpb24YAiABKAsyIS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5NdXRhdGlvbhJICgRtb2RlGAQgASgOMisuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQ29tbWl0UmVxdWVzdC5Nb2RlOg1UUkFOU0FDVElPTkFMIjAKBE1vZGUSEQoNVFJBTlNBQ1RJT05BTBABEhUKEU5PTl9UUkFOU0FDVElPTkFMEAIiUgoOQ29tbWl0UmVzcG9uc2USQAoPbXV0YXRpb25fcmVzdWx0GAEgASgLMicuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuTXV0YXRpb25SZXN1bHQicwoSQWxsb2NhdGVJZHNSZXF1ZXN0Ei4KCGFsbG9jYXRlGAEgAygLMhwuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuS2V5Ei0KB3Jlc2VydmUYAiADKAsyHC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LZXkiRgoTQWxsb2NhdGVJZHNSZXNwb25zZRIvCglhbGxvY2F0ZWQYASADKAsyHC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LZXkiQwoMV3JpdGVSZXF1ZXN0EjMKCG11dGF0aW9uGAEgAigLMiEuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuTXV0YXRpb24yogcKEkRhdGFzdG9yZVY0U2VydmljZRJ5ChBCZWdpblRyYW5zYWN0aW9uEjAuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQmVnaW5UcmFuc2FjdGlvblJlcXVlc3QaMS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5CZWdpblRyYW5zYWN0aW9uUmVzcG9uc2UiABJhCghSb2xsYmFjaxIoLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJvbGxiYWNrUmVxdWVzdBopLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJvbGxiYWNrUmVzcG9uc2UiABJbCgZDb21taXQSJi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Db21taXRSZXF1ZXN0GicuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQ29tbWl0UmVzcG9uc2UiABJhCghSdW5RdWVyeRIoLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJ1blF1ZXJ5UmVxdWVzdBopLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJ1blF1ZXJ5UmVzcG9uc2UiABJwCg1Db250aW51ZVF1ZXJ5Ei0uYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQ29udGludWVRdWVyeVJlcXVlc3QaLi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Db250aW51ZVF1ZXJ5UmVzcG9uc2UiABJbCgZMb29rdXASJi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Mb29rdXBSZXF1ZXN0GicuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuTG9va3VwUmVzcG9uc2UiABJqCgtBbGxvY2F0ZUlkcxIrLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkFsbG9jYXRlSWRzUmVxdWVzdBosLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkFsbG9jYXRlSWRzUmVzcG9uc2UiABJYCgNHZXQSJi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Mb29rdXBSZXF1ZXN0GicuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuTG9va3VwUmVzcG9uc2UiABJZCgVXcml0ZRIlLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LldyaXRlUmVxdWVzdBonLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbW1pdFJlc3BvbnNlIgBCIQofY29tLmdvb2dsZS5hcHBob3N0aW5nLmRhdGFzdG9yZQ=="))
181 if _net_proto___parse__python is not None:
182 _net_proto___parse__python.RegisterType(
183 _SERIALIZED_DESCRIPTOR.tostring())
185 class EntityResult(ProtocolBuffer.ProtocolMessage):
188 FULL = 1
189 PROJECTION = 2
190 KEY_ONLY = 3
192 _ResultType_NAMES = {
193 1: "FULL",
194 2: "PROJECTION",
195 3: "KEY_ONLY",
198 def ResultType_Name(cls, x): return cls._ResultType_NAMES.get(x, "")
199 ResultType_Name = classmethod(ResultType_Name)
201 has_entity_ = 0
202 has_version_ = 0
203 version_ = 0
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
221 self.version_ = x
223 def clear_version(self):
224 if self.has_version_:
225 self.has_version_ = 0
226 self.version_ = 0
228 def has_version(self): return self.has_version_
231 def MergeFrom(self, x):
232 assert x is not self
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:
241 def _CEncode(self):
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)
263 def Equals(self, x):
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
269 return 1
271 def IsInitialized(self, debug_strs=None):
272 initialized = 1
273 if (not self.has_entity_):
274 initialized = 0
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
278 return initialized
280 def ByteSize(self):
281 n = 0
282 n += self.lengthString(self.entity_.ByteSize())
283 if (self.has_version_): n += 1 + self.lengthVarInt64(self.version_)
284 return n + 1
286 def ByteSizePartial(self):
287 n = 0
288 if (self.has_entity_):
289 n += 1
290 n += self.lengthString(self.entity_.ByteSizePartial())
291 if (self.has_version_): n += 1 + self.lengthVarInt64(self.version_)
292 return n
294 def Clear(self):
295 self.clear_entity()
296 self.clear_version()
298 def OutputUnchecked(self, out):
299 out.putVarInt32(10)
300 out.putVarInt32(self.entity_.ByteSize())
301 self.entity_.OutputUnchecked(out)
302 if (self.has_version_):
303 out.putVarInt32(16)
304 out.putVarInt64(self.version_)
306 def OutputPartial(self, out):
307 if (self.has_entity_):
308 out.putVarInt32(10)
309 out.putVarInt32(self.entity_.ByteSizePartial())
310 self.entity_.OutputPartial(out)
311 if (self.has_version_):
312 out.putVarInt32(16)
313 out.putVarInt64(self.version_)
315 def TryMerge(self, d):
316 while d.avail() > 0:
317 tt = d.getVarInt32()
318 if tt == 10:
319 length = d.getVarInt32()
320 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
321 d.skip(length)
322 self.mutable_entity().TryMerge(tmp)
323 continue
324 if tt == 16:
325 self.set_version(d.getVarInt64())
326 continue
329 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
330 d.skipData(tt)
333 def __str__(self, prefix="", printElemNumber=0):
334 res=""
335 if self.has_entity_:
336 res+=prefix+"entity <\n"
337 res+=self.entity_.__str__(prefix + " ", printElemNumber)
338 res+=prefix+">\n"
339 if self.has_version_: res+=prefix+("version: %s\n" % self.DebugFormatInt64(self.version_))
340 return res
343 def _BuildTagLookupTable(sparse, maxtag, default=None):
344 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
346 kentity = 1
347 kversion = 2
349 _TEXT = _BuildTagLookupTable({
350 0: "ErrorCode",
351 1: "entity",
352 2: "version",
353 }, 2)
355 _TYPES = _BuildTagLookupTable({
356 0: ProtocolBuffer.Encoder.NUMERIC,
357 1: ProtocolBuffer.Encoder.STRING,
358 2: ProtocolBuffer.Encoder.NUMERIC,
359 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
362 _STYLE = """"""
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):
372 has_filter_ = 0
373 filter_ = None
374 has_start_cursor_ = 0
375 start_cursor_ = ""
376 has_end_cursor_ = 0
377 end_cursor_ = ""
378 has_offset_ = 0
379 offset_ = 0
380 has_limit_ = 0
381 limit_ = 0
383 def __init__(self, contents=None):
384 self.projection_ = []
385 self.kind_ = []
386 self.order_ = []
387 self.group_by_ = []
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)
403 return 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_
410 def kind(self, i):
411 return self.kind_[i]
413 def mutable_kind(self, i):
414 return self.kind_[i]
416 def add_kind(self):
417 x = KindExpression()
418 self.kind_.append(x)
419 return x
421 def clear_kind(self):
422 self.kind_ = []
423 def filter(self):
424 if self.filter_ is None:
425 self.lazy_init_lock_.acquire()
426 try:
427 if self.filter_ is None: self.filter_ = Filter()
428 finally:
429 self.lazy_init_lock_.release()
430 return self.filter_
432 def mutable_filter(self): self.has_filter_ = 1; return self.filter()
434 def clear_filter(self):
436 if self.has_filter_:
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_
445 def order(self, i):
446 return self.order_[i]
448 def mutable_order(self, i):
449 return self.order_[i]
451 def add_order(self):
452 x = PropertyOrder()
453 self.order_.append(x)
454 return x
456 def clear_order(self):
457 self.order_ = []
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)
470 return x
472 def clear_group_by(self):
473 self.group_by_ = []
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
491 self.end_cursor_ = x
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):
503 self.has_offset_ = 1
504 self.offset_ = x
506 def clear_offset(self):
507 if self.has_offset_:
508 self.has_offset_ = 0
509 self.offset_ = 0
511 def has_offset(self): return self.has_offset_
513 def limit(self): return self.limit_
515 def set_limit(self, x):
516 self.has_limit_ = 1
517 self.limit_ = x
519 def clear_limit(self):
520 if self.has_limit_:
521 self.has_limit_ = 0
522 self.limit_ = 0
524 def has_limit(self): return self.has_limit_
527 def MergeFrom(self, x):
528 assert x is not self
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:
544 def _CEncode(self):
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)
566 def Equals(self, x):
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
590 return 1
592 def IsInitialized(self, debug_strs=None):
593 initialized = 1
594 for p in self.projection_:
595 if not p.IsInitialized(debug_strs): initialized=0
596 for p in self.kind_:
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
603 return initialized
605 def ByteSize(self):
606 n = 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_)
620 return n
622 def ByteSizePartial(self):
623 n = 0
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_)
637 return n
639 def Clear(self):
640 self.clear_projection()
641 self.clear_kind()
642 self.clear_filter()
643 self.clear_order()
644 self.clear_group_by()
645 self.clear_start_cursor()
646 self.clear_end_cursor()
647 self.clear_offset()
648 self.clear_limit()
650 def OutputUnchecked(self, out):
651 for i in xrange(len(self.projection_)):
652 out.putVarInt32(18)
653 out.putVarInt32(self.projection_[i].ByteSize())
654 self.projection_[i].OutputUnchecked(out)
655 for i in xrange(len(self.kind_)):
656 out.putVarInt32(26)
657 out.putVarInt32(self.kind_[i].ByteSize())
658 self.kind_[i].OutputUnchecked(out)
659 if (self.has_filter_):
660 out.putVarInt32(34)
661 out.putVarInt32(self.filter_.ByteSize())
662 self.filter_.OutputUnchecked(out)
663 for i in xrange(len(self.order_)):
664 out.putVarInt32(42)
665 out.putVarInt32(self.order_[i].ByteSize())
666 self.order_[i].OutputUnchecked(out)
667 for i in xrange(len(self.group_by_)):
668 out.putVarInt32(50)
669 out.putVarInt32(self.group_by_[i].ByteSize())
670 self.group_by_[i].OutputUnchecked(out)
671 if (self.has_start_cursor_):
672 out.putVarInt32(58)
673 out.putPrefixedString(self.start_cursor_)
674 if (self.has_end_cursor_):
675 out.putVarInt32(66)
676 out.putPrefixedString(self.end_cursor_)
677 if (self.has_offset_):
678 out.putVarInt32(80)
679 out.putVarInt32(self.offset_)
680 if (self.has_limit_):
681 out.putVarInt32(88)
682 out.putVarInt32(self.limit_)
684 def OutputPartial(self, out):
685 for i in xrange(len(self.projection_)):
686 out.putVarInt32(18)
687 out.putVarInt32(self.projection_[i].ByteSizePartial())
688 self.projection_[i].OutputPartial(out)
689 for i in xrange(len(self.kind_)):
690 out.putVarInt32(26)
691 out.putVarInt32(self.kind_[i].ByteSizePartial())
692 self.kind_[i].OutputPartial(out)
693 if (self.has_filter_):
694 out.putVarInt32(34)
695 out.putVarInt32(self.filter_.ByteSizePartial())
696 self.filter_.OutputPartial(out)
697 for i in xrange(len(self.order_)):
698 out.putVarInt32(42)
699 out.putVarInt32(self.order_[i].ByteSizePartial())
700 self.order_[i].OutputPartial(out)
701 for i in xrange(len(self.group_by_)):
702 out.putVarInt32(50)
703 out.putVarInt32(self.group_by_[i].ByteSizePartial())
704 self.group_by_[i].OutputPartial(out)
705 if (self.has_start_cursor_):
706 out.putVarInt32(58)
707 out.putPrefixedString(self.start_cursor_)
708 if (self.has_end_cursor_):
709 out.putVarInt32(66)
710 out.putPrefixedString(self.end_cursor_)
711 if (self.has_offset_):
712 out.putVarInt32(80)
713 out.putVarInt32(self.offset_)
714 if (self.has_limit_):
715 out.putVarInt32(88)
716 out.putVarInt32(self.limit_)
718 def TryMerge(self, d):
719 while d.avail() > 0:
720 tt = d.getVarInt32()
721 if tt == 18:
722 length = d.getVarInt32()
723 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
724 d.skip(length)
725 self.add_projection().TryMerge(tmp)
726 continue
727 if tt == 26:
728 length = d.getVarInt32()
729 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
730 d.skip(length)
731 self.add_kind().TryMerge(tmp)
732 continue
733 if tt == 34:
734 length = d.getVarInt32()
735 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
736 d.skip(length)
737 self.mutable_filter().TryMerge(tmp)
738 continue
739 if tt == 42:
740 length = d.getVarInt32()
741 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
742 d.skip(length)
743 self.add_order().TryMerge(tmp)
744 continue
745 if tt == 50:
746 length = d.getVarInt32()
747 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
748 d.skip(length)
749 self.add_group_by().TryMerge(tmp)
750 continue
751 if tt == 58:
752 self.set_start_cursor(d.getPrefixedString())
753 continue
754 if tt == 66:
755 self.set_end_cursor(d.getPrefixedString())
756 continue
757 if tt == 80:
758 self.set_offset(d.getVarInt32())
759 continue
760 if tt == 88:
761 self.set_limit(d.getVarInt32())
762 continue
765 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
766 d.skipData(tt)
769 def __str__(self, prefix="", printElemNumber=0):
770 res=""
771 cnt=0
772 for e in self.projection_:
773 elm=""
774 if printElemNumber: elm="(%d)" % cnt
775 res+=prefix+("projection%s <\n" % elm)
776 res+=e.__str__(prefix + " ", printElemNumber)
777 res+=prefix+">\n"
778 cnt+=1
779 cnt=0
780 for e in self.kind_:
781 elm=""
782 if printElemNumber: elm="(%d)" % cnt
783 res+=prefix+("kind%s <\n" % elm)
784 res+=e.__str__(prefix + " ", printElemNumber)
785 res+=prefix+">\n"
786 cnt+=1
787 if self.has_filter_:
788 res+=prefix+"filter <\n"
789 res+=self.filter_.__str__(prefix + " ", printElemNumber)
790 res+=prefix+">\n"
791 cnt=0
792 for e in self.order_:
793 elm=""
794 if printElemNumber: elm="(%d)" % cnt
795 res+=prefix+("order%s <\n" % elm)
796 res+=e.__str__(prefix + " ", printElemNumber)
797 res+=prefix+">\n"
798 cnt+=1
799 cnt=0
800 for e in self.group_by_:
801 elm=""
802 if printElemNumber: elm="(%d)" % cnt
803 res+=prefix+("group_by%s <\n" % elm)
804 res+=e.__str__(prefix + " ", printElemNumber)
805 res+=prefix+">\n"
806 cnt+=1
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_))
811 return res
814 def _BuildTagLookupTable(sparse, maxtag, default=None):
815 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
817 kprojection = 2
818 kkind = 3
819 kfilter = 4
820 korder = 5
821 kgroup_by = 6
822 kstart_cursor = 7
823 kend_cursor = 8
824 koffset = 10
825 klimit = 11
827 _TEXT = _BuildTagLookupTable({
828 0: "ErrorCode",
829 2: "projection",
830 3: "kind",
831 4: "filter",
832 5: "order",
833 6: "group_by",
834 7: "start_cursor",
835 8: "end_cursor",
836 10: "offset",
837 11: "limit",
838 }, 11)
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)
854 _STYLE = """"""
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):
864 has_name_ = 0
865 name_ = ""
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):
873 self.has_name_ = 1
874 self.name_ = x
876 def clear_name(self):
877 if self.has_name_:
878 self.has_name_ = 0
879 self.name_ = ""
881 def has_name(self): return self.has_name_
884 def MergeFrom(self, x):
885 assert x is not self
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:
893 def _CEncode(self):
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)
915 def Equals(self, x):
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
919 return 1
921 def IsInitialized(self, debug_strs=None):
922 initialized = 1
923 if (not self.has_name_):
924 initialized = 0
925 if debug_strs is not None:
926 debug_strs.append('Required field: name not set.')
927 return initialized
929 def ByteSize(self):
930 n = 0
931 n += self.lengthString(len(self.name_))
932 return n + 1
934 def ByteSizePartial(self):
935 n = 0
936 if (self.has_name_):
937 n += 1
938 n += self.lengthString(len(self.name_))
939 return n
941 def Clear(self):
942 self.clear_name()
944 def OutputUnchecked(self, out):
945 out.putVarInt32(10)
946 out.putPrefixedString(self.name_)
948 def OutputPartial(self, out):
949 if (self.has_name_):
950 out.putVarInt32(10)
951 out.putPrefixedString(self.name_)
953 def TryMerge(self, d):
954 while d.avail() > 0:
955 tt = d.getVarInt32()
956 if tt == 10:
957 self.set_name(d.getPrefixedString())
958 continue
961 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
962 d.skipData(tt)
965 def __str__(self, prefix="", printElemNumber=0):
966 res=""
967 if self.has_name_: res+=prefix+("name: %s\n" % self.DebugFormatString(self.name_))
968 return res
971 def _BuildTagLookupTable(sparse, maxtag, default=None):
972 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
974 kname = 1
976 _TEXT = _BuildTagLookupTable({
977 0: "ErrorCode",
978 1: "name",
979 }, 1)
981 _TYPES = _BuildTagLookupTable({
982 0: ProtocolBuffer.Encoder.NUMERIC,
983 1: ProtocolBuffer.Encoder.STRING,
984 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
987 _STYLE = """"""
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):
997 has_name_ = 0
998 name_ = ""
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):
1006 self.has_name_ = 1
1007 self.name_ = x
1009 def clear_name(self):
1010 if self.has_name_:
1011 self.has_name_ = 0
1012 self.name_ = ""
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:
1026 def _CEncode(self):
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
1052 return 1
1054 def IsInitialized(self, debug_strs=None):
1055 initialized = 1
1056 if (not self.has_name_):
1057 initialized = 0
1058 if debug_strs is not None:
1059 debug_strs.append('Required field: name not set.')
1060 return initialized
1062 def ByteSize(self):
1063 n = 0
1064 n += self.lengthString(len(self.name_))
1065 return n + 1
1067 def ByteSizePartial(self):
1068 n = 0
1069 if (self.has_name_):
1070 n += 1
1071 n += self.lengthString(len(self.name_))
1072 return n
1074 def Clear(self):
1075 self.clear_name()
1077 def OutputUnchecked(self, out):
1078 out.putVarInt32(18)
1079 out.putPrefixedString(self.name_)
1081 def OutputPartial(self, out):
1082 if (self.has_name_):
1083 out.putVarInt32(18)
1084 out.putPrefixedString(self.name_)
1086 def TryMerge(self, d):
1087 while d.avail() > 0:
1088 tt = d.getVarInt32()
1089 if tt == 18:
1090 self.set_name(d.getPrefixedString())
1091 continue
1094 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1095 d.skipData(tt)
1098 def __str__(self, prefix="", printElemNumber=0):
1099 res=""
1100 if self.has_name_: res+=prefix+("name: %s\n" % self.DebugFormatString(self.name_))
1101 return res
1104 def _BuildTagLookupTable(sparse, maxtag, default=None):
1105 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1107 kname = 2
1109 _TEXT = _BuildTagLookupTable({
1110 0: "ErrorCode",
1111 2: "name",
1112 }, 2)
1114 _TYPES = _BuildTagLookupTable({
1115 0: ProtocolBuffer.Encoder.NUMERIC,
1116 2: ProtocolBuffer.Encoder.STRING,
1117 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
1120 _STYLE = """"""
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):
1132 FIRST = 1
1134 _AggregationFunction_NAMES = {
1135 1: "FIRST",
1138 def AggregationFunction_Name(cls, x): return cls._AggregationFunction_NAMES.get(x, "")
1139 AggregationFunction_Name = classmethod(AggregationFunction_Name)
1141 has_property_ = 0
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:
1181 def _CEncode(self):
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
1209 return 1
1211 def IsInitialized(self, debug_strs=None):
1212 initialized = 1
1213 if (not self.has_property_):
1214 initialized = 0
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
1218 return initialized
1220 def ByteSize(self):
1221 n = 0
1222 n += self.lengthString(self.property_.ByteSize())
1223 if (self.has_aggregation_function_): n += 1 + self.lengthVarInt64(self.aggregation_function_)
1224 return n + 1
1226 def ByteSizePartial(self):
1227 n = 0
1228 if (self.has_property_):
1229 n += 1
1230 n += self.lengthString(self.property_.ByteSizePartial())
1231 if (self.has_aggregation_function_): n += 1 + self.lengthVarInt64(self.aggregation_function_)
1232 return n
1234 def Clear(self):
1235 self.clear_property()
1236 self.clear_aggregation_function()
1238 def OutputUnchecked(self, out):
1239 out.putVarInt32(10)
1240 out.putVarInt32(self.property_.ByteSize())
1241 self.property_.OutputUnchecked(out)
1242 if (self.has_aggregation_function_):
1243 out.putVarInt32(16)
1244 out.putVarInt32(self.aggregation_function_)
1246 def OutputPartial(self, out):
1247 if (self.has_property_):
1248 out.putVarInt32(10)
1249 out.putVarInt32(self.property_.ByteSizePartial())
1250 self.property_.OutputPartial(out)
1251 if (self.has_aggregation_function_):
1252 out.putVarInt32(16)
1253 out.putVarInt32(self.aggregation_function_)
1255 def TryMerge(self, d):
1256 while d.avail() > 0:
1257 tt = d.getVarInt32()
1258 if tt == 10:
1259 length = d.getVarInt32()
1260 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
1261 d.skip(length)
1262 self.mutable_property().TryMerge(tmp)
1263 continue
1264 if tt == 16:
1265 self.set_aggregation_function(d.getVarInt32())
1266 continue
1269 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1270 d.skipData(tt)
1273 def __str__(self, prefix="", printElemNumber=0):
1274 res=""
1275 if self.has_property_:
1276 res+=prefix+"property <\n"
1277 res+=self.property_.__str__(prefix + " ", printElemNumber)
1278 res+=prefix+">\n"
1279 if self.has_aggregation_function_: res+=prefix+("aggregation_function: %s\n" % self.DebugFormatInt32(self.aggregation_function_))
1280 return res
1283 def _BuildTagLookupTable(sparse, maxtag, default=None):
1284 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1286 kproperty = 1
1287 kaggregation_function = 2
1289 _TEXT = _BuildTagLookupTable({
1290 0: "ErrorCode",
1291 1: "property",
1292 2: "aggregation_function",
1293 }, 2)
1295 _TYPES = _BuildTagLookupTable({
1296 0: ProtocolBuffer.Encoder.NUMERIC,
1297 1: ProtocolBuffer.Encoder.STRING,
1298 2: ProtocolBuffer.Encoder.NUMERIC,
1299 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
1302 _STYLE = """"""
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):
1314 ASCENDING = 1
1315 DESCENDING = 2
1317 _Direction_NAMES = {
1318 1: "ASCENDING",
1319 2: "DESCENDING",
1322 def Direction_Name(cls, x): return cls._Direction_NAMES.get(x, "")
1323 Direction_Name = classmethod(Direction_Name)
1325 has_property_ = 0
1326 has_direction_ = 0
1327 direction_ = 1
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
1345 self.direction_ = x
1347 def clear_direction(self):
1348 if self.has_direction_:
1349 self.has_direction_ = 0
1350 self.direction_ = 1
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:
1365 def _CEncode(self):
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
1393 return 1
1395 def IsInitialized(self, debug_strs=None):
1396 initialized = 1
1397 if (not self.has_property_):
1398 initialized = 0
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
1402 return initialized
1404 def ByteSize(self):
1405 n = 0
1406 n += self.lengthString(self.property_.ByteSize())
1407 if (self.has_direction_): n += 1 + self.lengthVarInt64(self.direction_)
1408 return n + 1
1410 def ByteSizePartial(self):
1411 n = 0
1412 if (self.has_property_):
1413 n += 1
1414 n += self.lengthString(self.property_.ByteSizePartial())
1415 if (self.has_direction_): n += 1 + self.lengthVarInt64(self.direction_)
1416 return n
1418 def Clear(self):
1419 self.clear_property()
1420 self.clear_direction()
1422 def OutputUnchecked(self, out):
1423 out.putVarInt32(10)
1424 out.putVarInt32(self.property_.ByteSize())
1425 self.property_.OutputUnchecked(out)
1426 if (self.has_direction_):
1427 out.putVarInt32(16)
1428 out.putVarInt32(self.direction_)
1430 def OutputPartial(self, out):
1431 if (self.has_property_):
1432 out.putVarInt32(10)
1433 out.putVarInt32(self.property_.ByteSizePartial())
1434 self.property_.OutputPartial(out)
1435 if (self.has_direction_):
1436 out.putVarInt32(16)
1437 out.putVarInt32(self.direction_)
1439 def TryMerge(self, d):
1440 while d.avail() > 0:
1441 tt = d.getVarInt32()
1442 if tt == 10:
1443 length = d.getVarInt32()
1444 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
1445 d.skip(length)
1446 self.mutable_property().TryMerge(tmp)
1447 continue
1448 if tt == 16:
1449 self.set_direction(d.getVarInt32())
1450 continue
1453 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1454 d.skipData(tt)
1457 def __str__(self, prefix="", printElemNumber=0):
1458 res=""
1459 if self.has_property_:
1460 res+=prefix+"property <\n"
1461 res+=self.property_.__str__(prefix + " ", printElemNumber)
1462 res+=prefix+">\n"
1463 if self.has_direction_: res+=prefix+("direction: %s\n" % self.DebugFormatInt32(self.direction_))
1464 return res
1467 def _BuildTagLookupTable(sparse, maxtag, default=None):
1468 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1470 kproperty = 1
1471 kdirection = 2
1473 _TEXT = _BuildTagLookupTable({
1474 0: "ErrorCode",
1475 1: "property",
1476 2: "direction",
1477 }, 2)
1479 _TYPES = _BuildTagLookupTable({
1480 0: ProtocolBuffer.Encoder.NUMERIC,
1481 1: ProtocolBuffer.Encoder.STRING,
1482 2: ProtocolBuffer.Encoder.NUMERIC,
1483 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
1486 _STYLE = """"""
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()
1508 try:
1509 if self.composite_filter_ is None: self.composite_filter_ = CompositeFilter()
1510 finally:
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()
1527 try:
1528 if self.property_filter_ is None: self.property_filter_ = PropertyFilter()
1529 finally:
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:
1554 def _CEncode(self):
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
1582 return 1
1584 def IsInitialized(self, debug_strs=None):
1585 initialized = 1
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
1588 return initialized
1590 def ByteSize(self):
1591 n = 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())
1594 return n
1596 def ByteSizePartial(self):
1597 n = 0
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())
1600 return n
1602 def Clear(self):
1603 self.clear_composite_filter()
1604 self.clear_property_filter()
1606 def OutputUnchecked(self, out):
1607 if (self.has_composite_filter_):
1608 out.putVarInt32(10)
1609 out.putVarInt32(self.composite_filter_.ByteSize())
1610 self.composite_filter_.OutputUnchecked(out)
1611 if (self.has_property_filter_):
1612 out.putVarInt32(18)
1613 out.putVarInt32(self.property_filter_.ByteSize())
1614 self.property_filter_.OutputUnchecked(out)
1616 def OutputPartial(self, out):
1617 if (self.has_composite_filter_):
1618 out.putVarInt32(10)
1619 out.putVarInt32(self.composite_filter_.ByteSizePartial())
1620 self.composite_filter_.OutputPartial(out)
1621 if (self.has_property_filter_):
1622 out.putVarInt32(18)
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()
1629 if tt == 10:
1630 length = d.getVarInt32()
1631 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
1632 d.skip(length)
1633 self.mutable_composite_filter().TryMerge(tmp)
1634 continue
1635 if tt == 18:
1636 length = d.getVarInt32()
1637 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
1638 d.skip(length)
1639 self.mutable_property_filter().TryMerge(tmp)
1640 continue
1643 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1644 d.skipData(tt)
1647 def __str__(self, prefix="", printElemNumber=0):
1648 res=""
1649 if self.has_composite_filter_:
1650 res+=prefix+"composite_filter <\n"
1651 res+=self.composite_filter_.__str__(prefix + " ", printElemNumber)
1652 res+=prefix+">\n"
1653 if self.has_property_filter_:
1654 res+=prefix+"property_filter <\n"
1655 res+=self.property_filter_.__str__(prefix + " ", printElemNumber)
1656 res+=prefix+">\n"
1657 return res
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({
1667 0: "ErrorCode",
1668 1: "composite_filter",
1669 2: "property_filter",
1670 }, 2)
1672 _TYPES = _BuildTagLookupTable({
1673 0: ProtocolBuffer.Encoder.NUMERIC,
1674 1: ProtocolBuffer.Encoder.STRING,
1675 2: ProtocolBuffer.Encoder.STRING,
1676 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
1679 _STYLE = """"""
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):
1691 AND = 1
1693 _Operator_NAMES = {
1694 1: "AND",
1697 def Operator_Name(cls, x): return cls._Operator_NAMES.get(x, "")
1698 Operator_Name = classmethod(Operator_Name)
1700 has_operator_ = 0
1701 operator_ = 0
1703 def __init__(self, contents=None):
1704 self.filter_ = []
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
1711 self.operator_ = x
1713 def clear_operator(self):
1714 if self.has_operator_:
1715 self.has_operator_ = 0
1716 self.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):
1730 x = Filter()
1731 self.filter_.append(x)
1732 return x
1734 def clear_filter(self):
1735 self.filter_ = []
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:
1747 def _CEncode(self):
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
1776 return 1
1778 def IsInitialized(self, debug_strs=None):
1779 initialized = 1
1780 if (not self.has_operator_):
1781 initialized = 0
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
1786 return initialized
1788 def ByteSize(self):
1789 n = 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())
1793 return n + 1
1795 def ByteSizePartial(self):
1796 n = 0
1797 if (self.has_operator_):
1798 n += 1
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())
1802 return n
1804 def Clear(self):
1805 self.clear_operator()
1806 self.clear_filter()
1808 def OutputUnchecked(self, out):
1809 out.putVarInt32(8)
1810 out.putVarInt32(self.operator_)
1811 for i in xrange(len(self.filter_)):
1812 out.putVarInt32(18)
1813 out.putVarInt32(self.filter_[i].ByteSize())
1814 self.filter_[i].OutputUnchecked(out)
1816 def OutputPartial(self, out):
1817 if (self.has_operator_):
1818 out.putVarInt32(8)
1819 out.putVarInt32(self.operator_)
1820 for i in xrange(len(self.filter_)):
1821 out.putVarInt32(18)
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()
1828 if tt == 8:
1829 self.set_operator(d.getVarInt32())
1830 continue
1831 if tt == 18:
1832 length = d.getVarInt32()
1833 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
1834 d.skip(length)
1835 self.add_filter().TryMerge(tmp)
1836 continue
1839 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1840 d.skipData(tt)
1843 def __str__(self, prefix="", printElemNumber=0):
1844 res=""
1845 if self.has_operator_: res+=prefix+("operator: %s\n" % self.DebugFormatInt32(self.operator_))
1846 cnt=0
1847 for e in self.filter_:
1848 elm=""
1849 if printElemNumber: elm="(%d)" % cnt
1850 res+=prefix+("filter%s <\n" % elm)
1851 res+=e.__str__(prefix + " ", printElemNumber)
1852 res+=prefix+">\n"
1853 cnt+=1
1854 return res
1857 def _BuildTagLookupTable(sparse, maxtag, default=None):
1858 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1860 koperator = 1
1861 kfilter = 2
1863 _TEXT = _BuildTagLookupTable({
1864 0: "ErrorCode",
1865 1: "operator",
1866 2: "filter",
1867 }, 2)
1869 _TYPES = _BuildTagLookupTable({
1870 0: ProtocolBuffer.Encoder.NUMERIC,
1871 1: ProtocolBuffer.Encoder.NUMERIC,
1872 2: ProtocolBuffer.Encoder.STRING,
1873 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
1876 _STYLE = """"""
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):
1888 LESS_THAN = 1
1889 LESS_THAN_OR_EQUAL = 2
1890 GREATER_THAN = 3
1891 GREATER_THAN_OR_EQUAL = 4
1892 EQUAL = 5
1893 HAS_ANCESTOR = 11
1895 _Operator_NAMES = {
1896 1: "LESS_THAN",
1897 2: "LESS_THAN_OR_EQUAL",
1898 3: "GREATER_THAN",
1899 4: "GREATER_THAN_OR_EQUAL",
1900 5: "EQUAL",
1901 11: "HAS_ANCESTOR",
1904 def Operator_Name(cls, x): return cls._Operator_NAMES.get(x, "")
1905 Operator_Name = classmethod(Operator_Name)
1907 has_property_ = 0
1908 has_operator_ = 0
1909 operator_ = 0
1910 has_value_ = 0
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
1929 self.operator_ = x
1931 def clear_operator(self):
1932 if self.has_operator_:
1933 self.has_operator_ = 0
1934 self.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:
1958 def _CEncode(self):
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
1988 return 1
1990 def IsInitialized(self, debug_strs=None):
1991 initialized = 1
1992 if (not self.has_property_):
1993 initialized = 0
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_):
1998 initialized = 0
1999 if debug_strs is not None:
2000 debug_strs.append('Required field: operator not set.')
2001 if (not self.has_value_):
2002 initialized = 0
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
2006 return initialized
2008 def ByteSize(self):
2009 n = 0
2010 n += self.lengthString(self.property_.ByteSize())
2011 n += self.lengthVarInt64(self.operator_)
2012 n += self.lengthString(self.value_.ByteSize())
2013 return n + 3
2015 def ByteSizePartial(self):
2016 n = 0
2017 if (self.has_property_):
2018 n += 1
2019 n += self.lengthString(self.property_.ByteSizePartial())
2020 if (self.has_operator_):
2021 n += 1
2022 n += self.lengthVarInt64(self.operator_)
2023 if (self.has_value_):
2024 n += 1
2025 n += self.lengthString(self.value_.ByteSizePartial())
2026 return n
2028 def Clear(self):
2029 self.clear_property()
2030 self.clear_operator()
2031 self.clear_value()
2033 def OutputUnchecked(self, out):
2034 out.putVarInt32(10)
2035 out.putVarInt32(self.property_.ByteSize())
2036 self.property_.OutputUnchecked(out)
2037 out.putVarInt32(16)
2038 out.putVarInt32(self.operator_)
2039 out.putVarInt32(26)
2040 out.putVarInt32(self.value_.ByteSize())
2041 self.value_.OutputUnchecked(out)
2043 def OutputPartial(self, out):
2044 if (self.has_property_):
2045 out.putVarInt32(10)
2046 out.putVarInt32(self.property_.ByteSizePartial())
2047 self.property_.OutputPartial(out)
2048 if (self.has_operator_):
2049 out.putVarInt32(16)
2050 out.putVarInt32(self.operator_)
2051 if (self.has_value_):
2052 out.putVarInt32(26)
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()
2059 if tt == 10:
2060 length = d.getVarInt32()
2061 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2062 d.skip(length)
2063 self.mutable_property().TryMerge(tmp)
2064 continue
2065 if tt == 16:
2066 self.set_operator(d.getVarInt32())
2067 continue
2068 if tt == 26:
2069 length = d.getVarInt32()
2070 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2071 d.skip(length)
2072 self.mutable_value().TryMerge(tmp)
2073 continue
2076 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
2077 d.skipData(tt)
2080 def __str__(self, prefix="", printElemNumber=0):
2081 res=""
2082 if self.has_property_:
2083 res+=prefix+"property <\n"
2084 res+=self.property_.__str__(prefix + " ", printElemNumber)
2085 res+=prefix+">\n"
2086 if self.has_operator_: res+=prefix+("operator: %s\n" % self.DebugFormatInt32(self.operator_))
2087 if self.has_value_:
2088 res+=prefix+"value <\n"
2089 res+=self.value_.__str__(prefix + " ", printElemNumber)
2090 res+=prefix+">\n"
2091 return res
2094 def _BuildTagLookupTable(sparse, maxtag, default=None):
2095 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
2097 kproperty = 1
2098 koperator = 2
2099 kvalue = 3
2101 _TEXT = _BuildTagLookupTable({
2102 0: "ErrorCode",
2103 1: "property",
2104 2: "operator",
2105 3: "value",
2106 }, 3)
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)
2116 _STYLE = """"""
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
2127 query_string_ = ""
2128 has_allow_literal_ = 0
2129 allow_literal_ = 0
2131 def __init__(self, contents=None):
2132 self.name_arg_ = []
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):
2172 x = GqlQueryArg()
2173 self.name_arg_.append(x)
2174 return x
2176 def clear_name_arg(self):
2177 self.name_arg_ = []
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):
2188 x = GqlQueryArg()
2189 self.number_arg_.append(x)
2190 return 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:
2207 def _CEncode(self):
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
2241 return 1
2243 def IsInitialized(self, debug_strs=None):
2244 initialized = 1
2245 if (not self.has_query_string_):
2246 initialized = 0
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
2253 return initialized
2255 def ByteSize(self):
2256 n = 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())
2263 return n + 1
2265 def ByteSizePartial(self):
2266 n = 0
2267 if (self.has_query_string_):
2268 n += 1
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())
2275 return n
2277 def Clear(self):
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):
2284 out.putVarInt32(10)
2285 out.putPrefixedString(self.query_string_)
2286 if (self.has_allow_literal_):
2287 out.putVarInt32(16)
2288 out.putBoolean(self.allow_literal_)
2289 for i in xrange(len(self.name_arg_)):
2290 out.putVarInt32(26)
2291 out.putVarInt32(self.name_arg_[i].ByteSize())
2292 self.name_arg_[i].OutputUnchecked(out)
2293 for i in xrange(len(self.number_arg_)):
2294 out.putVarInt32(34)
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_):
2300 out.putVarInt32(10)
2301 out.putPrefixedString(self.query_string_)
2302 if (self.has_allow_literal_):
2303 out.putVarInt32(16)
2304 out.putBoolean(self.allow_literal_)
2305 for i in xrange(len(self.name_arg_)):
2306 out.putVarInt32(26)
2307 out.putVarInt32(self.name_arg_[i].ByteSizePartial())
2308 self.name_arg_[i].OutputPartial(out)
2309 for i in xrange(len(self.number_arg_)):
2310 out.putVarInt32(34)
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()
2317 if tt == 10:
2318 self.set_query_string(d.getPrefixedString())
2319 continue
2320 if tt == 16:
2321 self.set_allow_literal(d.getBoolean())
2322 continue
2323 if tt == 26:
2324 length = d.getVarInt32()
2325 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2326 d.skip(length)
2327 self.add_name_arg().TryMerge(tmp)
2328 continue
2329 if tt == 34:
2330 length = d.getVarInt32()
2331 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2332 d.skip(length)
2333 self.add_number_arg().TryMerge(tmp)
2334 continue
2337 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
2338 d.skipData(tt)
2341 def __str__(self, prefix="", printElemNumber=0):
2342 res=""
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_))
2345 cnt=0
2346 for e in self.name_arg_:
2347 elm=""
2348 if printElemNumber: elm="(%d)" % cnt
2349 res+=prefix+("name_arg%s <\n" % elm)
2350 res+=e.__str__(prefix + " ", printElemNumber)
2351 res+=prefix+">\n"
2352 cnt+=1
2353 cnt=0
2354 for e in self.number_arg_:
2355 elm=""
2356 if printElemNumber: elm="(%d)" % cnt
2357 res+=prefix+("number_arg%s <\n" % elm)
2358 res+=e.__str__(prefix + " ", printElemNumber)
2359 res+=prefix+">\n"
2360 cnt+=1
2361 return res
2364 def _BuildTagLookupTable(sparse, maxtag, default=None):
2365 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
2367 kquery_string = 1
2368 kallow_literal = 2
2369 kname_arg = 3
2370 knumber_arg = 4
2372 _TEXT = _BuildTagLookupTable({
2373 0: "ErrorCode",
2374 1: "query_string",
2375 2: "allow_literal",
2376 3: "name_arg",
2377 4: "number_arg",
2378 }, 4)
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)
2389 _STYLE = """"""
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):
2399 has_name_ = 0
2400 name_ = ""
2401 has_value_ = 0
2402 value_ = None
2403 has_cursor_ = 0
2404 cursor_ = ""
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):
2413 self.has_name_ = 1
2414 self.name_ = x
2416 def clear_name(self):
2417 if self.has_name_:
2418 self.has_name_ = 0
2419 self.name_ = ""
2421 def has_name(self): return self.has_name_
2423 def value(self):
2424 if self.value_ is None:
2425 self.lazy_init_lock_.acquire()
2426 try:
2427 if self.value_ is None: self.value_ = google.appengine.datastore.entity_v4_pb.Value()
2428 finally:
2429 self.lazy_init_lock_.release()
2430 return self.value_
2432 def mutable_value(self): self.has_value_ = 1; return self.value()
2434 def clear_value(self):
2436 if self.has_value_:
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
2446 self.cursor_ = x
2448 def clear_cursor(self):
2449 if self.has_cursor_:
2450 self.has_cursor_ = 0
2451 self.cursor_ = ""
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:
2467 def _CEncode(self):
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
2497 return 1
2499 def IsInitialized(self, debug_strs=None):
2500 initialized = 1
2501 if (self.has_value_ and not self.value_.IsInitialized(debug_strs)): initialized = 0
2502 return initialized
2504 def ByteSize(self):
2505 n = 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_))
2509 return n
2511 def ByteSizePartial(self):
2512 n = 0
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_))
2516 return n
2518 def Clear(self):
2519 self.clear_name()
2520 self.clear_value()
2521 self.clear_cursor()
2523 def OutputUnchecked(self, out):
2524 if (self.has_name_):
2525 out.putVarInt32(10)
2526 out.putPrefixedString(self.name_)
2527 if (self.has_value_):
2528 out.putVarInt32(18)
2529 out.putVarInt32(self.value_.ByteSize())
2530 self.value_.OutputUnchecked(out)
2531 if (self.has_cursor_):
2532 out.putVarInt32(26)
2533 out.putPrefixedString(self.cursor_)
2535 def OutputPartial(self, out):
2536 if (self.has_name_):
2537 out.putVarInt32(10)
2538 out.putPrefixedString(self.name_)
2539 if (self.has_value_):
2540 out.putVarInt32(18)
2541 out.putVarInt32(self.value_.ByteSizePartial())
2542 self.value_.OutputPartial(out)
2543 if (self.has_cursor_):
2544 out.putVarInt32(26)
2545 out.putPrefixedString(self.cursor_)
2547 def TryMerge(self, d):
2548 while d.avail() > 0:
2549 tt = d.getVarInt32()
2550 if tt == 10:
2551 self.set_name(d.getPrefixedString())
2552 continue
2553 if tt == 18:
2554 length = d.getVarInt32()
2555 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2556 d.skip(length)
2557 self.mutable_value().TryMerge(tmp)
2558 continue
2559 if tt == 26:
2560 self.set_cursor(d.getPrefixedString())
2561 continue
2564 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
2565 d.skipData(tt)
2568 def __str__(self, prefix="", printElemNumber=0):
2569 res=""
2570 if self.has_name_: res+=prefix+("name: %s\n" % self.DebugFormatString(self.name_))
2571 if self.has_value_:
2572 res+=prefix+"value <\n"
2573 res+=self.value_.__str__(prefix + " ", printElemNumber)
2574 res+=prefix+">\n"
2575 if self.has_cursor_: res+=prefix+("cursor: %s\n" % self.DebugFormatString(self.cursor_))
2576 return res
2579 def _BuildTagLookupTable(sparse, maxtag, default=None):
2580 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
2582 kname = 1
2583 kvalue = 2
2584 kcursor = 3
2586 _TEXT = _BuildTagLookupTable({
2587 0: "ErrorCode",
2588 1: "name",
2589 2: "value",
2590 3: "cursor",
2591 }, 3)
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)
2601 _STYLE = """"""
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):
2613 NOT_FINISHED = 1
2614 MORE_RESULTS_AFTER_LIMIT = 2
2615 NO_MORE_RESULTS = 3
2617 _MoreResultsType_NAMES = {
2618 1: "NOT_FINISHED",
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
2628 has_end_cursor_ = 0
2629 end_cursor_ = ""
2630 has_more_results_ = 0
2631 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):
2662 x = EntityResult()
2663 self.entity_result_.append(x)
2664 return 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:
2721 def _CEncode(self):
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
2756 return 1
2758 def IsInitialized(self, debug_strs=None):
2759 initialized = 1
2760 if (not self.has_entity_result_type_):
2761 initialized = 0
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_):
2767 initialized = 0
2768 if debug_strs is not None:
2769 debug_strs.append('Required field: more_results not set.')
2770 return initialized
2772 def ByteSize(self):
2773 n = 0
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_)
2780 return n + 2
2782 def ByteSizePartial(self):
2783 n = 0
2784 if (self.has_entity_result_type_):
2785 n += 1
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_):
2791 n += 1
2792 n += self.lengthVarInt64(self.more_results_)
2793 if (self.has_skipped_results_): n += 1 + self.lengthVarInt64(self.skipped_results_)
2794 return n
2796 def Clear(self):
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):
2804 out.putVarInt32(8)
2805 out.putVarInt32(self.entity_result_type_)
2806 for i in xrange(len(self.entity_result_)):
2807 out.putVarInt32(18)
2808 out.putVarInt32(self.entity_result_[i].ByteSize())
2809 self.entity_result_[i].OutputUnchecked(out)
2810 if (self.has_end_cursor_):
2811 out.putVarInt32(34)
2812 out.putPrefixedString(self.end_cursor_)
2813 out.putVarInt32(40)
2814 out.putVarInt32(self.more_results_)
2815 if (self.has_skipped_results_):
2816 out.putVarInt32(48)
2817 out.putVarInt32(self.skipped_results_)
2819 def OutputPartial(self, out):
2820 if (self.has_entity_result_type_):
2821 out.putVarInt32(8)
2822 out.putVarInt32(self.entity_result_type_)
2823 for i in xrange(len(self.entity_result_)):
2824 out.putVarInt32(18)
2825 out.putVarInt32(self.entity_result_[i].ByteSizePartial())
2826 self.entity_result_[i].OutputPartial(out)
2827 if (self.has_end_cursor_):
2828 out.putVarInt32(34)
2829 out.putPrefixedString(self.end_cursor_)
2830 if (self.has_more_results_):
2831 out.putVarInt32(40)
2832 out.putVarInt32(self.more_results_)
2833 if (self.has_skipped_results_):
2834 out.putVarInt32(48)
2835 out.putVarInt32(self.skipped_results_)
2837 def TryMerge(self, d):
2838 while d.avail() > 0:
2839 tt = d.getVarInt32()
2840 if tt == 8:
2841 self.set_entity_result_type(d.getVarInt32())
2842 continue
2843 if tt == 18:
2844 length = d.getVarInt32()
2845 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2846 d.skip(length)
2847 self.add_entity_result().TryMerge(tmp)
2848 continue
2849 if tt == 34:
2850 self.set_end_cursor(d.getPrefixedString())
2851 continue
2852 if tt == 40:
2853 self.set_more_results(d.getVarInt32())
2854 continue
2855 if tt == 48:
2856 self.set_skipped_results(d.getVarInt32())
2857 continue
2860 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
2861 d.skipData(tt)
2864 def __str__(self, prefix="", printElemNumber=0):
2865 res=""
2866 if self.has_entity_result_type_: res+=prefix+("entity_result_type: %s\n" % self.DebugFormatInt32(self.entity_result_type_))
2867 cnt=0
2868 for e in self.entity_result_:
2869 elm=""
2870 if printElemNumber: elm="(%d)" % cnt
2871 res+=prefix+("entity_result%s <\n" % elm)
2872 res+=e.__str__(prefix + " ", printElemNumber)
2873 res+=prefix+">\n"
2874 cnt+=1
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_))
2878 return res
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
2885 kentity_result = 2
2886 kend_cursor = 4
2887 kmore_results = 5
2888 kskipped_results = 6
2890 _TEXT = _BuildTagLookupTable({
2891 0: "ErrorCode",
2892 1: "entity_result_type",
2893 2: "entity_result",
2894 4: "end_cursor",
2895 5: "more_results",
2896 6: "skipped_results",
2897 }, 6)
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)
2909 _STYLE = """"""
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):
2919 has_force_ = 0
2920 force_ = 0
2922 def __init__(self, contents=None):
2923 self.upsert_ = []
2924 self.update_ = []
2925 self.insert_ = []
2926 self.insert_auto_id_ = []
2927 self.delete_ = []
2928 if contents is not None: self.MergeFromString(contents)
2930 def upsert_size(self): return len(self.upsert_)
2931 def upsert_list(self): return self.upsert_
2933 def upsert(self, i):
2934 return self.upsert_[i]
2936 def mutable_upsert(self, i):
2937 return self.upsert_[i]
2939 def add_upsert(self):
2940 x = google.appengine.datastore.entity_v4_pb.Entity()
2941 self.upsert_.append(x)
2942 return x
2944 def clear_upsert(self):
2945 self.upsert_ = []
2946 def update_size(self): return len(self.update_)
2947 def update_list(self): return self.update_
2949 def update(self, i):
2950 return self.update_[i]
2952 def mutable_update(self, i):
2953 return self.update_[i]
2955 def add_update(self):
2956 x = google.appengine.datastore.entity_v4_pb.Entity()
2957 self.update_.append(x)
2958 return x
2960 def clear_update(self):
2961 self.update_ = []
2962 def insert_size(self): return len(self.insert_)
2963 def insert_list(self): return self.insert_
2965 def insert(self, i):
2966 return self.insert_[i]
2968 def mutable_insert(self, i):
2969 return self.insert_[i]
2971 def add_insert(self):
2972 x = google.appengine.datastore.entity_v4_pb.Entity()
2973 self.insert_.append(x)
2974 return x
2976 def clear_insert(self):
2977 self.insert_ = []
2978 def insert_auto_id_size(self): return len(self.insert_auto_id_)
2979 def insert_auto_id_list(self): return self.insert_auto_id_
2981 def insert_auto_id(self, i):
2982 return self.insert_auto_id_[i]
2984 def mutable_insert_auto_id(self, i):
2985 return self.insert_auto_id_[i]
2987 def add_insert_auto_id(self):
2988 x = google.appengine.datastore.entity_v4_pb.Entity()
2989 self.insert_auto_id_.append(x)
2990 return x
2992 def clear_insert_auto_id(self):
2993 self.insert_auto_id_ = []
2994 def delete_size(self): return len(self.delete_)
2995 def delete_list(self): return self.delete_
2997 def delete(self, i):
2998 return self.delete_[i]
3000 def mutable_delete(self, i):
3001 return self.delete_[i]
3003 def add_delete(self):
3004 x = google.appengine.datastore.entity_v4_pb.Key()
3005 self.delete_.append(x)
3006 return x
3008 def clear_delete(self):
3009 self.delete_ = []
3010 def force(self): return self.force_
3012 def set_force(self, x):
3013 self.has_force_ = 1
3014 self.force_ = x
3016 def clear_force(self):
3017 if self.has_force_:
3018 self.has_force_ = 0
3019 self.force_ = 0
3021 def has_force(self): return self.has_force_
3024 def MergeFrom(self, x):
3025 assert x is not self
3026 for i in xrange(x.upsert_size()): self.add_upsert().CopyFrom(x.upsert(i))
3027 for i in xrange(x.update_size()): self.add_update().CopyFrom(x.update(i))
3028 for i in xrange(x.insert_size()): self.add_insert().CopyFrom(x.insert(i))
3029 for i in xrange(x.insert_auto_id_size()): self.add_insert_auto_id().CopyFrom(x.insert_auto_id(i))
3030 for i in xrange(x.delete_size()): self.add_delete().CopyFrom(x.delete(i))
3031 if (x.has_force()): self.set_force(x.force())
3033 if _net_proto___parse__python is not None:
3034 def _CMergeFromString(self, s):
3035 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.Mutation', s)
3037 if _net_proto___parse__python is not None:
3038 def _CEncode(self):
3039 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.Mutation')
3041 if _net_proto___parse__python is not None:
3042 def _CEncodePartial(self):
3043 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.Mutation')
3045 if _net_proto___parse__python is not None:
3046 def _CToASCII(self, output_format):
3047 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.Mutation', output_format)
3050 if _net_proto___parse__python is not None:
3051 def ParseASCII(self, s):
3052 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.Mutation', s)
3055 if _net_proto___parse__python is not None:
3056 def ParseASCIIIgnoreUnknown(self, s):
3057 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.Mutation', s)
3060 def Equals(self, x):
3061 if x is self: return 1
3062 if len(self.upsert_) != len(x.upsert_): return 0
3063 for e1, e2 in zip(self.upsert_, x.upsert_):
3064 if e1 != e2: return 0
3065 if len(self.update_) != len(x.update_): return 0
3066 for e1, e2 in zip(self.update_, x.update_):
3067 if e1 != e2: return 0
3068 if len(self.insert_) != len(x.insert_): return 0
3069 for e1, e2 in zip(self.insert_, x.insert_):
3070 if e1 != e2: return 0
3071 if len(self.insert_auto_id_) != len(x.insert_auto_id_): return 0
3072 for e1, e2 in zip(self.insert_auto_id_, x.insert_auto_id_):
3073 if e1 != e2: return 0
3074 if len(self.delete_) != len(x.delete_): return 0
3075 for e1, e2 in zip(self.delete_, x.delete_):
3076 if e1 != e2: return 0
3077 if self.has_force_ != x.has_force_: return 0
3078 if self.has_force_ and self.force_ != x.force_: return 0
3079 return 1
3081 def IsInitialized(self, debug_strs=None):
3082 initialized = 1
3083 for p in self.upsert_:
3084 if not p.IsInitialized(debug_strs): initialized=0
3085 for p in self.update_:
3086 if not p.IsInitialized(debug_strs): initialized=0
3087 for p in self.insert_:
3088 if not p.IsInitialized(debug_strs): initialized=0
3089 for p in self.insert_auto_id_:
3090 if not p.IsInitialized(debug_strs): initialized=0
3091 for p in self.delete_:
3092 if not p.IsInitialized(debug_strs): initialized=0
3093 return initialized
3095 def ByteSize(self):
3096 n = 0
3097 n += 1 * len(self.upsert_)
3098 for i in xrange(len(self.upsert_)): n += self.lengthString(self.upsert_[i].ByteSize())
3099 n += 1 * len(self.update_)
3100 for i in xrange(len(self.update_)): n += self.lengthString(self.update_[i].ByteSize())
3101 n += 1 * len(self.insert_)
3102 for i in xrange(len(self.insert_)): n += self.lengthString(self.insert_[i].ByteSize())
3103 n += 1 * len(self.insert_auto_id_)
3104 for i in xrange(len(self.insert_auto_id_)): n += self.lengthString(self.insert_auto_id_[i].ByteSize())
3105 n += 1 * len(self.delete_)
3106 for i in xrange(len(self.delete_)): n += self.lengthString(self.delete_[i].ByteSize())
3107 if (self.has_force_): n += 2
3108 return n
3110 def ByteSizePartial(self):
3111 n = 0
3112 n += 1 * len(self.upsert_)
3113 for i in xrange(len(self.upsert_)): n += self.lengthString(self.upsert_[i].ByteSizePartial())
3114 n += 1 * len(self.update_)
3115 for i in xrange(len(self.update_)): n += self.lengthString(self.update_[i].ByteSizePartial())
3116 n += 1 * len(self.insert_)
3117 for i in xrange(len(self.insert_)): n += self.lengthString(self.insert_[i].ByteSizePartial())
3118 n += 1 * len(self.insert_auto_id_)
3119 for i in xrange(len(self.insert_auto_id_)): n += self.lengthString(self.insert_auto_id_[i].ByteSizePartial())
3120 n += 1 * len(self.delete_)
3121 for i in xrange(len(self.delete_)): n += self.lengthString(self.delete_[i].ByteSizePartial())
3122 if (self.has_force_): n += 2
3123 return n
3125 def Clear(self):
3126 self.clear_upsert()
3127 self.clear_update()
3128 self.clear_insert()
3129 self.clear_insert_auto_id()
3130 self.clear_delete()
3131 self.clear_force()
3133 def OutputUnchecked(self, out):
3134 for i in xrange(len(self.upsert_)):
3135 out.putVarInt32(10)
3136 out.putVarInt32(self.upsert_[i].ByteSize())
3137 self.upsert_[i].OutputUnchecked(out)
3138 for i in xrange(len(self.update_)):
3139 out.putVarInt32(18)
3140 out.putVarInt32(self.update_[i].ByteSize())
3141 self.update_[i].OutputUnchecked(out)
3142 for i in xrange(len(self.insert_)):
3143 out.putVarInt32(26)
3144 out.putVarInt32(self.insert_[i].ByteSize())
3145 self.insert_[i].OutputUnchecked(out)
3146 for i in xrange(len(self.insert_auto_id_)):
3147 out.putVarInt32(34)
3148 out.putVarInt32(self.insert_auto_id_[i].ByteSize())
3149 self.insert_auto_id_[i].OutputUnchecked(out)
3150 for i in xrange(len(self.delete_)):
3151 out.putVarInt32(42)
3152 out.putVarInt32(self.delete_[i].ByteSize())
3153 self.delete_[i].OutputUnchecked(out)
3154 if (self.has_force_):
3155 out.putVarInt32(48)
3156 out.putBoolean(self.force_)
3158 def OutputPartial(self, out):
3159 for i in xrange(len(self.upsert_)):
3160 out.putVarInt32(10)
3161 out.putVarInt32(self.upsert_[i].ByteSizePartial())
3162 self.upsert_[i].OutputPartial(out)
3163 for i in xrange(len(self.update_)):
3164 out.putVarInt32(18)
3165 out.putVarInt32(self.update_[i].ByteSizePartial())
3166 self.update_[i].OutputPartial(out)
3167 for i in xrange(len(self.insert_)):
3168 out.putVarInt32(26)
3169 out.putVarInt32(self.insert_[i].ByteSizePartial())
3170 self.insert_[i].OutputPartial(out)
3171 for i in xrange(len(self.insert_auto_id_)):
3172 out.putVarInt32(34)
3173 out.putVarInt32(self.insert_auto_id_[i].ByteSizePartial())
3174 self.insert_auto_id_[i].OutputPartial(out)
3175 for i in xrange(len(self.delete_)):
3176 out.putVarInt32(42)
3177 out.putVarInt32(self.delete_[i].ByteSizePartial())
3178 self.delete_[i].OutputPartial(out)
3179 if (self.has_force_):
3180 out.putVarInt32(48)
3181 out.putBoolean(self.force_)
3183 def TryMerge(self, d):
3184 while d.avail() > 0:
3185 tt = d.getVarInt32()
3186 if tt == 10:
3187 length = d.getVarInt32()
3188 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
3189 d.skip(length)
3190 self.add_upsert().TryMerge(tmp)
3191 continue
3192 if tt == 18:
3193 length = d.getVarInt32()
3194 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
3195 d.skip(length)
3196 self.add_update().TryMerge(tmp)
3197 continue
3198 if tt == 26:
3199 length = d.getVarInt32()
3200 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
3201 d.skip(length)
3202 self.add_insert().TryMerge(tmp)
3203 continue
3204 if tt == 34:
3205 length = d.getVarInt32()
3206 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
3207 d.skip(length)
3208 self.add_insert_auto_id().TryMerge(tmp)
3209 continue
3210 if tt == 42:
3211 length = d.getVarInt32()
3212 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
3213 d.skip(length)
3214 self.add_delete().TryMerge(tmp)
3215 continue
3216 if tt == 48:
3217 self.set_force(d.getBoolean())
3218 continue
3221 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
3222 d.skipData(tt)
3225 def __str__(self, prefix="", printElemNumber=0):
3226 res=""
3227 cnt=0
3228 for e in self.upsert_:
3229 elm=""
3230 if printElemNumber: elm="(%d)" % cnt
3231 res+=prefix+("upsert%s <\n" % elm)
3232 res+=e.__str__(prefix + " ", printElemNumber)
3233 res+=prefix+">\n"
3234 cnt+=1
3235 cnt=0
3236 for e in self.update_:
3237 elm=""
3238 if printElemNumber: elm="(%d)" % cnt
3239 res+=prefix+("update%s <\n" % elm)
3240 res+=e.__str__(prefix + " ", printElemNumber)
3241 res+=prefix+">\n"
3242 cnt+=1
3243 cnt=0
3244 for e in self.insert_:
3245 elm=""
3246 if printElemNumber: elm="(%d)" % cnt
3247 res+=prefix+("insert%s <\n" % elm)
3248 res+=e.__str__(prefix + " ", printElemNumber)
3249 res+=prefix+">\n"
3250 cnt+=1
3251 cnt=0
3252 for e in self.insert_auto_id_:
3253 elm=""
3254 if printElemNumber: elm="(%d)" % cnt
3255 res+=prefix+("insert_auto_id%s <\n" % elm)
3256 res+=e.__str__(prefix + " ", printElemNumber)
3257 res+=prefix+">\n"
3258 cnt+=1
3259 cnt=0
3260 for e in self.delete_:
3261 elm=""
3262 if printElemNumber: elm="(%d)" % cnt
3263 res+=prefix+("delete%s <\n" % elm)
3264 res+=e.__str__(prefix + " ", printElemNumber)
3265 res+=prefix+">\n"
3266 cnt+=1
3267 if self.has_force_: res+=prefix+("force: %s\n" % self.DebugFormatBool(self.force_))
3268 return res
3271 def _BuildTagLookupTable(sparse, maxtag, default=None):
3272 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
3274 kupsert = 1
3275 kupdate = 2
3276 kinsert = 3
3277 kinsert_auto_id = 4
3278 kdelete = 5
3279 kforce = 6
3281 _TEXT = _BuildTagLookupTable({
3282 0: "ErrorCode",
3283 1: "upsert",
3284 2: "update",
3285 3: "insert",
3286 4: "insert_auto_id",
3287 5: "delete",
3288 6: "force",
3289 }, 6)
3291 _TYPES = _BuildTagLookupTable({
3292 0: ProtocolBuffer.Encoder.NUMERIC,
3293 1: ProtocolBuffer.Encoder.STRING,
3294 2: ProtocolBuffer.Encoder.STRING,
3295 3: ProtocolBuffer.Encoder.STRING,
3296 4: ProtocolBuffer.Encoder.STRING,
3297 5: ProtocolBuffer.Encoder.STRING,
3298 6: ProtocolBuffer.Encoder.NUMERIC,
3299 }, 6, ProtocolBuffer.Encoder.MAX_TYPE)
3302 _STYLE = """"""
3303 _STYLE_CONTENT_TYPE = """"""
3304 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.Mutation'
3305 _SERIALIZED_DESCRIPTOR = array.array('B')
3306 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KIGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uExoGdXBzZXJ0IAEoAjALOANKHmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eaMBqgEFY3R5cGWyAQZwcm90bzKkARQTGgZ1cGRhdGUgAigCMAs4A0oeYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaBmluc2VydCADKAIwCzgDSh5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FbnRpdHmjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoOaW5zZXJ0X2F1dG9faWQgBCgCMAs4A0oeYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaBmRlbGV0ZSAFKAIwCzgDShthcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LZXmjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoFZm9yY2UgBigAMAg4ARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
3307 if _net_proto___parse__python is not None:
3308 _net_proto___parse__python.RegisterType(
3309 _SERIALIZED_DESCRIPTOR.tostring())
3311 class MutationResult(ProtocolBuffer.ProtocolMessage):
3312 has_index_updates_ = 0
3313 index_updates_ = 0
3315 def __init__(self, contents=None):
3316 self.insert_auto_id_key_ = []
3317 self.upsert_version_ = []
3318 self.update_version_ = []
3319 self.insert_version_ = []
3320 self.insert_auto_id_version_ = []
3321 self.delete_version_ = []
3322 if contents is not None: self.MergeFromString(contents)
3324 def index_updates(self): return self.index_updates_
3326 def set_index_updates(self, x):
3327 self.has_index_updates_ = 1
3328 self.index_updates_ = x
3330 def clear_index_updates(self):
3331 if self.has_index_updates_:
3332 self.has_index_updates_ = 0
3333 self.index_updates_ = 0
3335 def has_index_updates(self): return self.has_index_updates_
3337 def insert_auto_id_key_size(self): return len(self.insert_auto_id_key_)
3338 def insert_auto_id_key_list(self): return self.insert_auto_id_key_
3340 def insert_auto_id_key(self, i):
3341 return self.insert_auto_id_key_[i]
3343 def mutable_insert_auto_id_key(self, i):
3344 return self.insert_auto_id_key_[i]
3346 def add_insert_auto_id_key(self):
3347 x = google.appengine.datastore.entity_v4_pb.Key()
3348 self.insert_auto_id_key_.append(x)
3349 return x
3351 def clear_insert_auto_id_key(self):
3352 self.insert_auto_id_key_ = []
3353 def upsert_version_size(self): return len(self.upsert_version_)
3354 def upsert_version_list(self): return self.upsert_version_
3356 def upsert_version(self, i):
3357 return self.upsert_version_[i]
3359 def set_upsert_version(self, i, x):
3360 self.upsert_version_[i] = x
3362 def add_upsert_version(self, x):
3363 self.upsert_version_.append(x)
3365 def clear_upsert_version(self):
3366 self.upsert_version_ = []
3368 def update_version_size(self): return len(self.update_version_)
3369 def update_version_list(self): return self.update_version_
3371 def update_version(self, i):
3372 return self.update_version_[i]
3374 def set_update_version(self, i, x):
3375 self.update_version_[i] = x
3377 def add_update_version(self, x):
3378 self.update_version_.append(x)
3380 def clear_update_version(self):
3381 self.update_version_ = []
3383 def insert_version_size(self): return len(self.insert_version_)
3384 def insert_version_list(self): return self.insert_version_
3386 def insert_version(self, i):
3387 return self.insert_version_[i]
3389 def set_insert_version(self, i, x):
3390 self.insert_version_[i] = x
3392 def add_insert_version(self, x):
3393 self.insert_version_.append(x)
3395 def clear_insert_version(self):
3396 self.insert_version_ = []
3398 def insert_auto_id_version_size(self): return len(self.insert_auto_id_version_)
3399 def insert_auto_id_version_list(self): return self.insert_auto_id_version_
3401 def insert_auto_id_version(self, i):
3402 return self.insert_auto_id_version_[i]
3404 def set_insert_auto_id_version(self, i, x):
3405 self.insert_auto_id_version_[i] = x
3407 def add_insert_auto_id_version(self, x):
3408 self.insert_auto_id_version_.append(x)
3410 def clear_insert_auto_id_version(self):
3411 self.insert_auto_id_version_ = []
3413 def delete_version_size(self): return len(self.delete_version_)
3414 def delete_version_list(self): return self.delete_version_
3416 def delete_version(self, i):
3417 return self.delete_version_[i]
3419 def set_delete_version(self, i, x):
3420 self.delete_version_[i] = x
3422 def add_delete_version(self, x):
3423 self.delete_version_.append(x)
3425 def clear_delete_version(self):
3426 self.delete_version_ = []
3429 def MergeFrom(self, x):
3430 assert x is not self
3431 if (x.has_index_updates()): self.set_index_updates(x.index_updates())
3432 for i in xrange(x.insert_auto_id_key_size()): self.add_insert_auto_id_key().CopyFrom(x.insert_auto_id_key(i))
3433 for i in xrange(x.upsert_version_size()): self.add_upsert_version(x.upsert_version(i))
3434 for i in xrange(x.update_version_size()): self.add_update_version(x.update_version(i))
3435 for i in xrange(x.insert_version_size()): self.add_insert_version(x.insert_version(i))
3436 for i in xrange(x.insert_auto_id_version_size()): self.add_insert_auto_id_version(x.insert_auto_id_version(i))
3437 for i in xrange(x.delete_version_size()): self.add_delete_version(x.delete_version(i))
3439 if _net_proto___parse__python is not None:
3440 def _CMergeFromString(self, s):
3441 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.MutationResult', s)
3443 if _net_proto___parse__python is not None:
3444 def _CEncode(self):
3445 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.MutationResult')
3447 if _net_proto___parse__python is not None:
3448 def _CEncodePartial(self):
3449 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.MutationResult')
3451 if _net_proto___parse__python is not None:
3452 def _CToASCII(self, output_format):
3453 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.MutationResult', output_format)
3456 if _net_proto___parse__python is not None:
3457 def ParseASCII(self, s):
3458 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.MutationResult', s)
3461 if _net_proto___parse__python is not None:
3462 def ParseASCIIIgnoreUnknown(self, s):
3463 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.MutationResult', s)
3466 def Equals(self, x):
3467 if x is self: return 1
3468 if self.has_index_updates_ != x.has_index_updates_: return 0
3469 if self.has_index_updates_ and self.index_updates_ != x.index_updates_: return 0
3470 if len(self.insert_auto_id_key_) != len(x.insert_auto_id_key_): return 0
3471 for e1, e2 in zip(self.insert_auto_id_key_, x.insert_auto_id_key_):
3472 if e1 != e2: return 0
3473 if len(self.upsert_version_) != len(x.upsert_version_): return 0
3474 for e1, e2 in zip(self.upsert_version_, x.upsert_version_):
3475 if e1 != e2: return 0
3476 if len(self.update_version_) != len(x.update_version_): return 0
3477 for e1, e2 in zip(self.update_version_, x.update_version_):
3478 if e1 != e2: return 0
3479 if len(self.insert_version_) != len(x.insert_version_): return 0
3480 for e1, e2 in zip(self.insert_version_, x.insert_version_):
3481 if e1 != e2: return 0
3482 if len(self.insert_auto_id_version_) != len(x.insert_auto_id_version_): return 0
3483 for e1, e2 in zip(self.insert_auto_id_version_, x.insert_auto_id_version_):
3484 if e1 != e2: return 0
3485 if len(self.delete_version_) != len(x.delete_version_): return 0
3486 for e1, e2 in zip(self.delete_version_, x.delete_version_):
3487 if e1 != e2: return 0
3488 return 1
3490 def IsInitialized(self, debug_strs=None):
3491 initialized = 1
3492 if (not self.has_index_updates_):
3493 initialized = 0
3494 if debug_strs is not None:
3495 debug_strs.append('Required field: index_updates not set.')
3496 for p in self.insert_auto_id_key_:
3497 if not p.IsInitialized(debug_strs): initialized=0
3498 return initialized
3500 def ByteSize(self):
3501 n = 0
3502 n += self.lengthVarInt64(self.index_updates_)
3503 n += 1 * len(self.insert_auto_id_key_)
3504 for i in xrange(len(self.insert_auto_id_key_)): n += self.lengthString(self.insert_auto_id_key_[i].ByteSize())
3505 n += 1 * len(self.upsert_version_)
3506 for i in xrange(len(self.upsert_version_)): n += self.lengthVarInt64(self.upsert_version_[i])
3507 n += 1 * len(self.update_version_)
3508 for i in xrange(len(self.update_version_)): n += self.lengthVarInt64(self.update_version_[i])
3509 n += 1 * len(self.insert_version_)
3510 for i in xrange(len(self.insert_version_)): n += self.lengthVarInt64(self.insert_version_[i])
3511 n += 1 * len(self.insert_auto_id_version_)
3512 for i in xrange(len(self.insert_auto_id_version_)): n += self.lengthVarInt64(self.insert_auto_id_version_[i])
3513 n += 1 * len(self.delete_version_)
3514 for i in xrange(len(self.delete_version_)): n += self.lengthVarInt64(self.delete_version_[i])
3515 return n + 1
3517 def ByteSizePartial(self):
3518 n = 0
3519 if (self.has_index_updates_):
3520 n += 1
3521 n += self.lengthVarInt64(self.index_updates_)
3522 n += 1 * len(self.insert_auto_id_key_)
3523 for i in xrange(len(self.insert_auto_id_key_)): n += self.lengthString(self.insert_auto_id_key_[i].ByteSizePartial())
3524 n += 1 * len(self.upsert_version_)
3525 for i in xrange(len(self.upsert_version_)): n += self.lengthVarInt64(self.upsert_version_[i])
3526 n += 1 * len(self.update_version_)
3527 for i in xrange(len(self.update_version_)): n += self.lengthVarInt64(self.update_version_[i])
3528 n += 1 * len(self.insert_version_)
3529 for i in xrange(len(self.insert_version_)): n += self.lengthVarInt64(self.insert_version_[i])
3530 n += 1 * len(self.insert_auto_id_version_)
3531 for i in xrange(len(self.insert_auto_id_version_)): n += self.lengthVarInt64(self.insert_auto_id_version_[i])
3532 n += 1 * len(self.delete_version_)
3533 for i in xrange(len(self.delete_version_)): n += self.lengthVarInt64(self.delete_version_[i])
3534 return n
3536 def Clear(self):
3537 self.clear_index_updates()
3538 self.clear_insert_auto_id_key()
3539 self.clear_upsert_version()
3540 self.clear_update_version()
3541 self.clear_insert_version()
3542 self.clear_insert_auto_id_version()
3543 self.clear_delete_version()
3545 def OutputUnchecked(self, out):
3546 out.putVarInt32(8)
3547 out.putVarInt32(self.index_updates_)
3548 for i in xrange(len(self.insert_auto_id_key_)):
3549 out.putVarInt32(18)
3550 out.putVarInt32(self.insert_auto_id_key_[i].ByteSize())
3551 self.insert_auto_id_key_[i].OutputUnchecked(out)
3552 for i in xrange(len(self.upsert_version_)):
3553 out.putVarInt32(24)
3554 out.putVarInt64(self.upsert_version_[i])
3555 for i in xrange(len(self.update_version_)):
3556 out.putVarInt32(32)
3557 out.putVarInt64(self.update_version_[i])
3558 for i in xrange(len(self.insert_version_)):
3559 out.putVarInt32(40)
3560 out.putVarInt64(self.insert_version_[i])
3561 for i in xrange(len(self.insert_auto_id_version_)):
3562 out.putVarInt32(48)
3563 out.putVarInt64(self.insert_auto_id_version_[i])
3564 for i in xrange(len(self.delete_version_)):
3565 out.putVarInt32(56)
3566 out.putVarInt64(self.delete_version_[i])
3568 def OutputPartial(self, out):
3569 if (self.has_index_updates_):
3570 out.putVarInt32(8)
3571 out.putVarInt32(self.index_updates_)
3572 for i in xrange(len(self.insert_auto_id_key_)):
3573 out.putVarInt32(18)
3574 out.putVarInt32(self.insert_auto_id_key_[i].ByteSizePartial())
3575 self.insert_auto_id_key_[i].OutputPartial(out)
3576 for i in xrange(len(self.upsert_version_)):
3577 out.putVarInt32(24)
3578 out.putVarInt64(self.upsert_version_[i])
3579 for i in xrange(len(self.update_version_)):
3580 out.putVarInt32(32)
3581 out.putVarInt64(self.update_version_[i])
3582 for i in xrange(len(self.insert_version_)):
3583 out.putVarInt32(40)
3584 out.putVarInt64(self.insert_version_[i])
3585 for i in xrange(len(self.insert_auto_id_version_)):
3586 out.putVarInt32(48)
3587 out.putVarInt64(self.insert_auto_id_version_[i])
3588 for i in xrange(len(self.delete_version_)):
3589 out.putVarInt32(56)
3590 out.putVarInt64(self.delete_version_[i])
3592 def TryMerge(self, d):
3593 while d.avail() > 0:
3594 tt = d.getVarInt32()
3595 if tt == 8:
3596 self.set_index_updates(d.getVarInt32())
3597 continue
3598 if tt == 18:
3599 length = d.getVarInt32()
3600 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
3601 d.skip(length)
3602 self.add_insert_auto_id_key().TryMerge(tmp)
3603 continue
3604 if tt == 24:
3605 self.add_upsert_version(d.getVarInt64())
3606 continue
3607 if tt == 32:
3608 self.add_update_version(d.getVarInt64())
3609 continue
3610 if tt == 40:
3611 self.add_insert_version(d.getVarInt64())
3612 continue
3613 if tt == 48:
3614 self.add_insert_auto_id_version(d.getVarInt64())
3615 continue
3616 if tt == 56:
3617 self.add_delete_version(d.getVarInt64())
3618 continue
3621 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
3622 d.skipData(tt)
3625 def __str__(self, prefix="", printElemNumber=0):
3626 res=""
3627 if self.has_index_updates_: res+=prefix+("index_updates: %s\n" % self.DebugFormatInt32(self.index_updates_))
3628 cnt=0
3629 for e in self.insert_auto_id_key_:
3630 elm=""
3631 if printElemNumber: elm="(%d)" % cnt
3632 res+=prefix+("insert_auto_id_key%s <\n" % elm)
3633 res+=e.__str__(prefix + " ", printElemNumber)
3634 res+=prefix+">\n"
3635 cnt+=1
3636 cnt=0
3637 for e in self.upsert_version_:
3638 elm=""
3639 if printElemNumber: elm="(%d)" % cnt
3640 res+=prefix+("upsert_version%s: %s\n" % (elm, self.DebugFormatInt64(e)))
3641 cnt+=1
3642 cnt=0
3643 for e in self.update_version_:
3644 elm=""
3645 if printElemNumber: elm="(%d)" % cnt
3646 res+=prefix+("update_version%s: %s\n" % (elm, self.DebugFormatInt64(e)))
3647 cnt+=1
3648 cnt=0
3649 for e in self.insert_version_:
3650 elm=""
3651 if printElemNumber: elm="(%d)" % cnt
3652 res+=prefix+("insert_version%s: %s\n" % (elm, self.DebugFormatInt64(e)))
3653 cnt+=1
3654 cnt=0
3655 for e in self.insert_auto_id_version_:
3656 elm=""
3657 if printElemNumber: elm="(%d)" % cnt
3658 res+=prefix+("insert_auto_id_version%s: %s\n" % (elm, self.DebugFormatInt64(e)))
3659 cnt+=1
3660 cnt=0
3661 for e in self.delete_version_:
3662 elm=""
3663 if printElemNumber: elm="(%d)" % cnt
3664 res+=prefix+("delete_version%s: %s\n" % (elm, self.DebugFormatInt64(e)))
3665 cnt+=1
3666 return res
3669 def _BuildTagLookupTable(sparse, maxtag, default=None):
3670 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
3672 kindex_updates = 1
3673 kinsert_auto_id_key = 2
3674 kupsert_version = 3
3675 kupdate_version = 4
3676 kinsert_version = 5
3677 kinsert_auto_id_version = 6
3678 kdelete_version = 7
3680 _TEXT = _BuildTagLookupTable({
3681 0: "ErrorCode",
3682 1: "index_updates",
3683 2: "insert_auto_id_key",
3684 3: "upsert_version",
3685 4: "update_version",
3686 5: "insert_version",
3687 6: "insert_auto_id_version",
3688 7: "delete_version",
3689 }, 7)
3691 _TYPES = _BuildTagLookupTable({
3692 0: ProtocolBuffer.Encoder.NUMERIC,
3693 1: ProtocolBuffer.Encoder.NUMERIC,
3694 2: ProtocolBuffer.Encoder.STRING,
3695 3: ProtocolBuffer.Encoder.NUMERIC,
3696 4: ProtocolBuffer.Encoder.NUMERIC,
3697 5: ProtocolBuffer.Encoder.NUMERIC,
3698 6: ProtocolBuffer.Encoder.NUMERIC,
3699 7: ProtocolBuffer.Encoder.NUMERIC,
3700 }, 7, ProtocolBuffer.Encoder.MAX_TYPE)
3703 _STYLE = """"""
3704 _STYLE_CONTENT_TYPE = """"""
3705 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.MutationResult'
3706 _SERIALIZED_DESCRIPTOR = array.array('B')
3707 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uUmVzdWx0ExoNaW5kZXhfdXBkYXRlcyABKAAwBTgCFBMaEmluc2VydF9hdXRvX2lkX2tleSACKAIwCzgDShthcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LZXmjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoOdXBzZXJ0X3ZlcnNpb24gAygAMAM4AxQTGg51cGRhdGVfdmVyc2lvbiAEKAAwAzgDFBMaDmluc2VydF92ZXJzaW9uIAUoADADOAMUExoWaW5zZXJ0X2F1dG9faWRfdmVyc2lvbiAGKAAwAzgDFBMaDmRlbGV0ZV92ZXJzaW9uIAcoADADOAMUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
3708 if _net_proto___parse__python is not None:
3709 _net_proto___parse__python.RegisterType(
3710 _SERIALIZED_DESCRIPTOR.tostring())
3712 class ReadOptions(ProtocolBuffer.ProtocolMessage):
3715 DEFAULT = 0
3716 STRONG = 1
3717 EVENTUAL = 2
3719 _ReadConsistency_NAMES = {
3720 0: "DEFAULT",
3721 1: "STRONG",
3722 2: "EVENTUAL",
3725 def ReadConsistency_Name(cls, x): return cls._ReadConsistency_NAMES.get(x, "")
3726 ReadConsistency_Name = classmethod(ReadConsistency_Name)
3728 has_read_consistency_ = 0
3729 read_consistency_ = 0
3730 has_transaction_ = 0
3731 transaction_ = ""
3733 def __init__(self, contents=None):
3734 if contents is not None: self.MergeFromString(contents)
3736 def read_consistency(self): return self.read_consistency_
3738 def set_read_consistency(self, x):
3739 self.has_read_consistency_ = 1
3740 self.read_consistency_ = x
3742 def clear_read_consistency(self):
3743 if self.has_read_consistency_:
3744 self.has_read_consistency_ = 0
3745 self.read_consistency_ = 0
3747 def has_read_consistency(self): return self.has_read_consistency_
3749 def transaction(self): return self.transaction_
3751 def set_transaction(self, x):
3752 self.has_transaction_ = 1
3753 self.transaction_ = x
3755 def clear_transaction(self):
3756 if self.has_transaction_:
3757 self.has_transaction_ = 0
3758 self.transaction_ = ""
3760 def has_transaction(self): return self.has_transaction_
3763 def MergeFrom(self, x):
3764 assert x is not self
3765 if (x.has_read_consistency()): self.set_read_consistency(x.read_consistency())
3766 if (x.has_transaction()): self.set_transaction(x.transaction())
3768 if _net_proto___parse__python is not None:
3769 def _CMergeFromString(self, s):
3770 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.ReadOptions', s)
3772 if _net_proto___parse__python is not None:
3773 def _CEncode(self):
3774 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.ReadOptions')
3776 if _net_proto___parse__python is not None:
3777 def _CEncodePartial(self):
3778 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.ReadOptions')
3780 if _net_proto___parse__python is not None:
3781 def _CToASCII(self, output_format):
3782 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.ReadOptions', output_format)
3785 if _net_proto___parse__python is not None:
3786 def ParseASCII(self, s):
3787 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.ReadOptions', s)
3790 if _net_proto___parse__python is not None:
3791 def ParseASCIIIgnoreUnknown(self, s):
3792 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.ReadOptions', s)
3795 def Equals(self, x):
3796 if x is self: return 1
3797 if self.has_read_consistency_ != x.has_read_consistency_: return 0
3798 if self.has_read_consistency_ and self.read_consistency_ != x.read_consistency_: return 0
3799 if self.has_transaction_ != x.has_transaction_: return 0
3800 if self.has_transaction_ and self.transaction_ != x.transaction_: return 0
3801 return 1
3803 def IsInitialized(self, debug_strs=None):
3804 initialized = 1
3805 return initialized
3807 def ByteSize(self):
3808 n = 0
3809 if (self.has_read_consistency_): n += 1 + self.lengthVarInt64(self.read_consistency_)
3810 if (self.has_transaction_): n += 1 + self.lengthString(len(self.transaction_))
3811 return n
3813 def ByteSizePartial(self):
3814 n = 0
3815 if (self.has_read_consistency_): n += 1 + self.lengthVarInt64(self.read_consistency_)
3816 if (self.has_transaction_): n += 1 + self.lengthString(len(self.transaction_))
3817 return n
3819 def Clear(self):
3820 self.clear_read_consistency()
3821 self.clear_transaction()
3823 def OutputUnchecked(self, out):
3824 if (self.has_read_consistency_):
3825 out.putVarInt32(8)
3826 out.putVarInt32(self.read_consistency_)
3827 if (self.has_transaction_):
3828 out.putVarInt32(18)
3829 out.putPrefixedString(self.transaction_)
3831 def OutputPartial(self, out):
3832 if (self.has_read_consistency_):
3833 out.putVarInt32(8)
3834 out.putVarInt32(self.read_consistency_)
3835 if (self.has_transaction_):
3836 out.putVarInt32(18)
3837 out.putPrefixedString(self.transaction_)
3839 def TryMerge(self, d):
3840 while d.avail() > 0:
3841 tt = d.getVarInt32()
3842 if tt == 8:
3843 self.set_read_consistency(d.getVarInt32())
3844 continue
3845 if tt == 18:
3846 self.set_transaction(d.getPrefixedString())
3847 continue
3850 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
3851 d.skipData(tt)
3854 def __str__(self, prefix="", printElemNumber=0):
3855 res=""
3856 if self.has_read_consistency_: res+=prefix+("read_consistency: %s\n" % self.DebugFormatInt32(self.read_consistency_))
3857 if self.has_transaction_: res+=prefix+("transaction: %s\n" % self.DebugFormatString(self.transaction_))
3858 return res
3861 def _BuildTagLookupTable(sparse, maxtag, default=None):
3862 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
3864 kread_consistency = 1
3865 ktransaction = 2
3867 _TEXT = _BuildTagLookupTable({
3868 0: "ErrorCode",
3869 1: "read_consistency",
3870 2: "transaction",
3871 }, 2)
3873 _TYPES = _BuildTagLookupTable({
3874 0: ProtocolBuffer.Encoder.NUMERIC,
3875 1: ProtocolBuffer.Encoder.NUMERIC,
3876 2: ProtocolBuffer.Encoder.STRING,
3877 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
3880 _STYLE = """"""
3881 _STYLE_CONTENT_TYPE = """"""
3882 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.ReadOptions'
3883 _SERIALIZED_DESCRIPTOR = array.array('B')
3884 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KI2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJlYWRPcHRpb25zExoQcmVhZF9jb25zaXN0ZW5jeSABKAAwBTgBQgEwaACjAaoBB2RlZmF1bHSyAQdERUZBVUxUpAEUExoLdHJhbnNhY3Rpb24gAigCMAk4ARRzeg9SZWFkQ29uc2lzdGVuY3mLAZIBB0RFRkFVTFSYAQCMAYsBkgEGU1RST05HmAEBjAGLAZIBCEVWRU5UVUFMmAECjAF0wgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
3885 if _net_proto___parse__python is not None:
3886 _net_proto___parse__python.RegisterType(
3887 _SERIALIZED_DESCRIPTOR.tostring())
3889 class LookupRequest(ProtocolBuffer.ProtocolMessage):
3890 has_read_options_ = 0
3891 read_options_ = None
3893 def __init__(self, contents=None):
3894 self.key_ = []
3895 self.lazy_init_lock_ = thread.allocate_lock()
3896 if contents is not None: self.MergeFromString(contents)
3898 def read_options(self):
3899 if self.read_options_ is None:
3900 self.lazy_init_lock_.acquire()
3901 try:
3902 if self.read_options_ is None: self.read_options_ = ReadOptions()
3903 finally:
3904 self.lazy_init_lock_.release()
3905 return self.read_options_
3907 def mutable_read_options(self): self.has_read_options_ = 1; return self.read_options()
3909 def clear_read_options(self):
3911 if self.has_read_options_:
3912 self.has_read_options_ = 0;
3913 if self.read_options_ is not None: self.read_options_.Clear()
3915 def has_read_options(self): return self.has_read_options_
3917 def key_size(self): return len(self.key_)
3918 def key_list(self): return self.key_
3920 def key(self, i):
3921 return self.key_[i]
3923 def mutable_key(self, i):
3924 return self.key_[i]
3926 def add_key(self):
3927 x = google.appengine.datastore.entity_v4_pb.Key()
3928 self.key_.append(x)
3929 return x
3931 def clear_key(self):
3932 self.key_ = []
3934 def MergeFrom(self, x):
3935 assert x is not self
3936 if (x.has_read_options()): self.mutable_read_options().MergeFrom(x.read_options())
3937 for i in xrange(x.key_size()): self.add_key().CopyFrom(x.key(i))
3939 if _net_proto___parse__python is not None:
3940 def _CMergeFromString(self, s):
3941 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.LookupRequest', s)
3943 if _net_proto___parse__python is not None:
3944 def _CEncode(self):
3945 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.LookupRequest')
3947 if _net_proto___parse__python is not None:
3948 def _CEncodePartial(self):
3949 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.LookupRequest')
3951 if _net_proto___parse__python is not None:
3952 def _CToASCII(self, output_format):
3953 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.LookupRequest', output_format)
3956 if _net_proto___parse__python is not None:
3957 def ParseASCII(self, s):
3958 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.LookupRequest', s)
3961 if _net_proto___parse__python is not None:
3962 def ParseASCIIIgnoreUnknown(self, s):
3963 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.LookupRequest', s)
3966 def Equals(self, x):
3967 if x is self: return 1
3968 if self.has_read_options_ != x.has_read_options_: return 0
3969 if self.has_read_options_ and self.read_options_ != x.read_options_: return 0
3970 if len(self.key_) != len(x.key_): return 0
3971 for e1, e2 in zip(self.key_, x.key_):
3972 if e1 != e2: return 0
3973 return 1
3975 def IsInitialized(self, debug_strs=None):
3976 initialized = 1
3977 if (self.has_read_options_ and not self.read_options_.IsInitialized(debug_strs)): initialized = 0
3978 for p in self.key_:
3979 if not p.IsInitialized(debug_strs): initialized=0
3980 return initialized
3982 def ByteSize(self):
3983 n = 0
3984 if (self.has_read_options_): n += 1 + self.lengthString(self.read_options_.ByteSize())
3985 n += 1 * len(self.key_)
3986 for i in xrange(len(self.key_)): n += self.lengthString(self.key_[i].ByteSize())
3987 return n
3989 def ByteSizePartial(self):
3990 n = 0
3991 if (self.has_read_options_): n += 1 + self.lengthString(self.read_options_.ByteSizePartial())
3992 n += 1 * len(self.key_)
3993 for i in xrange(len(self.key_)): n += self.lengthString(self.key_[i].ByteSizePartial())
3994 return n
3996 def Clear(self):
3997 self.clear_read_options()
3998 self.clear_key()
4000 def OutputUnchecked(self, out):
4001 if (self.has_read_options_):
4002 out.putVarInt32(10)
4003 out.putVarInt32(self.read_options_.ByteSize())
4004 self.read_options_.OutputUnchecked(out)
4005 for i in xrange(len(self.key_)):
4006 out.putVarInt32(26)
4007 out.putVarInt32(self.key_[i].ByteSize())
4008 self.key_[i].OutputUnchecked(out)
4010 def OutputPartial(self, out):
4011 if (self.has_read_options_):
4012 out.putVarInt32(10)
4013 out.putVarInt32(self.read_options_.ByteSizePartial())
4014 self.read_options_.OutputPartial(out)
4015 for i in xrange(len(self.key_)):
4016 out.putVarInt32(26)
4017 out.putVarInt32(self.key_[i].ByteSizePartial())
4018 self.key_[i].OutputPartial(out)
4020 def TryMerge(self, d):
4021 while d.avail() > 0:
4022 tt = d.getVarInt32()
4023 if tt == 10:
4024 length = d.getVarInt32()
4025 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
4026 d.skip(length)
4027 self.mutable_read_options().TryMerge(tmp)
4028 continue
4029 if tt == 26:
4030 length = d.getVarInt32()
4031 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
4032 d.skip(length)
4033 self.add_key().TryMerge(tmp)
4034 continue
4037 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
4038 d.skipData(tt)
4041 def __str__(self, prefix="", printElemNumber=0):
4042 res=""
4043 if self.has_read_options_:
4044 res+=prefix+"read_options <\n"
4045 res+=self.read_options_.__str__(prefix + " ", printElemNumber)
4046 res+=prefix+">\n"
4047 cnt=0
4048 for e in self.key_:
4049 elm=""
4050 if printElemNumber: elm="(%d)" % cnt
4051 res+=prefix+("key%s <\n" % elm)
4052 res+=e.__str__(prefix + " ", printElemNumber)
4053 res+=prefix+">\n"
4054 cnt+=1
4055 return res
4058 def _BuildTagLookupTable(sparse, maxtag, default=None):
4059 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
4061 kread_options = 1
4062 kkey = 3
4064 _TEXT = _BuildTagLookupTable({
4065 0: "ErrorCode",
4066 1: "read_options",
4067 3: "key",
4068 }, 3)
4070 _TYPES = _BuildTagLookupTable({
4071 0: ProtocolBuffer.Encoder.NUMERIC,
4072 1: ProtocolBuffer.Encoder.STRING,
4073 3: ProtocolBuffer.Encoder.STRING,
4074 }, 3, ProtocolBuffer.Encoder.MAX_TYPE)
4077 _STYLE = """"""
4078 _STYLE_CONTENT_TYPE = """"""
4079 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.LookupRequest'
4080 _SERIALIZED_DESCRIPTOR = array.array('B')
4081 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lkxvb2t1cFJlcXVlc3QTGgxyZWFkX29wdGlvbnMgASgCMAs4AUojYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUmVhZE9wdGlvbnOjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoDa2V5IAMoAjALOANKG2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleaMBqgEFY3R5cGWyAQZwcm90bzKkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
4082 if _net_proto___parse__python is not None:
4083 _net_proto___parse__python.RegisterType(
4084 _SERIALIZED_DESCRIPTOR.tostring())
4086 class LookupResponse(ProtocolBuffer.ProtocolMessage):
4088 def __init__(self, contents=None):
4089 self.found_ = []
4090 self.missing_ = []
4091 self.deferred_ = []
4092 if contents is not None: self.MergeFromString(contents)
4094 def found_size(self): return len(self.found_)
4095 def found_list(self): return self.found_
4097 def found(self, i):
4098 return self.found_[i]
4100 def mutable_found(self, i):
4101 return self.found_[i]
4103 def add_found(self):
4104 x = EntityResult()
4105 self.found_.append(x)
4106 return x
4108 def clear_found(self):
4109 self.found_ = []
4110 def missing_size(self): return len(self.missing_)
4111 def missing_list(self): return self.missing_
4113 def missing(self, i):
4114 return self.missing_[i]
4116 def mutable_missing(self, i):
4117 return self.missing_[i]
4119 def add_missing(self):
4120 x = EntityResult()
4121 self.missing_.append(x)
4122 return x
4124 def clear_missing(self):
4125 self.missing_ = []
4126 def deferred_size(self): return len(self.deferred_)
4127 def deferred_list(self): return self.deferred_
4129 def deferred(self, i):
4130 return self.deferred_[i]
4132 def mutable_deferred(self, i):
4133 return self.deferred_[i]
4135 def add_deferred(self):
4136 x = google.appengine.datastore.entity_v4_pb.Key()
4137 self.deferred_.append(x)
4138 return x
4140 def clear_deferred(self):
4141 self.deferred_ = []
4143 def MergeFrom(self, x):
4144 assert x is not self
4145 for i in xrange(x.found_size()): self.add_found().CopyFrom(x.found(i))
4146 for i in xrange(x.missing_size()): self.add_missing().CopyFrom(x.missing(i))
4147 for i in xrange(x.deferred_size()): self.add_deferred().CopyFrom(x.deferred(i))
4149 if _net_proto___parse__python is not None:
4150 def _CMergeFromString(self, s):
4151 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.LookupResponse', s)
4153 if _net_proto___parse__python is not None:
4154 def _CEncode(self):
4155 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.LookupResponse')
4157 if _net_proto___parse__python is not None:
4158 def _CEncodePartial(self):
4159 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.LookupResponse')
4161 if _net_proto___parse__python is not None:
4162 def _CToASCII(self, output_format):
4163 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.LookupResponse', output_format)
4166 if _net_proto___parse__python is not None:
4167 def ParseASCII(self, s):
4168 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.LookupResponse', s)
4171 if _net_proto___parse__python is not None:
4172 def ParseASCIIIgnoreUnknown(self, s):
4173 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.LookupResponse', s)
4176 def Equals(self, x):
4177 if x is self: return 1
4178 if len(self.found_) != len(x.found_): return 0
4179 for e1, e2 in zip(self.found_, x.found_):
4180 if e1 != e2: return 0
4181 if len(self.missing_) != len(x.missing_): return 0
4182 for e1, e2 in zip(self.missing_, x.missing_):
4183 if e1 != e2: return 0
4184 if len(self.deferred_) != len(x.deferred_): return 0
4185 for e1, e2 in zip(self.deferred_, x.deferred_):
4186 if e1 != e2: return 0
4187 return 1
4189 def IsInitialized(self, debug_strs=None):
4190 initialized = 1
4191 for p in self.found_:
4192 if not p.IsInitialized(debug_strs): initialized=0
4193 for p in self.missing_:
4194 if not p.IsInitialized(debug_strs): initialized=0
4195 for p in self.deferred_:
4196 if not p.IsInitialized(debug_strs): initialized=0
4197 return initialized
4199 def ByteSize(self):
4200 n = 0
4201 n += 1 * len(self.found_)
4202 for i in xrange(len(self.found_)): n += self.lengthString(self.found_[i].ByteSize())
4203 n += 1 * len(self.missing_)
4204 for i in xrange(len(self.missing_)): n += self.lengthString(self.missing_[i].ByteSize())
4205 n += 1 * len(self.deferred_)
4206 for i in xrange(len(self.deferred_)): n += self.lengthString(self.deferred_[i].ByteSize())
4207 return n
4209 def ByteSizePartial(self):
4210 n = 0
4211 n += 1 * len(self.found_)
4212 for i in xrange(len(self.found_)): n += self.lengthString(self.found_[i].ByteSizePartial())
4213 n += 1 * len(self.missing_)
4214 for i in xrange(len(self.missing_)): n += self.lengthString(self.missing_[i].ByteSizePartial())
4215 n += 1 * len(self.deferred_)
4216 for i in xrange(len(self.deferred_)): n += self.lengthString(self.deferred_[i].ByteSizePartial())
4217 return n
4219 def Clear(self):
4220 self.clear_found()
4221 self.clear_missing()
4222 self.clear_deferred()
4224 def OutputUnchecked(self, out):
4225 for i in xrange(len(self.found_)):
4226 out.putVarInt32(10)
4227 out.putVarInt32(self.found_[i].ByteSize())
4228 self.found_[i].OutputUnchecked(out)
4229 for i in xrange(len(self.missing_)):
4230 out.putVarInt32(18)
4231 out.putVarInt32(self.missing_[i].ByteSize())
4232 self.missing_[i].OutputUnchecked(out)
4233 for i in xrange(len(self.deferred_)):
4234 out.putVarInt32(26)
4235 out.putVarInt32(self.deferred_[i].ByteSize())
4236 self.deferred_[i].OutputUnchecked(out)
4238 def OutputPartial(self, out):
4239 for i in xrange(len(self.found_)):
4240 out.putVarInt32(10)
4241 out.putVarInt32(self.found_[i].ByteSizePartial())
4242 self.found_[i].OutputPartial(out)
4243 for i in xrange(len(self.missing_)):
4244 out.putVarInt32(18)
4245 out.putVarInt32(self.missing_[i].ByteSizePartial())
4246 self.missing_[i].OutputPartial(out)
4247 for i in xrange(len(self.deferred_)):
4248 out.putVarInt32(26)
4249 out.putVarInt32(self.deferred_[i].ByteSizePartial())
4250 self.deferred_[i].OutputPartial(out)
4252 def TryMerge(self, d):
4253 while d.avail() > 0:
4254 tt = d.getVarInt32()
4255 if tt == 10:
4256 length = d.getVarInt32()
4257 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
4258 d.skip(length)
4259 self.add_found().TryMerge(tmp)
4260 continue
4261 if tt == 18:
4262 length = d.getVarInt32()
4263 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
4264 d.skip(length)
4265 self.add_missing().TryMerge(tmp)
4266 continue
4267 if tt == 26:
4268 length = d.getVarInt32()
4269 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
4270 d.skip(length)
4271 self.add_deferred().TryMerge(tmp)
4272 continue
4275 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
4276 d.skipData(tt)
4279 def __str__(self, prefix="", printElemNumber=0):
4280 res=""
4281 cnt=0
4282 for e in self.found_:
4283 elm=""
4284 if printElemNumber: elm="(%d)" % cnt
4285 res+=prefix+("found%s <\n" % elm)
4286 res+=e.__str__(prefix + " ", printElemNumber)
4287 res+=prefix+">\n"
4288 cnt+=1
4289 cnt=0
4290 for e in self.missing_:
4291 elm=""
4292 if printElemNumber: elm="(%d)" % cnt
4293 res+=prefix+("missing%s <\n" % elm)
4294 res+=e.__str__(prefix + " ", printElemNumber)
4295 res+=prefix+">\n"
4296 cnt+=1
4297 cnt=0
4298 for e in self.deferred_:
4299 elm=""
4300 if printElemNumber: elm="(%d)" % cnt
4301 res+=prefix+("deferred%s <\n" % elm)
4302 res+=e.__str__(prefix + " ", printElemNumber)
4303 res+=prefix+">\n"
4304 cnt+=1
4305 return res
4308 def _BuildTagLookupTable(sparse, maxtag, default=None):
4309 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
4311 kfound = 1
4312 kmissing = 2
4313 kdeferred = 3
4315 _TEXT = _BuildTagLookupTable({
4316 0: "ErrorCode",
4317 1: "found",
4318 2: "missing",
4319 3: "deferred",
4320 }, 3)
4322 _TYPES = _BuildTagLookupTable({
4323 0: ProtocolBuffer.Encoder.NUMERIC,
4324 1: ProtocolBuffer.Encoder.STRING,
4325 2: ProtocolBuffer.Encoder.STRING,
4326 3: ProtocolBuffer.Encoder.STRING,
4327 }, 3, ProtocolBuffer.Encoder.MAX_TYPE)
4330 _STYLE = """"""
4331 _STYLE_CONTENT_TYPE = """"""
4332 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.LookupResponse'
4333 _SERIALIZED_DESCRIPTOR = array.array('B')
4334 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lkxvb2t1cFJlc3BvbnNlExoFZm91bmQgASgCMAs4A0okYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5UmVzdWx0owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaB21pc3NpbmcgAigCMAs4A0okYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5UmVzdWx0owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaCGRlZmVycmVkIAMoAjALOANKG2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleaMBqgEFY3R5cGWyAQZwcm90bzKkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
4335 if _net_proto___parse__python is not None:
4336 _net_proto___parse__python.RegisterType(
4337 _SERIALIZED_DESCRIPTOR.tostring())
4339 class RunQueryRequest(ProtocolBuffer.ProtocolMessage):
4340 has_read_options_ = 0
4341 read_options_ = None
4342 has_partition_id_ = 0
4343 partition_id_ = None
4344 has_query_ = 0
4345 query_ = None
4346 has_gql_query_ = 0
4347 gql_query_ = None
4348 has_min_safe_time_seconds_ = 0
4349 min_safe_time_seconds_ = 0
4350 has_suggested_batch_size_ = 0
4351 suggested_batch_size_ = 0
4353 def __init__(self, contents=None):
4354 self.lazy_init_lock_ = thread.allocate_lock()
4355 if contents is not None: self.MergeFromString(contents)
4357 def read_options(self):
4358 if self.read_options_ is None:
4359 self.lazy_init_lock_.acquire()
4360 try:
4361 if self.read_options_ is None: self.read_options_ = ReadOptions()
4362 finally:
4363 self.lazy_init_lock_.release()
4364 return self.read_options_
4366 def mutable_read_options(self): self.has_read_options_ = 1; return self.read_options()
4368 def clear_read_options(self):
4370 if self.has_read_options_:
4371 self.has_read_options_ = 0;
4372 if self.read_options_ is not None: self.read_options_.Clear()
4374 def has_read_options(self): return self.has_read_options_
4376 def partition_id(self):
4377 if self.partition_id_ is None:
4378 self.lazy_init_lock_.acquire()
4379 try:
4380 if self.partition_id_ is None: self.partition_id_ = google.appengine.datastore.entity_v4_pb.PartitionId()
4381 finally:
4382 self.lazy_init_lock_.release()
4383 return self.partition_id_
4385 def mutable_partition_id(self): self.has_partition_id_ = 1; return self.partition_id()
4387 def clear_partition_id(self):
4389 if self.has_partition_id_:
4390 self.has_partition_id_ = 0;
4391 if self.partition_id_ is not None: self.partition_id_.Clear()
4393 def has_partition_id(self): return self.has_partition_id_
4395 def query(self):
4396 if self.query_ is None:
4397 self.lazy_init_lock_.acquire()
4398 try:
4399 if self.query_ is None: self.query_ = Query()
4400 finally:
4401 self.lazy_init_lock_.release()
4402 return self.query_
4404 def mutable_query(self): self.has_query_ = 1; return self.query()
4406 def clear_query(self):
4408 if self.has_query_:
4409 self.has_query_ = 0;
4410 if self.query_ is not None: self.query_.Clear()
4412 def has_query(self): return self.has_query_
4414 def gql_query(self):
4415 if self.gql_query_ is None:
4416 self.lazy_init_lock_.acquire()
4417 try:
4418 if self.gql_query_ is None: self.gql_query_ = GqlQuery()
4419 finally:
4420 self.lazy_init_lock_.release()
4421 return self.gql_query_
4423 def mutable_gql_query(self): self.has_gql_query_ = 1; return self.gql_query()
4425 def clear_gql_query(self):
4427 if self.has_gql_query_:
4428 self.has_gql_query_ = 0;
4429 if self.gql_query_ is not None: self.gql_query_.Clear()
4431 def has_gql_query(self): return self.has_gql_query_
4433 def min_safe_time_seconds(self): return self.min_safe_time_seconds_
4435 def set_min_safe_time_seconds(self, x):
4436 self.has_min_safe_time_seconds_ = 1
4437 self.min_safe_time_seconds_ = x
4439 def clear_min_safe_time_seconds(self):
4440 if self.has_min_safe_time_seconds_:
4441 self.has_min_safe_time_seconds_ = 0
4442 self.min_safe_time_seconds_ = 0
4444 def has_min_safe_time_seconds(self): return self.has_min_safe_time_seconds_
4446 def suggested_batch_size(self): return self.suggested_batch_size_
4448 def set_suggested_batch_size(self, x):
4449 self.has_suggested_batch_size_ = 1
4450 self.suggested_batch_size_ = x
4452 def clear_suggested_batch_size(self):
4453 if self.has_suggested_batch_size_:
4454 self.has_suggested_batch_size_ = 0
4455 self.suggested_batch_size_ = 0
4457 def has_suggested_batch_size(self): return self.has_suggested_batch_size_
4460 def MergeFrom(self, x):
4461 assert x is not self
4462 if (x.has_read_options()): self.mutable_read_options().MergeFrom(x.read_options())
4463 if (x.has_partition_id()): self.mutable_partition_id().MergeFrom(x.partition_id())
4464 if (x.has_query()): self.mutable_query().MergeFrom(x.query())
4465 if (x.has_gql_query()): self.mutable_gql_query().MergeFrom(x.gql_query())
4466 if (x.has_min_safe_time_seconds()): self.set_min_safe_time_seconds(x.min_safe_time_seconds())
4467 if (x.has_suggested_batch_size()): self.set_suggested_batch_size(x.suggested_batch_size())
4469 if _net_proto___parse__python is not None:
4470 def _CMergeFromString(self, s):
4471 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.RunQueryRequest', s)
4473 if _net_proto___parse__python is not None:
4474 def _CEncode(self):
4475 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.RunQueryRequest')
4477 if _net_proto___parse__python is not None:
4478 def _CEncodePartial(self):
4479 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.RunQueryRequest')
4481 if _net_proto___parse__python is not None:
4482 def _CToASCII(self, output_format):
4483 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.RunQueryRequest', output_format)
4486 if _net_proto___parse__python is not None:
4487 def ParseASCII(self, s):
4488 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.RunQueryRequest', s)
4491 if _net_proto___parse__python is not None:
4492 def ParseASCIIIgnoreUnknown(self, s):
4493 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.RunQueryRequest', s)
4496 def Equals(self, x):
4497 if x is self: return 1
4498 if self.has_read_options_ != x.has_read_options_: return 0
4499 if self.has_read_options_ and self.read_options_ != x.read_options_: return 0
4500 if self.has_partition_id_ != x.has_partition_id_: return 0
4501 if self.has_partition_id_ and self.partition_id_ != x.partition_id_: return 0
4502 if self.has_query_ != x.has_query_: return 0
4503 if self.has_query_ and self.query_ != x.query_: return 0
4504 if self.has_gql_query_ != x.has_gql_query_: return 0
4505 if self.has_gql_query_ and self.gql_query_ != x.gql_query_: return 0
4506 if self.has_min_safe_time_seconds_ != x.has_min_safe_time_seconds_: return 0
4507 if self.has_min_safe_time_seconds_ and self.min_safe_time_seconds_ != x.min_safe_time_seconds_: return 0
4508 if self.has_suggested_batch_size_ != x.has_suggested_batch_size_: return 0
4509 if self.has_suggested_batch_size_ and self.suggested_batch_size_ != x.suggested_batch_size_: return 0
4510 return 1
4512 def IsInitialized(self, debug_strs=None):
4513 initialized = 1
4514 if (self.has_read_options_ and not self.read_options_.IsInitialized(debug_strs)): initialized = 0
4515 if (self.has_partition_id_ and not self.partition_id_.IsInitialized(debug_strs)): initialized = 0
4516 if (self.has_query_ and not self.query_.IsInitialized(debug_strs)): initialized = 0
4517 if (self.has_gql_query_ and not self.gql_query_.IsInitialized(debug_strs)): initialized = 0
4518 return initialized
4520 def ByteSize(self):
4521 n = 0
4522 if (self.has_read_options_): n += 1 + self.lengthString(self.read_options_.ByteSize())
4523 if (self.has_partition_id_): n += 1 + self.lengthString(self.partition_id_.ByteSize())
4524 if (self.has_query_): n += 1 + self.lengthString(self.query_.ByteSize())
4525 if (self.has_gql_query_): n += 1 + self.lengthString(self.gql_query_.ByteSize())
4526 if (self.has_min_safe_time_seconds_): n += 1 + self.lengthVarInt64(self.min_safe_time_seconds_)
4527 if (self.has_suggested_batch_size_): n += 1 + self.lengthVarInt64(self.suggested_batch_size_)
4528 return n
4530 def ByteSizePartial(self):
4531 n = 0
4532 if (self.has_read_options_): n += 1 + self.lengthString(self.read_options_.ByteSizePartial())
4533 if (self.has_partition_id_): n += 1 + self.lengthString(self.partition_id_.ByteSizePartial())
4534 if (self.has_query_): n += 1 + self.lengthString(self.query_.ByteSizePartial())
4535 if (self.has_gql_query_): n += 1 + self.lengthString(self.gql_query_.ByteSizePartial())
4536 if (self.has_min_safe_time_seconds_): n += 1 + self.lengthVarInt64(self.min_safe_time_seconds_)
4537 if (self.has_suggested_batch_size_): n += 1 + self.lengthVarInt64(self.suggested_batch_size_)
4538 return n
4540 def Clear(self):
4541 self.clear_read_options()
4542 self.clear_partition_id()
4543 self.clear_query()
4544 self.clear_gql_query()
4545 self.clear_min_safe_time_seconds()
4546 self.clear_suggested_batch_size()
4548 def OutputUnchecked(self, out):
4549 if (self.has_read_options_):
4550 out.putVarInt32(10)
4551 out.putVarInt32(self.read_options_.ByteSize())
4552 self.read_options_.OutputUnchecked(out)
4553 if (self.has_partition_id_):
4554 out.putVarInt32(18)
4555 out.putVarInt32(self.partition_id_.ByteSize())
4556 self.partition_id_.OutputUnchecked(out)
4557 if (self.has_query_):
4558 out.putVarInt32(26)
4559 out.putVarInt32(self.query_.ByteSize())
4560 self.query_.OutputUnchecked(out)
4561 if (self.has_min_safe_time_seconds_):
4562 out.putVarInt32(32)
4563 out.putVarInt64(self.min_safe_time_seconds_)
4564 if (self.has_suggested_batch_size_):
4565 out.putVarInt32(40)
4566 out.putVarInt32(self.suggested_batch_size_)
4567 if (self.has_gql_query_):
4568 out.putVarInt32(58)
4569 out.putVarInt32(self.gql_query_.ByteSize())
4570 self.gql_query_.OutputUnchecked(out)
4572 def OutputPartial(self, out):
4573 if (self.has_read_options_):
4574 out.putVarInt32(10)
4575 out.putVarInt32(self.read_options_.ByteSizePartial())
4576 self.read_options_.OutputPartial(out)
4577 if (self.has_partition_id_):
4578 out.putVarInt32(18)
4579 out.putVarInt32(self.partition_id_.ByteSizePartial())
4580 self.partition_id_.OutputPartial(out)
4581 if (self.has_query_):
4582 out.putVarInt32(26)
4583 out.putVarInt32(self.query_.ByteSizePartial())
4584 self.query_.OutputPartial(out)
4585 if (self.has_min_safe_time_seconds_):
4586 out.putVarInt32(32)
4587 out.putVarInt64(self.min_safe_time_seconds_)
4588 if (self.has_suggested_batch_size_):
4589 out.putVarInt32(40)
4590 out.putVarInt32(self.suggested_batch_size_)
4591 if (self.has_gql_query_):
4592 out.putVarInt32(58)
4593 out.putVarInt32(self.gql_query_.ByteSizePartial())
4594 self.gql_query_.OutputPartial(out)
4596 def TryMerge(self, d):
4597 while d.avail() > 0:
4598 tt = d.getVarInt32()
4599 if tt == 10:
4600 length = d.getVarInt32()
4601 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
4602 d.skip(length)
4603 self.mutable_read_options().TryMerge(tmp)
4604 continue
4605 if tt == 18:
4606 length = d.getVarInt32()
4607 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
4608 d.skip(length)
4609 self.mutable_partition_id().TryMerge(tmp)
4610 continue
4611 if tt == 26:
4612 length = d.getVarInt32()
4613 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
4614 d.skip(length)
4615 self.mutable_query().TryMerge(tmp)
4616 continue
4617 if tt == 32:
4618 self.set_min_safe_time_seconds(d.getVarInt64())
4619 continue
4620 if tt == 40:
4621 self.set_suggested_batch_size(d.getVarInt32())
4622 continue
4623 if tt == 58:
4624 length = d.getVarInt32()
4625 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
4626 d.skip(length)
4627 self.mutable_gql_query().TryMerge(tmp)
4628 continue
4631 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
4632 d.skipData(tt)
4635 def __str__(self, prefix="", printElemNumber=0):
4636 res=""
4637 if self.has_read_options_:
4638 res+=prefix+"read_options <\n"
4639 res+=self.read_options_.__str__(prefix + " ", printElemNumber)
4640 res+=prefix+">\n"
4641 if self.has_partition_id_:
4642 res+=prefix+"partition_id <\n"
4643 res+=self.partition_id_.__str__(prefix + " ", printElemNumber)
4644 res+=prefix+">\n"
4645 if self.has_query_:
4646 res+=prefix+"query <\n"
4647 res+=self.query_.__str__(prefix + " ", printElemNumber)
4648 res+=prefix+">\n"
4649 if self.has_gql_query_:
4650 res+=prefix+"gql_query <\n"
4651 res+=self.gql_query_.__str__(prefix + " ", printElemNumber)
4652 res+=prefix+">\n"
4653 if self.has_min_safe_time_seconds_: res+=prefix+("min_safe_time_seconds: %s\n" % self.DebugFormatInt64(self.min_safe_time_seconds_))
4654 if self.has_suggested_batch_size_: res+=prefix+("suggested_batch_size: %s\n" % self.DebugFormatInt32(self.suggested_batch_size_))
4655 return res
4658 def _BuildTagLookupTable(sparse, maxtag, default=None):
4659 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
4661 kread_options = 1
4662 kpartition_id = 2
4663 kquery = 3
4664 kgql_query = 7
4665 kmin_safe_time_seconds = 4
4666 ksuggested_batch_size = 5
4668 _TEXT = _BuildTagLookupTable({
4669 0: "ErrorCode",
4670 1: "read_options",
4671 2: "partition_id",
4672 3: "query",
4673 4: "min_safe_time_seconds",
4674 5: "suggested_batch_size",
4675 7: "gql_query",
4676 }, 7)
4678 _TYPES = _BuildTagLookupTable({
4679 0: ProtocolBuffer.Encoder.NUMERIC,
4680 1: ProtocolBuffer.Encoder.STRING,
4681 2: ProtocolBuffer.Encoder.STRING,
4682 3: ProtocolBuffer.Encoder.STRING,
4683 4: ProtocolBuffer.Encoder.NUMERIC,
4684 5: ProtocolBuffer.Encoder.NUMERIC,
4685 7: ProtocolBuffer.Encoder.STRING,
4686 }, 7, ProtocolBuffer.Encoder.MAX_TYPE)
4689 _STYLE = """"""
4690 _STYLE_CONTENT_TYPE = """"""
4691 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.RunQueryRequest'
4692 _SERIALIZED_DESCRIPTOR = array.array('B')
4693 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJ2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJ1blF1ZXJ5UmVxdWVzdBMaDHJlYWRfb3B0aW9ucyABKAIwCzgBSiNhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5SZWFkT3B0aW9uc6MBqgEFY3R5cGWyAQZwcm90bzKkARQTGgxwYXJ0aXRpb25faWQgAigCMAs4AUojYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUGFydGl0aW9uSWSjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoFcXVlcnkgAygCMAs4AUodYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUXVlcnmjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoJZ3FsX3F1ZXJ5IAcoAjALOAFKIGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkdxbFF1ZXJ5owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaFW1pbl9zYWZlX3RpbWVfc2Vjb25kcyAEKAAwAzgBFBMaFHN1Z2dlc3RlZF9iYXRjaF9zaXplIAUoADAFOAEUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
4694 if _net_proto___parse__python is not None:
4695 _net_proto___parse__python.RegisterType(
4696 _SERIALIZED_DESCRIPTOR.tostring())
4698 class RunQueryResponse(ProtocolBuffer.ProtocolMessage):
4699 has_batch_ = 0
4700 has_query_handle_ = 0
4701 query_handle_ = ""
4703 def __init__(self, contents=None):
4704 self.batch_ = QueryResultBatch()
4705 if contents is not None: self.MergeFromString(contents)
4707 def batch(self): return self.batch_
4709 def mutable_batch(self): self.has_batch_ = 1; return self.batch_
4711 def clear_batch(self):self.has_batch_ = 0; self.batch_.Clear()
4713 def has_batch(self): return self.has_batch_
4715 def query_handle(self): return self.query_handle_
4717 def set_query_handle(self, x):
4718 self.has_query_handle_ = 1
4719 self.query_handle_ = x
4721 def clear_query_handle(self):
4722 if self.has_query_handle_:
4723 self.has_query_handle_ = 0
4724 self.query_handle_ = ""
4726 def has_query_handle(self): return self.has_query_handle_
4729 def MergeFrom(self, x):
4730 assert x is not self
4731 if (x.has_batch()): self.mutable_batch().MergeFrom(x.batch())
4732 if (x.has_query_handle()): self.set_query_handle(x.query_handle())
4734 if _net_proto___parse__python is not None:
4735 def _CMergeFromString(self, s):
4736 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.RunQueryResponse', s)
4738 if _net_proto___parse__python is not None:
4739 def _CEncode(self):
4740 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.RunQueryResponse')
4742 if _net_proto___parse__python is not None:
4743 def _CEncodePartial(self):
4744 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.RunQueryResponse')
4746 if _net_proto___parse__python is not None:
4747 def _CToASCII(self, output_format):
4748 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.RunQueryResponse', output_format)
4751 if _net_proto___parse__python is not None:
4752 def ParseASCII(self, s):
4753 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.RunQueryResponse', s)
4756 if _net_proto___parse__python is not None:
4757 def ParseASCIIIgnoreUnknown(self, s):
4758 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.RunQueryResponse', s)
4761 def Equals(self, x):
4762 if x is self: return 1
4763 if self.has_batch_ != x.has_batch_: return 0
4764 if self.has_batch_ and self.batch_ != x.batch_: return 0
4765 if self.has_query_handle_ != x.has_query_handle_: return 0
4766 if self.has_query_handle_ and self.query_handle_ != x.query_handle_: return 0
4767 return 1
4769 def IsInitialized(self, debug_strs=None):
4770 initialized = 1
4771 if (not self.has_batch_):
4772 initialized = 0
4773 if debug_strs is not None:
4774 debug_strs.append('Required field: batch not set.')
4775 elif not self.batch_.IsInitialized(debug_strs): initialized = 0
4776 return initialized
4778 def ByteSize(self):
4779 n = 0
4780 n += self.lengthString(self.batch_.ByteSize())
4781 if (self.has_query_handle_): n += 1 + self.lengthString(len(self.query_handle_))
4782 return n + 1
4784 def ByteSizePartial(self):
4785 n = 0
4786 if (self.has_batch_):
4787 n += 1
4788 n += self.lengthString(self.batch_.ByteSizePartial())
4789 if (self.has_query_handle_): n += 1 + self.lengthString(len(self.query_handle_))
4790 return n
4792 def Clear(self):
4793 self.clear_batch()
4794 self.clear_query_handle()
4796 def OutputUnchecked(self, out):
4797 out.putVarInt32(10)
4798 out.putVarInt32(self.batch_.ByteSize())
4799 self.batch_.OutputUnchecked(out)
4800 if (self.has_query_handle_):
4801 out.putVarInt32(18)
4802 out.putPrefixedString(self.query_handle_)
4804 def OutputPartial(self, out):
4805 if (self.has_batch_):
4806 out.putVarInt32(10)
4807 out.putVarInt32(self.batch_.ByteSizePartial())
4808 self.batch_.OutputPartial(out)
4809 if (self.has_query_handle_):
4810 out.putVarInt32(18)
4811 out.putPrefixedString(self.query_handle_)
4813 def TryMerge(self, d):
4814 while d.avail() > 0:
4815 tt = d.getVarInt32()
4816 if tt == 10:
4817 length = d.getVarInt32()
4818 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
4819 d.skip(length)
4820 self.mutable_batch().TryMerge(tmp)
4821 continue
4822 if tt == 18:
4823 self.set_query_handle(d.getPrefixedString())
4824 continue
4827 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
4828 d.skipData(tt)
4831 def __str__(self, prefix="", printElemNumber=0):
4832 res=""
4833 if self.has_batch_:
4834 res+=prefix+"batch <\n"
4835 res+=self.batch_.__str__(prefix + " ", printElemNumber)
4836 res+=prefix+">\n"
4837 if self.has_query_handle_: res+=prefix+("query_handle: %s\n" % self.DebugFormatString(self.query_handle_))
4838 return res
4841 def _BuildTagLookupTable(sparse, maxtag, default=None):
4842 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
4844 kbatch = 1
4845 kquery_handle = 2
4847 _TEXT = _BuildTagLookupTable({
4848 0: "ErrorCode",
4849 1: "batch",
4850 2: "query_handle",
4851 }, 2)
4853 _TYPES = _BuildTagLookupTable({
4854 0: ProtocolBuffer.Encoder.NUMERIC,
4855 1: ProtocolBuffer.Encoder.STRING,
4856 2: ProtocolBuffer.Encoder.STRING,
4857 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
4860 _STYLE = """"""
4861 _STYLE_CONTENT_TYPE = """"""
4862 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.RunQueryResponse'
4863 _SERIALIZED_DESCRIPTOR = array.array('B')
4864 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJ1blF1ZXJ5UmVzcG9uc2UTGgViYXRjaCABKAIwCzgCSihhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5RdWVyeVJlc3VsdEJhdGNoowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaDHF1ZXJ5X2hhbmRsZSACKAIwCTgBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
4865 if _net_proto___parse__python is not None:
4866 _net_proto___parse__python.RegisterType(
4867 _SERIALIZED_DESCRIPTOR.tostring())
4869 class ContinueQueryRequest(ProtocolBuffer.ProtocolMessage):
4870 has_query_handle_ = 0
4871 query_handle_ = ""
4873 def __init__(self, contents=None):
4874 if contents is not None: self.MergeFromString(contents)
4876 def query_handle(self): return self.query_handle_
4878 def set_query_handle(self, x):
4879 self.has_query_handle_ = 1
4880 self.query_handle_ = x
4882 def clear_query_handle(self):
4883 if self.has_query_handle_:
4884 self.has_query_handle_ = 0
4885 self.query_handle_ = ""
4887 def has_query_handle(self): return self.has_query_handle_
4890 def MergeFrom(self, x):
4891 assert x is not self
4892 if (x.has_query_handle()): self.set_query_handle(x.query_handle())
4894 if _net_proto___parse__python is not None:
4895 def _CMergeFromString(self, s):
4896 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.ContinueQueryRequest', s)
4898 if _net_proto___parse__python is not None:
4899 def _CEncode(self):
4900 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.ContinueQueryRequest')
4902 if _net_proto___parse__python is not None:
4903 def _CEncodePartial(self):
4904 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.ContinueQueryRequest')
4906 if _net_proto___parse__python is not None:
4907 def _CToASCII(self, output_format):
4908 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.ContinueQueryRequest', output_format)
4911 if _net_proto___parse__python is not None:
4912 def ParseASCII(self, s):
4913 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.ContinueQueryRequest', s)
4916 if _net_proto___parse__python is not None:
4917 def ParseASCIIIgnoreUnknown(self, s):
4918 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.ContinueQueryRequest', s)
4921 def Equals(self, x):
4922 if x is self: return 1
4923 if self.has_query_handle_ != x.has_query_handle_: return 0
4924 if self.has_query_handle_ and self.query_handle_ != x.query_handle_: return 0
4925 return 1
4927 def IsInitialized(self, debug_strs=None):
4928 initialized = 1
4929 if (not self.has_query_handle_):
4930 initialized = 0
4931 if debug_strs is not None:
4932 debug_strs.append('Required field: query_handle not set.')
4933 return initialized
4935 def ByteSize(self):
4936 n = 0
4937 n += self.lengthString(len(self.query_handle_))
4938 return n + 1
4940 def ByteSizePartial(self):
4941 n = 0
4942 if (self.has_query_handle_):
4943 n += 1
4944 n += self.lengthString(len(self.query_handle_))
4945 return n
4947 def Clear(self):
4948 self.clear_query_handle()
4950 def OutputUnchecked(self, out):
4951 out.putVarInt32(10)
4952 out.putPrefixedString(self.query_handle_)
4954 def OutputPartial(self, out):
4955 if (self.has_query_handle_):
4956 out.putVarInt32(10)
4957 out.putPrefixedString(self.query_handle_)
4959 def TryMerge(self, d):
4960 while d.avail() > 0:
4961 tt = d.getVarInt32()
4962 if tt == 10:
4963 self.set_query_handle(d.getPrefixedString())
4964 continue
4967 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
4968 d.skipData(tt)
4971 def __str__(self, prefix="", printElemNumber=0):
4972 res=""
4973 if self.has_query_handle_: res+=prefix+("query_handle: %s\n" % self.DebugFormatString(self.query_handle_))
4974 return res
4977 def _BuildTagLookupTable(sparse, maxtag, default=None):
4978 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
4980 kquery_handle = 1
4982 _TEXT = _BuildTagLookupTable({
4983 0: "ErrorCode",
4984 1: "query_handle",
4985 }, 1)
4987 _TYPES = _BuildTagLookupTable({
4988 0: ProtocolBuffer.Encoder.NUMERIC,
4989 1: ProtocolBuffer.Encoder.STRING,
4990 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
4993 _STYLE = """"""
4994 _STYLE_CONTENT_TYPE = """"""
4995 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.ContinueQueryRequest'
4996 _SERIALIZED_DESCRIPTOR = array.array('B')
4997 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KLGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbnRpbnVlUXVlcnlSZXF1ZXN0ExoMcXVlcnlfaGFuZGxlIAEoAjAJOAIUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
4998 if _net_proto___parse__python is not None:
4999 _net_proto___parse__python.RegisterType(
5000 _SERIALIZED_DESCRIPTOR.tostring())
5002 class ContinueQueryResponse(ProtocolBuffer.ProtocolMessage):
5003 has_batch_ = 0
5005 def __init__(self, contents=None):
5006 self.batch_ = QueryResultBatch()
5007 if contents is not None: self.MergeFromString(contents)
5009 def batch(self): return self.batch_
5011 def mutable_batch(self): self.has_batch_ = 1; return self.batch_
5013 def clear_batch(self):self.has_batch_ = 0; self.batch_.Clear()
5015 def has_batch(self): return self.has_batch_
5018 def MergeFrom(self, x):
5019 assert x is not self
5020 if (x.has_batch()): self.mutable_batch().MergeFrom(x.batch())
5022 if _net_proto___parse__python is not None:
5023 def _CMergeFromString(self, s):
5024 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.ContinueQueryResponse', s)
5026 if _net_proto___parse__python is not None:
5027 def _CEncode(self):
5028 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.ContinueQueryResponse')
5030 if _net_proto___parse__python is not None:
5031 def _CEncodePartial(self):
5032 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.ContinueQueryResponse')
5034 if _net_proto___parse__python is not None:
5035 def _CToASCII(self, output_format):
5036 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.ContinueQueryResponse', output_format)
5039 if _net_proto___parse__python is not None:
5040 def ParseASCII(self, s):
5041 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.ContinueQueryResponse', s)
5044 if _net_proto___parse__python is not None:
5045 def ParseASCIIIgnoreUnknown(self, s):
5046 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.ContinueQueryResponse', s)
5049 def Equals(self, x):
5050 if x is self: return 1
5051 if self.has_batch_ != x.has_batch_: return 0
5052 if self.has_batch_ and self.batch_ != x.batch_: return 0
5053 return 1
5055 def IsInitialized(self, debug_strs=None):
5056 initialized = 1
5057 if (not self.has_batch_):
5058 initialized = 0
5059 if debug_strs is not None:
5060 debug_strs.append('Required field: batch not set.')
5061 elif not self.batch_.IsInitialized(debug_strs): initialized = 0
5062 return initialized
5064 def ByteSize(self):
5065 n = 0
5066 n += self.lengthString(self.batch_.ByteSize())
5067 return n + 1
5069 def ByteSizePartial(self):
5070 n = 0
5071 if (self.has_batch_):
5072 n += 1
5073 n += self.lengthString(self.batch_.ByteSizePartial())
5074 return n
5076 def Clear(self):
5077 self.clear_batch()
5079 def OutputUnchecked(self, out):
5080 out.putVarInt32(10)
5081 out.putVarInt32(self.batch_.ByteSize())
5082 self.batch_.OutputUnchecked(out)
5084 def OutputPartial(self, out):
5085 if (self.has_batch_):
5086 out.putVarInt32(10)
5087 out.putVarInt32(self.batch_.ByteSizePartial())
5088 self.batch_.OutputPartial(out)
5090 def TryMerge(self, d):
5091 while d.avail() > 0:
5092 tt = d.getVarInt32()
5093 if tt == 10:
5094 length = d.getVarInt32()
5095 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
5096 d.skip(length)
5097 self.mutable_batch().TryMerge(tmp)
5098 continue
5101 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
5102 d.skipData(tt)
5105 def __str__(self, prefix="", printElemNumber=0):
5106 res=""
5107 if self.has_batch_:
5108 res+=prefix+"batch <\n"
5109 res+=self.batch_.__str__(prefix + " ", printElemNumber)
5110 res+=prefix+">\n"
5111 return res
5114 def _BuildTagLookupTable(sparse, maxtag, default=None):
5115 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
5117 kbatch = 1
5119 _TEXT = _BuildTagLookupTable({
5120 0: "ErrorCode",
5121 1: "batch",
5122 }, 1)
5124 _TYPES = _BuildTagLookupTable({
5125 0: ProtocolBuffer.Encoder.NUMERIC,
5126 1: ProtocolBuffer.Encoder.STRING,
5127 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
5130 _STYLE = """"""
5131 _STYLE_CONTENT_TYPE = """"""
5132 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.ContinueQueryResponse'
5133 _SERIALIZED_DESCRIPTOR = array.array('B')
5134 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KLWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbnRpbnVlUXVlcnlSZXNwb25zZRMaBWJhdGNoIAEoAjALOAJKKGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlF1ZXJ5UmVzdWx0QmF0Y2ijAaoBBWN0eXBlsgEGcHJvdG8ypAEUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
5135 if _net_proto___parse__python is not None:
5136 _net_proto___parse__python.RegisterType(
5137 _SERIALIZED_DESCRIPTOR.tostring())
5139 class BeginTransactionRequest(ProtocolBuffer.ProtocolMessage):
5140 has_cross_group_ = 0
5141 cross_group_ = 0
5142 has_cross_request_ = 0
5143 cross_request_ = 0
5145 def __init__(self, contents=None):
5146 if contents is not None: self.MergeFromString(contents)
5148 def cross_group(self): return self.cross_group_
5150 def set_cross_group(self, x):
5151 self.has_cross_group_ = 1
5152 self.cross_group_ = x
5154 def clear_cross_group(self):
5155 if self.has_cross_group_:
5156 self.has_cross_group_ = 0
5157 self.cross_group_ = 0
5159 def has_cross_group(self): return self.has_cross_group_
5161 def cross_request(self): return self.cross_request_
5163 def set_cross_request(self, x):
5164 self.has_cross_request_ = 1
5165 self.cross_request_ = x
5167 def clear_cross_request(self):
5168 if self.has_cross_request_:
5169 self.has_cross_request_ = 0
5170 self.cross_request_ = 0
5172 def has_cross_request(self): return self.has_cross_request_
5175 def MergeFrom(self, x):
5176 assert x is not self
5177 if (x.has_cross_group()): self.set_cross_group(x.cross_group())
5178 if (x.has_cross_request()): self.set_cross_request(x.cross_request())
5180 if _net_proto___parse__python is not None:
5181 def _CMergeFromString(self, s):
5182 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.BeginTransactionRequest', s)
5184 if _net_proto___parse__python is not None:
5185 def _CEncode(self):
5186 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.BeginTransactionRequest')
5188 if _net_proto___parse__python is not None:
5189 def _CEncodePartial(self):
5190 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.BeginTransactionRequest')
5192 if _net_proto___parse__python is not None:
5193 def _CToASCII(self, output_format):
5194 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.BeginTransactionRequest', output_format)
5197 if _net_proto___parse__python is not None:
5198 def ParseASCII(self, s):
5199 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.BeginTransactionRequest', s)
5202 if _net_proto___parse__python is not None:
5203 def ParseASCIIIgnoreUnknown(self, s):
5204 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.BeginTransactionRequest', s)
5207 def Equals(self, x):
5208 if x is self: return 1
5209 if self.has_cross_group_ != x.has_cross_group_: return 0
5210 if self.has_cross_group_ and self.cross_group_ != x.cross_group_: return 0
5211 if self.has_cross_request_ != x.has_cross_request_: return 0
5212 if self.has_cross_request_ and self.cross_request_ != x.cross_request_: return 0
5213 return 1
5215 def IsInitialized(self, debug_strs=None):
5216 initialized = 1
5217 return initialized
5219 def ByteSize(self):
5220 n = 0
5221 if (self.has_cross_group_): n += 2
5222 if (self.has_cross_request_): n += 2
5223 return n
5225 def ByteSizePartial(self):
5226 n = 0
5227 if (self.has_cross_group_): n += 2
5228 if (self.has_cross_request_): n += 2
5229 return n
5231 def Clear(self):
5232 self.clear_cross_group()
5233 self.clear_cross_request()
5235 def OutputUnchecked(self, out):
5236 if (self.has_cross_group_):
5237 out.putVarInt32(8)
5238 out.putBoolean(self.cross_group_)
5239 if (self.has_cross_request_):
5240 out.putVarInt32(16)
5241 out.putBoolean(self.cross_request_)
5243 def OutputPartial(self, out):
5244 if (self.has_cross_group_):
5245 out.putVarInt32(8)
5246 out.putBoolean(self.cross_group_)
5247 if (self.has_cross_request_):
5248 out.putVarInt32(16)
5249 out.putBoolean(self.cross_request_)
5251 def TryMerge(self, d):
5252 while d.avail() > 0:
5253 tt = d.getVarInt32()
5254 if tt == 8:
5255 self.set_cross_group(d.getBoolean())
5256 continue
5257 if tt == 16:
5258 self.set_cross_request(d.getBoolean())
5259 continue
5262 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
5263 d.skipData(tt)
5266 def __str__(self, prefix="", printElemNumber=0):
5267 res=""
5268 if self.has_cross_group_: res+=prefix+("cross_group: %s\n" % self.DebugFormatBool(self.cross_group_))
5269 if self.has_cross_request_: res+=prefix+("cross_request: %s\n" % self.DebugFormatBool(self.cross_request_))
5270 return res
5273 def _BuildTagLookupTable(sparse, maxtag, default=None):
5274 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
5276 kcross_group = 1
5277 kcross_request = 2
5279 _TEXT = _BuildTagLookupTable({
5280 0: "ErrorCode",
5281 1: "cross_group",
5282 2: "cross_request",
5283 }, 2)
5285 _TYPES = _BuildTagLookupTable({
5286 0: ProtocolBuffer.Encoder.NUMERIC,
5287 1: ProtocolBuffer.Encoder.NUMERIC,
5288 2: ProtocolBuffer.Encoder.NUMERIC,
5289 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
5292 _STYLE = """"""
5293 _STYLE_CONTENT_TYPE = """"""
5294 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.BeginTransactionRequest'
5295 _SERIALIZED_DESCRIPTOR = array.array('B')
5296 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KL2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkJlZ2luVHJhbnNhY3Rpb25SZXF1ZXN0ExoLY3Jvc3NfZ3JvdXAgASgAMAg4AUIFZmFsc2WjAaoBB2RlZmF1bHSyAQVmYWxzZaQBFBMaDWNyb3NzX3JlcXVlc3QgAigAMAg4AUIFZmFsc2WjAaoBB2RlZmF1bHSyAQVmYWxzZaQBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
5297 if _net_proto___parse__python is not None:
5298 _net_proto___parse__python.RegisterType(
5299 _SERIALIZED_DESCRIPTOR.tostring())
5301 class BeginTransactionResponse(ProtocolBuffer.ProtocolMessage):
5302 has_transaction_ = 0
5303 transaction_ = ""
5305 def __init__(self, contents=None):
5306 if contents is not None: self.MergeFromString(contents)
5308 def transaction(self): return self.transaction_
5310 def set_transaction(self, x):
5311 self.has_transaction_ = 1
5312 self.transaction_ = x
5314 def clear_transaction(self):
5315 if self.has_transaction_:
5316 self.has_transaction_ = 0
5317 self.transaction_ = ""
5319 def has_transaction(self): return self.has_transaction_
5322 def MergeFrom(self, x):
5323 assert x is not self
5324 if (x.has_transaction()): self.set_transaction(x.transaction())
5326 if _net_proto___parse__python is not None:
5327 def _CMergeFromString(self, s):
5328 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.BeginTransactionResponse', s)
5330 if _net_proto___parse__python is not None:
5331 def _CEncode(self):
5332 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.BeginTransactionResponse')
5334 if _net_proto___parse__python is not None:
5335 def _CEncodePartial(self):
5336 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.BeginTransactionResponse')
5338 if _net_proto___parse__python is not None:
5339 def _CToASCII(self, output_format):
5340 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.BeginTransactionResponse', output_format)
5343 if _net_proto___parse__python is not None:
5344 def ParseASCII(self, s):
5345 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.BeginTransactionResponse', s)
5348 if _net_proto___parse__python is not None:
5349 def ParseASCIIIgnoreUnknown(self, s):
5350 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.BeginTransactionResponse', s)
5353 def Equals(self, x):
5354 if x is self: return 1
5355 if self.has_transaction_ != x.has_transaction_: return 0
5356 if self.has_transaction_ and self.transaction_ != x.transaction_: return 0
5357 return 1
5359 def IsInitialized(self, debug_strs=None):
5360 initialized = 1
5361 if (not self.has_transaction_):
5362 initialized = 0
5363 if debug_strs is not None:
5364 debug_strs.append('Required field: transaction not set.')
5365 return initialized
5367 def ByteSize(self):
5368 n = 0
5369 n += self.lengthString(len(self.transaction_))
5370 return n + 1
5372 def ByteSizePartial(self):
5373 n = 0
5374 if (self.has_transaction_):
5375 n += 1
5376 n += self.lengthString(len(self.transaction_))
5377 return n
5379 def Clear(self):
5380 self.clear_transaction()
5382 def OutputUnchecked(self, out):
5383 out.putVarInt32(10)
5384 out.putPrefixedString(self.transaction_)
5386 def OutputPartial(self, out):
5387 if (self.has_transaction_):
5388 out.putVarInt32(10)
5389 out.putPrefixedString(self.transaction_)
5391 def TryMerge(self, d):
5392 while d.avail() > 0:
5393 tt = d.getVarInt32()
5394 if tt == 10:
5395 self.set_transaction(d.getPrefixedString())
5396 continue
5399 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
5400 d.skipData(tt)
5403 def __str__(self, prefix="", printElemNumber=0):
5404 res=""
5405 if self.has_transaction_: res+=prefix+("transaction: %s\n" % self.DebugFormatString(self.transaction_))
5406 return res
5409 def _BuildTagLookupTable(sparse, maxtag, default=None):
5410 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
5412 ktransaction = 1
5414 _TEXT = _BuildTagLookupTable({
5415 0: "ErrorCode",
5416 1: "transaction",
5417 }, 1)
5419 _TYPES = _BuildTagLookupTable({
5420 0: ProtocolBuffer.Encoder.NUMERIC,
5421 1: ProtocolBuffer.Encoder.STRING,
5422 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
5425 _STYLE = """"""
5426 _STYLE_CONTENT_TYPE = """"""
5427 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.BeginTransactionResponse'
5428 _SERIALIZED_DESCRIPTOR = array.array('B')
5429 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KMGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkJlZ2luVHJhbnNhY3Rpb25SZXNwb25zZRMaC3RyYW5zYWN0aW9uIAEoAjAJOAIUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
5430 if _net_proto___parse__python is not None:
5431 _net_proto___parse__python.RegisterType(
5432 _SERIALIZED_DESCRIPTOR.tostring())
5434 class RollbackRequest(ProtocolBuffer.ProtocolMessage):
5435 has_transaction_ = 0
5436 transaction_ = ""
5438 def __init__(self, contents=None):
5439 if contents is not None: self.MergeFromString(contents)
5441 def transaction(self): return self.transaction_
5443 def set_transaction(self, x):
5444 self.has_transaction_ = 1
5445 self.transaction_ = x
5447 def clear_transaction(self):
5448 if self.has_transaction_:
5449 self.has_transaction_ = 0
5450 self.transaction_ = ""
5452 def has_transaction(self): return self.has_transaction_
5455 def MergeFrom(self, x):
5456 assert x is not self
5457 if (x.has_transaction()): self.set_transaction(x.transaction())
5459 if _net_proto___parse__python is not None:
5460 def _CMergeFromString(self, s):
5461 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.RollbackRequest', s)
5463 if _net_proto___parse__python is not None:
5464 def _CEncode(self):
5465 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.RollbackRequest')
5467 if _net_proto___parse__python is not None:
5468 def _CEncodePartial(self):
5469 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.RollbackRequest')
5471 if _net_proto___parse__python is not None:
5472 def _CToASCII(self, output_format):
5473 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.RollbackRequest', output_format)
5476 if _net_proto___parse__python is not None:
5477 def ParseASCII(self, s):
5478 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.RollbackRequest', s)
5481 if _net_proto___parse__python is not None:
5482 def ParseASCIIIgnoreUnknown(self, s):
5483 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.RollbackRequest', s)
5486 def Equals(self, x):
5487 if x is self: return 1
5488 if self.has_transaction_ != x.has_transaction_: return 0
5489 if self.has_transaction_ and self.transaction_ != x.transaction_: return 0
5490 return 1
5492 def IsInitialized(self, debug_strs=None):
5493 initialized = 1
5494 if (not self.has_transaction_):
5495 initialized = 0
5496 if debug_strs is not None:
5497 debug_strs.append('Required field: transaction not set.')
5498 return initialized
5500 def ByteSize(self):
5501 n = 0
5502 n += self.lengthString(len(self.transaction_))
5503 return n + 1
5505 def ByteSizePartial(self):
5506 n = 0
5507 if (self.has_transaction_):
5508 n += 1
5509 n += self.lengthString(len(self.transaction_))
5510 return n
5512 def Clear(self):
5513 self.clear_transaction()
5515 def OutputUnchecked(self, out):
5516 out.putVarInt32(10)
5517 out.putPrefixedString(self.transaction_)
5519 def OutputPartial(self, out):
5520 if (self.has_transaction_):
5521 out.putVarInt32(10)
5522 out.putPrefixedString(self.transaction_)
5524 def TryMerge(self, d):
5525 while d.avail() > 0:
5526 tt = d.getVarInt32()
5527 if tt == 10:
5528 self.set_transaction(d.getPrefixedString())
5529 continue
5532 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
5533 d.skipData(tt)
5536 def __str__(self, prefix="", printElemNumber=0):
5537 res=""
5538 if self.has_transaction_: res+=prefix+("transaction: %s\n" % self.DebugFormatString(self.transaction_))
5539 return res
5542 def _BuildTagLookupTable(sparse, maxtag, default=None):
5543 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
5545 ktransaction = 1
5547 _TEXT = _BuildTagLookupTable({
5548 0: "ErrorCode",
5549 1: "transaction",
5550 }, 1)
5552 _TYPES = _BuildTagLookupTable({
5553 0: ProtocolBuffer.Encoder.NUMERIC,
5554 1: ProtocolBuffer.Encoder.STRING,
5555 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
5558 _STYLE = """"""
5559 _STYLE_CONTENT_TYPE = """"""
5560 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.RollbackRequest'
5561 _SERIALIZED_DESCRIPTOR = array.array('B')
5562 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJ2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJvbGxiYWNrUmVxdWVzdBMaC3RyYW5zYWN0aW9uIAEoAjAJOAIUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
5563 if _net_proto___parse__python is not None:
5564 _net_proto___parse__python.RegisterType(
5565 _SERIALIZED_DESCRIPTOR.tostring())
5567 class RollbackResponse(ProtocolBuffer.ProtocolMessage):
5569 def __init__(self, contents=None):
5570 pass
5571 if contents is not None: self.MergeFromString(contents)
5574 def MergeFrom(self, x):
5575 assert x is not self
5577 if _net_proto___parse__python is not None:
5578 def _CMergeFromString(self, s):
5579 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.RollbackResponse', s)
5581 if _net_proto___parse__python is not None:
5582 def _CEncode(self):
5583 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.RollbackResponse')
5585 if _net_proto___parse__python is not None:
5586 def _CEncodePartial(self):
5587 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.RollbackResponse')
5589 if _net_proto___parse__python is not None:
5590 def _CToASCII(self, output_format):
5591 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.RollbackResponse', output_format)
5594 if _net_proto___parse__python is not None:
5595 def ParseASCII(self, s):
5596 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.RollbackResponse', s)
5599 if _net_proto___parse__python is not None:
5600 def ParseASCIIIgnoreUnknown(self, s):
5601 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.RollbackResponse', s)
5604 def Equals(self, x):
5605 if x is self: return 1
5606 return 1
5608 def IsInitialized(self, debug_strs=None):
5609 initialized = 1
5610 return initialized
5612 def ByteSize(self):
5613 n = 0
5614 return n
5616 def ByteSizePartial(self):
5617 n = 0
5618 return n
5620 def Clear(self):
5621 pass
5623 def OutputUnchecked(self, out):
5624 pass
5626 def OutputPartial(self, out):
5627 pass
5629 def TryMerge(self, d):
5630 while d.avail() > 0:
5631 tt = d.getVarInt32()
5634 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
5635 d.skipData(tt)
5638 def __str__(self, prefix="", printElemNumber=0):
5639 res=""
5640 return res
5643 def _BuildTagLookupTable(sparse, maxtag, default=None):
5644 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
5647 _TEXT = _BuildTagLookupTable({
5648 0: "ErrorCode",
5649 }, 0)
5651 _TYPES = _BuildTagLookupTable({
5652 0: ProtocolBuffer.Encoder.NUMERIC,
5653 }, 0, ProtocolBuffer.Encoder.MAX_TYPE)
5656 _STYLE = """"""
5657 _STYLE_CONTENT_TYPE = """"""
5658 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.RollbackResponse'
5659 _SERIALIZED_DESCRIPTOR = array.array('B')
5660 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJvbGxiYWNrUmVzcG9uc2XCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
5661 if _net_proto___parse__python is not None:
5662 _net_proto___parse__python.RegisterType(
5663 _SERIALIZED_DESCRIPTOR.tostring())
5665 class CommitRequest(ProtocolBuffer.ProtocolMessage):
5668 TRANSACTIONAL = 1
5669 NON_TRANSACTIONAL = 2
5671 _Mode_NAMES = {
5672 1: "TRANSACTIONAL",
5673 2: "NON_TRANSACTIONAL",
5676 def Mode_Name(cls, x): return cls._Mode_NAMES.get(x, "")
5677 Mode_Name = classmethod(Mode_Name)
5679 has_transaction_ = 0
5680 transaction_ = ""
5681 has_mutation_ = 0
5682 mutation_ = None
5683 has_mode_ = 0
5684 mode_ = 1
5686 def __init__(self, contents=None):
5687 self.lazy_init_lock_ = thread.allocate_lock()
5688 if contents is not None: self.MergeFromString(contents)
5690 def transaction(self): return self.transaction_
5692 def set_transaction(self, x):
5693 self.has_transaction_ = 1
5694 self.transaction_ = x
5696 def clear_transaction(self):
5697 if self.has_transaction_:
5698 self.has_transaction_ = 0
5699 self.transaction_ = ""
5701 def has_transaction(self): return self.has_transaction_
5703 def mutation(self):
5704 if self.mutation_ is None:
5705 self.lazy_init_lock_.acquire()
5706 try:
5707 if self.mutation_ is None: self.mutation_ = Mutation()
5708 finally:
5709 self.lazy_init_lock_.release()
5710 return self.mutation_
5712 def mutable_mutation(self): self.has_mutation_ = 1; return self.mutation()
5714 def clear_mutation(self):
5716 if self.has_mutation_:
5717 self.has_mutation_ = 0;
5718 if self.mutation_ is not None: self.mutation_.Clear()
5720 def has_mutation(self): return self.has_mutation_
5722 def mode(self): return self.mode_
5724 def set_mode(self, x):
5725 self.has_mode_ = 1
5726 self.mode_ = x
5728 def clear_mode(self):
5729 if self.has_mode_:
5730 self.has_mode_ = 0
5731 self.mode_ = 1
5733 def has_mode(self): return self.has_mode_
5736 def MergeFrom(self, x):
5737 assert x is not self
5738 if (x.has_transaction()): self.set_transaction(x.transaction())
5739 if (x.has_mutation()): self.mutable_mutation().MergeFrom(x.mutation())
5740 if (x.has_mode()): self.set_mode(x.mode())
5742 if _net_proto___parse__python is not None:
5743 def _CMergeFromString(self, s):
5744 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.CommitRequest', s)
5746 if _net_proto___parse__python is not None:
5747 def _CEncode(self):
5748 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.CommitRequest')
5750 if _net_proto___parse__python is not None:
5751 def _CEncodePartial(self):
5752 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.CommitRequest')
5754 if _net_proto___parse__python is not None:
5755 def _CToASCII(self, output_format):
5756 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.CommitRequest', output_format)
5759 if _net_proto___parse__python is not None:
5760 def ParseASCII(self, s):
5761 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.CommitRequest', s)
5764 if _net_proto___parse__python is not None:
5765 def ParseASCIIIgnoreUnknown(self, s):
5766 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.CommitRequest', s)
5769 def Equals(self, x):
5770 if x is self: return 1
5771 if self.has_transaction_ != x.has_transaction_: return 0
5772 if self.has_transaction_ and self.transaction_ != x.transaction_: return 0
5773 if self.has_mutation_ != x.has_mutation_: return 0
5774 if self.has_mutation_ and self.mutation_ != x.mutation_: return 0
5775 if self.has_mode_ != x.has_mode_: return 0
5776 if self.has_mode_ and self.mode_ != x.mode_: return 0
5777 return 1
5779 def IsInitialized(self, debug_strs=None):
5780 initialized = 1
5781 if (self.has_mutation_ and not self.mutation_.IsInitialized(debug_strs)): initialized = 0
5782 return initialized
5784 def ByteSize(self):
5785 n = 0
5786 if (self.has_transaction_): n += 1 + self.lengthString(len(self.transaction_))
5787 if (self.has_mutation_): n += 1 + self.lengthString(self.mutation_.ByteSize())
5788 if (self.has_mode_): n += 1 + self.lengthVarInt64(self.mode_)
5789 return n
5791 def ByteSizePartial(self):
5792 n = 0
5793 if (self.has_transaction_): n += 1 + self.lengthString(len(self.transaction_))
5794 if (self.has_mutation_): n += 1 + self.lengthString(self.mutation_.ByteSizePartial())
5795 if (self.has_mode_): n += 1 + self.lengthVarInt64(self.mode_)
5796 return n
5798 def Clear(self):
5799 self.clear_transaction()
5800 self.clear_mutation()
5801 self.clear_mode()
5803 def OutputUnchecked(self, out):
5804 if (self.has_transaction_):
5805 out.putVarInt32(10)
5806 out.putPrefixedString(self.transaction_)
5807 if (self.has_mutation_):
5808 out.putVarInt32(18)
5809 out.putVarInt32(self.mutation_.ByteSize())
5810 self.mutation_.OutputUnchecked(out)
5811 if (self.has_mode_):
5812 out.putVarInt32(32)
5813 out.putVarInt32(self.mode_)
5815 def OutputPartial(self, out):
5816 if (self.has_transaction_):
5817 out.putVarInt32(10)
5818 out.putPrefixedString(self.transaction_)
5819 if (self.has_mutation_):
5820 out.putVarInt32(18)
5821 out.putVarInt32(self.mutation_.ByteSizePartial())
5822 self.mutation_.OutputPartial(out)
5823 if (self.has_mode_):
5824 out.putVarInt32(32)
5825 out.putVarInt32(self.mode_)
5827 def TryMerge(self, d):
5828 while d.avail() > 0:
5829 tt = d.getVarInt32()
5830 if tt == 10:
5831 self.set_transaction(d.getPrefixedString())
5832 continue
5833 if tt == 18:
5834 length = d.getVarInt32()
5835 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
5836 d.skip(length)
5837 self.mutable_mutation().TryMerge(tmp)
5838 continue
5839 if tt == 32:
5840 self.set_mode(d.getVarInt32())
5841 continue
5844 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
5845 d.skipData(tt)
5848 def __str__(self, prefix="", printElemNumber=0):
5849 res=""
5850 if self.has_transaction_: res+=prefix+("transaction: %s\n" % self.DebugFormatString(self.transaction_))
5851 if self.has_mutation_:
5852 res+=prefix+"mutation <\n"
5853 res+=self.mutation_.__str__(prefix + " ", printElemNumber)
5854 res+=prefix+">\n"
5855 if self.has_mode_: res+=prefix+("mode: %s\n" % self.DebugFormatInt32(self.mode_))
5856 return res
5859 def _BuildTagLookupTable(sparse, maxtag, default=None):
5860 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
5862 ktransaction = 1
5863 kmutation = 2
5864 kmode = 4
5866 _TEXT = _BuildTagLookupTable({
5867 0: "ErrorCode",
5868 1: "transaction",
5869 2: "mutation",
5870 4: "mode",
5871 }, 4)
5873 _TYPES = _BuildTagLookupTable({
5874 0: ProtocolBuffer.Encoder.NUMERIC,
5875 1: ProtocolBuffer.Encoder.STRING,
5876 2: ProtocolBuffer.Encoder.STRING,
5877 4: ProtocolBuffer.Encoder.NUMERIC,
5878 }, 4, ProtocolBuffer.Encoder.MAX_TYPE)
5881 _STYLE = """"""
5882 _STYLE_CONTENT_TYPE = """"""
5883 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.CommitRequest'
5884 _SERIALIZED_DESCRIPTOR = array.array('B')
5885 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbW1pdFJlcXVlc3QTGgt0cmFuc2FjdGlvbiABKAIwCTgBFBMaCG11dGF0aW9uIAIoAjALOAFKIGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaBG1vZGUgBCgAMAU4AUIBMWgAowGqAQdkZWZhdWx0sgENVFJBTlNBQ1RJT05BTKQBFHN6BE1vZGWLAZIBDVRSQU5TQUNUSU9OQUyYAQGMAYsBkgERTk9OX1RSQU5TQUNUSU9OQUyYAQKMAXTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
5886 if _net_proto___parse__python is not None:
5887 _net_proto___parse__python.RegisterType(
5888 _SERIALIZED_DESCRIPTOR.tostring())
5890 class CommitResponse(ProtocolBuffer.ProtocolMessage):
5891 has_mutation_result_ = 0
5892 mutation_result_ = None
5894 def __init__(self, contents=None):
5895 self.lazy_init_lock_ = thread.allocate_lock()
5896 if contents is not None: self.MergeFromString(contents)
5898 def mutation_result(self):
5899 if self.mutation_result_ is None:
5900 self.lazy_init_lock_.acquire()
5901 try:
5902 if self.mutation_result_ is None: self.mutation_result_ = MutationResult()
5903 finally:
5904 self.lazy_init_lock_.release()
5905 return self.mutation_result_
5907 def mutable_mutation_result(self): self.has_mutation_result_ = 1; return self.mutation_result()
5909 def clear_mutation_result(self):
5911 if self.has_mutation_result_:
5912 self.has_mutation_result_ = 0;
5913 if self.mutation_result_ is not None: self.mutation_result_.Clear()
5915 def has_mutation_result(self): return self.has_mutation_result_
5918 def MergeFrom(self, x):
5919 assert x is not self
5920 if (x.has_mutation_result()): self.mutable_mutation_result().MergeFrom(x.mutation_result())
5922 if _net_proto___parse__python is not None:
5923 def _CMergeFromString(self, s):
5924 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.CommitResponse', s)
5926 if _net_proto___parse__python is not None:
5927 def _CEncode(self):
5928 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.CommitResponse')
5930 if _net_proto___parse__python is not None:
5931 def _CEncodePartial(self):
5932 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.CommitResponse')
5934 if _net_proto___parse__python is not None:
5935 def _CToASCII(self, output_format):
5936 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.CommitResponse', output_format)
5939 if _net_proto___parse__python is not None:
5940 def ParseASCII(self, s):
5941 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.CommitResponse', s)
5944 if _net_proto___parse__python is not None:
5945 def ParseASCIIIgnoreUnknown(self, s):
5946 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.CommitResponse', s)
5949 def Equals(self, x):
5950 if x is self: return 1
5951 if self.has_mutation_result_ != x.has_mutation_result_: return 0
5952 if self.has_mutation_result_ and self.mutation_result_ != x.mutation_result_: return 0
5953 return 1
5955 def IsInitialized(self, debug_strs=None):
5956 initialized = 1
5957 if (self.has_mutation_result_ and not self.mutation_result_.IsInitialized(debug_strs)): initialized = 0
5958 return initialized
5960 def ByteSize(self):
5961 n = 0
5962 if (self.has_mutation_result_): n += 1 + self.lengthString(self.mutation_result_.ByteSize())
5963 return n
5965 def ByteSizePartial(self):
5966 n = 0
5967 if (self.has_mutation_result_): n += 1 + self.lengthString(self.mutation_result_.ByteSizePartial())
5968 return n
5970 def Clear(self):
5971 self.clear_mutation_result()
5973 def OutputUnchecked(self, out):
5974 if (self.has_mutation_result_):
5975 out.putVarInt32(10)
5976 out.putVarInt32(self.mutation_result_.ByteSize())
5977 self.mutation_result_.OutputUnchecked(out)
5979 def OutputPartial(self, out):
5980 if (self.has_mutation_result_):
5981 out.putVarInt32(10)
5982 out.putVarInt32(self.mutation_result_.ByteSizePartial())
5983 self.mutation_result_.OutputPartial(out)
5985 def TryMerge(self, d):
5986 while d.avail() > 0:
5987 tt = d.getVarInt32()
5988 if tt == 10:
5989 length = d.getVarInt32()
5990 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
5991 d.skip(length)
5992 self.mutable_mutation_result().TryMerge(tmp)
5993 continue
5996 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
5997 d.skipData(tt)
6000 def __str__(self, prefix="", printElemNumber=0):
6001 res=""
6002 if self.has_mutation_result_:
6003 res+=prefix+"mutation_result <\n"
6004 res+=self.mutation_result_.__str__(prefix + " ", printElemNumber)
6005 res+=prefix+">\n"
6006 return res
6009 def _BuildTagLookupTable(sparse, maxtag, default=None):
6010 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
6012 kmutation_result = 1
6014 _TEXT = _BuildTagLookupTable({
6015 0: "ErrorCode",
6016 1: "mutation_result",
6017 }, 1)
6019 _TYPES = _BuildTagLookupTable({
6020 0: ProtocolBuffer.Encoder.NUMERIC,
6021 1: ProtocolBuffer.Encoder.STRING,
6022 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
6025 _STYLE = """"""
6026 _STYLE_CONTENT_TYPE = """"""
6027 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.CommitResponse'
6028 _SERIALIZED_DESCRIPTOR = array.array('B')
6029 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbW1pdFJlc3BvbnNlExoPbXV0YXRpb25fcmVzdWx0IAEoAjALOAFKJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uUmVzdWx0owGqAQVjdHlwZbIBBnByb3RvMqQBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
6030 if _net_proto___parse__python is not None:
6031 _net_proto___parse__python.RegisterType(
6032 _SERIALIZED_DESCRIPTOR.tostring())
6034 class AllocateIdsRequest(ProtocolBuffer.ProtocolMessage):
6036 def __init__(self, contents=None):
6037 self.allocate_ = []
6038 self.reserve_ = []
6039 if contents is not None: self.MergeFromString(contents)
6041 def allocate_size(self): return len(self.allocate_)
6042 def allocate_list(self): return self.allocate_
6044 def allocate(self, i):
6045 return self.allocate_[i]
6047 def mutable_allocate(self, i):
6048 return self.allocate_[i]
6050 def add_allocate(self):
6051 x = google.appengine.datastore.entity_v4_pb.Key()
6052 self.allocate_.append(x)
6053 return x
6055 def clear_allocate(self):
6056 self.allocate_ = []
6057 def reserve_size(self): return len(self.reserve_)
6058 def reserve_list(self): return self.reserve_
6060 def reserve(self, i):
6061 return self.reserve_[i]
6063 def mutable_reserve(self, i):
6064 return self.reserve_[i]
6066 def add_reserve(self):
6067 x = google.appengine.datastore.entity_v4_pb.Key()
6068 self.reserve_.append(x)
6069 return x
6071 def clear_reserve(self):
6072 self.reserve_ = []
6074 def MergeFrom(self, x):
6075 assert x is not self
6076 for i in xrange(x.allocate_size()): self.add_allocate().CopyFrom(x.allocate(i))
6077 for i in xrange(x.reserve_size()): self.add_reserve().CopyFrom(x.reserve(i))
6079 if _net_proto___parse__python is not None:
6080 def _CMergeFromString(self, s):
6081 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.AllocateIdsRequest', s)
6083 if _net_proto___parse__python is not None:
6084 def _CEncode(self):
6085 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.AllocateIdsRequest')
6087 if _net_proto___parse__python is not None:
6088 def _CEncodePartial(self):
6089 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.AllocateIdsRequest')
6091 if _net_proto___parse__python is not None:
6092 def _CToASCII(self, output_format):
6093 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.AllocateIdsRequest', output_format)
6096 if _net_proto___parse__python is not None:
6097 def ParseASCII(self, s):
6098 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.AllocateIdsRequest', s)
6101 if _net_proto___parse__python is not None:
6102 def ParseASCIIIgnoreUnknown(self, s):
6103 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.AllocateIdsRequest', s)
6106 def Equals(self, x):
6107 if x is self: return 1
6108 if len(self.allocate_) != len(x.allocate_): return 0
6109 for e1, e2 in zip(self.allocate_, x.allocate_):
6110 if e1 != e2: return 0
6111 if len(self.reserve_) != len(x.reserve_): return 0
6112 for e1, e2 in zip(self.reserve_, x.reserve_):
6113 if e1 != e2: return 0
6114 return 1
6116 def IsInitialized(self, debug_strs=None):
6117 initialized = 1
6118 for p in self.allocate_:
6119 if not p.IsInitialized(debug_strs): initialized=0
6120 for p in self.reserve_:
6121 if not p.IsInitialized(debug_strs): initialized=0
6122 return initialized
6124 def ByteSize(self):
6125 n = 0
6126 n += 1 * len(self.allocate_)
6127 for i in xrange(len(self.allocate_)): n += self.lengthString(self.allocate_[i].ByteSize())
6128 n += 1 * len(self.reserve_)
6129 for i in xrange(len(self.reserve_)): n += self.lengthString(self.reserve_[i].ByteSize())
6130 return n
6132 def ByteSizePartial(self):
6133 n = 0
6134 n += 1 * len(self.allocate_)
6135 for i in xrange(len(self.allocate_)): n += self.lengthString(self.allocate_[i].ByteSizePartial())
6136 n += 1 * len(self.reserve_)
6137 for i in xrange(len(self.reserve_)): n += self.lengthString(self.reserve_[i].ByteSizePartial())
6138 return n
6140 def Clear(self):
6141 self.clear_allocate()
6142 self.clear_reserve()
6144 def OutputUnchecked(self, out):
6145 for i in xrange(len(self.allocate_)):
6146 out.putVarInt32(10)
6147 out.putVarInt32(self.allocate_[i].ByteSize())
6148 self.allocate_[i].OutputUnchecked(out)
6149 for i in xrange(len(self.reserve_)):
6150 out.putVarInt32(18)
6151 out.putVarInt32(self.reserve_[i].ByteSize())
6152 self.reserve_[i].OutputUnchecked(out)
6154 def OutputPartial(self, out):
6155 for i in xrange(len(self.allocate_)):
6156 out.putVarInt32(10)
6157 out.putVarInt32(self.allocate_[i].ByteSizePartial())
6158 self.allocate_[i].OutputPartial(out)
6159 for i in xrange(len(self.reserve_)):
6160 out.putVarInt32(18)
6161 out.putVarInt32(self.reserve_[i].ByteSizePartial())
6162 self.reserve_[i].OutputPartial(out)
6164 def TryMerge(self, d):
6165 while d.avail() > 0:
6166 tt = d.getVarInt32()
6167 if tt == 10:
6168 length = d.getVarInt32()
6169 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
6170 d.skip(length)
6171 self.add_allocate().TryMerge(tmp)
6172 continue
6173 if tt == 18:
6174 length = d.getVarInt32()
6175 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
6176 d.skip(length)
6177 self.add_reserve().TryMerge(tmp)
6178 continue
6181 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
6182 d.skipData(tt)
6185 def __str__(self, prefix="", printElemNumber=0):
6186 res=""
6187 cnt=0
6188 for e in self.allocate_:
6189 elm=""
6190 if printElemNumber: elm="(%d)" % cnt
6191 res+=prefix+("allocate%s <\n" % elm)
6192 res+=e.__str__(prefix + " ", printElemNumber)
6193 res+=prefix+">\n"
6194 cnt+=1
6195 cnt=0
6196 for e in self.reserve_:
6197 elm=""
6198 if printElemNumber: elm="(%d)" % cnt
6199 res+=prefix+("reserve%s <\n" % elm)
6200 res+=e.__str__(prefix + " ", printElemNumber)
6201 res+=prefix+">\n"
6202 cnt+=1
6203 return res
6206 def _BuildTagLookupTable(sparse, maxtag, default=None):
6207 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
6209 kallocate = 1
6210 kreserve = 2
6212 _TEXT = _BuildTagLookupTable({
6213 0: "ErrorCode",
6214 1: "allocate",
6215 2: "reserve",
6216 }, 2)
6218 _TYPES = _BuildTagLookupTable({
6219 0: ProtocolBuffer.Encoder.NUMERIC,
6220 1: ProtocolBuffer.Encoder.STRING,
6221 2: ProtocolBuffer.Encoder.STRING,
6222 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
6225 _STYLE = """"""
6226 _STYLE_CONTENT_TYPE = """"""
6227 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.AllocateIdsRequest'
6228 _SERIALIZED_DESCRIPTOR = array.array('B')
6229 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkFsbG9jYXRlSWRzUmVxdWVzdBMaCGFsbG9jYXRlIAEoAjALOANKG2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleaMBqgEFY3R5cGWyAQZwcm90bzKkARQTGgdyZXNlcnZlIAIoAjALOANKG2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleaMBqgEFY3R5cGWyAQZwcm90bzKkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
6230 if _net_proto___parse__python is not None:
6231 _net_proto___parse__python.RegisterType(
6232 _SERIALIZED_DESCRIPTOR.tostring())
6234 class AllocateIdsResponse(ProtocolBuffer.ProtocolMessage):
6236 def __init__(self, contents=None):
6237 self.allocated_ = []
6238 if contents is not None: self.MergeFromString(contents)
6240 def allocated_size(self): return len(self.allocated_)
6241 def allocated_list(self): return self.allocated_
6243 def allocated(self, i):
6244 return self.allocated_[i]
6246 def mutable_allocated(self, i):
6247 return self.allocated_[i]
6249 def add_allocated(self):
6250 x = google.appengine.datastore.entity_v4_pb.Key()
6251 self.allocated_.append(x)
6252 return x
6254 def clear_allocated(self):
6255 self.allocated_ = []
6257 def MergeFrom(self, x):
6258 assert x is not self
6259 for i in xrange(x.allocated_size()): self.add_allocated().CopyFrom(x.allocated(i))
6261 if _net_proto___parse__python is not None:
6262 def _CMergeFromString(self, s):
6263 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.AllocateIdsResponse', s)
6265 if _net_proto___parse__python is not None:
6266 def _CEncode(self):
6267 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.AllocateIdsResponse')
6269 if _net_proto___parse__python is not None:
6270 def _CEncodePartial(self):
6271 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.AllocateIdsResponse')
6273 if _net_proto___parse__python is not None:
6274 def _CToASCII(self, output_format):
6275 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.AllocateIdsResponse', output_format)
6278 if _net_proto___parse__python is not None:
6279 def ParseASCII(self, s):
6280 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.AllocateIdsResponse', s)
6283 if _net_proto___parse__python is not None:
6284 def ParseASCIIIgnoreUnknown(self, s):
6285 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.AllocateIdsResponse', s)
6288 def Equals(self, x):
6289 if x is self: return 1
6290 if len(self.allocated_) != len(x.allocated_): return 0
6291 for e1, e2 in zip(self.allocated_, x.allocated_):
6292 if e1 != e2: return 0
6293 return 1
6295 def IsInitialized(self, debug_strs=None):
6296 initialized = 1
6297 for p in self.allocated_:
6298 if not p.IsInitialized(debug_strs): initialized=0
6299 return initialized
6301 def ByteSize(self):
6302 n = 0
6303 n += 1 * len(self.allocated_)
6304 for i in xrange(len(self.allocated_)): n += self.lengthString(self.allocated_[i].ByteSize())
6305 return n
6307 def ByteSizePartial(self):
6308 n = 0
6309 n += 1 * len(self.allocated_)
6310 for i in xrange(len(self.allocated_)): n += self.lengthString(self.allocated_[i].ByteSizePartial())
6311 return n
6313 def Clear(self):
6314 self.clear_allocated()
6316 def OutputUnchecked(self, out):
6317 for i in xrange(len(self.allocated_)):
6318 out.putVarInt32(10)
6319 out.putVarInt32(self.allocated_[i].ByteSize())
6320 self.allocated_[i].OutputUnchecked(out)
6322 def OutputPartial(self, out):
6323 for i in xrange(len(self.allocated_)):
6324 out.putVarInt32(10)
6325 out.putVarInt32(self.allocated_[i].ByteSizePartial())
6326 self.allocated_[i].OutputPartial(out)
6328 def TryMerge(self, d):
6329 while d.avail() > 0:
6330 tt = d.getVarInt32()
6331 if tt == 10:
6332 length = d.getVarInt32()
6333 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
6334 d.skip(length)
6335 self.add_allocated().TryMerge(tmp)
6336 continue
6339 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
6340 d.skipData(tt)
6343 def __str__(self, prefix="", printElemNumber=0):
6344 res=""
6345 cnt=0
6346 for e in self.allocated_:
6347 elm=""
6348 if printElemNumber: elm="(%d)" % cnt
6349 res+=prefix+("allocated%s <\n" % elm)
6350 res+=e.__str__(prefix + " ", printElemNumber)
6351 res+=prefix+">\n"
6352 cnt+=1
6353 return res
6356 def _BuildTagLookupTable(sparse, maxtag, default=None):
6357 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
6359 kallocated = 1
6361 _TEXT = _BuildTagLookupTable({
6362 0: "ErrorCode",
6363 1: "allocated",
6364 }, 1)
6366 _TYPES = _BuildTagLookupTable({
6367 0: ProtocolBuffer.Encoder.NUMERIC,
6368 1: ProtocolBuffer.Encoder.STRING,
6369 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
6372 _STYLE = """"""
6373 _STYLE_CONTENT_TYPE = """"""
6374 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.AllocateIdsResponse'
6375 _SERIALIZED_DESCRIPTOR = array.array('B')
6376 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KK2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkFsbG9jYXRlSWRzUmVzcG9uc2UTGglhbGxvY2F0ZWQgASgCMAs4A0obYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuS2V5owGqAQVjdHlwZbIBBnByb3RvMqQBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
6377 if _net_proto___parse__python is not None:
6378 _net_proto___parse__python.RegisterType(
6379 _SERIALIZED_DESCRIPTOR.tostring())
6381 class WriteRequest(ProtocolBuffer.ProtocolMessage):
6382 has_mutation_ = 0
6384 def __init__(self, contents=None):
6385 self.mutation_ = Mutation()
6386 if contents is not None: self.MergeFromString(contents)
6388 def mutation(self): return self.mutation_
6390 def mutable_mutation(self): self.has_mutation_ = 1; return self.mutation_
6392 def clear_mutation(self):self.has_mutation_ = 0; self.mutation_.Clear()
6394 def has_mutation(self): return self.has_mutation_
6397 def MergeFrom(self, x):
6398 assert x is not self
6399 if (x.has_mutation()): self.mutable_mutation().MergeFrom(x.mutation())
6401 if _net_proto___parse__python is not None:
6402 def _CMergeFromString(self, s):
6403 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.WriteRequest', s)
6405 if _net_proto___parse__python is not None:
6406 def _CEncode(self):
6407 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.WriteRequest')
6409 if _net_proto___parse__python is not None:
6410 def _CEncodePartial(self):
6411 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.WriteRequest')
6413 if _net_proto___parse__python is not None:
6414 def _CToASCII(self, output_format):
6415 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.WriteRequest', output_format)
6418 if _net_proto___parse__python is not None:
6419 def ParseASCII(self, s):
6420 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.WriteRequest', s)
6423 if _net_proto___parse__python is not None:
6424 def ParseASCIIIgnoreUnknown(self, s):
6425 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.WriteRequest', s)
6428 def Equals(self, x):
6429 if x is self: return 1
6430 if self.has_mutation_ != x.has_mutation_: return 0
6431 if self.has_mutation_ and self.mutation_ != x.mutation_: return 0
6432 return 1
6434 def IsInitialized(self, debug_strs=None):
6435 initialized = 1
6436 if (not self.has_mutation_):
6437 initialized = 0
6438 if debug_strs is not None:
6439 debug_strs.append('Required field: mutation not set.')
6440 elif not self.mutation_.IsInitialized(debug_strs): initialized = 0
6441 return initialized
6443 def ByteSize(self):
6444 n = 0
6445 n += self.lengthString(self.mutation_.ByteSize())
6446 return n + 1
6448 def ByteSizePartial(self):
6449 n = 0
6450 if (self.has_mutation_):
6451 n += 1
6452 n += self.lengthString(self.mutation_.ByteSizePartial())
6453 return n
6455 def Clear(self):
6456 self.clear_mutation()
6458 def OutputUnchecked(self, out):
6459 out.putVarInt32(10)
6460 out.putVarInt32(self.mutation_.ByteSize())
6461 self.mutation_.OutputUnchecked(out)
6463 def OutputPartial(self, out):
6464 if (self.has_mutation_):
6465 out.putVarInt32(10)
6466 out.putVarInt32(self.mutation_.ByteSizePartial())
6467 self.mutation_.OutputPartial(out)
6469 def TryMerge(self, d):
6470 while d.avail() > 0:
6471 tt = d.getVarInt32()
6472 if tt == 10:
6473 length = d.getVarInt32()
6474 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
6475 d.skip(length)
6476 self.mutable_mutation().TryMerge(tmp)
6477 continue
6480 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
6481 d.skipData(tt)
6484 def __str__(self, prefix="", printElemNumber=0):
6485 res=""
6486 if self.has_mutation_:
6487 res+=prefix+"mutation <\n"
6488 res+=self.mutation_.__str__(prefix + " ", printElemNumber)
6489 res+=prefix+">\n"
6490 return res
6493 def _BuildTagLookupTable(sparse, maxtag, default=None):
6494 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
6496 kmutation = 1
6498 _TEXT = _BuildTagLookupTable({
6499 0: "ErrorCode",
6500 1: "mutation",
6501 }, 1)
6503 _TYPES = _BuildTagLookupTable({
6504 0: ProtocolBuffer.Encoder.NUMERIC,
6505 1: ProtocolBuffer.Encoder.STRING,
6506 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
6509 _STYLE = """"""
6510 _STYLE_CONTENT_TYPE = """"""
6511 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.WriteRequest'
6512 _SERIALIZED_DESCRIPTOR = array.array('B')
6513 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LldyaXRlUmVxdWVzdBMaCG11dGF0aW9uIAEoAjALOAJKIGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uowGqAQVjdHlwZbIBBnByb3RvMqQBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
6514 if _net_proto___parse__python is not None:
6515 _net_proto___parse__python.RegisterType(
6516 _SERIALIZED_DESCRIPTOR.tostring())
6520 class _DatastoreV4Service_ClientBaseStub(_client_stub_base_class):
6521 """Makes Stubby RPC calls to a DatastoreV4Service server."""
6523 __slots__ = (
6524 '_protorpc_BeginTransaction', '_full_name_BeginTransaction',
6525 '_protorpc_Rollback', '_full_name_Rollback',
6526 '_protorpc_Commit', '_full_name_Commit',
6527 '_protorpc_RunQuery', '_full_name_RunQuery',
6528 '_protorpc_ContinueQuery', '_full_name_ContinueQuery',
6529 '_protorpc_Lookup', '_full_name_Lookup',
6530 '_protorpc_AllocateIds', '_full_name_AllocateIds',
6531 '_protorpc_Get', '_full_name_Get',
6532 '_protorpc_Write', '_full_name_Write',
6535 def __init__(self, rpc_stub):
6536 self._stub = rpc_stub
6538 self._protorpc_BeginTransaction = pywraprpc.RPC()
6539 self._full_name_BeginTransaction = self._stub.GetFullMethodName(
6540 'BeginTransaction')
6542 self._protorpc_Rollback = pywraprpc.RPC()
6543 self._full_name_Rollback = self._stub.GetFullMethodName(
6544 'Rollback')
6546 self._protorpc_Commit = pywraprpc.RPC()
6547 self._full_name_Commit = self._stub.GetFullMethodName(
6548 'Commit')
6550 self._protorpc_RunQuery = pywraprpc.RPC()
6551 self._full_name_RunQuery = self._stub.GetFullMethodName(
6552 'RunQuery')
6554 self._protorpc_ContinueQuery = pywraprpc.RPC()
6555 self._full_name_ContinueQuery = self._stub.GetFullMethodName(
6556 'ContinueQuery')
6558 self._protorpc_Lookup = pywraprpc.RPC()
6559 self._full_name_Lookup = self._stub.GetFullMethodName(
6560 'Lookup')
6562 self._protorpc_AllocateIds = pywraprpc.RPC()
6563 self._full_name_AllocateIds = self._stub.GetFullMethodName(
6564 'AllocateIds')
6566 self._protorpc_Get = pywraprpc.RPC()
6567 self._full_name_Get = self._stub.GetFullMethodName(
6568 'Get')
6570 self._protorpc_Write = pywraprpc.RPC()
6571 self._full_name_Write = self._stub.GetFullMethodName(
6572 'Write')
6574 def BeginTransaction(self, request, rpc=None, callback=None, response=None):
6575 """Make a BeginTransaction RPC call.
6577 Args:
6578 request: a BeginTransactionRequest instance.
6579 rpc: Optional RPC instance to use for the call.
6580 callback: Optional final callback. Will be called as
6581 callback(rpc, result) when the rpc completes. If None, the
6582 call is synchronous.
6583 response: Optional ProtocolMessage to be filled in with response.
6585 Returns:
6586 The BeginTransactionResponse if callback is None. Otherwise, returns None.
6589 if response is None:
6590 response = BeginTransactionResponse
6591 return self._MakeCall(rpc,
6592 self._full_name_BeginTransaction,
6593 'BeginTransaction',
6594 request,
6595 response,
6596 callback,
6597 self._protorpc_BeginTransaction)
6599 def Rollback(self, request, rpc=None, callback=None, response=None):
6600 """Make a Rollback RPC call.
6602 Args:
6603 request: a RollbackRequest instance.
6604 rpc: Optional RPC instance to use for the call.
6605 callback: Optional final callback. Will be called as
6606 callback(rpc, result) when the rpc completes. If None, the
6607 call is synchronous.
6608 response: Optional ProtocolMessage to be filled in with response.
6610 Returns:
6611 The RollbackResponse if callback is None. Otherwise, returns None.
6614 if response is None:
6615 response = RollbackResponse
6616 return self._MakeCall(rpc,
6617 self._full_name_Rollback,
6618 'Rollback',
6619 request,
6620 response,
6621 callback,
6622 self._protorpc_Rollback)
6624 def Commit(self, request, rpc=None, callback=None, response=None):
6625 """Make a Commit RPC call.
6627 Args:
6628 request: a CommitRequest instance.
6629 rpc: Optional RPC instance to use for the call.
6630 callback: Optional final callback. Will be called as
6631 callback(rpc, result) when the rpc completes. If None, the
6632 call is synchronous.
6633 response: Optional ProtocolMessage to be filled in with response.
6635 Returns:
6636 The CommitResponse if callback is None. Otherwise, returns None.
6639 if response is None:
6640 response = CommitResponse
6641 return self._MakeCall(rpc,
6642 self._full_name_Commit,
6643 'Commit',
6644 request,
6645 response,
6646 callback,
6647 self._protorpc_Commit)
6649 def RunQuery(self, request, rpc=None, callback=None, response=None):
6650 """Make a RunQuery RPC call.
6652 Args:
6653 request: a RunQueryRequest instance.
6654 rpc: Optional RPC instance to use for the call.
6655 callback: Optional final callback. Will be called as
6656 callback(rpc, result) when the rpc completes. If None, the
6657 call is synchronous.
6658 response: Optional ProtocolMessage to be filled in with response.
6660 Returns:
6661 The RunQueryResponse if callback is None. Otherwise, returns None.
6664 if response is None:
6665 response = RunQueryResponse
6666 return self._MakeCall(rpc,
6667 self._full_name_RunQuery,
6668 'RunQuery',
6669 request,
6670 response,
6671 callback,
6672 self._protorpc_RunQuery)
6674 def ContinueQuery(self, request, rpc=None, callback=None, response=None):
6675 """Make a ContinueQuery RPC call.
6677 Args:
6678 request: a ContinueQueryRequest instance.
6679 rpc: Optional RPC instance to use for the call.
6680 callback: Optional final callback. Will be called as
6681 callback(rpc, result) when the rpc completes. If None, the
6682 call is synchronous.
6683 response: Optional ProtocolMessage to be filled in with response.
6685 Returns:
6686 The ContinueQueryResponse if callback is None. Otherwise, returns None.
6689 if response is None:
6690 response = ContinueQueryResponse
6691 return self._MakeCall(rpc,
6692 self._full_name_ContinueQuery,
6693 'ContinueQuery',
6694 request,
6695 response,
6696 callback,
6697 self._protorpc_ContinueQuery)
6699 def Lookup(self, request, rpc=None, callback=None, response=None):
6700 """Make a Lookup RPC call.
6702 Args:
6703 request: a LookupRequest instance.
6704 rpc: Optional RPC instance to use for the call.
6705 callback: Optional final callback. Will be called as
6706 callback(rpc, result) when the rpc completes. If None, the
6707 call is synchronous.
6708 response: Optional ProtocolMessage to be filled in with response.
6710 Returns:
6711 The LookupResponse if callback is None. Otherwise, returns None.
6714 if response is None:
6715 response = LookupResponse
6716 return self._MakeCall(rpc,
6717 self._full_name_Lookup,
6718 'Lookup',
6719 request,
6720 response,
6721 callback,
6722 self._protorpc_Lookup)
6724 def AllocateIds(self, request, rpc=None, callback=None, response=None):
6725 """Make a AllocateIds RPC call.
6727 Args:
6728 request: a AllocateIdsRequest instance.
6729 rpc: Optional RPC instance to use for the call.
6730 callback: Optional final callback. Will be called as
6731 callback(rpc, result) when the rpc completes. If None, the
6732 call is synchronous.
6733 response: Optional ProtocolMessage to be filled in with response.
6735 Returns:
6736 The AllocateIdsResponse if callback is None. Otherwise, returns None.
6739 if response is None:
6740 response = AllocateIdsResponse
6741 return self._MakeCall(rpc,
6742 self._full_name_AllocateIds,
6743 'AllocateIds',
6744 request,
6745 response,
6746 callback,
6747 self._protorpc_AllocateIds)
6749 def Get(self, request, rpc=None, callback=None, response=None):
6750 """Make a Get RPC call.
6752 Args:
6753 request: a LookupRequest instance.
6754 rpc: Optional RPC instance to use for the call.
6755 callback: Optional final callback. Will be called as
6756 callback(rpc, result) when the rpc completes. If None, the
6757 call is synchronous.
6758 response: Optional ProtocolMessage to be filled in with response.
6760 Returns:
6761 The LookupResponse if callback is None. Otherwise, returns None.
6764 if response is None:
6765 response = LookupResponse
6766 return self._MakeCall(rpc,
6767 self._full_name_Get,
6768 'Get',
6769 request,
6770 response,
6771 callback,
6772 self._protorpc_Get)
6774 def Write(self, request, rpc=None, callback=None, response=None):
6775 """Make a Write RPC call.
6777 Args:
6778 request: a WriteRequest instance.
6779 rpc: Optional RPC instance to use for the call.
6780 callback: Optional final callback. Will be called as
6781 callback(rpc, result) when the rpc completes. If None, the
6782 call is synchronous.
6783 response: Optional ProtocolMessage to be filled in with response.
6785 Returns:
6786 The CommitResponse if callback is None. Otherwise, returns None.
6789 if response is None:
6790 response = CommitResponse
6791 return self._MakeCall(rpc,
6792 self._full_name_Write,
6793 'Write',
6794 request,
6795 response,
6796 callback,
6797 self._protorpc_Write)
6800 class _DatastoreV4Service_ClientStub(_DatastoreV4Service_ClientBaseStub):
6801 __slots__ = ('_params',)
6802 def __init__(self, rpc_stub_parameters, service_name):
6803 if service_name is None:
6804 service_name = 'DatastoreV4Service'
6805 _DatastoreV4Service_ClientBaseStub.__init__(self, pywraprpc.RPC_GenericStub(service_name, rpc_stub_parameters))
6806 self._params = rpc_stub_parameters
6809 class _DatastoreV4Service_RPC2ClientStub(_DatastoreV4Service_ClientBaseStub):
6810 __slots__ = ()
6811 def __init__(self, server, channel, service_name):
6812 if service_name is None:
6813 service_name = 'DatastoreV4Service'
6814 if channel is not None:
6815 if channel.version() == 1:
6816 raise RuntimeError('Expecting an RPC2 channel to create the stub')
6817 _DatastoreV4Service_ClientBaseStub.__init__(self, pywraprpc.RPC_GenericStub(service_name, channel))
6818 elif server is not None:
6819 _DatastoreV4Service_ClientBaseStub.__init__(self, pywraprpc.RPC_GenericStub(service_name, pywraprpc.NewClientChannel(server)))
6820 else:
6821 raise RuntimeError('Invalid argument combination to create a stub')
6824 class DatastoreV4Service(_server_stub_base_class):
6825 """Base class for DatastoreV4Service Stubby servers."""
6827 @classmethod
6828 def _MethodSignatures(cls):
6829 """Returns a dict of {<method-name>: (<request-type>, <response-type>)}."""
6830 return {
6831 'BeginTransaction': (BeginTransactionRequest, BeginTransactionResponse),
6832 'Rollback': (RollbackRequest, RollbackResponse),
6833 'Commit': (CommitRequest, CommitResponse),
6834 'RunQuery': (RunQueryRequest, RunQueryResponse),
6835 'ContinueQuery': (ContinueQueryRequest, ContinueQueryResponse),
6836 'Lookup': (LookupRequest, LookupResponse),
6837 'AllocateIds': (AllocateIdsRequest, AllocateIdsResponse),
6838 'Get': (LookupRequest, LookupResponse),
6839 'Write': (WriteRequest, CommitResponse),
6842 @classmethod
6843 def _StreamMethodSignatures(cls):
6844 """Returns a dict of {<method-name>: (<request-type>, <stream-type>, <response-type>)}."""
6845 return {
6848 def __init__(self, *args, **kwargs):
6849 """Creates a Stubby RPC server.
6851 See BaseRpcServer.__init__ in rpcserver.py for detail on arguments.
6853 if _server_stub_base_class is object:
6854 raise NotImplementedError('Add //net/rpc/python:rpcserver as a '
6855 'dependency for Stubby server support.')
6856 _server_stub_base_class.__init__(self, 'apphosting.datastore.v4.DatastoreV4Service', *args, **kwargs)
6858 @staticmethod
6859 def NewStub(rpc_stub_parameters, service_name=None):
6860 """Creates a new DatastoreV4Service Stubby client stub.
6862 Args:
6863 rpc_stub_parameters: an RPC_StubParameter instance.
6864 service_name: the service name used by the Stubby server.
6867 if _client_stub_base_class is object:
6868 raise RuntimeError('Add //net/rpc/python as a dependency to use Stubby')
6869 return _DatastoreV4Service_ClientStub(rpc_stub_parameters, service_name)
6871 @staticmethod
6872 def NewRPC2Stub(server=None, channel=None, service_name=None):
6873 """Creates a new DatastoreV4Service Stubby2 client stub.
6875 Args:
6876 server: host:port or bns address.
6877 channel: directly use a channel to create a stub. Will ignore server
6878 argument if this is specified.
6879 service_name: the service name used by the Stubby server.
6882 if _client_stub_base_class is object:
6883 raise RuntimeError('Add //net/rpc/python as a dependency to use Stubby')
6884 return _DatastoreV4Service_RPC2ClientStub(server, channel, service_name)
6886 def BeginTransaction(self, rpc, request, response):
6887 """Handles a BeginTransaction RPC call. You should override this.
6889 Args:
6890 rpc: a Stubby RPC object
6891 request: a BeginTransactionRequest that contains the client request
6892 response: a BeginTransactionResponse that should be modified to send the response
6894 raise NotImplementedError
6897 def Rollback(self, rpc, request, response):
6898 """Handles a Rollback RPC call. You should override this.
6900 Args:
6901 rpc: a Stubby RPC object
6902 request: a RollbackRequest that contains the client request
6903 response: a RollbackResponse that should be modified to send the response
6905 raise NotImplementedError
6908 def Commit(self, rpc, request, response):
6909 """Handles a Commit RPC call. You should override this.
6911 Args:
6912 rpc: a Stubby RPC object
6913 request: a CommitRequest that contains the client request
6914 response: a CommitResponse that should be modified to send the response
6916 raise NotImplementedError
6919 def RunQuery(self, rpc, request, response):
6920 """Handles a RunQuery RPC call. You should override this.
6922 Args:
6923 rpc: a Stubby RPC object
6924 request: a RunQueryRequest that contains the client request
6925 response: a RunQueryResponse that should be modified to send the response
6927 raise NotImplementedError
6930 def ContinueQuery(self, rpc, request, response):
6931 """Handles a ContinueQuery RPC call. You should override this.
6933 Args:
6934 rpc: a Stubby RPC object
6935 request: a ContinueQueryRequest that contains the client request
6936 response: a ContinueQueryResponse that should be modified to send the response
6938 raise NotImplementedError
6941 def Lookup(self, rpc, request, response):
6942 """Handles a Lookup RPC call. You should override this.
6944 Args:
6945 rpc: a Stubby RPC object
6946 request: a LookupRequest that contains the client request
6947 response: a LookupResponse that should be modified to send the response
6949 raise NotImplementedError
6952 def AllocateIds(self, rpc, request, response):
6953 """Handles a AllocateIds RPC call. You should override this.
6955 Args:
6956 rpc: a Stubby RPC object
6957 request: a AllocateIdsRequest that contains the client request
6958 response: a AllocateIdsResponse that should be modified to send the response
6960 raise NotImplementedError
6963 def Get(self, rpc, request, response):
6964 """Handles a Get RPC call. You should override this.
6966 Args:
6967 rpc: a Stubby RPC object
6968 request: a LookupRequest that contains the client request
6969 response: a LookupResponse that should be modified to send the response
6971 raise NotImplementedError
6974 def Write(self, rpc, request, response):
6975 """Handles a Write RPC call. You should override this.
6977 Args:
6978 rpc: a Stubby RPC object
6979 request: a WriteRequest that contains the client request
6980 response: a CommitResponse that should be modified to send the response
6982 raise NotImplementedError
6984 def _AddMethodAttributes(self):
6985 """Sets attributes on Python RPC handlers.
6987 See BaseRpcServer in rpcserver.py for details.
6989 rpcserver._GetHandlerDecorator(
6990 self.BeginTransaction.im_func,
6991 BeginTransactionRequest,
6992 BeginTransactionResponse,
6993 None,
6994 'none')
6995 rpcserver._GetHandlerDecorator(
6996 self.Rollback.im_func,
6997 RollbackRequest,
6998 RollbackResponse,
6999 None,
7000 'none')
7001 rpcserver._GetHandlerDecorator(
7002 self.Commit.im_func,
7003 CommitRequest,
7004 CommitResponse,
7005 None,
7006 'none')
7007 rpcserver._GetHandlerDecorator(
7008 self.RunQuery.im_func,
7009 RunQueryRequest,
7010 RunQueryResponse,
7011 None,
7012 'none')
7013 rpcserver._GetHandlerDecorator(
7014 self.ContinueQuery.im_func,
7015 ContinueQueryRequest,
7016 ContinueQueryResponse,
7017 None,
7018 'none')
7019 rpcserver._GetHandlerDecorator(
7020 self.Lookup.im_func,
7021 LookupRequest,
7022 LookupResponse,
7023 None,
7024 'none')
7025 rpcserver._GetHandlerDecorator(
7026 self.AllocateIds.im_func,
7027 AllocateIdsRequest,
7028 AllocateIdsResponse,
7029 None,
7030 'none')
7031 rpcserver._GetHandlerDecorator(
7032 self.Get.im_func,
7033 LookupRequest,
7034 LookupResponse,
7035 None,
7036 'none')
7037 rpcserver._GetHandlerDecorator(
7038 self.Write.im_func,
7039 WriteRequest,
7040 CommitResponse,
7041 None,
7042 'none')
7044 if _extension_runtime:
7045 pass
7047 __all__ = ['Error','EntityResult','Query','KindExpression','PropertyReference','PropertyExpression','PropertyOrder','Filter','CompositeFilter','PropertyFilter','GqlQuery','GqlQueryArg','QueryResultBatch','Mutation','MutationResult','ReadOptions','LookupRequest','LookupResponse','RunQueryRequest','RunQueryResponse','ContinueQueryRequest','ContinueQueryResponse','BeginTransactionRequest','BeginTransactionResponse','RollbackRequest','RollbackResponse','CommitRequest','CommitResponse','AllocateIdsRequest','AllocateIdsResponse','WriteRequest','DatastoreV4Service']