App Engine Python SDK version 1.9.12
[gae.git] / python / google / appengine / datastore / datastore_v4_pb.py
blob57d8e8e06cc6f4a11382db57853dc8caf8024c84
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("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9yc3oJRXJyb3JDb2RliwGSAQtCQURfUkVRVUVTVJgBAYwBiwGSARZDT05DVVJSRU5UX1RSQU5TQUNUSU9OmAECjAGLAZIBDklOVEVSTkFMX0VSUk9SmAEDjAGLAZIBCk5FRURfSU5ERViYAQSMAYsBkgEHVElNRU9VVJgBBYwBiwGSARFQRVJNSVNTSU9OX0RFTklFRJgBBowBiwGSAQ5CSUdUQUJMRV9FUlJPUpgBB4wBiwGSARxDT01NSVRURURfQlVUX1NUSUxMX0FQUExZSU5HmAEIjAGLAZIBE0NBUEFCSUxJVFlfRElTQUJMRUSYAQmMAYsBkgEVVFJZX0FMVEVSTkFURV9CQUNLRU5EmAEKjAGLAZIBEVNBRkVfVElNRV9UT09fT0xEmAELjAF0ugGJNwonYXBwaG9zdGluZy9kYXRhc3RvcmUvZGF0YXN0b3JlX3Y0LnByb3RvEhdhcHBob3N0aW5nLmRhdGFzdG9yZS52NBokYXBwaG9zdGluZy9kYXRhc3RvcmUvZW50aXR5X3Y0LnByb3RvIosCCgVFcnJvciKBAgoJRXJyb3JDb2RlEg8KC0JBRF9SRVFVRVNUEAESGgoWQ09OQ1VSUkVOVF9UUkFOU0FDVElPThACEhIKDklOVEVSTkFMX0VSUk9SEAMSDgoKTkVFRF9JTkRFWBAEEgsKB1RJTUVPVVQQBRIVChFQRVJNSVNTSU9OX0RFTklFRBAGEhIKDkJJR1RBQkxFX0VSUk9SEAcSIAocQ09NTUlUVEVEX0JVVF9TVElMTF9BUFBMWUlORxAIEhcKE0NBUEFCSUxJVFlfRElTQUJMRUQQCRIZChVUUllfQUxURVJOQVRFX0JBQ0tFTkQQChIVChFTQUZFX1RJTUVfVE9PX09MRBALIpYBCgxFbnRpdHlSZXN1bHQSLwoGZW50aXR5GAEgAigLMh8uYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5Eg8KB3ZlcnNpb24YAiABKAMSDgoGY3Vyc29yGAMgASgMIjQKClJlc3VsdFR5cGUSCAoERlVMTBABEg4KClBST0pFQ1RJT04QAhIMCghLRVlfT05MWRADIvECCgVRdWVyeRI/Cgpwcm9qZWN0aW9uGAIgAygLMisuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlFeHByZXNzaW9uEjUKBGtpbmQYAyADKAsyJy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LaW5kRXhwcmVzc2lvbhIvCgZmaWx0ZXIYBCABKAsyHy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5GaWx0ZXISNQoFb3JkZXIYBSADKAsyJi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eU9yZGVyEjwKCGdyb3VwX2J5GAYgAygLMiouYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlSZWZlcmVuY2USFAoMc3RhcnRfY3Vyc29yGAcgASgMEhIKCmVuZF9jdXJzb3IYCCABKAwSEQoGb2Zmc2V0GAogASgFOgEwEg0KBWxpbWl0GAsgASgFIh4KDktpbmRFeHByZXNzaW9uEgwKBG5hbWUYASACKAkiIQoRUHJvcGVydHlSZWZlcmVuY2USDAoEbmFtZRgCIAIoCSLTAQoSUHJvcGVydHlFeHByZXNzaW9uEjwKCHByb3BlcnR5GAEgAigLMiouYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlSZWZlcmVuY2USXQoUYWdncmVnYXRpb25fZnVuY3Rpb24YAiABKA4yPy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eUV4cHJlc3Npb24uQWdncmVnYXRpb25GdW5jdGlvbiIgChNBZ2dyZWdhdGlvbkZ1bmN0aW9uEgkKBUZJUlNUEAEiyQEKDVByb3BlcnR5T3JkZXISPAoIcHJvcGVydHkYASACKAsyKi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eVJlZmVyZW5jZRJOCglkaXJlY3Rpb24YAiABKA4yMC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eU9yZGVyLkRpcmVjdGlvbjoJQVNDRU5ESU5HIioKCURpcmVjdGlvbhINCglBU0NFTkRJTkcQARIOCgpERVNDRU5ESU5HEAIipgIKBkZpbHRlchJCChBjb21wb3NpdGVfZmlsdGVyGAEgASgLMiguYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQ29tcG9zaXRlRmlsdGVyEkAKD3Byb3BlcnR5X2ZpbHRlchgCIAEoCzInLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5RmlsdGVyEk0KFmJvdW5kaW5nX2NpcmNsZV9maWx0ZXIYAyABKAsyLS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Cb3VuZGluZ0NpcmNsZUZpbHRlchJHChNib3VuZGluZ19ib3hfZmlsdGVyGAQgASgLMiouYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQm91bmRpbmdCb3hGaWx0ZXIinAEKD0NvbXBvc2l0ZUZpbHRlchJDCghvcGVyYXRvchgBIAIoDjIxLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbXBvc2l0ZUZpbHRlci5PcGVyYXRvchIvCgZmaWx0ZXIYAiADKAsyHy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5GaWx0ZXIiEwoIT3BlcmF0b3ISBwoDQU5EEAEivgIKDlByb3BlcnR5RmlsdGVyEjwKCHByb3BlcnR5GAEgAigLMiouYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlSZWZlcmVuY2USQgoIb3BlcmF0b3IYAiACKA4yMC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eUZpbHRlci5PcGVyYXRvchItCgV2YWx1ZRgDIAIoCzIeLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlZhbHVlInsKCE9wZXJhdG9yEg0KCUxFU1NfVEhBThABEhYKEkxFU1NfVEhBTl9PUl9FUVVBTBACEhAKDEdSRUFURVJfVEhBThADEhkKFUdSRUFURVJfVEhBTl9PUl9FUVVBTBAEEgkKBUVRVUFMEAUSEAoMSEFTX0FOQ0VTVE9SEAsingEKFEJvdW5kaW5nQ2lyY2xlRmlsdGVyEjwKCHByb3BlcnR5GAEgAigLMiouYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlSZWZlcmVuY2USMQoGY2VudGVyGAIgAigLMiEuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuR2VvUG9pbnQSFQoNcmFkaXVzX21ldGVycxgDIAIoASK9AQoRQm91bmRpbmdCb3hGaWx0ZXISPAoIcHJvcGVydHkYASACKAsyKi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eVJlZmVyZW5jZRI0Cglzb3V0aHdlc3QYAiACKAsyIS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5HZW9Qb2ludBI0Cglub3J0aGVhc3QYAyACKAsyIS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5HZW9Qb2ludCKwAQoIR3FsUXVlcnkSFAoMcXVlcnlfc3RyaW5nGAEgAigJEhwKDWFsbG93X2xpdGVyYWwYAiABKAg6BWZhbHNlEjYKCG5hbWVfYXJnGAMgAygLMiQuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuR3FsUXVlcnlBcmcSOAoKbnVtYmVyX2FyZxgEIAMoCzIkLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkdxbFF1ZXJ5QXJnIloKC0dxbFF1ZXJ5QXJnEgwKBG5hbWUYASABKAkSLQoFdmFsdWUYAiABKAsyHi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5WYWx1ZRIOCgZjdXJzb3IYAyABKAwiqQMKEFF1ZXJ5UmVzdWx0QmF0Y2gSTAoSZW50aXR5X3Jlc3VsdF90eXBlGAEgAigOMjAuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5UmVzdWx0LlJlc3VsdFR5cGUSPAoNZW50aXR5X3Jlc3VsdBgCIAMoCzIlLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eVJlc3VsdBIWCg5za2lwcGVkX2N1cnNvchgDIAEoDBISCgplbmRfY3Vyc29yGAQgASgMEk8KDG1vcmVfcmVzdWx0cxgFIAIoDjI5LmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlF1ZXJ5UmVzdWx0QmF0Y2guTW9yZVJlc3VsdHNUeXBlEhoKD3NraXBwZWRfcmVzdWx0cxgGIAEoBToBMBIYChBzbmFwc2hvdF92ZXJzaW9uGAcgASgDIlYKD01vcmVSZXN1bHRzVHlwZRIQCgxOT1RfRklOSVNIRUQQARIcChhNT1JFX1JFU1VMVFNfQUZURVJfTElNSVQQAhITCg9OT19NT1JFX1JFU1VMVFMQAyLyAQoITXV0YXRpb24SQAoCb3AYASABKA4yKy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5NdXRhdGlvbi5PcGVyYXRpb246B1VOS05PV04SKQoDa2V5GAIgASgLMhwuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuS2V5Ei8KBmVudGl0eRgDIAEoCzIfLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eSJICglPcGVyYXRpb24SCwoHVU5LTk9XThAAEgoKBklOU0VSVBABEgoKBlVQREFURRACEgoKBlVQU0VSVBADEgoKBkRFTEVURRAEIlMKDk11dGF0aW9uUmVzdWx0EikKA2tleRgDIAEoCzIcLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleRIWCgtuZXdfdmVyc2lvbhgEIAEoAzoBMCKkAgoSRGVwcmVjYXRlZE11dGF0aW9uEi8KBnVwc2VydBgBIAMoCzIfLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eRIvCgZ1cGRhdGUYAiADKAsyHy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FbnRpdHkSLwoGaW5zZXJ0GAMgAygLMh8uYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5EjcKDmluc2VydF9hdXRvX2lkGAQgAygLMh8uYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5EiwKBmRlbGV0ZRgFIAMoCzIcLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleRIUCgVmb3JjZRgGIAEoCDoFZmFsc2Ui6wEKGERlcHJlY2F0ZWRNdXRhdGlvblJlc3VsdBIVCg1pbmRleF91cGRhdGVzGAEgAigFEjgKEmluc2VydF9hdXRvX2lkX2tleRgCIAMoCzIcLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleRIWCg51cHNlcnRfdmVyc2lvbhgDIAMoAxIWCg51cGRhdGVfdmVyc2lvbhgEIAMoAxIWCg5pbnNlcnRfdmVyc2lvbhgFIAMoAxIeChZpbnNlcnRfYXV0b19pZF92ZXJzaW9uGAYgAygDEhYKDmRlbGV0ZV92ZXJzaW9uGAcgAygDIrUBCgtSZWFkT3B0aW9ucxJXChByZWFkX2NvbnNpc3RlbmN5GAEgASgOMjQuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUmVhZE9wdGlvbnMuUmVhZENvbnNpc3RlbmN5OgdERUZBVUxUEhMKC3RyYW5zYWN0aW9uGAIgASgMIjgKD1JlYWRDb25zaXN0ZW5jeRILCgdERUZBVUxUEAASCgoGU1RST05HEAESDAoIRVZFTlRVQUwQAiJ2Cg1Mb29rdXBSZXF1ZXN0EjoKDHJlYWRfb3B0aW9ucxgBIAEoCzIkLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJlYWRPcHRpb25zEikKA2tleRgDIAMoCzIcLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleSKuAQoOTG9va3VwUmVzcG9uc2USNAoFZm91bmQYASADKAsyJS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FbnRpdHlSZXN1bHQSNgoHbWlzc2luZxgCIAMoCzIlLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eVJlc3VsdBIuCghkZWZlcnJlZBgDIAMoCzIcLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleSKrAgoPUnVuUXVlcnlSZXF1ZXN0EjoKDHJlYWRfb3B0aW9ucxgBIAEoCzIkLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJlYWRPcHRpb25zEjoKDHBhcnRpdGlvbl9pZBgCIAEoCzIkLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlBhcnRpdGlvbklkEi0KBXF1ZXJ5GAMgASgLMh4uYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUXVlcnkSNAoJZ3FsX3F1ZXJ5GAcgASgLMiEuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuR3FsUXVlcnkSHQoVbWluX3NhZmVfdGltZV9zZWNvbmRzGAQgASgDEhwKFHN1Z2dlc3RlZF9iYXRjaF9zaXplGAUgASgFImIKEFJ1blF1ZXJ5UmVzcG9uc2USOAoFYmF0Y2gYASACKAsyKS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5RdWVyeVJlc3VsdEJhdGNoEhQKDHF1ZXJ5X2hhbmRsZRgCIAEoDCIsChRDb250aW51ZVF1ZXJ5UmVxdWVzdBIUCgxxdWVyeV9oYW5kbGUYASACKAwiUQoVQ29udGludWVRdWVyeVJlc3BvbnNlEjgKBWJhdGNoGAEgAigLMikuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUXVlcnlSZXN1bHRCYXRjaCJTChdCZWdpblRyYW5zYWN0aW9uUmVxdWVzdBIaCgtjcm9zc19ncm91cBgBIAEoCDoFZmFsc2USHAoNY3Jvc3NfcmVxdWVzdBgCIAEoCDoFZmFsc2UiLwoYQmVnaW5UcmFuc2FjdGlvblJlc3BvbnNlEhMKC3RyYW5zYWN0aW9uGAEgAigMIiYKD1JvbGxiYWNrUmVxdWVzdBITCgt0cmFuc2FjdGlvbhgBIAIoDCISChBSb2xsYmFja1Jlc3BvbnNlIsACCg1Db21taXRSZXF1ZXN0EhMKC3RyYW5zYWN0aW9uGAEgASgMEjMKCG11dGF0aW9uGAUgAygLMiEuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuTXV0YXRpb24SSAoTZGVwcmVjYXRlZF9tdXRhdGlvbhgCIAEoCzIrLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkRlcHJlY2F0ZWRNdXRhdGlvbhJICgRtb2RlGAQgASgOMisuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQ29tbWl0UmVxdWVzdC5Nb2RlOg1UUkFOU0FDVElPTkFMEh8KEGlnbm9yZV9yZWFkX29ubHkYBiABKAg6BWZhbHNlIjAKBE1vZGUSEQoNVFJBTlNBQ1RJT05BTBABEhUKEU5PTl9UUkFOU0FDVElPTkFMEAIiwAEKDkNvbW1pdFJlc3BvbnNlEkAKD211dGF0aW9uX3Jlc3VsdBgDIAMoCzInLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uUmVzdWx0ElUKGmRlcHJlY2F0ZWRfbXV0YXRpb25fcmVzdWx0GAEgASgLMjEuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRGVwcmVjYXRlZE11dGF0aW9uUmVzdWx0EhUKDWluZGV4X3VwZGF0ZXMYBCABKAUicwoSQWxsb2NhdGVJZHNSZXF1ZXN0Ei4KCGFsbG9jYXRlGAEgAygLMhwuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuS2V5Ei0KB3Jlc2VydmUYAiADKAsyHC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LZXkiRgoTQWxsb2NhdGVJZHNSZXNwb25zZRIvCglhbGxvY2F0ZWQYASADKAsyHC5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LZXkiWAoMV3JpdGVSZXF1ZXN0EkgKE2RlcHJlY2F0ZWRfbXV0YXRpb24YASACKAsyKy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5EZXByZWNhdGVkTXV0YXRpb24yogcKEkRhdGFzdG9yZVY0U2VydmljZRJ5ChBCZWdpblRyYW5zYWN0aW9uEjAuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQmVnaW5UcmFuc2FjdGlvblJlcXVlc3QaMS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5CZWdpblRyYW5zYWN0aW9uUmVzcG9uc2UiABJhCghSb2xsYmFjaxIoLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJvbGxiYWNrUmVxdWVzdBopLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJvbGxiYWNrUmVzcG9uc2UiABJbCgZDb21taXQSJi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Db21taXRSZXF1ZXN0GicuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQ29tbWl0UmVzcG9uc2UiABJhCghSdW5RdWVyeRIoLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJ1blF1ZXJ5UmVxdWVzdBopLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJ1blF1ZXJ5UmVzcG9uc2UiABJwCg1Db250aW51ZVF1ZXJ5Ei0uYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQ29udGludWVRdWVyeVJlcXVlc3QaLi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Db250aW51ZVF1ZXJ5UmVzcG9uc2UiABJbCgZMb29rdXASJi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Mb29rdXBSZXF1ZXN0GicuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuTG9va3VwUmVzcG9uc2UiABJqCgtBbGxvY2F0ZUlkcxIrLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkFsbG9jYXRlSWRzUmVxdWVzdBosLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkFsbG9jYXRlSWRzUmVzcG9uc2UiABJYCgNHZXQSJi5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Mb29rdXBSZXF1ZXN0GicuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuTG9va3VwUmVzcG9uc2UiABJZCgVXcml0ZRIlLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LldyaXRlUmVxdWVzdBonLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbW1pdFJlc3BvbnNlIgBCIwofY29tLmdvb2dsZS5hcHBob3N0aW5nLmRhdGFzdG9yZSAB"))
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
204 has_cursor_ = 0
205 cursor_ = ""
207 def __init__(self, contents=None):
208 self.entity_ = google.appengine.datastore.entity_v4_pb.Entity()
209 if contents is not None: self.MergeFromString(contents)
211 def entity(self): return self.entity_
213 def mutable_entity(self): self.has_entity_ = 1; return self.entity_
215 def clear_entity(self):self.has_entity_ = 0; self.entity_.Clear()
217 def has_entity(self): return self.has_entity_
219 def version(self): return self.version_
221 def set_version(self, x):
222 self.has_version_ = 1
223 self.version_ = x
225 def clear_version(self):
226 if self.has_version_:
227 self.has_version_ = 0
228 self.version_ = 0
230 def has_version(self): return self.has_version_
232 def cursor(self): return self.cursor_
234 def set_cursor(self, x):
235 self.has_cursor_ = 1
236 self.cursor_ = x
238 def clear_cursor(self):
239 if self.has_cursor_:
240 self.has_cursor_ = 0
241 self.cursor_ = ""
243 def has_cursor(self): return self.has_cursor_
246 def MergeFrom(self, x):
247 assert x is not self
248 if (x.has_entity()): self.mutable_entity().MergeFrom(x.entity())
249 if (x.has_version()): self.set_version(x.version())
250 if (x.has_cursor()): self.set_cursor(x.cursor())
252 if _net_proto___parse__python is not None:
253 def _CMergeFromString(self, s):
254 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.EntityResult', s)
256 if _net_proto___parse__python is not None:
257 def _CEncode(self):
258 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.EntityResult')
260 if _net_proto___parse__python is not None:
261 def _CEncodePartial(self):
262 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.EntityResult')
264 if _net_proto___parse__python is not None:
265 def _CToASCII(self, output_format):
266 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.EntityResult', output_format)
269 if _net_proto___parse__python is not None:
270 def ParseASCII(self, s):
271 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.EntityResult', s)
274 if _net_proto___parse__python is not None:
275 def ParseASCIIIgnoreUnknown(self, s):
276 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.EntityResult', s)
279 def Equals(self, x):
280 if x is self: return 1
281 if self.has_entity_ != x.has_entity_: return 0
282 if self.has_entity_ and self.entity_ != x.entity_: return 0
283 if self.has_version_ != x.has_version_: return 0
284 if self.has_version_ and self.version_ != x.version_: return 0
285 if self.has_cursor_ != x.has_cursor_: return 0
286 if self.has_cursor_ and self.cursor_ != x.cursor_: return 0
287 return 1
289 def IsInitialized(self, debug_strs=None):
290 initialized = 1
291 if (not self.has_entity_):
292 initialized = 0
293 if debug_strs is not None:
294 debug_strs.append('Required field: entity not set.')
295 elif not self.entity_.IsInitialized(debug_strs): initialized = 0
296 return initialized
298 def ByteSize(self):
299 n = 0
300 n += self.lengthString(self.entity_.ByteSize())
301 if (self.has_version_): n += 1 + self.lengthVarInt64(self.version_)
302 if (self.has_cursor_): n += 1 + self.lengthString(len(self.cursor_))
303 return n + 1
305 def ByteSizePartial(self):
306 n = 0
307 if (self.has_entity_):
308 n += 1
309 n += self.lengthString(self.entity_.ByteSizePartial())
310 if (self.has_version_): n += 1 + self.lengthVarInt64(self.version_)
311 if (self.has_cursor_): n += 1 + self.lengthString(len(self.cursor_))
312 return n
314 def Clear(self):
315 self.clear_entity()
316 self.clear_version()
317 self.clear_cursor()
319 def OutputUnchecked(self, out):
320 out.putVarInt32(10)
321 out.putVarInt32(self.entity_.ByteSize())
322 self.entity_.OutputUnchecked(out)
323 if (self.has_version_):
324 out.putVarInt32(16)
325 out.putVarInt64(self.version_)
326 if (self.has_cursor_):
327 out.putVarInt32(26)
328 out.putPrefixedString(self.cursor_)
330 def OutputPartial(self, out):
331 if (self.has_entity_):
332 out.putVarInt32(10)
333 out.putVarInt32(self.entity_.ByteSizePartial())
334 self.entity_.OutputPartial(out)
335 if (self.has_version_):
336 out.putVarInt32(16)
337 out.putVarInt64(self.version_)
338 if (self.has_cursor_):
339 out.putVarInt32(26)
340 out.putPrefixedString(self.cursor_)
342 def TryMerge(self, d):
343 while d.avail() > 0:
344 tt = d.getVarInt32()
345 if tt == 10:
346 length = d.getVarInt32()
347 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
348 d.skip(length)
349 self.mutable_entity().TryMerge(tmp)
350 continue
351 if tt == 16:
352 self.set_version(d.getVarInt64())
353 continue
354 if tt == 26:
355 self.set_cursor(d.getPrefixedString())
356 continue
359 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
360 d.skipData(tt)
363 def __str__(self, prefix="", printElemNumber=0):
364 res=""
365 if self.has_entity_:
366 res+=prefix+"entity <\n"
367 res+=self.entity_.__str__(prefix + " ", printElemNumber)
368 res+=prefix+">\n"
369 if self.has_version_: res+=prefix+("version: %s\n" % self.DebugFormatInt64(self.version_))
370 if self.has_cursor_: res+=prefix+("cursor: %s\n" % self.DebugFormatString(self.cursor_))
371 return res
374 def _BuildTagLookupTable(sparse, maxtag, default=None):
375 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
377 kentity = 1
378 kversion = 2
379 kcursor = 3
381 _TEXT = _BuildTagLookupTable({
382 0: "ErrorCode",
383 1: "entity",
384 2: "version",
385 3: "cursor",
386 }, 3)
388 _TYPES = _BuildTagLookupTable({
389 0: ProtocolBuffer.Encoder.NUMERIC,
390 1: ProtocolBuffer.Encoder.STRING,
391 2: ProtocolBuffer.Encoder.NUMERIC,
392 3: ProtocolBuffer.Encoder.STRING,
393 }, 3, ProtocolBuffer.Encoder.MAX_TYPE)
396 _STYLE = """"""
397 _STYLE_CONTENT_TYPE = """"""
398 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.EntityResult'
399 _SERIALIZED_DESCRIPTOR = array.array('B')
400 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eVJlc3VsdBMaBmVudGl0eSABKAIwCzgCSh5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FbnRpdHmjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoHdmVyc2lvbiACKAAwAzgBFBMaBmN1cnNvciADKAIwCTgBFHN6ClJlc3VsdFR5cGWLAZIBBEZVTEyYAQGMAYsBkgEKUFJPSkVDVElPTpgBAowBiwGSAQhLRVlfT05MWZgBA4wBdMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
401 if _net_proto___parse__python is not None:
402 _net_proto___parse__python.RegisterType(
403 _SERIALIZED_DESCRIPTOR.tostring())
405 class Query(ProtocolBuffer.ProtocolMessage):
406 has_filter_ = 0
407 filter_ = None
408 has_start_cursor_ = 0
409 start_cursor_ = ""
410 has_end_cursor_ = 0
411 end_cursor_ = ""
412 has_offset_ = 0
413 offset_ = 0
414 has_limit_ = 0
415 limit_ = 0
417 def __init__(self, contents=None):
418 self.projection_ = []
419 self.kind_ = []
420 self.order_ = []
421 self.group_by_ = []
422 self.lazy_init_lock_ = thread.allocate_lock()
423 if contents is not None: self.MergeFromString(contents)
425 def projection_size(self): return len(self.projection_)
426 def projection_list(self): return self.projection_
428 def projection(self, i):
429 return self.projection_[i]
431 def mutable_projection(self, i):
432 return self.projection_[i]
434 def add_projection(self):
435 x = PropertyExpression()
436 self.projection_.append(x)
437 return x
439 def clear_projection(self):
440 self.projection_ = []
441 def kind_size(self): return len(self.kind_)
442 def kind_list(self): return self.kind_
444 def kind(self, i):
445 return self.kind_[i]
447 def mutable_kind(self, i):
448 return self.kind_[i]
450 def add_kind(self):
451 x = KindExpression()
452 self.kind_.append(x)
453 return x
455 def clear_kind(self):
456 self.kind_ = []
457 def filter(self):
458 if self.filter_ is None:
459 self.lazy_init_lock_.acquire()
460 try:
461 if self.filter_ is None: self.filter_ = Filter()
462 finally:
463 self.lazy_init_lock_.release()
464 return self.filter_
466 def mutable_filter(self): self.has_filter_ = 1; return self.filter()
468 def clear_filter(self):
470 if self.has_filter_:
471 self.has_filter_ = 0;
472 if self.filter_ is not None: self.filter_.Clear()
474 def has_filter(self): return self.has_filter_
476 def order_size(self): return len(self.order_)
477 def order_list(self): return self.order_
479 def order(self, i):
480 return self.order_[i]
482 def mutable_order(self, i):
483 return self.order_[i]
485 def add_order(self):
486 x = PropertyOrder()
487 self.order_.append(x)
488 return x
490 def clear_order(self):
491 self.order_ = []
492 def group_by_size(self): return len(self.group_by_)
493 def group_by_list(self): return self.group_by_
495 def group_by(self, i):
496 return self.group_by_[i]
498 def mutable_group_by(self, i):
499 return self.group_by_[i]
501 def add_group_by(self):
502 x = PropertyReference()
503 self.group_by_.append(x)
504 return x
506 def clear_group_by(self):
507 self.group_by_ = []
508 def start_cursor(self): return self.start_cursor_
510 def set_start_cursor(self, x):
511 self.has_start_cursor_ = 1
512 self.start_cursor_ = x
514 def clear_start_cursor(self):
515 if self.has_start_cursor_:
516 self.has_start_cursor_ = 0
517 self.start_cursor_ = ""
519 def has_start_cursor(self): return self.has_start_cursor_
521 def end_cursor(self): return self.end_cursor_
523 def set_end_cursor(self, x):
524 self.has_end_cursor_ = 1
525 self.end_cursor_ = x
527 def clear_end_cursor(self):
528 if self.has_end_cursor_:
529 self.has_end_cursor_ = 0
530 self.end_cursor_ = ""
532 def has_end_cursor(self): return self.has_end_cursor_
534 def offset(self): return self.offset_
536 def set_offset(self, x):
537 self.has_offset_ = 1
538 self.offset_ = x
540 def clear_offset(self):
541 if self.has_offset_:
542 self.has_offset_ = 0
543 self.offset_ = 0
545 def has_offset(self): return self.has_offset_
547 def limit(self): return self.limit_
549 def set_limit(self, x):
550 self.has_limit_ = 1
551 self.limit_ = x
553 def clear_limit(self):
554 if self.has_limit_:
555 self.has_limit_ = 0
556 self.limit_ = 0
558 def has_limit(self): return self.has_limit_
561 def MergeFrom(self, x):
562 assert x is not self
563 for i in xrange(x.projection_size()): self.add_projection().CopyFrom(x.projection(i))
564 for i in xrange(x.kind_size()): self.add_kind().CopyFrom(x.kind(i))
565 if (x.has_filter()): self.mutable_filter().MergeFrom(x.filter())
566 for i in xrange(x.order_size()): self.add_order().CopyFrom(x.order(i))
567 for i in xrange(x.group_by_size()): self.add_group_by().CopyFrom(x.group_by(i))
568 if (x.has_start_cursor()): self.set_start_cursor(x.start_cursor())
569 if (x.has_end_cursor()): self.set_end_cursor(x.end_cursor())
570 if (x.has_offset()): self.set_offset(x.offset())
571 if (x.has_limit()): self.set_limit(x.limit())
573 if _net_proto___parse__python is not None:
574 def _CMergeFromString(self, s):
575 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.Query', s)
577 if _net_proto___parse__python is not None:
578 def _CEncode(self):
579 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.Query')
581 if _net_proto___parse__python is not None:
582 def _CEncodePartial(self):
583 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.Query')
585 if _net_proto___parse__python is not None:
586 def _CToASCII(self, output_format):
587 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.Query', output_format)
590 if _net_proto___parse__python is not None:
591 def ParseASCII(self, s):
592 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.Query', s)
595 if _net_proto___parse__python is not None:
596 def ParseASCIIIgnoreUnknown(self, s):
597 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.Query', s)
600 def Equals(self, x):
601 if x is self: return 1
602 if len(self.projection_) != len(x.projection_): return 0
603 for e1, e2 in zip(self.projection_, x.projection_):
604 if e1 != e2: return 0
605 if len(self.kind_) != len(x.kind_): return 0
606 for e1, e2 in zip(self.kind_, x.kind_):
607 if e1 != e2: return 0
608 if self.has_filter_ != x.has_filter_: return 0
609 if self.has_filter_ and self.filter_ != x.filter_: return 0
610 if len(self.order_) != len(x.order_): return 0
611 for e1, e2 in zip(self.order_, x.order_):
612 if e1 != e2: return 0
613 if len(self.group_by_) != len(x.group_by_): return 0
614 for e1, e2 in zip(self.group_by_, x.group_by_):
615 if e1 != e2: return 0
616 if self.has_start_cursor_ != x.has_start_cursor_: return 0
617 if self.has_start_cursor_ and self.start_cursor_ != x.start_cursor_: return 0
618 if self.has_end_cursor_ != x.has_end_cursor_: return 0
619 if self.has_end_cursor_ and self.end_cursor_ != x.end_cursor_: return 0
620 if self.has_offset_ != x.has_offset_: return 0
621 if self.has_offset_ and self.offset_ != x.offset_: return 0
622 if self.has_limit_ != x.has_limit_: return 0
623 if self.has_limit_ and self.limit_ != x.limit_: return 0
624 return 1
626 def IsInitialized(self, debug_strs=None):
627 initialized = 1
628 for p in self.projection_:
629 if not p.IsInitialized(debug_strs): initialized=0
630 for p in self.kind_:
631 if not p.IsInitialized(debug_strs): initialized=0
632 if (self.has_filter_ and not self.filter_.IsInitialized(debug_strs)): initialized = 0
633 for p in self.order_:
634 if not p.IsInitialized(debug_strs): initialized=0
635 for p in self.group_by_:
636 if not p.IsInitialized(debug_strs): initialized=0
637 return initialized
639 def ByteSize(self):
640 n = 0
641 n += 1 * len(self.projection_)
642 for i in xrange(len(self.projection_)): n += self.lengthString(self.projection_[i].ByteSize())
643 n += 1 * len(self.kind_)
644 for i in xrange(len(self.kind_)): n += self.lengthString(self.kind_[i].ByteSize())
645 if (self.has_filter_): n += 1 + self.lengthString(self.filter_.ByteSize())
646 n += 1 * len(self.order_)
647 for i in xrange(len(self.order_)): n += self.lengthString(self.order_[i].ByteSize())
648 n += 1 * len(self.group_by_)
649 for i in xrange(len(self.group_by_)): n += self.lengthString(self.group_by_[i].ByteSize())
650 if (self.has_start_cursor_): n += 1 + self.lengthString(len(self.start_cursor_))
651 if (self.has_end_cursor_): n += 1 + self.lengthString(len(self.end_cursor_))
652 if (self.has_offset_): n += 1 + self.lengthVarInt64(self.offset_)
653 if (self.has_limit_): n += 1 + self.lengthVarInt64(self.limit_)
654 return n
656 def ByteSizePartial(self):
657 n = 0
658 n += 1 * len(self.projection_)
659 for i in xrange(len(self.projection_)): n += self.lengthString(self.projection_[i].ByteSizePartial())
660 n += 1 * len(self.kind_)
661 for i in xrange(len(self.kind_)): n += self.lengthString(self.kind_[i].ByteSizePartial())
662 if (self.has_filter_): n += 1 + self.lengthString(self.filter_.ByteSizePartial())
663 n += 1 * len(self.order_)
664 for i in xrange(len(self.order_)): n += self.lengthString(self.order_[i].ByteSizePartial())
665 n += 1 * len(self.group_by_)
666 for i in xrange(len(self.group_by_)): n += self.lengthString(self.group_by_[i].ByteSizePartial())
667 if (self.has_start_cursor_): n += 1 + self.lengthString(len(self.start_cursor_))
668 if (self.has_end_cursor_): n += 1 + self.lengthString(len(self.end_cursor_))
669 if (self.has_offset_): n += 1 + self.lengthVarInt64(self.offset_)
670 if (self.has_limit_): n += 1 + self.lengthVarInt64(self.limit_)
671 return n
673 def Clear(self):
674 self.clear_projection()
675 self.clear_kind()
676 self.clear_filter()
677 self.clear_order()
678 self.clear_group_by()
679 self.clear_start_cursor()
680 self.clear_end_cursor()
681 self.clear_offset()
682 self.clear_limit()
684 def OutputUnchecked(self, out):
685 for i in xrange(len(self.projection_)):
686 out.putVarInt32(18)
687 out.putVarInt32(self.projection_[i].ByteSize())
688 self.projection_[i].OutputUnchecked(out)
689 for i in xrange(len(self.kind_)):
690 out.putVarInt32(26)
691 out.putVarInt32(self.kind_[i].ByteSize())
692 self.kind_[i].OutputUnchecked(out)
693 if (self.has_filter_):
694 out.putVarInt32(34)
695 out.putVarInt32(self.filter_.ByteSize())
696 self.filter_.OutputUnchecked(out)
697 for i in xrange(len(self.order_)):
698 out.putVarInt32(42)
699 out.putVarInt32(self.order_[i].ByteSize())
700 self.order_[i].OutputUnchecked(out)
701 for i in xrange(len(self.group_by_)):
702 out.putVarInt32(50)
703 out.putVarInt32(self.group_by_[i].ByteSize())
704 self.group_by_[i].OutputUnchecked(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 OutputPartial(self, out):
719 for i in xrange(len(self.projection_)):
720 out.putVarInt32(18)
721 out.putVarInt32(self.projection_[i].ByteSizePartial())
722 self.projection_[i].OutputPartial(out)
723 for i in xrange(len(self.kind_)):
724 out.putVarInt32(26)
725 out.putVarInt32(self.kind_[i].ByteSizePartial())
726 self.kind_[i].OutputPartial(out)
727 if (self.has_filter_):
728 out.putVarInt32(34)
729 out.putVarInt32(self.filter_.ByteSizePartial())
730 self.filter_.OutputPartial(out)
731 for i in xrange(len(self.order_)):
732 out.putVarInt32(42)
733 out.putVarInt32(self.order_[i].ByteSizePartial())
734 self.order_[i].OutputPartial(out)
735 for i in xrange(len(self.group_by_)):
736 out.putVarInt32(50)
737 out.putVarInt32(self.group_by_[i].ByteSizePartial())
738 self.group_by_[i].OutputPartial(out)
739 if (self.has_start_cursor_):
740 out.putVarInt32(58)
741 out.putPrefixedString(self.start_cursor_)
742 if (self.has_end_cursor_):
743 out.putVarInt32(66)
744 out.putPrefixedString(self.end_cursor_)
745 if (self.has_offset_):
746 out.putVarInt32(80)
747 out.putVarInt32(self.offset_)
748 if (self.has_limit_):
749 out.putVarInt32(88)
750 out.putVarInt32(self.limit_)
752 def TryMerge(self, d):
753 while d.avail() > 0:
754 tt = d.getVarInt32()
755 if tt == 18:
756 length = d.getVarInt32()
757 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
758 d.skip(length)
759 self.add_projection().TryMerge(tmp)
760 continue
761 if tt == 26:
762 length = d.getVarInt32()
763 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
764 d.skip(length)
765 self.add_kind().TryMerge(tmp)
766 continue
767 if tt == 34:
768 length = d.getVarInt32()
769 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
770 d.skip(length)
771 self.mutable_filter().TryMerge(tmp)
772 continue
773 if tt == 42:
774 length = d.getVarInt32()
775 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
776 d.skip(length)
777 self.add_order().TryMerge(tmp)
778 continue
779 if tt == 50:
780 length = d.getVarInt32()
781 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
782 d.skip(length)
783 self.add_group_by().TryMerge(tmp)
784 continue
785 if tt == 58:
786 self.set_start_cursor(d.getPrefixedString())
787 continue
788 if tt == 66:
789 self.set_end_cursor(d.getPrefixedString())
790 continue
791 if tt == 80:
792 self.set_offset(d.getVarInt32())
793 continue
794 if tt == 88:
795 self.set_limit(d.getVarInt32())
796 continue
799 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
800 d.skipData(tt)
803 def __str__(self, prefix="", printElemNumber=0):
804 res=""
805 cnt=0
806 for e in self.projection_:
807 elm=""
808 if printElemNumber: elm="(%d)" % cnt
809 res+=prefix+("projection%s <\n" % elm)
810 res+=e.__str__(prefix + " ", printElemNumber)
811 res+=prefix+">\n"
812 cnt+=1
813 cnt=0
814 for e in self.kind_:
815 elm=""
816 if printElemNumber: elm="(%d)" % cnt
817 res+=prefix+("kind%s <\n" % elm)
818 res+=e.__str__(prefix + " ", printElemNumber)
819 res+=prefix+">\n"
820 cnt+=1
821 if self.has_filter_:
822 res+=prefix+"filter <\n"
823 res+=self.filter_.__str__(prefix + " ", printElemNumber)
824 res+=prefix+">\n"
825 cnt=0
826 for e in self.order_:
827 elm=""
828 if printElemNumber: elm="(%d)" % cnt
829 res+=prefix+("order%s <\n" % elm)
830 res+=e.__str__(prefix + " ", printElemNumber)
831 res+=prefix+">\n"
832 cnt+=1
833 cnt=0
834 for e in self.group_by_:
835 elm=""
836 if printElemNumber: elm="(%d)" % cnt
837 res+=prefix+("group_by%s <\n" % elm)
838 res+=e.__str__(prefix + " ", printElemNumber)
839 res+=prefix+">\n"
840 cnt+=1
841 if self.has_start_cursor_: res+=prefix+("start_cursor: %s\n" % self.DebugFormatString(self.start_cursor_))
842 if self.has_end_cursor_: res+=prefix+("end_cursor: %s\n" % self.DebugFormatString(self.end_cursor_))
843 if self.has_offset_: res+=prefix+("offset: %s\n" % self.DebugFormatInt32(self.offset_))
844 if self.has_limit_: res+=prefix+("limit: %s\n" % self.DebugFormatInt32(self.limit_))
845 return res
848 def _BuildTagLookupTable(sparse, maxtag, default=None):
849 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
851 kprojection = 2
852 kkind = 3
853 kfilter = 4
854 korder = 5
855 kgroup_by = 6
856 kstart_cursor = 7
857 kend_cursor = 8
858 koffset = 10
859 klimit = 11
861 _TEXT = _BuildTagLookupTable({
862 0: "ErrorCode",
863 2: "projection",
864 3: "kind",
865 4: "filter",
866 5: "order",
867 6: "group_by",
868 7: "start_cursor",
869 8: "end_cursor",
870 10: "offset",
871 11: "limit",
872 }, 11)
874 _TYPES = _BuildTagLookupTable({
875 0: ProtocolBuffer.Encoder.NUMERIC,
876 2: ProtocolBuffer.Encoder.STRING,
877 3: ProtocolBuffer.Encoder.STRING,
878 4: ProtocolBuffer.Encoder.STRING,
879 5: ProtocolBuffer.Encoder.STRING,
880 6: ProtocolBuffer.Encoder.STRING,
881 7: ProtocolBuffer.Encoder.STRING,
882 8: ProtocolBuffer.Encoder.STRING,
883 10: ProtocolBuffer.Encoder.NUMERIC,
884 11: ProtocolBuffer.Encoder.NUMERIC,
885 }, 11, ProtocolBuffer.Encoder.MAX_TYPE)
888 _STYLE = """"""
889 _STYLE_CONTENT_TYPE = """"""
890 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.Query'
891 _SERIALIZED_DESCRIPTOR = array.array('B')
892 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlF1ZXJ5ExoKcHJvamVjdGlvbiACKAIwCzgDSiphcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eUV4cHJlc3Npb26jAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoEa2luZCADKAIwCzgDSiZhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LaW5kRXhwcmVzc2lvbqMBqgEFY3R5cGWyAQZwcm90bzKkARQTGgZmaWx0ZXIgBCgCMAs4AUoeYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRmlsdGVyowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaBW9yZGVyIAUoAjALOANKJWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5T3JkZXKjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoIZ3JvdXBfYnkgBigCMAs4A0opYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlSZWZlcmVuY2WjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoMc3RhcnRfY3Vyc29yIAcoAjAJOAEUExoKZW5kX2N1cnNvciAIKAIwCTgBFBMaBm9mZnNldCAKKAAwBTgBQgEwowGqAQdkZWZhdWx0sgEBMKQBFBMaBWxpbWl0IAsoADAFOAEUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
893 if _net_proto___parse__python is not None:
894 _net_proto___parse__python.RegisterType(
895 _SERIALIZED_DESCRIPTOR.tostring())
897 class KindExpression(ProtocolBuffer.ProtocolMessage):
898 has_name_ = 0
899 name_ = ""
901 def __init__(self, contents=None):
902 if contents is not None: self.MergeFromString(contents)
904 def name(self): return self.name_
906 def set_name(self, x):
907 self.has_name_ = 1
908 self.name_ = x
910 def clear_name(self):
911 if self.has_name_:
912 self.has_name_ = 0
913 self.name_ = ""
915 def has_name(self): return self.has_name_
918 def MergeFrom(self, x):
919 assert x is not self
920 if (x.has_name()): self.set_name(x.name())
922 if _net_proto___parse__python is not None:
923 def _CMergeFromString(self, s):
924 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.KindExpression', s)
926 if _net_proto___parse__python is not None:
927 def _CEncode(self):
928 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.KindExpression')
930 if _net_proto___parse__python is not None:
931 def _CEncodePartial(self):
932 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.KindExpression')
934 if _net_proto___parse__python is not None:
935 def _CToASCII(self, output_format):
936 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.KindExpression', output_format)
939 if _net_proto___parse__python is not None:
940 def ParseASCII(self, s):
941 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.KindExpression', s)
944 if _net_proto___parse__python is not None:
945 def ParseASCIIIgnoreUnknown(self, s):
946 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.KindExpression', s)
949 def Equals(self, x):
950 if x is self: return 1
951 if self.has_name_ != x.has_name_: return 0
952 if self.has_name_ and self.name_ != x.name_: return 0
953 return 1
955 def IsInitialized(self, debug_strs=None):
956 initialized = 1
957 if (not self.has_name_):
958 initialized = 0
959 if debug_strs is not None:
960 debug_strs.append('Required field: name not set.')
961 return initialized
963 def ByteSize(self):
964 n = 0
965 n += self.lengthString(len(self.name_))
966 return n + 1
968 def ByteSizePartial(self):
969 n = 0
970 if (self.has_name_):
971 n += 1
972 n += self.lengthString(len(self.name_))
973 return n
975 def Clear(self):
976 self.clear_name()
978 def OutputUnchecked(self, out):
979 out.putVarInt32(10)
980 out.putPrefixedString(self.name_)
982 def OutputPartial(self, out):
983 if (self.has_name_):
984 out.putVarInt32(10)
985 out.putPrefixedString(self.name_)
987 def TryMerge(self, d):
988 while d.avail() > 0:
989 tt = d.getVarInt32()
990 if tt == 10:
991 self.set_name(d.getPrefixedString())
992 continue
995 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
996 d.skipData(tt)
999 def __str__(self, prefix="", printElemNumber=0):
1000 res=""
1001 if self.has_name_: res+=prefix+("name: %s\n" % self.DebugFormatString(self.name_))
1002 return res
1005 def _BuildTagLookupTable(sparse, maxtag, default=None):
1006 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1008 kname = 1
1010 _TEXT = _BuildTagLookupTable({
1011 0: "ErrorCode",
1012 1: "name",
1013 }, 1)
1015 _TYPES = _BuildTagLookupTable({
1016 0: ProtocolBuffer.Encoder.NUMERIC,
1017 1: ProtocolBuffer.Encoder.STRING,
1018 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
1021 _STYLE = """"""
1022 _STYLE_CONTENT_TYPE = """"""
1023 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.KindExpression'
1024 _SERIALIZED_DESCRIPTOR = array.array('B')
1025 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktpbmRFeHByZXNzaW9uExoEbmFtZSABKAIwCTgCFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
1026 if _net_proto___parse__python is not None:
1027 _net_proto___parse__python.RegisterType(
1028 _SERIALIZED_DESCRIPTOR.tostring())
1030 class PropertyReference(ProtocolBuffer.ProtocolMessage):
1031 has_name_ = 0
1032 name_ = ""
1034 def __init__(self, contents=None):
1035 if contents is not None: self.MergeFromString(contents)
1037 def name(self): return self.name_
1039 def set_name(self, x):
1040 self.has_name_ = 1
1041 self.name_ = x
1043 def clear_name(self):
1044 if self.has_name_:
1045 self.has_name_ = 0
1046 self.name_ = ""
1048 def has_name(self): return self.has_name_
1051 def MergeFrom(self, x):
1052 assert x is not self
1053 if (x.has_name()): self.set_name(x.name())
1055 if _net_proto___parse__python is not None:
1056 def _CMergeFromString(self, s):
1057 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.PropertyReference', s)
1059 if _net_proto___parse__python is not None:
1060 def _CEncode(self):
1061 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.PropertyReference')
1063 if _net_proto___parse__python is not None:
1064 def _CEncodePartial(self):
1065 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.PropertyReference')
1067 if _net_proto___parse__python is not None:
1068 def _CToASCII(self, output_format):
1069 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.PropertyReference', output_format)
1072 if _net_proto___parse__python is not None:
1073 def ParseASCII(self, s):
1074 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.PropertyReference', s)
1077 if _net_proto___parse__python is not None:
1078 def ParseASCIIIgnoreUnknown(self, s):
1079 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.PropertyReference', s)
1082 def Equals(self, x):
1083 if x is self: return 1
1084 if self.has_name_ != x.has_name_: return 0
1085 if self.has_name_ and self.name_ != x.name_: return 0
1086 return 1
1088 def IsInitialized(self, debug_strs=None):
1089 initialized = 1
1090 if (not self.has_name_):
1091 initialized = 0
1092 if debug_strs is not None:
1093 debug_strs.append('Required field: name not set.')
1094 return initialized
1096 def ByteSize(self):
1097 n = 0
1098 n += self.lengthString(len(self.name_))
1099 return n + 1
1101 def ByteSizePartial(self):
1102 n = 0
1103 if (self.has_name_):
1104 n += 1
1105 n += self.lengthString(len(self.name_))
1106 return n
1108 def Clear(self):
1109 self.clear_name()
1111 def OutputUnchecked(self, out):
1112 out.putVarInt32(18)
1113 out.putPrefixedString(self.name_)
1115 def OutputPartial(self, out):
1116 if (self.has_name_):
1117 out.putVarInt32(18)
1118 out.putPrefixedString(self.name_)
1120 def TryMerge(self, d):
1121 while d.avail() > 0:
1122 tt = d.getVarInt32()
1123 if tt == 18:
1124 self.set_name(d.getPrefixedString())
1125 continue
1128 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1129 d.skipData(tt)
1132 def __str__(self, prefix="", printElemNumber=0):
1133 res=""
1134 if self.has_name_: res+=prefix+("name: %s\n" % self.DebugFormatString(self.name_))
1135 return res
1138 def _BuildTagLookupTable(sparse, maxtag, default=None):
1139 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1141 kname = 2
1143 _TEXT = _BuildTagLookupTable({
1144 0: "ErrorCode",
1145 2: "name",
1146 }, 2)
1148 _TYPES = _BuildTagLookupTable({
1149 0: ProtocolBuffer.Encoder.NUMERIC,
1150 2: ProtocolBuffer.Encoder.STRING,
1151 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
1154 _STYLE = """"""
1155 _STYLE_CONTENT_TYPE = """"""
1156 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.PropertyReference'
1157 _SERIALIZED_DESCRIPTOR = array.array('B')
1158 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5UmVmZXJlbmNlExoEbmFtZSACKAIwCTgCFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
1159 if _net_proto___parse__python is not None:
1160 _net_proto___parse__python.RegisterType(
1161 _SERIALIZED_DESCRIPTOR.tostring())
1163 class PropertyExpression(ProtocolBuffer.ProtocolMessage):
1166 FIRST = 1
1168 _AggregationFunction_NAMES = {
1169 1: "FIRST",
1172 def AggregationFunction_Name(cls, x): return cls._AggregationFunction_NAMES.get(x, "")
1173 AggregationFunction_Name = classmethod(AggregationFunction_Name)
1175 has_property_ = 0
1176 has_aggregation_function_ = 0
1177 aggregation_function_ = 0
1179 def __init__(self, contents=None):
1180 self.property_ = PropertyReference()
1181 if contents is not None: self.MergeFromString(contents)
1183 def property(self): return self.property_
1185 def mutable_property(self): self.has_property_ = 1; return self.property_
1187 def clear_property(self):self.has_property_ = 0; self.property_.Clear()
1189 def has_property(self): return self.has_property_
1191 def aggregation_function(self): return self.aggregation_function_
1193 def set_aggregation_function(self, x):
1194 self.has_aggregation_function_ = 1
1195 self.aggregation_function_ = x
1197 def clear_aggregation_function(self):
1198 if self.has_aggregation_function_:
1199 self.has_aggregation_function_ = 0
1200 self.aggregation_function_ = 0
1202 def has_aggregation_function(self): return self.has_aggregation_function_
1205 def MergeFrom(self, x):
1206 assert x is not self
1207 if (x.has_property()): self.mutable_property().MergeFrom(x.property())
1208 if (x.has_aggregation_function()): self.set_aggregation_function(x.aggregation_function())
1210 if _net_proto___parse__python is not None:
1211 def _CMergeFromString(self, s):
1212 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.PropertyExpression', s)
1214 if _net_proto___parse__python is not None:
1215 def _CEncode(self):
1216 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.PropertyExpression')
1218 if _net_proto___parse__python is not None:
1219 def _CEncodePartial(self):
1220 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.PropertyExpression')
1222 if _net_proto___parse__python is not None:
1223 def _CToASCII(self, output_format):
1224 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.PropertyExpression', output_format)
1227 if _net_proto___parse__python is not None:
1228 def ParseASCII(self, s):
1229 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.PropertyExpression', s)
1232 if _net_proto___parse__python is not None:
1233 def ParseASCIIIgnoreUnknown(self, s):
1234 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.PropertyExpression', s)
1237 def Equals(self, x):
1238 if x is self: return 1
1239 if self.has_property_ != x.has_property_: return 0
1240 if self.has_property_ and self.property_ != x.property_: return 0
1241 if self.has_aggregation_function_ != x.has_aggregation_function_: return 0
1242 if self.has_aggregation_function_ and self.aggregation_function_ != x.aggregation_function_: return 0
1243 return 1
1245 def IsInitialized(self, debug_strs=None):
1246 initialized = 1
1247 if (not self.has_property_):
1248 initialized = 0
1249 if debug_strs is not None:
1250 debug_strs.append('Required field: property not set.')
1251 elif not self.property_.IsInitialized(debug_strs): initialized = 0
1252 return initialized
1254 def ByteSize(self):
1255 n = 0
1256 n += self.lengthString(self.property_.ByteSize())
1257 if (self.has_aggregation_function_): n += 1 + self.lengthVarInt64(self.aggregation_function_)
1258 return n + 1
1260 def ByteSizePartial(self):
1261 n = 0
1262 if (self.has_property_):
1263 n += 1
1264 n += self.lengthString(self.property_.ByteSizePartial())
1265 if (self.has_aggregation_function_): n += 1 + self.lengthVarInt64(self.aggregation_function_)
1266 return n
1268 def Clear(self):
1269 self.clear_property()
1270 self.clear_aggregation_function()
1272 def OutputUnchecked(self, out):
1273 out.putVarInt32(10)
1274 out.putVarInt32(self.property_.ByteSize())
1275 self.property_.OutputUnchecked(out)
1276 if (self.has_aggregation_function_):
1277 out.putVarInt32(16)
1278 out.putVarInt32(self.aggregation_function_)
1280 def OutputPartial(self, out):
1281 if (self.has_property_):
1282 out.putVarInt32(10)
1283 out.putVarInt32(self.property_.ByteSizePartial())
1284 self.property_.OutputPartial(out)
1285 if (self.has_aggregation_function_):
1286 out.putVarInt32(16)
1287 out.putVarInt32(self.aggregation_function_)
1289 def TryMerge(self, d):
1290 while d.avail() > 0:
1291 tt = d.getVarInt32()
1292 if tt == 10:
1293 length = d.getVarInt32()
1294 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
1295 d.skip(length)
1296 self.mutable_property().TryMerge(tmp)
1297 continue
1298 if tt == 16:
1299 self.set_aggregation_function(d.getVarInt32())
1300 continue
1303 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1304 d.skipData(tt)
1307 def __str__(self, prefix="", printElemNumber=0):
1308 res=""
1309 if self.has_property_:
1310 res+=prefix+"property <\n"
1311 res+=self.property_.__str__(prefix + " ", printElemNumber)
1312 res+=prefix+">\n"
1313 if self.has_aggregation_function_: res+=prefix+("aggregation_function: %s\n" % self.DebugFormatInt32(self.aggregation_function_))
1314 return res
1317 def _BuildTagLookupTable(sparse, maxtag, default=None):
1318 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1320 kproperty = 1
1321 kaggregation_function = 2
1323 _TEXT = _BuildTagLookupTable({
1324 0: "ErrorCode",
1325 1: "property",
1326 2: "aggregation_function",
1327 }, 2)
1329 _TYPES = _BuildTagLookupTable({
1330 0: ProtocolBuffer.Encoder.NUMERIC,
1331 1: ProtocolBuffer.Encoder.STRING,
1332 2: ProtocolBuffer.Encoder.NUMERIC,
1333 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
1336 _STYLE = """"""
1337 _STYLE_CONTENT_TYPE = """"""
1338 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.PropertyExpression'
1339 _SERIALIZED_DESCRIPTOR = array.array('B')
1340 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5RXhwcmVzc2lvbhMaCHByb3BlcnR5IAEoAjALOAJKKWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5UmVmZXJlbmNlowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaFGFnZ3JlZ2F0aW9uX2Z1bmN0aW9uIAIoADAFOAFoABRzehNBZ2dyZWdhdGlvbkZ1bmN0aW9uiwGSAQVGSVJTVJgBAYwBdMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
1341 if _net_proto___parse__python is not None:
1342 _net_proto___parse__python.RegisterType(
1343 _SERIALIZED_DESCRIPTOR.tostring())
1345 class PropertyOrder(ProtocolBuffer.ProtocolMessage):
1348 ASCENDING = 1
1349 DESCENDING = 2
1351 _Direction_NAMES = {
1352 1: "ASCENDING",
1353 2: "DESCENDING",
1356 def Direction_Name(cls, x): return cls._Direction_NAMES.get(x, "")
1357 Direction_Name = classmethod(Direction_Name)
1359 has_property_ = 0
1360 has_direction_ = 0
1361 direction_ = 1
1363 def __init__(self, contents=None):
1364 self.property_ = PropertyReference()
1365 if contents is not None: self.MergeFromString(contents)
1367 def property(self): return self.property_
1369 def mutable_property(self): self.has_property_ = 1; return self.property_
1371 def clear_property(self):self.has_property_ = 0; self.property_.Clear()
1373 def has_property(self): return self.has_property_
1375 def direction(self): return self.direction_
1377 def set_direction(self, x):
1378 self.has_direction_ = 1
1379 self.direction_ = x
1381 def clear_direction(self):
1382 if self.has_direction_:
1383 self.has_direction_ = 0
1384 self.direction_ = 1
1386 def has_direction(self): return self.has_direction_
1389 def MergeFrom(self, x):
1390 assert x is not self
1391 if (x.has_property()): self.mutable_property().MergeFrom(x.property())
1392 if (x.has_direction()): self.set_direction(x.direction())
1394 if _net_proto___parse__python is not None:
1395 def _CMergeFromString(self, s):
1396 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.PropertyOrder', s)
1398 if _net_proto___parse__python is not None:
1399 def _CEncode(self):
1400 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.PropertyOrder')
1402 if _net_proto___parse__python is not None:
1403 def _CEncodePartial(self):
1404 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.PropertyOrder')
1406 if _net_proto___parse__python is not None:
1407 def _CToASCII(self, output_format):
1408 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.PropertyOrder', output_format)
1411 if _net_proto___parse__python is not None:
1412 def ParseASCII(self, s):
1413 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.PropertyOrder', s)
1416 if _net_proto___parse__python is not None:
1417 def ParseASCIIIgnoreUnknown(self, s):
1418 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.PropertyOrder', s)
1421 def Equals(self, x):
1422 if x is self: return 1
1423 if self.has_property_ != x.has_property_: return 0
1424 if self.has_property_ and self.property_ != x.property_: return 0
1425 if self.has_direction_ != x.has_direction_: return 0
1426 if self.has_direction_ and self.direction_ != x.direction_: return 0
1427 return 1
1429 def IsInitialized(self, debug_strs=None):
1430 initialized = 1
1431 if (not self.has_property_):
1432 initialized = 0
1433 if debug_strs is not None:
1434 debug_strs.append('Required field: property not set.')
1435 elif not self.property_.IsInitialized(debug_strs): initialized = 0
1436 return initialized
1438 def ByteSize(self):
1439 n = 0
1440 n += self.lengthString(self.property_.ByteSize())
1441 if (self.has_direction_): n += 1 + self.lengthVarInt64(self.direction_)
1442 return n + 1
1444 def ByteSizePartial(self):
1445 n = 0
1446 if (self.has_property_):
1447 n += 1
1448 n += self.lengthString(self.property_.ByteSizePartial())
1449 if (self.has_direction_): n += 1 + self.lengthVarInt64(self.direction_)
1450 return n
1452 def Clear(self):
1453 self.clear_property()
1454 self.clear_direction()
1456 def OutputUnchecked(self, out):
1457 out.putVarInt32(10)
1458 out.putVarInt32(self.property_.ByteSize())
1459 self.property_.OutputUnchecked(out)
1460 if (self.has_direction_):
1461 out.putVarInt32(16)
1462 out.putVarInt32(self.direction_)
1464 def OutputPartial(self, out):
1465 if (self.has_property_):
1466 out.putVarInt32(10)
1467 out.putVarInt32(self.property_.ByteSizePartial())
1468 self.property_.OutputPartial(out)
1469 if (self.has_direction_):
1470 out.putVarInt32(16)
1471 out.putVarInt32(self.direction_)
1473 def TryMerge(self, d):
1474 while d.avail() > 0:
1475 tt = d.getVarInt32()
1476 if tt == 10:
1477 length = d.getVarInt32()
1478 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
1479 d.skip(length)
1480 self.mutable_property().TryMerge(tmp)
1481 continue
1482 if tt == 16:
1483 self.set_direction(d.getVarInt32())
1484 continue
1487 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1488 d.skipData(tt)
1491 def __str__(self, prefix="", printElemNumber=0):
1492 res=""
1493 if self.has_property_:
1494 res+=prefix+"property <\n"
1495 res+=self.property_.__str__(prefix + " ", printElemNumber)
1496 res+=prefix+">\n"
1497 if self.has_direction_: res+=prefix+("direction: %s\n" % self.DebugFormatInt32(self.direction_))
1498 return res
1501 def _BuildTagLookupTable(sparse, maxtag, default=None):
1502 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1504 kproperty = 1
1505 kdirection = 2
1507 _TEXT = _BuildTagLookupTable({
1508 0: "ErrorCode",
1509 1: "property",
1510 2: "direction",
1511 }, 2)
1513 _TYPES = _BuildTagLookupTable({
1514 0: ProtocolBuffer.Encoder.NUMERIC,
1515 1: ProtocolBuffer.Encoder.STRING,
1516 2: ProtocolBuffer.Encoder.NUMERIC,
1517 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
1520 _STYLE = """"""
1521 _STYLE_CONTENT_TYPE = """"""
1522 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.PropertyOrder'
1523 _SERIALIZED_DESCRIPTOR = array.array('B')
1524 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5T3JkZXITGghwcm9wZXJ0eSABKAIwCzgCSilhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eVJlZmVyZW5jZaMBqgEFY3R5cGWyAQZwcm90bzKkARQTGglkaXJlY3Rpb24gAigAMAU4AUIBMWgAowGqAQdkZWZhdWx0sgEJQVNDRU5ESU5HpAEUc3oJRGlyZWN0aW9uiwGSAQlBU0NFTkRJTkeYAQGMAYsBkgEKREVTQ0VORElOR5gBAowBdMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
1525 if _net_proto___parse__python is not None:
1526 _net_proto___parse__python.RegisterType(
1527 _SERIALIZED_DESCRIPTOR.tostring())
1529 class Filter(ProtocolBuffer.ProtocolMessage):
1530 has_composite_filter_ = 0
1531 composite_filter_ = None
1532 has_property_filter_ = 0
1533 property_filter_ = None
1534 has_bounding_circle_filter_ = 0
1535 bounding_circle_filter_ = None
1536 has_bounding_box_filter_ = 0
1537 bounding_box_filter_ = None
1539 def __init__(self, contents=None):
1540 self.lazy_init_lock_ = thread.allocate_lock()
1541 if contents is not None: self.MergeFromString(contents)
1543 def composite_filter(self):
1544 if self.composite_filter_ is None:
1545 self.lazy_init_lock_.acquire()
1546 try:
1547 if self.composite_filter_ is None: self.composite_filter_ = CompositeFilter()
1548 finally:
1549 self.lazy_init_lock_.release()
1550 return self.composite_filter_
1552 def mutable_composite_filter(self): self.has_composite_filter_ = 1; return self.composite_filter()
1554 def clear_composite_filter(self):
1556 if self.has_composite_filter_:
1557 self.has_composite_filter_ = 0;
1558 if self.composite_filter_ is not None: self.composite_filter_.Clear()
1560 def has_composite_filter(self): return self.has_composite_filter_
1562 def property_filter(self):
1563 if self.property_filter_ is None:
1564 self.lazy_init_lock_.acquire()
1565 try:
1566 if self.property_filter_ is None: self.property_filter_ = PropertyFilter()
1567 finally:
1568 self.lazy_init_lock_.release()
1569 return self.property_filter_
1571 def mutable_property_filter(self): self.has_property_filter_ = 1; return self.property_filter()
1573 def clear_property_filter(self):
1575 if self.has_property_filter_:
1576 self.has_property_filter_ = 0;
1577 if self.property_filter_ is not None: self.property_filter_.Clear()
1579 def has_property_filter(self): return self.has_property_filter_
1581 def bounding_circle_filter(self):
1582 if self.bounding_circle_filter_ is None:
1583 self.lazy_init_lock_.acquire()
1584 try:
1585 if self.bounding_circle_filter_ is None: self.bounding_circle_filter_ = BoundingCircleFilter()
1586 finally:
1587 self.lazy_init_lock_.release()
1588 return self.bounding_circle_filter_
1590 def mutable_bounding_circle_filter(self): self.has_bounding_circle_filter_ = 1; return self.bounding_circle_filter()
1592 def clear_bounding_circle_filter(self):
1594 if self.has_bounding_circle_filter_:
1595 self.has_bounding_circle_filter_ = 0;
1596 if self.bounding_circle_filter_ is not None: self.bounding_circle_filter_.Clear()
1598 def has_bounding_circle_filter(self): return self.has_bounding_circle_filter_
1600 def bounding_box_filter(self):
1601 if self.bounding_box_filter_ is None:
1602 self.lazy_init_lock_.acquire()
1603 try:
1604 if self.bounding_box_filter_ is None: self.bounding_box_filter_ = BoundingBoxFilter()
1605 finally:
1606 self.lazy_init_lock_.release()
1607 return self.bounding_box_filter_
1609 def mutable_bounding_box_filter(self): self.has_bounding_box_filter_ = 1; return self.bounding_box_filter()
1611 def clear_bounding_box_filter(self):
1613 if self.has_bounding_box_filter_:
1614 self.has_bounding_box_filter_ = 0;
1615 if self.bounding_box_filter_ is not None: self.bounding_box_filter_.Clear()
1617 def has_bounding_box_filter(self): return self.has_bounding_box_filter_
1620 def MergeFrom(self, x):
1621 assert x is not self
1622 if (x.has_composite_filter()): self.mutable_composite_filter().MergeFrom(x.composite_filter())
1623 if (x.has_property_filter()): self.mutable_property_filter().MergeFrom(x.property_filter())
1624 if (x.has_bounding_circle_filter()): self.mutable_bounding_circle_filter().MergeFrom(x.bounding_circle_filter())
1625 if (x.has_bounding_box_filter()): self.mutable_bounding_box_filter().MergeFrom(x.bounding_box_filter())
1627 if _net_proto___parse__python is not None:
1628 def _CMergeFromString(self, s):
1629 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.Filter', s)
1631 if _net_proto___parse__python is not None:
1632 def _CEncode(self):
1633 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.Filter')
1635 if _net_proto___parse__python is not None:
1636 def _CEncodePartial(self):
1637 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.Filter')
1639 if _net_proto___parse__python is not None:
1640 def _CToASCII(self, output_format):
1641 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.Filter', output_format)
1644 if _net_proto___parse__python is not None:
1645 def ParseASCII(self, s):
1646 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.Filter', s)
1649 if _net_proto___parse__python is not None:
1650 def ParseASCIIIgnoreUnknown(self, s):
1651 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.Filter', s)
1654 def Equals(self, x):
1655 if x is self: return 1
1656 if self.has_composite_filter_ != x.has_composite_filter_: return 0
1657 if self.has_composite_filter_ and self.composite_filter_ != x.composite_filter_: return 0
1658 if self.has_property_filter_ != x.has_property_filter_: return 0
1659 if self.has_property_filter_ and self.property_filter_ != x.property_filter_: return 0
1660 if self.has_bounding_circle_filter_ != x.has_bounding_circle_filter_: return 0
1661 if self.has_bounding_circle_filter_ and self.bounding_circle_filter_ != x.bounding_circle_filter_: return 0
1662 if self.has_bounding_box_filter_ != x.has_bounding_box_filter_: return 0
1663 if self.has_bounding_box_filter_ and self.bounding_box_filter_ != x.bounding_box_filter_: return 0
1664 return 1
1666 def IsInitialized(self, debug_strs=None):
1667 initialized = 1
1668 if (self.has_composite_filter_ and not self.composite_filter_.IsInitialized(debug_strs)): initialized = 0
1669 if (self.has_property_filter_ and not self.property_filter_.IsInitialized(debug_strs)): initialized = 0
1670 if (self.has_bounding_circle_filter_ and not self.bounding_circle_filter_.IsInitialized(debug_strs)): initialized = 0
1671 if (self.has_bounding_box_filter_ and not self.bounding_box_filter_.IsInitialized(debug_strs)): initialized = 0
1672 return initialized
1674 def ByteSize(self):
1675 n = 0
1676 if (self.has_composite_filter_): n += 1 + self.lengthString(self.composite_filter_.ByteSize())
1677 if (self.has_property_filter_): n += 1 + self.lengthString(self.property_filter_.ByteSize())
1678 if (self.has_bounding_circle_filter_): n += 1 + self.lengthString(self.bounding_circle_filter_.ByteSize())
1679 if (self.has_bounding_box_filter_): n += 1 + self.lengthString(self.bounding_box_filter_.ByteSize())
1680 return n
1682 def ByteSizePartial(self):
1683 n = 0
1684 if (self.has_composite_filter_): n += 1 + self.lengthString(self.composite_filter_.ByteSizePartial())
1685 if (self.has_property_filter_): n += 1 + self.lengthString(self.property_filter_.ByteSizePartial())
1686 if (self.has_bounding_circle_filter_): n += 1 + self.lengthString(self.bounding_circle_filter_.ByteSizePartial())
1687 if (self.has_bounding_box_filter_): n += 1 + self.lengthString(self.bounding_box_filter_.ByteSizePartial())
1688 return n
1690 def Clear(self):
1691 self.clear_composite_filter()
1692 self.clear_property_filter()
1693 self.clear_bounding_circle_filter()
1694 self.clear_bounding_box_filter()
1696 def OutputUnchecked(self, out):
1697 if (self.has_composite_filter_):
1698 out.putVarInt32(10)
1699 out.putVarInt32(self.composite_filter_.ByteSize())
1700 self.composite_filter_.OutputUnchecked(out)
1701 if (self.has_property_filter_):
1702 out.putVarInt32(18)
1703 out.putVarInt32(self.property_filter_.ByteSize())
1704 self.property_filter_.OutputUnchecked(out)
1705 if (self.has_bounding_circle_filter_):
1706 out.putVarInt32(26)
1707 out.putVarInt32(self.bounding_circle_filter_.ByteSize())
1708 self.bounding_circle_filter_.OutputUnchecked(out)
1709 if (self.has_bounding_box_filter_):
1710 out.putVarInt32(34)
1711 out.putVarInt32(self.bounding_box_filter_.ByteSize())
1712 self.bounding_box_filter_.OutputUnchecked(out)
1714 def OutputPartial(self, out):
1715 if (self.has_composite_filter_):
1716 out.putVarInt32(10)
1717 out.putVarInt32(self.composite_filter_.ByteSizePartial())
1718 self.composite_filter_.OutputPartial(out)
1719 if (self.has_property_filter_):
1720 out.putVarInt32(18)
1721 out.putVarInt32(self.property_filter_.ByteSizePartial())
1722 self.property_filter_.OutputPartial(out)
1723 if (self.has_bounding_circle_filter_):
1724 out.putVarInt32(26)
1725 out.putVarInt32(self.bounding_circle_filter_.ByteSizePartial())
1726 self.bounding_circle_filter_.OutputPartial(out)
1727 if (self.has_bounding_box_filter_):
1728 out.putVarInt32(34)
1729 out.putVarInt32(self.bounding_box_filter_.ByteSizePartial())
1730 self.bounding_box_filter_.OutputPartial(out)
1732 def TryMerge(self, d):
1733 while d.avail() > 0:
1734 tt = d.getVarInt32()
1735 if tt == 10:
1736 length = d.getVarInt32()
1737 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
1738 d.skip(length)
1739 self.mutable_composite_filter().TryMerge(tmp)
1740 continue
1741 if tt == 18:
1742 length = d.getVarInt32()
1743 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
1744 d.skip(length)
1745 self.mutable_property_filter().TryMerge(tmp)
1746 continue
1747 if tt == 26:
1748 length = d.getVarInt32()
1749 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
1750 d.skip(length)
1751 self.mutable_bounding_circle_filter().TryMerge(tmp)
1752 continue
1753 if tt == 34:
1754 length = d.getVarInt32()
1755 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
1756 d.skip(length)
1757 self.mutable_bounding_box_filter().TryMerge(tmp)
1758 continue
1761 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1762 d.skipData(tt)
1765 def __str__(self, prefix="", printElemNumber=0):
1766 res=""
1767 if self.has_composite_filter_:
1768 res+=prefix+"composite_filter <\n"
1769 res+=self.composite_filter_.__str__(prefix + " ", printElemNumber)
1770 res+=prefix+">\n"
1771 if self.has_property_filter_:
1772 res+=prefix+"property_filter <\n"
1773 res+=self.property_filter_.__str__(prefix + " ", printElemNumber)
1774 res+=prefix+">\n"
1775 if self.has_bounding_circle_filter_:
1776 res+=prefix+"bounding_circle_filter <\n"
1777 res+=self.bounding_circle_filter_.__str__(prefix + " ", printElemNumber)
1778 res+=prefix+">\n"
1779 if self.has_bounding_box_filter_:
1780 res+=prefix+"bounding_box_filter <\n"
1781 res+=self.bounding_box_filter_.__str__(prefix + " ", printElemNumber)
1782 res+=prefix+">\n"
1783 return res
1786 def _BuildTagLookupTable(sparse, maxtag, default=None):
1787 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1789 kcomposite_filter = 1
1790 kproperty_filter = 2
1791 kbounding_circle_filter = 3
1792 kbounding_box_filter = 4
1794 _TEXT = _BuildTagLookupTable({
1795 0: "ErrorCode",
1796 1: "composite_filter",
1797 2: "property_filter",
1798 3: "bounding_circle_filter",
1799 4: "bounding_box_filter",
1800 }, 4)
1802 _TYPES = _BuildTagLookupTable({
1803 0: ProtocolBuffer.Encoder.NUMERIC,
1804 1: ProtocolBuffer.Encoder.STRING,
1805 2: ProtocolBuffer.Encoder.STRING,
1806 3: ProtocolBuffer.Encoder.STRING,
1807 4: ProtocolBuffer.Encoder.STRING,
1808 }, 4, ProtocolBuffer.Encoder.MAX_TYPE)
1811 _STYLE = """"""
1812 _STYLE_CONTENT_TYPE = """"""
1813 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.Filter'
1814 _SERIALIZED_DESCRIPTOR = array.array('B')
1815 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KHmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkZpbHRlchMaEGNvbXBvc2l0ZV9maWx0ZXIgASgCMAs4AUonYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQ29tcG9zaXRlRmlsdGVyowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaD3Byb3BlcnR5X2ZpbHRlciACKAIwCzgBSiZhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eUZpbHRlcqMBqgEFY3R5cGWyAQZwcm90bzKkARQTGhZib3VuZGluZ19jaXJjbGVfZmlsdGVyIAMoAjALOAFKLGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkJvdW5kaW5nQ2lyY2xlRmlsdGVyowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaE2JvdW5kaW5nX2JveF9maWx0ZXIgBCgCMAs4AUopYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQm91bmRpbmdCb3hGaWx0ZXKjAaoBBWN0eXBlsgEGcHJvdG8ypAEUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
1816 if _net_proto___parse__python is not None:
1817 _net_proto___parse__python.RegisterType(
1818 _SERIALIZED_DESCRIPTOR.tostring())
1820 class CompositeFilter(ProtocolBuffer.ProtocolMessage):
1823 AND = 1
1825 _Operator_NAMES = {
1826 1: "AND",
1829 def Operator_Name(cls, x): return cls._Operator_NAMES.get(x, "")
1830 Operator_Name = classmethod(Operator_Name)
1832 has_operator_ = 0
1833 operator_ = 0
1835 def __init__(self, contents=None):
1836 self.filter_ = []
1837 if contents is not None: self.MergeFromString(contents)
1839 def operator(self): return self.operator_
1841 def set_operator(self, x):
1842 self.has_operator_ = 1
1843 self.operator_ = x
1845 def clear_operator(self):
1846 if self.has_operator_:
1847 self.has_operator_ = 0
1848 self.operator_ = 0
1850 def has_operator(self): return self.has_operator_
1852 def filter_size(self): return len(self.filter_)
1853 def filter_list(self): return self.filter_
1855 def filter(self, i):
1856 return self.filter_[i]
1858 def mutable_filter(self, i):
1859 return self.filter_[i]
1861 def add_filter(self):
1862 x = Filter()
1863 self.filter_.append(x)
1864 return x
1866 def clear_filter(self):
1867 self.filter_ = []
1869 def MergeFrom(self, x):
1870 assert x is not self
1871 if (x.has_operator()): self.set_operator(x.operator())
1872 for i in xrange(x.filter_size()): self.add_filter().CopyFrom(x.filter(i))
1874 if _net_proto___parse__python is not None:
1875 def _CMergeFromString(self, s):
1876 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.CompositeFilter', s)
1878 if _net_proto___parse__python is not None:
1879 def _CEncode(self):
1880 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.CompositeFilter')
1882 if _net_proto___parse__python is not None:
1883 def _CEncodePartial(self):
1884 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.CompositeFilter')
1886 if _net_proto___parse__python is not None:
1887 def _CToASCII(self, output_format):
1888 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.CompositeFilter', output_format)
1891 if _net_proto___parse__python is not None:
1892 def ParseASCII(self, s):
1893 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.CompositeFilter', s)
1896 if _net_proto___parse__python is not None:
1897 def ParseASCIIIgnoreUnknown(self, s):
1898 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.CompositeFilter', s)
1901 def Equals(self, x):
1902 if x is self: return 1
1903 if self.has_operator_ != x.has_operator_: return 0
1904 if self.has_operator_ and self.operator_ != x.operator_: return 0
1905 if len(self.filter_) != len(x.filter_): return 0
1906 for e1, e2 in zip(self.filter_, x.filter_):
1907 if e1 != e2: return 0
1908 return 1
1910 def IsInitialized(self, debug_strs=None):
1911 initialized = 1
1912 if (not self.has_operator_):
1913 initialized = 0
1914 if debug_strs is not None:
1915 debug_strs.append('Required field: operator not set.')
1916 for p in self.filter_:
1917 if not p.IsInitialized(debug_strs): initialized=0
1918 return initialized
1920 def ByteSize(self):
1921 n = 0
1922 n += self.lengthVarInt64(self.operator_)
1923 n += 1 * len(self.filter_)
1924 for i in xrange(len(self.filter_)): n += self.lengthString(self.filter_[i].ByteSize())
1925 return n + 1
1927 def ByteSizePartial(self):
1928 n = 0
1929 if (self.has_operator_):
1930 n += 1
1931 n += self.lengthVarInt64(self.operator_)
1932 n += 1 * len(self.filter_)
1933 for i in xrange(len(self.filter_)): n += self.lengthString(self.filter_[i].ByteSizePartial())
1934 return n
1936 def Clear(self):
1937 self.clear_operator()
1938 self.clear_filter()
1940 def OutputUnchecked(self, out):
1941 out.putVarInt32(8)
1942 out.putVarInt32(self.operator_)
1943 for i in xrange(len(self.filter_)):
1944 out.putVarInt32(18)
1945 out.putVarInt32(self.filter_[i].ByteSize())
1946 self.filter_[i].OutputUnchecked(out)
1948 def OutputPartial(self, out):
1949 if (self.has_operator_):
1950 out.putVarInt32(8)
1951 out.putVarInt32(self.operator_)
1952 for i in xrange(len(self.filter_)):
1953 out.putVarInt32(18)
1954 out.putVarInt32(self.filter_[i].ByteSizePartial())
1955 self.filter_[i].OutputPartial(out)
1957 def TryMerge(self, d):
1958 while d.avail() > 0:
1959 tt = d.getVarInt32()
1960 if tt == 8:
1961 self.set_operator(d.getVarInt32())
1962 continue
1963 if tt == 18:
1964 length = d.getVarInt32()
1965 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
1966 d.skip(length)
1967 self.add_filter().TryMerge(tmp)
1968 continue
1971 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1972 d.skipData(tt)
1975 def __str__(self, prefix="", printElemNumber=0):
1976 res=""
1977 if self.has_operator_: res+=prefix+("operator: %s\n" % self.DebugFormatInt32(self.operator_))
1978 cnt=0
1979 for e in self.filter_:
1980 elm=""
1981 if printElemNumber: elm="(%d)" % cnt
1982 res+=prefix+("filter%s <\n" % elm)
1983 res+=e.__str__(prefix + " ", printElemNumber)
1984 res+=prefix+">\n"
1985 cnt+=1
1986 return res
1989 def _BuildTagLookupTable(sparse, maxtag, default=None):
1990 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1992 koperator = 1
1993 kfilter = 2
1995 _TEXT = _BuildTagLookupTable({
1996 0: "ErrorCode",
1997 1: "operator",
1998 2: "filter",
1999 }, 2)
2001 _TYPES = _BuildTagLookupTable({
2002 0: ProtocolBuffer.Encoder.NUMERIC,
2003 1: ProtocolBuffer.Encoder.NUMERIC,
2004 2: ProtocolBuffer.Encoder.STRING,
2005 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
2008 _STYLE = """"""
2009 _STYLE_CONTENT_TYPE = """"""
2010 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.CompositeFilter'
2011 _SERIALIZED_DESCRIPTOR = array.array('B')
2012 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJ2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbXBvc2l0ZUZpbHRlchMaCG9wZXJhdG9yIAEoADAFOAJoABQTGgZmaWx0ZXIgAigCMAs4A0oeYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRmlsdGVyowGqAQVjdHlwZbIBBnByb3RvMqQBFHN6CE9wZXJhdG9yiwGSAQNBTkSYAQGMAXTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
2013 if _net_proto___parse__python is not None:
2014 _net_proto___parse__python.RegisterType(
2015 _SERIALIZED_DESCRIPTOR.tostring())
2017 class PropertyFilter(ProtocolBuffer.ProtocolMessage):
2020 LESS_THAN = 1
2021 LESS_THAN_OR_EQUAL = 2
2022 GREATER_THAN = 3
2023 GREATER_THAN_OR_EQUAL = 4
2024 EQUAL = 5
2025 HAS_ANCESTOR = 11
2027 _Operator_NAMES = {
2028 1: "LESS_THAN",
2029 2: "LESS_THAN_OR_EQUAL",
2030 3: "GREATER_THAN",
2031 4: "GREATER_THAN_OR_EQUAL",
2032 5: "EQUAL",
2033 11: "HAS_ANCESTOR",
2036 def Operator_Name(cls, x): return cls._Operator_NAMES.get(x, "")
2037 Operator_Name = classmethod(Operator_Name)
2039 has_property_ = 0
2040 has_operator_ = 0
2041 operator_ = 0
2042 has_value_ = 0
2044 def __init__(self, contents=None):
2045 self.property_ = PropertyReference()
2046 self.value_ = google.appengine.datastore.entity_v4_pb.Value()
2047 if contents is not None: self.MergeFromString(contents)
2049 def property(self): return self.property_
2051 def mutable_property(self): self.has_property_ = 1; return self.property_
2053 def clear_property(self):self.has_property_ = 0; self.property_.Clear()
2055 def has_property(self): return self.has_property_
2057 def operator(self): return self.operator_
2059 def set_operator(self, x):
2060 self.has_operator_ = 1
2061 self.operator_ = x
2063 def clear_operator(self):
2064 if self.has_operator_:
2065 self.has_operator_ = 0
2066 self.operator_ = 0
2068 def has_operator(self): return self.has_operator_
2070 def value(self): return self.value_
2072 def mutable_value(self): self.has_value_ = 1; return self.value_
2074 def clear_value(self):self.has_value_ = 0; self.value_.Clear()
2076 def has_value(self): return self.has_value_
2079 def MergeFrom(self, x):
2080 assert x is not self
2081 if (x.has_property()): self.mutable_property().MergeFrom(x.property())
2082 if (x.has_operator()): self.set_operator(x.operator())
2083 if (x.has_value()): self.mutable_value().MergeFrom(x.value())
2085 if _net_proto___parse__python is not None:
2086 def _CMergeFromString(self, s):
2087 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.PropertyFilter', s)
2089 if _net_proto___parse__python is not None:
2090 def _CEncode(self):
2091 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.PropertyFilter')
2093 if _net_proto___parse__python is not None:
2094 def _CEncodePartial(self):
2095 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.PropertyFilter')
2097 if _net_proto___parse__python is not None:
2098 def _CToASCII(self, output_format):
2099 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.PropertyFilter', output_format)
2102 if _net_proto___parse__python is not None:
2103 def ParseASCII(self, s):
2104 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.PropertyFilter', s)
2107 if _net_proto___parse__python is not None:
2108 def ParseASCIIIgnoreUnknown(self, s):
2109 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.PropertyFilter', s)
2112 def Equals(self, x):
2113 if x is self: return 1
2114 if self.has_property_ != x.has_property_: return 0
2115 if self.has_property_ and self.property_ != x.property_: return 0
2116 if self.has_operator_ != x.has_operator_: return 0
2117 if self.has_operator_ and self.operator_ != x.operator_: return 0
2118 if self.has_value_ != x.has_value_: return 0
2119 if self.has_value_ and self.value_ != x.value_: return 0
2120 return 1
2122 def IsInitialized(self, debug_strs=None):
2123 initialized = 1
2124 if (not self.has_property_):
2125 initialized = 0
2126 if debug_strs is not None:
2127 debug_strs.append('Required field: property not set.')
2128 elif not self.property_.IsInitialized(debug_strs): initialized = 0
2129 if (not self.has_operator_):
2130 initialized = 0
2131 if debug_strs is not None:
2132 debug_strs.append('Required field: operator not set.')
2133 if (not self.has_value_):
2134 initialized = 0
2135 if debug_strs is not None:
2136 debug_strs.append('Required field: value not set.')
2137 elif not self.value_.IsInitialized(debug_strs): initialized = 0
2138 return initialized
2140 def ByteSize(self):
2141 n = 0
2142 n += self.lengthString(self.property_.ByteSize())
2143 n += self.lengthVarInt64(self.operator_)
2144 n += self.lengthString(self.value_.ByteSize())
2145 return n + 3
2147 def ByteSizePartial(self):
2148 n = 0
2149 if (self.has_property_):
2150 n += 1
2151 n += self.lengthString(self.property_.ByteSizePartial())
2152 if (self.has_operator_):
2153 n += 1
2154 n += self.lengthVarInt64(self.operator_)
2155 if (self.has_value_):
2156 n += 1
2157 n += self.lengthString(self.value_.ByteSizePartial())
2158 return n
2160 def Clear(self):
2161 self.clear_property()
2162 self.clear_operator()
2163 self.clear_value()
2165 def OutputUnchecked(self, out):
2166 out.putVarInt32(10)
2167 out.putVarInt32(self.property_.ByteSize())
2168 self.property_.OutputUnchecked(out)
2169 out.putVarInt32(16)
2170 out.putVarInt32(self.operator_)
2171 out.putVarInt32(26)
2172 out.putVarInt32(self.value_.ByteSize())
2173 self.value_.OutputUnchecked(out)
2175 def OutputPartial(self, out):
2176 if (self.has_property_):
2177 out.putVarInt32(10)
2178 out.putVarInt32(self.property_.ByteSizePartial())
2179 self.property_.OutputPartial(out)
2180 if (self.has_operator_):
2181 out.putVarInt32(16)
2182 out.putVarInt32(self.operator_)
2183 if (self.has_value_):
2184 out.putVarInt32(26)
2185 out.putVarInt32(self.value_.ByteSizePartial())
2186 self.value_.OutputPartial(out)
2188 def TryMerge(self, d):
2189 while d.avail() > 0:
2190 tt = d.getVarInt32()
2191 if tt == 10:
2192 length = d.getVarInt32()
2193 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2194 d.skip(length)
2195 self.mutable_property().TryMerge(tmp)
2196 continue
2197 if tt == 16:
2198 self.set_operator(d.getVarInt32())
2199 continue
2200 if tt == 26:
2201 length = d.getVarInt32()
2202 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2203 d.skip(length)
2204 self.mutable_value().TryMerge(tmp)
2205 continue
2208 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
2209 d.skipData(tt)
2212 def __str__(self, prefix="", printElemNumber=0):
2213 res=""
2214 if self.has_property_:
2215 res+=prefix+"property <\n"
2216 res+=self.property_.__str__(prefix + " ", printElemNumber)
2217 res+=prefix+">\n"
2218 if self.has_operator_: res+=prefix+("operator: %s\n" % self.DebugFormatInt32(self.operator_))
2219 if self.has_value_:
2220 res+=prefix+"value <\n"
2221 res+=self.value_.__str__(prefix + " ", printElemNumber)
2222 res+=prefix+">\n"
2223 return res
2226 def _BuildTagLookupTable(sparse, maxtag, default=None):
2227 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
2229 kproperty = 1
2230 koperator = 2
2231 kvalue = 3
2233 _TEXT = _BuildTagLookupTable({
2234 0: "ErrorCode",
2235 1: "property",
2236 2: "operator",
2237 3: "value",
2238 }, 3)
2240 _TYPES = _BuildTagLookupTable({
2241 0: ProtocolBuffer.Encoder.NUMERIC,
2242 1: ProtocolBuffer.Encoder.STRING,
2243 2: ProtocolBuffer.Encoder.NUMERIC,
2244 3: ProtocolBuffer.Encoder.STRING,
2245 }, 3, ProtocolBuffer.Encoder.MAX_TYPE)
2248 _STYLE = """"""
2249 _STYLE_CONTENT_TYPE = """"""
2250 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.PropertyFilter'
2251 _SERIALIZED_DESCRIPTOR = array.array('B')
2252 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5RmlsdGVyExoIcHJvcGVydHkgASgCMAs4AkopYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlSZWZlcmVuY2WjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoIb3BlcmF0b3IgAigAMAU4AmgAFBMaBXZhbHVlIAMoAjALOAJKHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlZhbHVlowGqAQVjdHlwZbIBBnByb3RvMqQBFHN6CE9wZXJhdG9yiwGSAQlMRVNTX1RIQU6YAQGMAYsBkgESTEVTU19USEFOX09SX0VRVUFMmAECjAGLAZIBDEdSRUFURVJfVEhBTpgBA4wBiwGSARVHUkVBVEVSX1RIQU5fT1JfRVFVQUyYAQSMAYsBkgEFRVFVQUyYAQWMAYsBkgEMSEFTX0FOQ0VTVE9SmAELjAF0wgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
2253 if _net_proto___parse__python is not None:
2254 _net_proto___parse__python.RegisterType(
2255 _SERIALIZED_DESCRIPTOR.tostring())
2257 class BoundingCircleFilter(ProtocolBuffer.ProtocolMessage):
2258 has_property_ = 0
2259 has_center_ = 0
2260 has_radius_meters_ = 0
2261 radius_meters_ = 0.0
2263 def __init__(self, contents=None):
2264 self.property_ = PropertyReference()
2265 self.center_ = google.appengine.datastore.entity_v4_pb.GeoPoint()
2266 if contents is not None: self.MergeFromString(contents)
2268 def property(self): return self.property_
2270 def mutable_property(self): self.has_property_ = 1; return self.property_
2272 def clear_property(self):self.has_property_ = 0; self.property_.Clear()
2274 def has_property(self): return self.has_property_
2276 def center(self): return self.center_
2278 def mutable_center(self): self.has_center_ = 1; return self.center_
2280 def clear_center(self):self.has_center_ = 0; self.center_.Clear()
2282 def has_center(self): return self.has_center_
2284 def radius_meters(self): return self.radius_meters_
2286 def set_radius_meters(self, x):
2287 self.has_radius_meters_ = 1
2288 self.radius_meters_ = x
2290 def clear_radius_meters(self):
2291 if self.has_radius_meters_:
2292 self.has_radius_meters_ = 0
2293 self.radius_meters_ = 0.0
2295 def has_radius_meters(self): return self.has_radius_meters_
2298 def MergeFrom(self, x):
2299 assert x is not self
2300 if (x.has_property()): self.mutable_property().MergeFrom(x.property())
2301 if (x.has_center()): self.mutable_center().MergeFrom(x.center())
2302 if (x.has_radius_meters()): self.set_radius_meters(x.radius_meters())
2304 if _net_proto___parse__python is not None:
2305 def _CMergeFromString(self, s):
2306 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.BoundingCircleFilter', s)
2308 if _net_proto___parse__python is not None:
2309 def _CEncode(self):
2310 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.BoundingCircleFilter')
2312 if _net_proto___parse__python is not None:
2313 def _CEncodePartial(self):
2314 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.BoundingCircleFilter')
2316 if _net_proto___parse__python is not None:
2317 def _CToASCII(self, output_format):
2318 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.BoundingCircleFilter', output_format)
2321 if _net_proto___parse__python is not None:
2322 def ParseASCII(self, s):
2323 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.BoundingCircleFilter', s)
2326 if _net_proto___parse__python is not None:
2327 def ParseASCIIIgnoreUnknown(self, s):
2328 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.BoundingCircleFilter', s)
2331 def Equals(self, x):
2332 if x is self: return 1
2333 if self.has_property_ != x.has_property_: return 0
2334 if self.has_property_ and self.property_ != x.property_: return 0
2335 if self.has_center_ != x.has_center_: return 0
2336 if self.has_center_ and self.center_ != x.center_: return 0
2337 if self.has_radius_meters_ != x.has_radius_meters_: return 0
2338 if self.has_radius_meters_ and self.radius_meters_ != x.radius_meters_: return 0
2339 return 1
2341 def IsInitialized(self, debug_strs=None):
2342 initialized = 1
2343 if (not self.has_property_):
2344 initialized = 0
2345 if debug_strs is not None:
2346 debug_strs.append('Required field: property not set.')
2347 elif not self.property_.IsInitialized(debug_strs): initialized = 0
2348 if (not self.has_center_):
2349 initialized = 0
2350 if debug_strs is not None:
2351 debug_strs.append('Required field: center not set.')
2352 elif not self.center_.IsInitialized(debug_strs): initialized = 0
2353 if (not self.has_radius_meters_):
2354 initialized = 0
2355 if debug_strs is not None:
2356 debug_strs.append('Required field: radius_meters not set.')
2357 return initialized
2359 def ByteSize(self):
2360 n = 0
2361 n += self.lengthString(self.property_.ByteSize())
2362 n += self.lengthString(self.center_.ByteSize())
2363 return n + 11
2365 def ByteSizePartial(self):
2366 n = 0
2367 if (self.has_property_):
2368 n += 1
2369 n += self.lengthString(self.property_.ByteSizePartial())
2370 if (self.has_center_):
2371 n += 1
2372 n += self.lengthString(self.center_.ByteSizePartial())
2373 if (self.has_radius_meters_):
2374 n += 9
2375 return n
2377 def Clear(self):
2378 self.clear_property()
2379 self.clear_center()
2380 self.clear_radius_meters()
2382 def OutputUnchecked(self, out):
2383 out.putVarInt32(10)
2384 out.putVarInt32(self.property_.ByteSize())
2385 self.property_.OutputUnchecked(out)
2386 out.putVarInt32(18)
2387 out.putVarInt32(self.center_.ByteSize())
2388 self.center_.OutputUnchecked(out)
2389 out.putVarInt32(25)
2390 out.putDouble(self.radius_meters_)
2392 def OutputPartial(self, out):
2393 if (self.has_property_):
2394 out.putVarInt32(10)
2395 out.putVarInt32(self.property_.ByteSizePartial())
2396 self.property_.OutputPartial(out)
2397 if (self.has_center_):
2398 out.putVarInt32(18)
2399 out.putVarInt32(self.center_.ByteSizePartial())
2400 self.center_.OutputPartial(out)
2401 if (self.has_radius_meters_):
2402 out.putVarInt32(25)
2403 out.putDouble(self.radius_meters_)
2405 def TryMerge(self, d):
2406 while d.avail() > 0:
2407 tt = d.getVarInt32()
2408 if tt == 10:
2409 length = d.getVarInt32()
2410 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2411 d.skip(length)
2412 self.mutable_property().TryMerge(tmp)
2413 continue
2414 if tt == 18:
2415 length = d.getVarInt32()
2416 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2417 d.skip(length)
2418 self.mutable_center().TryMerge(tmp)
2419 continue
2420 if tt == 25:
2421 self.set_radius_meters(d.getDouble())
2422 continue
2425 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
2426 d.skipData(tt)
2429 def __str__(self, prefix="", printElemNumber=0):
2430 res=""
2431 if self.has_property_:
2432 res+=prefix+"property <\n"
2433 res+=self.property_.__str__(prefix + " ", printElemNumber)
2434 res+=prefix+">\n"
2435 if self.has_center_:
2436 res+=prefix+"center <\n"
2437 res+=self.center_.__str__(prefix + " ", printElemNumber)
2438 res+=prefix+">\n"
2439 if self.has_radius_meters_: res+=prefix+("radius_meters: %s\n" % self.DebugFormat(self.radius_meters_))
2440 return res
2443 def _BuildTagLookupTable(sparse, maxtag, default=None):
2444 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
2446 kproperty = 1
2447 kcenter = 2
2448 kradius_meters = 3
2450 _TEXT = _BuildTagLookupTable({
2451 0: "ErrorCode",
2452 1: "property",
2453 2: "center",
2454 3: "radius_meters",
2455 }, 3)
2457 _TYPES = _BuildTagLookupTable({
2458 0: ProtocolBuffer.Encoder.NUMERIC,
2459 1: ProtocolBuffer.Encoder.STRING,
2460 2: ProtocolBuffer.Encoder.STRING,
2461 3: ProtocolBuffer.Encoder.DOUBLE,
2462 }, 3, ProtocolBuffer.Encoder.MAX_TYPE)
2465 _STYLE = """"""
2466 _STYLE_CONTENT_TYPE = """"""
2467 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.BoundingCircleFilter'
2468 _SERIALIZED_DESCRIPTOR = array.array('B')
2469 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KLGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkJvdW5kaW5nQ2lyY2xlRmlsdGVyExoIcHJvcGVydHkgASgCMAs4AkopYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlSZWZlcmVuY2WjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoGY2VudGVyIAIoAjALOAJKIGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lkdlb1BvaW50owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaDXJhZGl1c19tZXRlcnMgAygBMAE4AhTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
2470 if _net_proto___parse__python is not None:
2471 _net_proto___parse__python.RegisterType(
2472 _SERIALIZED_DESCRIPTOR.tostring())
2474 class BoundingBoxFilter(ProtocolBuffer.ProtocolMessage):
2475 has_property_ = 0
2476 has_southwest_ = 0
2477 has_northeast_ = 0
2479 def __init__(self, contents=None):
2480 self.property_ = PropertyReference()
2481 self.southwest_ = google.appengine.datastore.entity_v4_pb.GeoPoint()
2482 self.northeast_ = google.appengine.datastore.entity_v4_pb.GeoPoint()
2483 if contents is not None: self.MergeFromString(contents)
2485 def property(self): return self.property_
2487 def mutable_property(self): self.has_property_ = 1; return self.property_
2489 def clear_property(self):self.has_property_ = 0; self.property_.Clear()
2491 def has_property(self): return self.has_property_
2493 def southwest(self): return self.southwest_
2495 def mutable_southwest(self): self.has_southwest_ = 1; return self.southwest_
2497 def clear_southwest(self):self.has_southwest_ = 0; self.southwest_.Clear()
2499 def has_southwest(self): return self.has_southwest_
2501 def northeast(self): return self.northeast_
2503 def mutable_northeast(self): self.has_northeast_ = 1; return self.northeast_
2505 def clear_northeast(self):self.has_northeast_ = 0; self.northeast_.Clear()
2507 def has_northeast(self): return self.has_northeast_
2510 def MergeFrom(self, x):
2511 assert x is not self
2512 if (x.has_property()): self.mutable_property().MergeFrom(x.property())
2513 if (x.has_southwest()): self.mutable_southwest().MergeFrom(x.southwest())
2514 if (x.has_northeast()): self.mutable_northeast().MergeFrom(x.northeast())
2516 if _net_proto___parse__python is not None:
2517 def _CMergeFromString(self, s):
2518 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.BoundingBoxFilter', s)
2520 if _net_proto___parse__python is not None:
2521 def _CEncode(self):
2522 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.BoundingBoxFilter')
2524 if _net_proto___parse__python is not None:
2525 def _CEncodePartial(self):
2526 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.BoundingBoxFilter')
2528 if _net_proto___parse__python is not None:
2529 def _CToASCII(self, output_format):
2530 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.BoundingBoxFilter', output_format)
2533 if _net_proto___parse__python is not None:
2534 def ParseASCII(self, s):
2535 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.BoundingBoxFilter', s)
2538 if _net_proto___parse__python is not None:
2539 def ParseASCIIIgnoreUnknown(self, s):
2540 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.BoundingBoxFilter', s)
2543 def Equals(self, x):
2544 if x is self: return 1
2545 if self.has_property_ != x.has_property_: return 0
2546 if self.has_property_ and self.property_ != x.property_: return 0
2547 if self.has_southwest_ != x.has_southwest_: return 0
2548 if self.has_southwest_ and self.southwest_ != x.southwest_: return 0
2549 if self.has_northeast_ != x.has_northeast_: return 0
2550 if self.has_northeast_ and self.northeast_ != x.northeast_: return 0
2551 return 1
2553 def IsInitialized(self, debug_strs=None):
2554 initialized = 1
2555 if (not self.has_property_):
2556 initialized = 0
2557 if debug_strs is not None:
2558 debug_strs.append('Required field: property not set.')
2559 elif not self.property_.IsInitialized(debug_strs): initialized = 0
2560 if (not self.has_southwest_):
2561 initialized = 0
2562 if debug_strs is not None:
2563 debug_strs.append('Required field: southwest not set.')
2564 elif not self.southwest_.IsInitialized(debug_strs): initialized = 0
2565 if (not self.has_northeast_):
2566 initialized = 0
2567 if debug_strs is not None:
2568 debug_strs.append('Required field: northeast not set.')
2569 elif not self.northeast_.IsInitialized(debug_strs): initialized = 0
2570 return initialized
2572 def ByteSize(self):
2573 n = 0
2574 n += self.lengthString(self.property_.ByteSize())
2575 n += self.lengthString(self.southwest_.ByteSize())
2576 n += self.lengthString(self.northeast_.ByteSize())
2577 return n + 3
2579 def ByteSizePartial(self):
2580 n = 0
2581 if (self.has_property_):
2582 n += 1
2583 n += self.lengthString(self.property_.ByteSizePartial())
2584 if (self.has_southwest_):
2585 n += 1
2586 n += self.lengthString(self.southwest_.ByteSizePartial())
2587 if (self.has_northeast_):
2588 n += 1
2589 n += self.lengthString(self.northeast_.ByteSizePartial())
2590 return n
2592 def Clear(self):
2593 self.clear_property()
2594 self.clear_southwest()
2595 self.clear_northeast()
2597 def OutputUnchecked(self, out):
2598 out.putVarInt32(10)
2599 out.putVarInt32(self.property_.ByteSize())
2600 self.property_.OutputUnchecked(out)
2601 out.putVarInt32(18)
2602 out.putVarInt32(self.southwest_.ByteSize())
2603 self.southwest_.OutputUnchecked(out)
2604 out.putVarInt32(26)
2605 out.putVarInt32(self.northeast_.ByteSize())
2606 self.northeast_.OutputUnchecked(out)
2608 def OutputPartial(self, out):
2609 if (self.has_property_):
2610 out.putVarInt32(10)
2611 out.putVarInt32(self.property_.ByteSizePartial())
2612 self.property_.OutputPartial(out)
2613 if (self.has_southwest_):
2614 out.putVarInt32(18)
2615 out.putVarInt32(self.southwest_.ByteSizePartial())
2616 self.southwest_.OutputPartial(out)
2617 if (self.has_northeast_):
2618 out.putVarInt32(26)
2619 out.putVarInt32(self.northeast_.ByteSizePartial())
2620 self.northeast_.OutputPartial(out)
2622 def TryMerge(self, d):
2623 while d.avail() > 0:
2624 tt = d.getVarInt32()
2625 if tt == 10:
2626 length = d.getVarInt32()
2627 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2628 d.skip(length)
2629 self.mutable_property().TryMerge(tmp)
2630 continue
2631 if tt == 18:
2632 length = d.getVarInt32()
2633 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2634 d.skip(length)
2635 self.mutable_southwest().TryMerge(tmp)
2636 continue
2637 if tt == 26:
2638 length = d.getVarInt32()
2639 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2640 d.skip(length)
2641 self.mutable_northeast().TryMerge(tmp)
2642 continue
2645 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
2646 d.skipData(tt)
2649 def __str__(self, prefix="", printElemNumber=0):
2650 res=""
2651 if self.has_property_:
2652 res+=prefix+"property <\n"
2653 res+=self.property_.__str__(prefix + " ", printElemNumber)
2654 res+=prefix+">\n"
2655 if self.has_southwest_:
2656 res+=prefix+"southwest <\n"
2657 res+=self.southwest_.__str__(prefix + " ", printElemNumber)
2658 res+=prefix+">\n"
2659 if self.has_northeast_:
2660 res+=prefix+"northeast <\n"
2661 res+=self.northeast_.__str__(prefix + " ", printElemNumber)
2662 res+=prefix+">\n"
2663 return res
2666 def _BuildTagLookupTable(sparse, maxtag, default=None):
2667 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
2669 kproperty = 1
2670 ksouthwest = 2
2671 knortheast = 3
2673 _TEXT = _BuildTagLookupTable({
2674 0: "ErrorCode",
2675 1: "property",
2676 2: "southwest",
2677 3: "northeast",
2678 }, 3)
2680 _TYPES = _BuildTagLookupTable({
2681 0: ProtocolBuffer.Encoder.NUMERIC,
2682 1: ProtocolBuffer.Encoder.STRING,
2683 2: ProtocolBuffer.Encoder.STRING,
2684 3: ProtocolBuffer.Encoder.STRING,
2685 }, 3, ProtocolBuffer.Encoder.MAX_TYPE)
2688 _STYLE = """"""
2689 _STYLE_CONTENT_TYPE = """"""
2690 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.BoundingBoxFilter'
2691 _SERIALIZED_DESCRIPTOR = array.array('B')
2692 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkJvdW5kaW5nQm94RmlsdGVyExoIcHJvcGVydHkgASgCMAs4AkopYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlSZWZlcmVuY2WjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoJc291dGh3ZXN0IAIoAjALOAJKIGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lkdlb1BvaW50owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaCW5vcnRoZWFzdCADKAIwCzgCSiBhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5HZW9Qb2ludKMBqgEFY3R5cGWyAQZwcm90bzKkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
2693 if _net_proto___parse__python is not None:
2694 _net_proto___parse__python.RegisterType(
2695 _SERIALIZED_DESCRIPTOR.tostring())
2697 class GqlQuery(ProtocolBuffer.ProtocolMessage):
2698 has_query_string_ = 0
2699 query_string_ = ""
2700 has_allow_literal_ = 0
2701 allow_literal_ = 0
2703 def __init__(self, contents=None):
2704 self.name_arg_ = []
2705 self.number_arg_ = []
2706 if contents is not None: self.MergeFromString(contents)
2708 def query_string(self): return self.query_string_
2710 def set_query_string(self, x):
2711 self.has_query_string_ = 1
2712 self.query_string_ = x
2714 def clear_query_string(self):
2715 if self.has_query_string_:
2716 self.has_query_string_ = 0
2717 self.query_string_ = ""
2719 def has_query_string(self): return self.has_query_string_
2721 def allow_literal(self): return self.allow_literal_
2723 def set_allow_literal(self, x):
2724 self.has_allow_literal_ = 1
2725 self.allow_literal_ = x
2727 def clear_allow_literal(self):
2728 if self.has_allow_literal_:
2729 self.has_allow_literal_ = 0
2730 self.allow_literal_ = 0
2732 def has_allow_literal(self): return self.has_allow_literal_
2734 def name_arg_size(self): return len(self.name_arg_)
2735 def name_arg_list(self): return self.name_arg_
2737 def name_arg(self, i):
2738 return self.name_arg_[i]
2740 def mutable_name_arg(self, i):
2741 return self.name_arg_[i]
2743 def add_name_arg(self):
2744 x = GqlQueryArg()
2745 self.name_arg_.append(x)
2746 return x
2748 def clear_name_arg(self):
2749 self.name_arg_ = []
2750 def number_arg_size(self): return len(self.number_arg_)
2751 def number_arg_list(self): return self.number_arg_
2753 def number_arg(self, i):
2754 return self.number_arg_[i]
2756 def mutable_number_arg(self, i):
2757 return self.number_arg_[i]
2759 def add_number_arg(self):
2760 x = GqlQueryArg()
2761 self.number_arg_.append(x)
2762 return x
2764 def clear_number_arg(self):
2765 self.number_arg_ = []
2767 def MergeFrom(self, x):
2768 assert x is not self
2769 if (x.has_query_string()): self.set_query_string(x.query_string())
2770 if (x.has_allow_literal()): self.set_allow_literal(x.allow_literal())
2771 for i in xrange(x.name_arg_size()): self.add_name_arg().CopyFrom(x.name_arg(i))
2772 for i in xrange(x.number_arg_size()): self.add_number_arg().CopyFrom(x.number_arg(i))
2774 if _net_proto___parse__python is not None:
2775 def _CMergeFromString(self, s):
2776 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.GqlQuery', s)
2778 if _net_proto___parse__python is not None:
2779 def _CEncode(self):
2780 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.GqlQuery')
2782 if _net_proto___parse__python is not None:
2783 def _CEncodePartial(self):
2784 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.GqlQuery')
2786 if _net_proto___parse__python is not None:
2787 def _CToASCII(self, output_format):
2788 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.GqlQuery', output_format)
2791 if _net_proto___parse__python is not None:
2792 def ParseASCII(self, s):
2793 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.GqlQuery', s)
2796 if _net_proto___parse__python is not None:
2797 def ParseASCIIIgnoreUnknown(self, s):
2798 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.GqlQuery', s)
2801 def Equals(self, x):
2802 if x is self: return 1
2803 if self.has_query_string_ != x.has_query_string_: return 0
2804 if self.has_query_string_ and self.query_string_ != x.query_string_: return 0
2805 if self.has_allow_literal_ != x.has_allow_literal_: return 0
2806 if self.has_allow_literal_ and self.allow_literal_ != x.allow_literal_: return 0
2807 if len(self.name_arg_) != len(x.name_arg_): return 0
2808 for e1, e2 in zip(self.name_arg_, x.name_arg_):
2809 if e1 != e2: return 0
2810 if len(self.number_arg_) != len(x.number_arg_): return 0
2811 for e1, e2 in zip(self.number_arg_, x.number_arg_):
2812 if e1 != e2: return 0
2813 return 1
2815 def IsInitialized(self, debug_strs=None):
2816 initialized = 1
2817 if (not self.has_query_string_):
2818 initialized = 0
2819 if debug_strs is not None:
2820 debug_strs.append('Required field: query_string not set.')
2821 for p in self.name_arg_:
2822 if not p.IsInitialized(debug_strs): initialized=0
2823 for p in self.number_arg_:
2824 if not p.IsInitialized(debug_strs): initialized=0
2825 return initialized
2827 def ByteSize(self):
2828 n = 0
2829 n += self.lengthString(len(self.query_string_))
2830 if (self.has_allow_literal_): n += 2
2831 n += 1 * len(self.name_arg_)
2832 for i in xrange(len(self.name_arg_)): n += self.lengthString(self.name_arg_[i].ByteSize())
2833 n += 1 * len(self.number_arg_)
2834 for i in xrange(len(self.number_arg_)): n += self.lengthString(self.number_arg_[i].ByteSize())
2835 return n + 1
2837 def ByteSizePartial(self):
2838 n = 0
2839 if (self.has_query_string_):
2840 n += 1
2841 n += self.lengthString(len(self.query_string_))
2842 if (self.has_allow_literal_): n += 2
2843 n += 1 * len(self.name_arg_)
2844 for i in xrange(len(self.name_arg_)): n += self.lengthString(self.name_arg_[i].ByteSizePartial())
2845 n += 1 * len(self.number_arg_)
2846 for i in xrange(len(self.number_arg_)): n += self.lengthString(self.number_arg_[i].ByteSizePartial())
2847 return n
2849 def Clear(self):
2850 self.clear_query_string()
2851 self.clear_allow_literal()
2852 self.clear_name_arg()
2853 self.clear_number_arg()
2855 def OutputUnchecked(self, out):
2856 out.putVarInt32(10)
2857 out.putPrefixedString(self.query_string_)
2858 if (self.has_allow_literal_):
2859 out.putVarInt32(16)
2860 out.putBoolean(self.allow_literal_)
2861 for i in xrange(len(self.name_arg_)):
2862 out.putVarInt32(26)
2863 out.putVarInt32(self.name_arg_[i].ByteSize())
2864 self.name_arg_[i].OutputUnchecked(out)
2865 for i in xrange(len(self.number_arg_)):
2866 out.putVarInt32(34)
2867 out.putVarInt32(self.number_arg_[i].ByteSize())
2868 self.number_arg_[i].OutputUnchecked(out)
2870 def OutputPartial(self, out):
2871 if (self.has_query_string_):
2872 out.putVarInt32(10)
2873 out.putPrefixedString(self.query_string_)
2874 if (self.has_allow_literal_):
2875 out.putVarInt32(16)
2876 out.putBoolean(self.allow_literal_)
2877 for i in xrange(len(self.name_arg_)):
2878 out.putVarInt32(26)
2879 out.putVarInt32(self.name_arg_[i].ByteSizePartial())
2880 self.name_arg_[i].OutputPartial(out)
2881 for i in xrange(len(self.number_arg_)):
2882 out.putVarInt32(34)
2883 out.putVarInt32(self.number_arg_[i].ByteSizePartial())
2884 self.number_arg_[i].OutputPartial(out)
2886 def TryMerge(self, d):
2887 while d.avail() > 0:
2888 tt = d.getVarInt32()
2889 if tt == 10:
2890 self.set_query_string(d.getPrefixedString())
2891 continue
2892 if tt == 16:
2893 self.set_allow_literal(d.getBoolean())
2894 continue
2895 if tt == 26:
2896 length = d.getVarInt32()
2897 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2898 d.skip(length)
2899 self.add_name_arg().TryMerge(tmp)
2900 continue
2901 if tt == 34:
2902 length = d.getVarInt32()
2903 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2904 d.skip(length)
2905 self.add_number_arg().TryMerge(tmp)
2906 continue
2909 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
2910 d.skipData(tt)
2913 def __str__(self, prefix="", printElemNumber=0):
2914 res=""
2915 if self.has_query_string_: res+=prefix+("query_string: %s\n" % self.DebugFormatString(self.query_string_))
2916 if self.has_allow_literal_: res+=prefix+("allow_literal: %s\n" % self.DebugFormatBool(self.allow_literal_))
2917 cnt=0
2918 for e in self.name_arg_:
2919 elm=""
2920 if printElemNumber: elm="(%d)" % cnt
2921 res+=prefix+("name_arg%s <\n" % elm)
2922 res+=e.__str__(prefix + " ", printElemNumber)
2923 res+=prefix+">\n"
2924 cnt+=1
2925 cnt=0
2926 for e in self.number_arg_:
2927 elm=""
2928 if printElemNumber: elm="(%d)" % cnt
2929 res+=prefix+("number_arg%s <\n" % elm)
2930 res+=e.__str__(prefix + " ", printElemNumber)
2931 res+=prefix+">\n"
2932 cnt+=1
2933 return res
2936 def _BuildTagLookupTable(sparse, maxtag, default=None):
2937 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
2939 kquery_string = 1
2940 kallow_literal = 2
2941 kname_arg = 3
2942 knumber_arg = 4
2944 _TEXT = _BuildTagLookupTable({
2945 0: "ErrorCode",
2946 1: "query_string",
2947 2: "allow_literal",
2948 3: "name_arg",
2949 4: "number_arg",
2950 }, 4)
2952 _TYPES = _BuildTagLookupTable({
2953 0: ProtocolBuffer.Encoder.NUMERIC,
2954 1: ProtocolBuffer.Encoder.STRING,
2955 2: ProtocolBuffer.Encoder.NUMERIC,
2956 3: ProtocolBuffer.Encoder.STRING,
2957 4: ProtocolBuffer.Encoder.STRING,
2958 }, 4, ProtocolBuffer.Encoder.MAX_TYPE)
2961 _STYLE = """"""
2962 _STYLE_CONTENT_TYPE = """"""
2963 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.GqlQuery'
2964 _SERIALIZED_DESCRIPTOR = array.array('B')
2965 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KIGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkdxbFF1ZXJ5ExoMcXVlcnlfc3RyaW5nIAEoAjAJOAIUExoNYWxsb3dfbGl0ZXJhbCACKAAwCDgBQgVmYWxzZaMBqgEHZGVmYXVsdLIBBWZhbHNlpAEUExoIbmFtZV9hcmcgAygCMAs4A0ojYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuR3FsUXVlcnlBcmejAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoKbnVtYmVyX2FyZyAEKAIwCzgDSiNhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5HcWxRdWVyeUFyZ6MBqgEFY3R5cGWyAQZwcm90bzKkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
2966 if _net_proto___parse__python is not None:
2967 _net_proto___parse__python.RegisterType(
2968 _SERIALIZED_DESCRIPTOR.tostring())
2970 class GqlQueryArg(ProtocolBuffer.ProtocolMessage):
2971 has_name_ = 0
2972 name_ = ""
2973 has_value_ = 0
2974 value_ = None
2975 has_cursor_ = 0
2976 cursor_ = ""
2978 def __init__(self, contents=None):
2979 self.lazy_init_lock_ = thread.allocate_lock()
2980 if contents is not None: self.MergeFromString(contents)
2982 def name(self): return self.name_
2984 def set_name(self, x):
2985 self.has_name_ = 1
2986 self.name_ = x
2988 def clear_name(self):
2989 if self.has_name_:
2990 self.has_name_ = 0
2991 self.name_ = ""
2993 def has_name(self): return self.has_name_
2995 def value(self):
2996 if self.value_ is None:
2997 self.lazy_init_lock_.acquire()
2998 try:
2999 if self.value_ is None: self.value_ = google.appengine.datastore.entity_v4_pb.Value()
3000 finally:
3001 self.lazy_init_lock_.release()
3002 return self.value_
3004 def mutable_value(self): self.has_value_ = 1; return self.value()
3006 def clear_value(self):
3008 if self.has_value_:
3009 self.has_value_ = 0;
3010 if self.value_ is not None: self.value_.Clear()
3012 def has_value(self): return self.has_value_
3014 def cursor(self): return self.cursor_
3016 def set_cursor(self, x):
3017 self.has_cursor_ = 1
3018 self.cursor_ = x
3020 def clear_cursor(self):
3021 if self.has_cursor_:
3022 self.has_cursor_ = 0
3023 self.cursor_ = ""
3025 def has_cursor(self): return self.has_cursor_
3028 def MergeFrom(self, x):
3029 assert x is not self
3030 if (x.has_name()): self.set_name(x.name())
3031 if (x.has_value()): self.mutable_value().MergeFrom(x.value())
3032 if (x.has_cursor()): self.set_cursor(x.cursor())
3034 if _net_proto___parse__python is not None:
3035 def _CMergeFromString(self, s):
3036 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.GqlQueryArg', s)
3038 if _net_proto___parse__python is not None:
3039 def _CEncode(self):
3040 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.GqlQueryArg')
3042 if _net_proto___parse__python is not None:
3043 def _CEncodePartial(self):
3044 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.GqlQueryArg')
3046 if _net_proto___parse__python is not None:
3047 def _CToASCII(self, output_format):
3048 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.GqlQueryArg', output_format)
3051 if _net_proto___parse__python is not None:
3052 def ParseASCII(self, s):
3053 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.GqlQueryArg', s)
3056 if _net_proto___parse__python is not None:
3057 def ParseASCIIIgnoreUnknown(self, s):
3058 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.GqlQueryArg', s)
3061 def Equals(self, x):
3062 if x is self: return 1
3063 if self.has_name_ != x.has_name_: return 0
3064 if self.has_name_ and self.name_ != x.name_: return 0
3065 if self.has_value_ != x.has_value_: return 0
3066 if self.has_value_ and self.value_ != x.value_: return 0
3067 if self.has_cursor_ != x.has_cursor_: return 0
3068 if self.has_cursor_ and self.cursor_ != x.cursor_: return 0
3069 return 1
3071 def IsInitialized(self, debug_strs=None):
3072 initialized = 1
3073 if (self.has_value_ and not self.value_.IsInitialized(debug_strs)): initialized = 0
3074 return initialized
3076 def ByteSize(self):
3077 n = 0
3078 if (self.has_name_): n += 1 + self.lengthString(len(self.name_))
3079 if (self.has_value_): n += 1 + self.lengthString(self.value_.ByteSize())
3080 if (self.has_cursor_): n += 1 + self.lengthString(len(self.cursor_))
3081 return n
3083 def ByteSizePartial(self):
3084 n = 0
3085 if (self.has_name_): n += 1 + self.lengthString(len(self.name_))
3086 if (self.has_value_): n += 1 + self.lengthString(self.value_.ByteSizePartial())
3087 if (self.has_cursor_): n += 1 + self.lengthString(len(self.cursor_))
3088 return n
3090 def Clear(self):
3091 self.clear_name()
3092 self.clear_value()
3093 self.clear_cursor()
3095 def OutputUnchecked(self, out):
3096 if (self.has_name_):
3097 out.putVarInt32(10)
3098 out.putPrefixedString(self.name_)
3099 if (self.has_value_):
3100 out.putVarInt32(18)
3101 out.putVarInt32(self.value_.ByteSize())
3102 self.value_.OutputUnchecked(out)
3103 if (self.has_cursor_):
3104 out.putVarInt32(26)
3105 out.putPrefixedString(self.cursor_)
3107 def OutputPartial(self, out):
3108 if (self.has_name_):
3109 out.putVarInt32(10)
3110 out.putPrefixedString(self.name_)
3111 if (self.has_value_):
3112 out.putVarInt32(18)
3113 out.putVarInt32(self.value_.ByteSizePartial())
3114 self.value_.OutputPartial(out)
3115 if (self.has_cursor_):
3116 out.putVarInt32(26)
3117 out.putPrefixedString(self.cursor_)
3119 def TryMerge(self, d):
3120 while d.avail() > 0:
3121 tt = d.getVarInt32()
3122 if tt == 10:
3123 self.set_name(d.getPrefixedString())
3124 continue
3125 if tt == 18:
3126 length = d.getVarInt32()
3127 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
3128 d.skip(length)
3129 self.mutable_value().TryMerge(tmp)
3130 continue
3131 if tt == 26:
3132 self.set_cursor(d.getPrefixedString())
3133 continue
3136 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
3137 d.skipData(tt)
3140 def __str__(self, prefix="", printElemNumber=0):
3141 res=""
3142 if self.has_name_: res+=prefix+("name: %s\n" % self.DebugFormatString(self.name_))
3143 if self.has_value_:
3144 res+=prefix+"value <\n"
3145 res+=self.value_.__str__(prefix + " ", printElemNumber)
3146 res+=prefix+">\n"
3147 if self.has_cursor_: res+=prefix+("cursor: %s\n" % self.DebugFormatString(self.cursor_))
3148 return res
3151 def _BuildTagLookupTable(sparse, maxtag, default=None):
3152 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
3154 kname = 1
3155 kvalue = 2
3156 kcursor = 3
3158 _TEXT = _BuildTagLookupTable({
3159 0: "ErrorCode",
3160 1: "name",
3161 2: "value",
3162 3: "cursor",
3163 }, 3)
3165 _TYPES = _BuildTagLookupTable({
3166 0: ProtocolBuffer.Encoder.NUMERIC,
3167 1: ProtocolBuffer.Encoder.STRING,
3168 2: ProtocolBuffer.Encoder.STRING,
3169 3: ProtocolBuffer.Encoder.STRING,
3170 }, 3, ProtocolBuffer.Encoder.MAX_TYPE)
3173 _STYLE = """"""
3174 _STYLE_CONTENT_TYPE = """"""
3175 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.GqlQueryArg'
3176 _SERIALIZED_DESCRIPTOR = array.array('B')
3177 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KI2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkdxbFF1ZXJ5QXJnExoEbmFtZSABKAIwCTgBFBMaBXZhbHVlIAIoAjALOAFKHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlZhbHVlowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaBmN1cnNvciADKAIwCTgBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
3178 if _net_proto___parse__python is not None:
3179 _net_proto___parse__python.RegisterType(
3180 _SERIALIZED_DESCRIPTOR.tostring())
3182 class QueryResultBatch(ProtocolBuffer.ProtocolMessage):
3185 NOT_FINISHED = 1
3186 MORE_RESULTS_AFTER_LIMIT = 2
3187 NO_MORE_RESULTS = 3
3189 _MoreResultsType_NAMES = {
3190 1: "NOT_FINISHED",
3191 2: "MORE_RESULTS_AFTER_LIMIT",
3192 3: "NO_MORE_RESULTS",
3195 def MoreResultsType_Name(cls, x): return cls._MoreResultsType_NAMES.get(x, "")
3196 MoreResultsType_Name = classmethod(MoreResultsType_Name)
3198 has_entity_result_type_ = 0
3199 entity_result_type_ = 0
3200 has_skipped_cursor_ = 0
3201 skipped_cursor_ = ""
3202 has_end_cursor_ = 0
3203 end_cursor_ = ""
3204 has_more_results_ = 0
3205 more_results_ = 0
3206 has_skipped_results_ = 0
3207 skipped_results_ = 0
3208 has_snapshot_version_ = 0
3209 snapshot_version_ = 0
3211 def __init__(self, contents=None):
3212 self.entity_result_ = []
3213 if contents is not None: self.MergeFromString(contents)
3215 def entity_result_type(self): return self.entity_result_type_
3217 def set_entity_result_type(self, x):
3218 self.has_entity_result_type_ = 1
3219 self.entity_result_type_ = x
3221 def clear_entity_result_type(self):
3222 if self.has_entity_result_type_:
3223 self.has_entity_result_type_ = 0
3224 self.entity_result_type_ = 0
3226 def has_entity_result_type(self): return self.has_entity_result_type_
3228 def entity_result_size(self): return len(self.entity_result_)
3229 def entity_result_list(self): return self.entity_result_
3231 def entity_result(self, i):
3232 return self.entity_result_[i]
3234 def mutable_entity_result(self, i):
3235 return self.entity_result_[i]
3237 def add_entity_result(self):
3238 x = EntityResult()
3239 self.entity_result_.append(x)
3240 return x
3242 def clear_entity_result(self):
3243 self.entity_result_ = []
3244 def skipped_cursor(self): return self.skipped_cursor_
3246 def set_skipped_cursor(self, x):
3247 self.has_skipped_cursor_ = 1
3248 self.skipped_cursor_ = x
3250 def clear_skipped_cursor(self):
3251 if self.has_skipped_cursor_:
3252 self.has_skipped_cursor_ = 0
3253 self.skipped_cursor_ = ""
3255 def has_skipped_cursor(self): return self.has_skipped_cursor_
3257 def end_cursor(self): return self.end_cursor_
3259 def set_end_cursor(self, x):
3260 self.has_end_cursor_ = 1
3261 self.end_cursor_ = x
3263 def clear_end_cursor(self):
3264 if self.has_end_cursor_:
3265 self.has_end_cursor_ = 0
3266 self.end_cursor_ = ""
3268 def has_end_cursor(self): return self.has_end_cursor_
3270 def more_results(self): return self.more_results_
3272 def set_more_results(self, x):
3273 self.has_more_results_ = 1
3274 self.more_results_ = x
3276 def clear_more_results(self):
3277 if self.has_more_results_:
3278 self.has_more_results_ = 0
3279 self.more_results_ = 0
3281 def has_more_results(self): return self.has_more_results_
3283 def skipped_results(self): return self.skipped_results_
3285 def set_skipped_results(self, x):
3286 self.has_skipped_results_ = 1
3287 self.skipped_results_ = x
3289 def clear_skipped_results(self):
3290 if self.has_skipped_results_:
3291 self.has_skipped_results_ = 0
3292 self.skipped_results_ = 0
3294 def has_skipped_results(self): return self.has_skipped_results_
3296 def snapshot_version(self): return self.snapshot_version_
3298 def set_snapshot_version(self, x):
3299 self.has_snapshot_version_ = 1
3300 self.snapshot_version_ = x
3302 def clear_snapshot_version(self):
3303 if self.has_snapshot_version_:
3304 self.has_snapshot_version_ = 0
3305 self.snapshot_version_ = 0
3307 def has_snapshot_version(self): return self.has_snapshot_version_
3310 def MergeFrom(self, x):
3311 assert x is not self
3312 if (x.has_entity_result_type()): self.set_entity_result_type(x.entity_result_type())
3313 for i in xrange(x.entity_result_size()): self.add_entity_result().CopyFrom(x.entity_result(i))
3314 if (x.has_skipped_cursor()): self.set_skipped_cursor(x.skipped_cursor())
3315 if (x.has_end_cursor()): self.set_end_cursor(x.end_cursor())
3316 if (x.has_more_results()): self.set_more_results(x.more_results())
3317 if (x.has_skipped_results()): self.set_skipped_results(x.skipped_results())
3318 if (x.has_snapshot_version()): self.set_snapshot_version(x.snapshot_version())
3320 if _net_proto___parse__python is not None:
3321 def _CMergeFromString(self, s):
3322 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.QueryResultBatch', s)
3324 if _net_proto___parse__python is not None:
3325 def _CEncode(self):
3326 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.QueryResultBatch')
3328 if _net_proto___parse__python is not None:
3329 def _CEncodePartial(self):
3330 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.QueryResultBatch')
3332 if _net_proto___parse__python is not None:
3333 def _CToASCII(self, output_format):
3334 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.QueryResultBatch', output_format)
3337 if _net_proto___parse__python is not None:
3338 def ParseASCII(self, s):
3339 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.QueryResultBatch', s)
3342 if _net_proto___parse__python is not None:
3343 def ParseASCIIIgnoreUnknown(self, s):
3344 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.QueryResultBatch', s)
3347 def Equals(self, x):
3348 if x is self: return 1
3349 if self.has_entity_result_type_ != x.has_entity_result_type_: return 0
3350 if self.has_entity_result_type_ and self.entity_result_type_ != x.entity_result_type_: return 0
3351 if len(self.entity_result_) != len(x.entity_result_): return 0
3352 for e1, e2 in zip(self.entity_result_, x.entity_result_):
3353 if e1 != e2: return 0
3354 if self.has_skipped_cursor_ != x.has_skipped_cursor_: return 0
3355 if self.has_skipped_cursor_ and self.skipped_cursor_ != x.skipped_cursor_: return 0
3356 if self.has_end_cursor_ != x.has_end_cursor_: return 0
3357 if self.has_end_cursor_ and self.end_cursor_ != x.end_cursor_: return 0
3358 if self.has_more_results_ != x.has_more_results_: return 0
3359 if self.has_more_results_ and self.more_results_ != x.more_results_: return 0
3360 if self.has_skipped_results_ != x.has_skipped_results_: return 0
3361 if self.has_skipped_results_ and self.skipped_results_ != x.skipped_results_: return 0
3362 if self.has_snapshot_version_ != x.has_snapshot_version_: return 0
3363 if self.has_snapshot_version_ and self.snapshot_version_ != x.snapshot_version_: return 0
3364 return 1
3366 def IsInitialized(self, debug_strs=None):
3367 initialized = 1
3368 if (not self.has_entity_result_type_):
3369 initialized = 0
3370 if debug_strs is not None:
3371 debug_strs.append('Required field: entity_result_type not set.')
3372 for p in self.entity_result_:
3373 if not p.IsInitialized(debug_strs): initialized=0
3374 if (not self.has_more_results_):
3375 initialized = 0
3376 if debug_strs is not None:
3377 debug_strs.append('Required field: more_results not set.')
3378 return initialized
3380 def ByteSize(self):
3381 n = 0
3382 n += self.lengthVarInt64(self.entity_result_type_)
3383 n += 1 * len(self.entity_result_)
3384 for i in xrange(len(self.entity_result_)): n += self.lengthString(self.entity_result_[i].ByteSize())
3385 if (self.has_skipped_cursor_): n += 1 + self.lengthString(len(self.skipped_cursor_))
3386 if (self.has_end_cursor_): n += 1 + self.lengthString(len(self.end_cursor_))
3387 n += self.lengthVarInt64(self.more_results_)
3388 if (self.has_skipped_results_): n += 1 + self.lengthVarInt64(self.skipped_results_)
3389 if (self.has_snapshot_version_): n += 1 + self.lengthVarInt64(self.snapshot_version_)
3390 return n + 2
3392 def ByteSizePartial(self):
3393 n = 0
3394 if (self.has_entity_result_type_):
3395 n += 1
3396 n += self.lengthVarInt64(self.entity_result_type_)
3397 n += 1 * len(self.entity_result_)
3398 for i in xrange(len(self.entity_result_)): n += self.lengthString(self.entity_result_[i].ByteSizePartial())
3399 if (self.has_skipped_cursor_): n += 1 + self.lengthString(len(self.skipped_cursor_))
3400 if (self.has_end_cursor_): n += 1 + self.lengthString(len(self.end_cursor_))
3401 if (self.has_more_results_):
3402 n += 1
3403 n += self.lengthVarInt64(self.more_results_)
3404 if (self.has_skipped_results_): n += 1 + self.lengthVarInt64(self.skipped_results_)
3405 if (self.has_snapshot_version_): n += 1 + self.lengthVarInt64(self.snapshot_version_)
3406 return n
3408 def Clear(self):
3409 self.clear_entity_result_type()
3410 self.clear_entity_result()
3411 self.clear_skipped_cursor()
3412 self.clear_end_cursor()
3413 self.clear_more_results()
3414 self.clear_skipped_results()
3415 self.clear_snapshot_version()
3417 def OutputUnchecked(self, out):
3418 out.putVarInt32(8)
3419 out.putVarInt32(self.entity_result_type_)
3420 for i in xrange(len(self.entity_result_)):
3421 out.putVarInt32(18)
3422 out.putVarInt32(self.entity_result_[i].ByteSize())
3423 self.entity_result_[i].OutputUnchecked(out)
3424 if (self.has_skipped_cursor_):
3425 out.putVarInt32(26)
3426 out.putPrefixedString(self.skipped_cursor_)
3427 if (self.has_end_cursor_):
3428 out.putVarInt32(34)
3429 out.putPrefixedString(self.end_cursor_)
3430 out.putVarInt32(40)
3431 out.putVarInt32(self.more_results_)
3432 if (self.has_skipped_results_):
3433 out.putVarInt32(48)
3434 out.putVarInt32(self.skipped_results_)
3435 if (self.has_snapshot_version_):
3436 out.putVarInt32(56)
3437 out.putVarInt64(self.snapshot_version_)
3439 def OutputPartial(self, out):
3440 if (self.has_entity_result_type_):
3441 out.putVarInt32(8)
3442 out.putVarInt32(self.entity_result_type_)
3443 for i in xrange(len(self.entity_result_)):
3444 out.putVarInt32(18)
3445 out.putVarInt32(self.entity_result_[i].ByteSizePartial())
3446 self.entity_result_[i].OutputPartial(out)
3447 if (self.has_skipped_cursor_):
3448 out.putVarInt32(26)
3449 out.putPrefixedString(self.skipped_cursor_)
3450 if (self.has_end_cursor_):
3451 out.putVarInt32(34)
3452 out.putPrefixedString(self.end_cursor_)
3453 if (self.has_more_results_):
3454 out.putVarInt32(40)
3455 out.putVarInt32(self.more_results_)
3456 if (self.has_skipped_results_):
3457 out.putVarInt32(48)
3458 out.putVarInt32(self.skipped_results_)
3459 if (self.has_snapshot_version_):
3460 out.putVarInt32(56)
3461 out.putVarInt64(self.snapshot_version_)
3463 def TryMerge(self, d):
3464 while d.avail() > 0:
3465 tt = d.getVarInt32()
3466 if tt == 8:
3467 self.set_entity_result_type(d.getVarInt32())
3468 continue
3469 if tt == 18:
3470 length = d.getVarInt32()
3471 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
3472 d.skip(length)
3473 self.add_entity_result().TryMerge(tmp)
3474 continue
3475 if tt == 26:
3476 self.set_skipped_cursor(d.getPrefixedString())
3477 continue
3478 if tt == 34:
3479 self.set_end_cursor(d.getPrefixedString())
3480 continue
3481 if tt == 40:
3482 self.set_more_results(d.getVarInt32())
3483 continue
3484 if tt == 48:
3485 self.set_skipped_results(d.getVarInt32())
3486 continue
3487 if tt == 56:
3488 self.set_snapshot_version(d.getVarInt64())
3489 continue
3492 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
3493 d.skipData(tt)
3496 def __str__(self, prefix="", printElemNumber=0):
3497 res=""
3498 if self.has_entity_result_type_: res+=prefix+("entity_result_type: %s\n" % self.DebugFormatInt32(self.entity_result_type_))
3499 cnt=0
3500 for e in self.entity_result_:
3501 elm=""
3502 if printElemNumber: elm="(%d)" % cnt
3503 res+=prefix+("entity_result%s <\n" % elm)
3504 res+=e.__str__(prefix + " ", printElemNumber)
3505 res+=prefix+">\n"
3506 cnt+=1
3507 if self.has_skipped_cursor_: res+=prefix+("skipped_cursor: %s\n" % self.DebugFormatString(self.skipped_cursor_))
3508 if self.has_end_cursor_: res+=prefix+("end_cursor: %s\n" % self.DebugFormatString(self.end_cursor_))
3509 if self.has_more_results_: res+=prefix+("more_results: %s\n" % self.DebugFormatInt32(self.more_results_))
3510 if self.has_skipped_results_: res+=prefix+("skipped_results: %s\n" % self.DebugFormatInt32(self.skipped_results_))
3511 if self.has_snapshot_version_: res+=prefix+("snapshot_version: %s\n" % self.DebugFormatInt64(self.snapshot_version_))
3512 return res
3515 def _BuildTagLookupTable(sparse, maxtag, default=None):
3516 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
3518 kentity_result_type = 1
3519 kentity_result = 2
3520 kskipped_cursor = 3
3521 kend_cursor = 4
3522 kmore_results = 5
3523 kskipped_results = 6
3524 ksnapshot_version = 7
3526 _TEXT = _BuildTagLookupTable({
3527 0: "ErrorCode",
3528 1: "entity_result_type",
3529 2: "entity_result",
3530 3: "skipped_cursor",
3531 4: "end_cursor",
3532 5: "more_results",
3533 6: "skipped_results",
3534 7: "snapshot_version",
3535 }, 7)
3537 _TYPES = _BuildTagLookupTable({
3538 0: ProtocolBuffer.Encoder.NUMERIC,
3539 1: ProtocolBuffer.Encoder.NUMERIC,
3540 2: ProtocolBuffer.Encoder.STRING,
3541 3: ProtocolBuffer.Encoder.STRING,
3542 4: ProtocolBuffer.Encoder.STRING,
3543 5: ProtocolBuffer.Encoder.NUMERIC,
3544 6: ProtocolBuffer.Encoder.NUMERIC,
3545 7: ProtocolBuffer.Encoder.NUMERIC,
3546 }, 7, ProtocolBuffer.Encoder.MAX_TYPE)
3549 _STYLE = """"""
3550 _STYLE_CONTENT_TYPE = """"""
3551 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.QueryResultBatch'
3552 _SERIALIZED_DESCRIPTOR = array.array('B')
3553 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlF1ZXJ5UmVzdWx0QmF0Y2gTGhJlbnRpdHlfcmVzdWx0X3R5cGUgASgAMAU4AhQTGg1lbnRpdHlfcmVzdWx0IAIoAjALOANKJGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eVJlc3VsdKMBqgEFY3R5cGWyAQZwcm90bzKkARQTGg5za2lwcGVkX2N1cnNvciADKAIwCTgBFBMaCmVuZF9jdXJzb3IgBCgCMAk4ARQTGgxtb3JlX3Jlc3VsdHMgBSgAMAU4AmgAFBMaD3NraXBwZWRfcmVzdWx0cyAGKAAwBTgBQgEwowGqAQdkZWZhdWx0sgEBMKQBFBMaEHNuYXBzaG90X3ZlcnNpb24gBygAMAM4ARRzeg9Nb3JlUmVzdWx0c1R5cGWLAZIBDE5PVF9GSU5JU0hFRJgBAYwBiwGSARhNT1JFX1JFU1VMVFNfQUZURVJfTElNSVSYAQKMAYsBkgEPTk9fTU9SRV9SRVNVTFRTmAEDjAF0wgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
3554 if _net_proto___parse__python is not None:
3555 _net_proto___parse__python.RegisterType(
3556 _SERIALIZED_DESCRIPTOR.tostring())
3558 class Mutation(ProtocolBuffer.ProtocolMessage):
3561 UNKNOWN = 0
3562 INSERT = 1
3563 UPDATE = 2
3564 UPSERT = 3
3565 DELETE = 4
3567 _Operation_NAMES = {
3568 0: "UNKNOWN",
3569 1: "INSERT",
3570 2: "UPDATE",
3571 3: "UPSERT",
3572 4: "DELETE",
3575 def Operation_Name(cls, x): return cls._Operation_NAMES.get(x, "")
3576 Operation_Name = classmethod(Operation_Name)
3578 has_op_ = 0
3579 op_ = 0
3580 has_key_ = 0
3581 key_ = None
3582 has_entity_ = 0
3583 entity_ = None
3585 def __init__(self, contents=None):
3586 self.lazy_init_lock_ = thread.allocate_lock()
3587 if contents is not None: self.MergeFromString(contents)
3589 def op(self): return self.op_
3591 def set_op(self, x):
3592 self.has_op_ = 1
3593 self.op_ = x
3595 def clear_op(self):
3596 if self.has_op_:
3597 self.has_op_ = 0
3598 self.op_ = 0
3600 def has_op(self): return self.has_op_
3602 def key(self):
3603 if self.key_ is None:
3604 self.lazy_init_lock_.acquire()
3605 try:
3606 if self.key_ is None: self.key_ = google.appengine.datastore.entity_v4_pb.Key()
3607 finally:
3608 self.lazy_init_lock_.release()
3609 return self.key_
3611 def mutable_key(self): self.has_key_ = 1; return self.key()
3613 def clear_key(self):
3615 if self.has_key_:
3616 self.has_key_ = 0;
3617 if self.key_ is not None: self.key_.Clear()
3619 def has_key(self): return self.has_key_
3621 def entity(self):
3622 if self.entity_ is None:
3623 self.lazy_init_lock_.acquire()
3624 try:
3625 if self.entity_ is None: self.entity_ = google.appengine.datastore.entity_v4_pb.Entity()
3626 finally:
3627 self.lazy_init_lock_.release()
3628 return self.entity_
3630 def mutable_entity(self): self.has_entity_ = 1; return self.entity()
3632 def clear_entity(self):
3634 if self.has_entity_:
3635 self.has_entity_ = 0;
3636 if self.entity_ is not None: self.entity_.Clear()
3638 def has_entity(self): return self.has_entity_
3641 def MergeFrom(self, x):
3642 assert x is not self
3643 if (x.has_op()): self.set_op(x.op())
3644 if (x.has_key()): self.mutable_key().MergeFrom(x.key())
3645 if (x.has_entity()): self.mutable_entity().MergeFrom(x.entity())
3647 if _net_proto___parse__python is not None:
3648 def _CMergeFromString(self, s):
3649 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.Mutation', s)
3651 if _net_proto___parse__python is not None:
3652 def _CEncode(self):
3653 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.Mutation')
3655 if _net_proto___parse__python is not None:
3656 def _CEncodePartial(self):
3657 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.Mutation')
3659 if _net_proto___parse__python is not None:
3660 def _CToASCII(self, output_format):
3661 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.Mutation', output_format)
3664 if _net_proto___parse__python is not None:
3665 def ParseASCII(self, s):
3666 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.Mutation', s)
3669 if _net_proto___parse__python is not None:
3670 def ParseASCIIIgnoreUnknown(self, s):
3671 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.Mutation', s)
3674 def Equals(self, x):
3675 if x is self: return 1
3676 if self.has_op_ != x.has_op_: return 0
3677 if self.has_op_ and self.op_ != x.op_: return 0
3678 if self.has_key_ != x.has_key_: return 0
3679 if self.has_key_ and self.key_ != x.key_: return 0
3680 if self.has_entity_ != x.has_entity_: return 0
3681 if self.has_entity_ and self.entity_ != x.entity_: return 0
3682 return 1
3684 def IsInitialized(self, debug_strs=None):
3685 initialized = 1
3686 if (self.has_key_ and not self.key_.IsInitialized(debug_strs)): initialized = 0
3687 if (self.has_entity_ and not self.entity_.IsInitialized(debug_strs)): initialized = 0
3688 return initialized
3690 def ByteSize(self):
3691 n = 0
3692 if (self.has_op_): n += 1 + self.lengthVarInt64(self.op_)
3693 if (self.has_key_): n += 1 + self.lengthString(self.key_.ByteSize())
3694 if (self.has_entity_): n += 1 + self.lengthString(self.entity_.ByteSize())
3695 return n
3697 def ByteSizePartial(self):
3698 n = 0
3699 if (self.has_op_): n += 1 + self.lengthVarInt64(self.op_)
3700 if (self.has_key_): n += 1 + self.lengthString(self.key_.ByteSizePartial())
3701 if (self.has_entity_): n += 1 + self.lengthString(self.entity_.ByteSizePartial())
3702 return n
3704 def Clear(self):
3705 self.clear_op()
3706 self.clear_key()
3707 self.clear_entity()
3709 def OutputUnchecked(self, out):
3710 if (self.has_op_):
3711 out.putVarInt32(8)
3712 out.putVarInt32(self.op_)
3713 if (self.has_key_):
3714 out.putVarInt32(18)
3715 out.putVarInt32(self.key_.ByteSize())
3716 self.key_.OutputUnchecked(out)
3717 if (self.has_entity_):
3718 out.putVarInt32(26)
3719 out.putVarInt32(self.entity_.ByteSize())
3720 self.entity_.OutputUnchecked(out)
3722 def OutputPartial(self, out):
3723 if (self.has_op_):
3724 out.putVarInt32(8)
3725 out.putVarInt32(self.op_)
3726 if (self.has_key_):
3727 out.putVarInt32(18)
3728 out.putVarInt32(self.key_.ByteSizePartial())
3729 self.key_.OutputPartial(out)
3730 if (self.has_entity_):
3731 out.putVarInt32(26)
3732 out.putVarInt32(self.entity_.ByteSizePartial())
3733 self.entity_.OutputPartial(out)
3735 def TryMerge(self, d):
3736 while d.avail() > 0:
3737 tt = d.getVarInt32()
3738 if tt == 8:
3739 self.set_op(d.getVarInt32())
3740 continue
3741 if tt == 18:
3742 length = d.getVarInt32()
3743 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
3744 d.skip(length)
3745 self.mutable_key().TryMerge(tmp)
3746 continue
3747 if tt == 26:
3748 length = d.getVarInt32()
3749 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
3750 d.skip(length)
3751 self.mutable_entity().TryMerge(tmp)
3752 continue
3755 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
3756 d.skipData(tt)
3759 def __str__(self, prefix="", printElemNumber=0):
3760 res=""
3761 if self.has_op_: res+=prefix+("op: %s\n" % self.DebugFormatInt32(self.op_))
3762 if self.has_key_:
3763 res+=prefix+"key <\n"
3764 res+=self.key_.__str__(prefix + " ", printElemNumber)
3765 res+=prefix+">\n"
3766 if self.has_entity_:
3767 res+=prefix+"entity <\n"
3768 res+=self.entity_.__str__(prefix + " ", printElemNumber)
3769 res+=prefix+">\n"
3770 return res
3773 def _BuildTagLookupTable(sparse, maxtag, default=None):
3774 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
3776 kop = 1
3777 kkey = 2
3778 kentity = 3
3780 _TEXT = _BuildTagLookupTable({
3781 0: "ErrorCode",
3782 1: "op",
3783 2: "key",
3784 3: "entity",
3785 }, 3)
3787 _TYPES = _BuildTagLookupTable({
3788 0: ProtocolBuffer.Encoder.NUMERIC,
3789 1: ProtocolBuffer.Encoder.NUMERIC,
3790 2: ProtocolBuffer.Encoder.STRING,
3791 3: ProtocolBuffer.Encoder.STRING,
3792 }, 3, ProtocolBuffer.Encoder.MAX_TYPE)
3795 _STYLE = """"""
3796 _STYLE_CONTENT_TYPE = """"""
3797 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.Mutation'
3798 _SERIALIZED_DESCRIPTOR = array.array('B')
3799 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KIGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uExoCb3AgASgAMAU4AUIBMGgAowGqAQdkZWZhdWx0sgEHVU5LTk9XTqQBFBMaA2tleSACKAIwCzgBShthcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LZXmjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoGZW50aXR5IAMoAjALOAFKHmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eaMBqgEFY3R5cGWyAQZwcm90bzKkARRzeglPcGVyYXRpb26LAZIBB1VOS05PV06YAQCMAYsBkgEGSU5TRVJUmAEBjAGLAZIBBlVQREFURZgBAowBiwGSAQZVUFNFUlSYAQOMAYsBkgEGREVMRVRFmAEEjAF0wgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
3800 if _net_proto___parse__python is not None:
3801 _net_proto___parse__python.RegisterType(
3802 _SERIALIZED_DESCRIPTOR.tostring())
3804 class MutationResult(ProtocolBuffer.ProtocolMessage):
3805 has_key_ = 0
3806 key_ = None
3807 has_new_version_ = 0
3808 new_version_ = 0
3810 def __init__(self, contents=None):
3811 self.lazy_init_lock_ = thread.allocate_lock()
3812 if contents is not None: self.MergeFromString(contents)
3814 def key(self):
3815 if self.key_ is None:
3816 self.lazy_init_lock_.acquire()
3817 try:
3818 if self.key_ is None: self.key_ = google.appengine.datastore.entity_v4_pb.Key()
3819 finally:
3820 self.lazy_init_lock_.release()
3821 return self.key_
3823 def mutable_key(self): self.has_key_ = 1; return self.key()
3825 def clear_key(self):
3827 if self.has_key_:
3828 self.has_key_ = 0;
3829 if self.key_ is not None: self.key_.Clear()
3831 def has_key(self): return self.has_key_
3833 def new_version(self): return self.new_version_
3835 def set_new_version(self, x):
3836 self.has_new_version_ = 1
3837 self.new_version_ = x
3839 def clear_new_version(self):
3840 if self.has_new_version_:
3841 self.has_new_version_ = 0
3842 self.new_version_ = 0
3844 def has_new_version(self): return self.has_new_version_
3847 def MergeFrom(self, x):
3848 assert x is not self
3849 if (x.has_key()): self.mutable_key().MergeFrom(x.key())
3850 if (x.has_new_version()): self.set_new_version(x.new_version())
3852 if _net_proto___parse__python is not None:
3853 def _CMergeFromString(self, s):
3854 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.MutationResult', s)
3856 if _net_proto___parse__python is not None:
3857 def _CEncode(self):
3858 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.MutationResult')
3860 if _net_proto___parse__python is not None:
3861 def _CEncodePartial(self):
3862 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.MutationResult')
3864 if _net_proto___parse__python is not None:
3865 def _CToASCII(self, output_format):
3866 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.MutationResult', output_format)
3869 if _net_proto___parse__python is not None:
3870 def ParseASCII(self, s):
3871 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.MutationResult', s)
3874 if _net_proto___parse__python is not None:
3875 def ParseASCIIIgnoreUnknown(self, s):
3876 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.MutationResult', s)
3879 def Equals(self, x):
3880 if x is self: return 1
3881 if self.has_key_ != x.has_key_: return 0
3882 if self.has_key_ and self.key_ != x.key_: return 0
3883 if self.has_new_version_ != x.has_new_version_: return 0
3884 if self.has_new_version_ and self.new_version_ != x.new_version_: return 0
3885 return 1
3887 def IsInitialized(self, debug_strs=None):
3888 initialized = 1
3889 if (self.has_key_ and not self.key_.IsInitialized(debug_strs)): initialized = 0
3890 return initialized
3892 def ByteSize(self):
3893 n = 0
3894 if (self.has_key_): n += 1 + self.lengthString(self.key_.ByteSize())
3895 if (self.has_new_version_): n += 1 + self.lengthVarInt64(self.new_version_)
3896 return n
3898 def ByteSizePartial(self):
3899 n = 0
3900 if (self.has_key_): n += 1 + self.lengthString(self.key_.ByteSizePartial())
3901 if (self.has_new_version_): n += 1 + self.lengthVarInt64(self.new_version_)
3902 return n
3904 def Clear(self):
3905 self.clear_key()
3906 self.clear_new_version()
3908 def OutputUnchecked(self, out):
3909 if (self.has_key_):
3910 out.putVarInt32(26)
3911 out.putVarInt32(self.key_.ByteSize())
3912 self.key_.OutputUnchecked(out)
3913 if (self.has_new_version_):
3914 out.putVarInt32(32)
3915 out.putVarInt64(self.new_version_)
3917 def OutputPartial(self, out):
3918 if (self.has_key_):
3919 out.putVarInt32(26)
3920 out.putVarInt32(self.key_.ByteSizePartial())
3921 self.key_.OutputPartial(out)
3922 if (self.has_new_version_):
3923 out.putVarInt32(32)
3924 out.putVarInt64(self.new_version_)
3926 def TryMerge(self, d):
3927 while d.avail() > 0:
3928 tt = d.getVarInt32()
3929 if tt == 26:
3930 length = d.getVarInt32()
3931 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
3932 d.skip(length)
3933 self.mutable_key().TryMerge(tmp)
3934 continue
3935 if tt == 32:
3936 self.set_new_version(d.getVarInt64())
3937 continue
3940 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
3941 d.skipData(tt)
3944 def __str__(self, prefix="", printElemNumber=0):
3945 res=""
3946 if self.has_key_:
3947 res+=prefix+"key <\n"
3948 res+=self.key_.__str__(prefix + " ", printElemNumber)
3949 res+=prefix+">\n"
3950 if self.has_new_version_: res+=prefix+("new_version: %s\n" % self.DebugFormatInt64(self.new_version_))
3951 return res
3954 def _BuildTagLookupTable(sparse, maxtag, default=None):
3955 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
3957 kkey = 3
3958 knew_version = 4
3960 _TEXT = _BuildTagLookupTable({
3961 0: "ErrorCode",
3962 3: "key",
3963 4: "new_version",
3964 }, 4)
3966 _TYPES = _BuildTagLookupTable({
3967 0: ProtocolBuffer.Encoder.NUMERIC,
3968 3: ProtocolBuffer.Encoder.STRING,
3969 4: ProtocolBuffer.Encoder.NUMERIC,
3970 }, 4, ProtocolBuffer.Encoder.MAX_TYPE)
3973 _STYLE = """"""
3974 _STYLE_CONTENT_TYPE = """"""
3975 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.MutationResult'
3976 _SERIALIZED_DESCRIPTOR = array.array('B')
3977 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uUmVzdWx0ExoDa2V5IAMoAjALOAFKG2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleaMBqgEFY3R5cGWyAQZwcm90bzKkARQTGgtuZXdfdmVyc2lvbiAEKAAwAzgBQgEwowGqAQdkZWZhdWx0sgEBMKQBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
3978 if _net_proto___parse__python is not None:
3979 _net_proto___parse__python.RegisterType(
3980 _SERIALIZED_DESCRIPTOR.tostring())
3982 class DeprecatedMutation(ProtocolBuffer.ProtocolMessage):
3983 has_force_ = 0
3984 force_ = 0
3986 def __init__(self, contents=None):
3987 self.upsert_ = []
3988 self.update_ = []
3989 self.insert_ = []
3990 self.insert_auto_id_ = []
3991 self.delete_ = []
3992 if contents is not None: self.MergeFromString(contents)
3994 def upsert_size(self): return len(self.upsert_)
3995 def upsert_list(self): return self.upsert_
3997 def upsert(self, i):
3998 return self.upsert_[i]
4000 def mutable_upsert(self, i):
4001 return self.upsert_[i]
4003 def add_upsert(self):
4004 x = google.appengine.datastore.entity_v4_pb.Entity()
4005 self.upsert_.append(x)
4006 return x
4008 def clear_upsert(self):
4009 self.upsert_ = []
4010 def update_size(self): return len(self.update_)
4011 def update_list(self): return self.update_
4013 def update(self, i):
4014 return self.update_[i]
4016 def mutable_update(self, i):
4017 return self.update_[i]
4019 def add_update(self):
4020 x = google.appengine.datastore.entity_v4_pb.Entity()
4021 self.update_.append(x)
4022 return x
4024 def clear_update(self):
4025 self.update_ = []
4026 def insert_size(self): return len(self.insert_)
4027 def insert_list(self): return self.insert_
4029 def insert(self, i):
4030 return self.insert_[i]
4032 def mutable_insert(self, i):
4033 return self.insert_[i]
4035 def add_insert(self):
4036 x = google.appengine.datastore.entity_v4_pb.Entity()
4037 self.insert_.append(x)
4038 return x
4040 def clear_insert(self):
4041 self.insert_ = []
4042 def insert_auto_id_size(self): return len(self.insert_auto_id_)
4043 def insert_auto_id_list(self): return self.insert_auto_id_
4045 def insert_auto_id(self, i):
4046 return self.insert_auto_id_[i]
4048 def mutable_insert_auto_id(self, i):
4049 return self.insert_auto_id_[i]
4051 def add_insert_auto_id(self):
4052 x = google.appengine.datastore.entity_v4_pb.Entity()
4053 self.insert_auto_id_.append(x)
4054 return x
4056 def clear_insert_auto_id(self):
4057 self.insert_auto_id_ = []
4058 def delete_size(self): return len(self.delete_)
4059 def delete_list(self): return self.delete_
4061 def delete(self, i):
4062 return self.delete_[i]
4064 def mutable_delete(self, i):
4065 return self.delete_[i]
4067 def add_delete(self):
4068 x = google.appengine.datastore.entity_v4_pb.Key()
4069 self.delete_.append(x)
4070 return x
4072 def clear_delete(self):
4073 self.delete_ = []
4074 def force(self): return self.force_
4076 def set_force(self, x):
4077 self.has_force_ = 1
4078 self.force_ = x
4080 def clear_force(self):
4081 if self.has_force_:
4082 self.has_force_ = 0
4083 self.force_ = 0
4085 def has_force(self): return self.has_force_
4088 def MergeFrom(self, x):
4089 assert x is not self
4090 for i in xrange(x.upsert_size()): self.add_upsert().CopyFrom(x.upsert(i))
4091 for i in xrange(x.update_size()): self.add_update().CopyFrom(x.update(i))
4092 for i in xrange(x.insert_size()): self.add_insert().CopyFrom(x.insert(i))
4093 for i in xrange(x.insert_auto_id_size()): self.add_insert_auto_id().CopyFrom(x.insert_auto_id(i))
4094 for i in xrange(x.delete_size()): self.add_delete().CopyFrom(x.delete(i))
4095 if (x.has_force()): self.set_force(x.force())
4097 if _net_proto___parse__python is not None:
4098 def _CMergeFromString(self, s):
4099 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.DeprecatedMutation', s)
4101 if _net_proto___parse__python is not None:
4102 def _CEncode(self):
4103 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.DeprecatedMutation')
4105 if _net_proto___parse__python is not None:
4106 def _CEncodePartial(self):
4107 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.DeprecatedMutation')
4109 if _net_proto___parse__python is not None:
4110 def _CToASCII(self, output_format):
4111 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.DeprecatedMutation', output_format)
4114 if _net_proto___parse__python is not None:
4115 def ParseASCII(self, s):
4116 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.DeprecatedMutation', s)
4119 if _net_proto___parse__python is not None:
4120 def ParseASCIIIgnoreUnknown(self, s):
4121 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.DeprecatedMutation', s)
4124 def Equals(self, x):
4125 if x is self: return 1
4126 if len(self.upsert_) != len(x.upsert_): return 0
4127 for e1, e2 in zip(self.upsert_, x.upsert_):
4128 if e1 != e2: return 0
4129 if len(self.update_) != len(x.update_): return 0
4130 for e1, e2 in zip(self.update_, x.update_):
4131 if e1 != e2: return 0
4132 if len(self.insert_) != len(x.insert_): return 0
4133 for e1, e2 in zip(self.insert_, x.insert_):
4134 if e1 != e2: return 0
4135 if len(self.insert_auto_id_) != len(x.insert_auto_id_): return 0
4136 for e1, e2 in zip(self.insert_auto_id_, x.insert_auto_id_):
4137 if e1 != e2: return 0
4138 if len(self.delete_) != len(x.delete_): return 0
4139 for e1, e2 in zip(self.delete_, x.delete_):
4140 if e1 != e2: return 0
4141 if self.has_force_ != x.has_force_: return 0
4142 if self.has_force_ and self.force_ != x.force_: return 0
4143 return 1
4145 def IsInitialized(self, debug_strs=None):
4146 initialized = 1
4147 for p in self.upsert_:
4148 if not p.IsInitialized(debug_strs): initialized=0
4149 for p in self.update_:
4150 if not p.IsInitialized(debug_strs): initialized=0
4151 for p in self.insert_:
4152 if not p.IsInitialized(debug_strs): initialized=0
4153 for p in self.insert_auto_id_:
4154 if not p.IsInitialized(debug_strs): initialized=0
4155 for p in self.delete_:
4156 if not p.IsInitialized(debug_strs): initialized=0
4157 return initialized
4159 def ByteSize(self):
4160 n = 0
4161 n += 1 * len(self.upsert_)
4162 for i in xrange(len(self.upsert_)): n += self.lengthString(self.upsert_[i].ByteSize())
4163 n += 1 * len(self.update_)
4164 for i in xrange(len(self.update_)): n += self.lengthString(self.update_[i].ByteSize())
4165 n += 1 * len(self.insert_)
4166 for i in xrange(len(self.insert_)): n += self.lengthString(self.insert_[i].ByteSize())
4167 n += 1 * len(self.insert_auto_id_)
4168 for i in xrange(len(self.insert_auto_id_)): n += self.lengthString(self.insert_auto_id_[i].ByteSize())
4169 n += 1 * len(self.delete_)
4170 for i in xrange(len(self.delete_)): n += self.lengthString(self.delete_[i].ByteSize())
4171 if (self.has_force_): n += 2
4172 return n
4174 def ByteSizePartial(self):
4175 n = 0
4176 n += 1 * len(self.upsert_)
4177 for i in xrange(len(self.upsert_)): n += self.lengthString(self.upsert_[i].ByteSizePartial())
4178 n += 1 * len(self.update_)
4179 for i in xrange(len(self.update_)): n += self.lengthString(self.update_[i].ByteSizePartial())
4180 n += 1 * len(self.insert_)
4181 for i in xrange(len(self.insert_)): n += self.lengthString(self.insert_[i].ByteSizePartial())
4182 n += 1 * len(self.insert_auto_id_)
4183 for i in xrange(len(self.insert_auto_id_)): n += self.lengthString(self.insert_auto_id_[i].ByteSizePartial())
4184 n += 1 * len(self.delete_)
4185 for i in xrange(len(self.delete_)): n += self.lengthString(self.delete_[i].ByteSizePartial())
4186 if (self.has_force_): n += 2
4187 return n
4189 def Clear(self):
4190 self.clear_upsert()
4191 self.clear_update()
4192 self.clear_insert()
4193 self.clear_insert_auto_id()
4194 self.clear_delete()
4195 self.clear_force()
4197 def OutputUnchecked(self, out):
4198 for i in xrange(len(self.upsert_)):
4199 out.putVarInt32(10)
4200 out.putVarInt32(self.upsert_[i].ByteSize())
4201 self.upsert_[i].OutputUnchecked(out)
4202 for i in xrange(len(self.update_)):
4203 out.putVarInt32(18)
4204 out.putVarInt32(self.update_[i].ByteSize())
4205 self.update_[i].OutputUnchecked(out)
4206 for i in xrange(len(self.insert_)):
4207 out.putVarInt32(26)
4208 out.putVarInt32(self.insert_[i].ByteSize())
4209 self.insert_[i].OutputUnchecked(out)
4210 for i in xrange(len(self.insert_auto_id_)):
4211 out.putVarInt32(34)
4212 out.putVarInt32(self.insert_auto_id_[i].ByteSize())
4213 self.insert_auto_id_[i].OutputUnchecked(out)
4214 for i in xrange(len(self.delete_)):
4215 out.putVarInt32(42)
4216 out.putVarInt32(self.delete_[i].ByteSize())
4217 self.delete_[i].OutputUnchecked(out)
4218 if (self.has_force_):
4219 out.putVarInt32(48)
4220 out.putBoolean(self.force_)
4222 def OutputPartial(self, out):
4223 for i in xrange(len(self.upsert_)):
4224 out.putVarInt32(10)
4225 out.putVarInt32(self.upsert_[i].ByteSizePartial())
4226 self.upsert_[i].OutputPartial(out)
4227 for i in xrange(len(self.update_)):
4228 out.putVarInt32(18)
4229 out.putVarInt32(self.update_[i].ByteSizePartial())
4230 self.update_[i].OutputPartial(out)
4231 for i in xrange(len(self.insert_)):
4232 out.putVarInt32(26)
4233 out.putVarInt32(self.insert_[i].ByteSizePartial())
4234 self.insert_[i].OutputPartial(out)
4235 for i in xrange(len(self.insert_auto_id_)):
4236 out.putVarInt32(34)
4237 out.putVarInt32(self.insert_auto_id_[i].ByteSizePartial())
4238 self.insert_auto_id_[i].OutputPartial(out)
4239 for i in xrange(len(self.delete_)):
4240 out.putVarInt32(42)
4241 out.putVarInt32(self.delete_[i].ByteSizePartial())
4242 self.delete_[i].OutputPartial(out)
4243 if (self.has_force_):
4244 out.putVarInt32(48)
4245 out.putBoolean(self.force_)
4247 def TryMerge(self, d):
4248 while d.avail() > 0:
4249 tt = d.getVarInt32()
4250 if tt == 10:
4251 length = d.getVarInt32()
4252 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
4253 d.skip(length)
4254 self.add_upsert().TryMerge(tmp)
4255 continue
4256 if tt == 18:
4257 length = d.getVarInt32()
4258 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
4259 d.skip(length)
4260 self.add_update().TryMerge(tmp)
4261 continue
4262 if tt == 26:
4263 length = d.getVarInt32()
4264 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
4265 d.skip(length)
4266 self.add_insert().TryMerge(tmp)
4267 continue
4268 if tt == 34:
4269 length = d.getVarInt32()
4270 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
4271 d.skip(length)
4272 self.add_insert_auto_id().TryMerge(tmp)
4273 continue
4274 if tt == 42:
4275 length = d.getVarInt32()
4276 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
4277 d.skip(length)
4278 self.add_delete().TryMerge(tmp)
4279 continue
4280 if tt == 48:
4281 self.set_force(d.getBoolean())
4282 continue
4285 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
4286 d.skipData(tt)
4289 def __str__(self, prefix="", printElemNumber=0):
4290 res=""
4291 cnt=0
4292 for e in self.upsert_:
4293 elm=""
4294 if printElemNumber: elm="(%d)" % cnt
4295 res+=prefix+("upsert%s <\n" % elm)
4296 res+=e.__str__(prefix + " ", printElemNumber)
4297 res+=prefix+">\n"
4298 cnt+=1
4299 cnt=0
4300 for e in self.update_:
4301 elm=""
4302 if printElemNumber: elm="(%d)" % cnt
4303 res+=prefix+("update%s <\n" % elm)
4304 res+=e.__str__(prefix + " ", printElemNumber)
4305 res+=prefix+">\n"
4306 cnt+=1
4307 cnt=0
4308 for e in self.insert_:
4309 elm=""
4310 if printElemNumber: elm="(%d)" % cnt
4311 res+=prefix+("insert%s <\n" % elm)
4312 res+=e.__str__(prefix + " ", printElemNumber)
4313 res+=prefix+">\n"
4314 cnt+=1
4315 cnt=0
4316 for e in self.insert_auto_id_:
4317 elm=""
4318 if printElemNumber: elm="(%d)" % cnt
4319 res+=prefix+("insert_auto_id%s <\n" % elm)
4320 res+=e.__str__(prefix + " ", printElemNumber)
4321 res+=prefix+">\n"
4322 cnt+=1
4323 cnt=0
4324 for e in self.delete_:
4325 elm=""
4326 if printElemNumber: elm="(%d)" % cnt
4327 res+=prefix+("delete%s <\n" % elm)
4328 res+=e.__str__(prefix + " ", printElemNumber)
4329 res+=prefix+">\n"
4330 cnt+=1
4331 if self.has_force_: res+=prefix+("force: %s\n" % self.DebugFormatBool(self.force_))
4332 return res
4335 def _BuildTagLookupTable(sparse, maxtag, default=None):
4336 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
4338 kupsert = 1
4339 kupdate = 2
4340 kinsert = 3
4341 kinsert_auto_id = 4
4342 kdelete = 5
4343 kforce = 6
4345 _TEXT = _BuildTagLookupTable({
4346 0: "ErrorCode",
4347 1: "upsert",
4348 2: "update",
4349 3: "insert",
4350 4: "insert_auto_id",
4351 5: "delete",
4352 6: "force",
4353 }, 6)
4355 _TYPES = _BuildTagLookupTable({
4356 0: ProtocolBuffer.Encoder.NUMERIC,
4357 1: ProtocolBuffer.Encoder.STRING,
4358 2: ProtocolBuffer.Encoder.STRING,
4359 3: ProtocolBuffer.Encoder.STRING,
4360 4: ProtocolBuffer.Encoder.STRING,
4361 5: ProtocolBuffer.Encoder.STRING,
4362 6: ProtocolBuffer.Encoder.NUMERIC,
4363 }, 6, ProtocolBuffer.Encoder.MAX_TYPE)
4366 _STYLE = """"""
4367 _STYLE_CONTENT_TYPE = """"""
4368 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.DeprecatedMutation'
4369 _SERIALIZED_DESCRIPTOR = array.array('B')
4370 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkRlcHJlY2F0ZWRNdXRhdGlvbhMaBnVwc2VydCABKAIwCzgDSh5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FbnRpdHmjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoGdXBkYXRlIAIoAjALOANKHmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eaMBqgEFY3R5cGWyAQZwcm90bzKkARQTGgZpbnNlcnQgAygCMAs4A0oeYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaDmluc2VydF9hdXRvX2lkIAQoAjALOANKHmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eaMBqgEFY3R5cGWyAQZwcm90bzKkARQTGgZkZWxldGUgBSgCMAs4A0obYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuS2V5owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaBWZvcmNlIAYoADAIOAFCBWZhbHNlowGqAQdkZWZhdWx0sgEFZmFsc2WkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
4371 if _net_proto___parse__python is not None:
4372 _net_proto___parse__python.RegisterType(
4373 _SERIALIZED_DESCRIPTOR.tostring())
4375 class DeprecatedMutationResult(ProtocolBuffer.ProtocolMessage):
4376 has_index_updates_ = 0
4377 index_updates_ = 0
4379 def __init__(self, contents=None):
4380 self.insert_auto_id_key_ = []
4381 self.upsert_version_ = []
4382 self.update_version_ = []
4383 self.insert_version_ = []
4384 self.insert_auto_id_version_ = []
4385 self.delete_version_ = []
4386 if contents is not None: self.MergeFromString(contents)
4388 def index_updates(self): return self.index_updates_
4390 def set_index_updates(self, x):
4391 self.has_index_updates_ = 1
4392 self.index_updates_ = x
4394 def clear_index_updates(self):
4395 if self.has_index_updates_:
4396 self.has_index_updates_ = 0
4397 self.index_updates_ = 0
4399 def has_index_updates(self): return self.has_index_updates_
4401 def insert_auto_id_key_size(self): return len(self.insert_auto_id_key_)
4402 def insert_auto_id_key_list(self): return self.insert_auto_id_key_
4404 def insert_auto_id_key(self, i):
4405 return self.insert_auto_id_key_[i]
4407 def mutable_insert_auto_id_key(self, i):
4408 return self.insert_auto_id_key_[i]
4410 def add_insert_auto_id_key(self):
4411 x = google.appengine.datastore.entity_v4_pb.Key()
4412 self.insert_auto_id_key_.append(x)
4413 return x
4415 def clear_insert_auto_id_key(self):
4416 self.insert_auto_id_key_ = []
4417 def upsert_version_size(self): return len(self.upsert_version_)
4418 def upsert_version_list(self): return self.upsert_version_
4420 def upsert_version(self, i):
4421 return self.upsert_version_[i]
4423 def set_upsert_version(self, i, x):
4424 self.upsert_version_[i] = x
4426 def add_upsert_version(self, x):
4427 self.upsert_version_.append(x)
4429 def clear_upsert_version(self):
4430 self.upsert_version_ = []
4432 def update_version_size(self): return len(self.update_version_)
4433 def update_version_list(self): return self.update_version_
4435 def update_version(self, i):
4436 return self.update_version_[i]
4438 def set_update_version(self, i, x):
4439 self.update_version_[i] = x
4441 def add_update_version(self, x):
4442 self.update_version_.append(x)
4444 def clear_update_version(self):
4445 self.update_version_ = []
4447 def insert_version_size(self): return len(self.insert_version_)
4448 def insert_version_list(self): return self.insert_version_
4450 def insert_version(self, i):
4451 return self.insert_version_[i]
4453 def set_insert_version(self, i, x):
4454 self.insert_version_[i] = x
4456 def add_insert_version(self, x):
4457 self.insert_version_.append(x)
4459 def clear_insert_version(self):
4460 self.insert_version_ = []
4462 def insert_auto_id_version_size(self): return len(self.insert_auto_id_version_)
4463 def insert_auto_id_version_list(self): return self.insert_auto_id_version_
4465 def insert_auto_id_version(self, i):
4466 return self.insert_auto_id_version_[i]
4468 def set_insert_auto_id_version(self, i, x):
4469 self.insert_auto_id_version_[i] = x
4471 def add_insert_auto_id_version(self, x):
4472 self.insert_auto_id_version_.append(x)
4474 def clear_insert_auto_id_version(self):
4475 self.insert_auto_id_version_ = []
4477 def delete_version_size(self): return len(self.delete_version_)
4478 def delete_version_list(self): return self.delete_version_
4480 def delete_version(self, i):
4481 return self.delete_version_[i]
4483 def set_delete_version(self, i, x):
4484 self.delete_version_[i] = x
4486 def add_delete_version(self, x):
4487 self.delete_version_.append(x)
4489 def clear_delete_version(self):
4490 self.delete_version_ = []
4493 def MergeFrom(self, x):
4494 assert x is not self
4495 if (x.has_index_updates()): self.set_index_updates(x.index_updates())
4496 for i in xrange(x.insert_auto_id_key_size()): self.add_insert_auto_id_key().CopyFrom(x.insert_auto_id_key(i))
4497 for i in xrange(x.upsert_version_size()): self.add_upsert_version(x.upsert_version(i))
4498 for i in xrange(x.update_version_size()): self.add_update_version(x.update_version(i))
4499 for i in xrange(x.insert_version_size()): self.add_insert_version(x.insert_version(i))
4500 for i in xrange(x.insert_auto_id_version_size()): self.add_insert_auto_id_version(x.insert_auto_id_version(i))
4501 for i in xrange(x.delete_version_size()): self.add_delete_version(x.delete_version(i))
4503 if _net_proto___parse__python is not None:
4504 def _CMergeFromString(self, s):
4505 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.DeprecatedMutationResult', s)
4507 if _net_proto___parse__python is not None:
4508 def _CEncode(self):
4509 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.DeprecatedMutationResult')
4511 if _net_proto___parse__python is not None:
4512 def _CEncodePartial(self):
4513 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.DeprecatedMutationResult')
4515 if _net_proto___parse__python is not None:
4516 def _CToASCII(self, output_format):
4517 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.DeprecatedMutationResult', output_format)
4520 if _net_proto___parse__python is not None:
4521 def ParseASCII(self, s):
4522 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.DeprecatedMutationResult', s)
4525 if _net_proto___parse__python is not None:
4526 def ParseASCIIIgnoreUnknown(self, s):
4527 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.DeprecatedMutationResult', s)
4530 def Equals(self, x):
4531 if x is self: return 1
4532 if self.has_index_updates_ != x.has_index_updates_: return 0
4533 if self.has_index_updates_ and self.index_updates_ != x.index_updates_: return 0
4534 if len(self.insert_auto_id_key_) != len(x.insert_auto_id_key_): return 0
4535 for e1, e2 in zip(self.insert_auto_id_key_, x.insert_auto_id_key_):
4536 if e1 != e2: return 0
4537 if len(self.upsert_version_) != len(x.upsert_version_): return 0
4538 for e1, e2 in zip(self.upsert_version_, x.upsert_version_):
4539 if e1 != e2: return 0
4540 if len(self.update_version_) != len(x.update_version_): return 0
4541 for e1, e2 in zip(self.update_version_, x.update_version_):
4542 if e1 != e2: return 0
4543 if len(self.insert_version_) != len(x.insert_version_): return 0
4544 for e1, e2 in zip(self.insert_version_, x.insert_version_):
4545 if e1 != e2: return 0
4546 if len(self.insert_auto_id_version_) != len(x.insert_auto_id_version_): return 0
4547 for e1, e2 in zip(self.insert_auto_id_version_, x.insert_auto_id_version_):
4548 if e1 != e2: return 0
4549 if len(self.delete_version_) != len(x.delete_version_): return 0
4550 for e1, e2 in zip(self.delete_version_, x.delete_version_):
4551 if e1 != e2: return 0
4552 return 1
4554 def IsInitialized(self, debug_strs=None):
4555 initialized = 1
4556 if (not self.has_index_updates_):
4557 initialized = 0
4558 if debug_strs is not None:
4559 debug_strs.append('Required field: index_updates not set.')
4560 for p in self.insert_auto_id_key_:
4561 if not p.IsInitialized(debug_strs): initialized=0
4562 return initialized
4564 def ByteSize(self):
4565 n = 0
4566 n += self.lengthVarInt64(self.index_updates_)
4567 n += 1 * len(self.insert_auto_id_key_)
4568 for i in xrange(len(self.insert_auto_id_key_)): n += self.lengthString(self.insert_auto_id_key_[i].ByteSize())
4569 n += 1 * len(self.upsert_version_)
4570 for i in xrange(len(self.upsert_version_)): n += self.lengthVarInt64(self.upsert_version_[i])
4571 n += 1 * len(self.update_version_)
4572 for i in xrange(len(self.update_version_)): n += self.lengthVarInt64(self.update_version_[i])
4573 n += 1 * len(self.insert_version_)
4574 for i in xrange(len(self.insert_version_)): n += self.lengthVarInt64(self.insert_version_[i])
4575 n += 1 * len(self.insert_auto_id_version_)
4576 for i in xrange(len(self.insert_auto_id_version_)): n += self.lengthVarInt64(self.insert_auto_id_version_[i])
4577 n += 1 * len(self.delete_version_)
4578 for i in xrange(len(self.delete_version_)): n += self.lengthVarInt64(self.delete_version_[i])
4579 return n + 1
4581 def ByteSizePartial(self):
4582 n = 0
4583 if (self.has_index_updates_):
4584 n += 1
4585 n += self.lengthVarInt64(self.index_updates_)
4586 n += 1 * len(self.insert_auto_id_key_)
4587 for i in xrange(len(self.insert_auto_id_key_)): n += self.lengthString(self.insert_auto_id_key_[i].ByteSizePartial())
4588 n += 1 * len(self.upsert_version_)
4589 for i in xrange(len(self.upsert_version_)): n += self.lengthVarInt64(self.upsert_version_[i])
4590 n += 1 * len(self.update_version_)
4591 for i in xrange(len(self.update_version_)): n += self.lengthVarInt64(self.update_version_[i])
4592 n += 1 * len(self.insert_version_)
4593 for i in xrange(len(self.insert_version_)): n += self.lengthVarInt64(self.insert_version_[i])
4594 n += 1 * len(self.insert_auto_id_version_)
4595 for i in xrange(len(self.insert_auto_id_version_)): n += self.lengthVarInt64(self.insert_auto_id_version_[i])
4596 n += 1 * len(self.delete_version_)
4597 for i in xrange(len(self.delete_version_)): n += self.lengthVarInt64(self.delete_version_[i])
4598 return n
4600 def Clear(self):
4601 self.clear_index_updates()
4602 self.clear_insert_auto_id_key()
4603 self.clear_upsert_version()
4604 self.clear_update_version()
4605 self.clear_insert_version()
4606 self.clear_insert_auto_id_version()
4607 self.clear_delete_version()
4609 def OutputUnchecked(self, out):
4610 out.putVarInt32(8)
4611 out.putVarInt32(self.index_updates_)
4612 for i in xrange(len(self.insert_auto_id_key_)):
4613 out.putVarInt32(18)
4614 out.putVarInt32(self.insert_auto_id_key_[i].ByteSize())
4615 self.insert_auto_id_key_[i].OutputUnchecked(out)
4616 for i in xrange(len(self.upsert_version_)):
4617 out.putVarInt32(24)
4618 out.putVarInt64(self.upsert_version_[i])
4619 for i in xrange(len(self.update_version_)):
4620 out.putVarInt32(32)
4621 out.putVarInt64(self.update_version_[i])
4622 for i in xrange(len(self.insert_version_)):
4623 out.putVarInt32(40)
4624 out.putVarInt64(self.insert_version_[i])
4625 for i in xrange(len(self.insert_auto_id_version_)):
4626 out.putVarInt32(48)
4627 out.putVarInt64(self.insert_auto_id_version_[i])
4628 for i in xrange(len(self.delete_version_)):
4629 out.putVarInt32(56)
4630 out.putVarInt64(self.delete_version_[i])
4632 def OutputPartial(self, out):
4633 if (self.has_index_updates_):
4634 out.putVarInt32(8)
4635 out.putVarInt32(self.index_updates_)
4636 for i in xrange(len(self.insert_auto_id_key_)):
4637 out.putVarInt32(18)
4638 out.putVarInt32(self.insert_auto_id_key_[i].ByteSizePartial())
4639 self.insert_auto_id_key_[i].OutputPartial(out)
4640 for i in xrange(len(self.upsert_version_)):
4641 out.putVarInt32(24)
4642 out.putVarInt64(self.upsert_version_[i])
4643 for i in xrange(len(self.update_version_)):
4644 out.putVarInt32(32)
4645 out.putVarInt64(self.update_version_[i])
4646 for i in xrange(len(self.insert_version_)):
4647 out.putVarInt32(40)
4648 out.putVarInt64(self.insert_version_[i])
4649 for i in xrange(len(self.insert_auto_id_version_)):
4650 out.putVarInt32(48)
4651 out.putVarInt64(self.insert_auto_id_version_[i])
4652 for i in xrange(len(self.delete_version_)):
4653 out.putVarInt32(56)
4654 out.putVarInt64(self.delete_version_[i])
4656 def TryMerge(self, d):
4657 while d.avail() > 0:
4658 tt = d.getVarInt32()
4659 if tt == 8:
4660 self.set_index_updates(d.getVarInt32())
4661 continue
4662 if tt == 18:
4663 length = d.getVarInt32()
4664 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
4665 d.skip(length)
4666 self.add_insert_auto_id_key().TryMerge(tmp)
4667 continue
4668 if tt == 24:
4669 self.add_upsert_version(d.getVarInt64())
4670 continue
4671 if tt == 32:
4672 self.add_update_version(d.getVarInt64())
4673 continue
4674 if tt == 40:
4675 self.add_insert_version(d.getVarInt64())
4676 continue
4677 if tt == 48:
4678 self.add_insert_auto_id_version(d.getVarInt64())
4679 continue
4680 if tt == 56:
4681 self.add_delete_version(d.getVarInt64())
4682 continue
4685 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
4686 d.skipData(tt)
4689 def __str__(self, prefix="", printElemNumber=0):
4690 res=""
4691 if self.has_index_updates_: res+=prefix+("index_updates: %s\n" % self.DebugFormatInt32(self.index_updates_))
4692 cnt=0
4693 for e in self.insert_auto_id_key_:
4694 elm=""
4695 if printElemNumber: elm="(%d)" % cnt
4696 res+=prefix+("insert_auto_id_key%s <\n" % elm)
4697 res+=e.__str__(prefix + " ", printElemNumber)
4698 res+=prefix+">\n"
4699 cnt+=1
4700 cnt=0
4701 for e in self.upsert_version_:
4702 elm=""
4703 if printElemNumber: elm="(%d)" % cnt
4704 res+=prefix+("upsert_version%s: %s\n" % (elm, self.DebugFormatInt64(e)))
4705 cnt+=1
4706 cnt=0
4707 for e in self.update_version_:
4708 elm=""
4709 if printElemNumber: elm="(%d)" % cnt
4710 res+=prefix+("update_version%s: %s\n" % (elm, self.DebugFormatInt64(e)))
4711 cnt+=1
4712 cnt=0
4713 for e in self.insert_version_:
4714 elm=""
4715 if printElemNumber: elm="(%d)" % cnt
4716 res+=prefix+("insert_version%s: %s\n" % (elm, self.DebugFormatInt64(e)))
4717 cnt+=1
4718 cnt=0
4719 for e in self.insert_auto_id_version_:
4720 elm=""
4721 if printElemNumber: elm="(%d)" % cnt
4722 res+=prefix+("insert_auto_id_version%s: %s\n" % (elm, self.DebugFormatInt64(e)))
4723 cnt+=1
4724 cnt=0
4725 for e in self.delete_version_:
4726 elm=""
4727 if printElemNumber: elm="(%d)" % cnt
4728 res+=prefix+("delete_version%s: %s\n" % (elm, self.DebugFormatInt64(e)))
4729 cnt+=1
4730 return res
4733 def _BuildTagLookupTable(sparse, maxtag, default=None):
4734 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
4736 kindex_updates = 1
4737 kinsert_auto_id_key = 2
4738 kupsert_version = 3
4739 kupdate_version = 4
4740 kinsert_version = 5
4741 kinsert_auto_id_version = 6
4742 kdelete_version = 7
4744 _TEXT = _BuildTagLookupTable({
4745 0: "ErrorCode",
4746 1: "index_updates",
4747 2: "insert_auto_id_key",
4748 3: "upsert_version",
4749 4: "update_version",
4750 5: "insert_version",
4751 6: "insert_auto_id_version",
4752 7: "delete_version",
4753 }, 7)
4755 _TYPES = _BuildTagLookupTable({
4756 0: ProtocolBuffer.Encoder.NUMERIC,
4757 1: ProtocolBuffer.Encoder.NUMERIC,
4758 2: ProtocolBuffer.Encoder.STRING,
4759 3: ProtocolBuffer.Encoder.NUMERIC,
4760 4: ProtocolBuffer.Encoder.NUMERIC,
4761 5: ProtocolBuffer.Encoder.NUMERIC,
4762 6: ProtocolBuffer.Encoder.NUMERIC,
4763 7: ProtocolBuffer.Encoder.NUMERIC,
4764 }, 7, ProtocolBuffer.Encoder.MAX_TYPE)
4767 _STYLE = """"""
4768 _STYLE_CONTENT_TYPE = """"""
4769 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.DeprecatedMutationResult'
4770 _SERIALIZED_DESCRIPTOR = array.array('B')
4771 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KMGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkRlcHJlY2F0ZWRNdXRhdGlvblJlc3VsdBMaDWluZGV4X3VwZGF0ZXMgASgAMAU4AhQTGhJpbnNlcnRfYXV0b19pZF9rZXkgAigCMAs4A0obYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuS2V5owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaDnVwc2VydF92ZXJzaW9uIAMoADADOAMUExoOdXBkYXRlX3ZlcnNpb24gBCgAMAM4AxQTGg5pbnNlcnRfdmVyc2lvbiAFKAAwAzgDFBMaFmluc2VydF9hdXRvX2lkX3ZlcnNpb24gBigAMAM4AxQTGg5kZWxldGVfdmVyc2lvbiAHKAAwAzgDFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
4772 if _net_proto___parse__python is not None:
4773 _net_proto___parse__python.RegisterType(
4774 _SERIALIZED_DESCRIPTOR.tostring())
4776 class ReadOptions(ProtocolBuffer.ProtocolMessage):
4779 DEFAULT = 0
4780 STRONG = 1
4781 EVENTUAL = 2
4783 _ReadConsistency_NAMES = {
4784 0: "DEFAULT",
4785 1: "STRONG",
4786 2: "EVENTUAL",
4789 def ReadConsistency_Name(cls, x): return cls._ReadConsistency_NAMES.get(x, "")
4790 ReadConsistency_Name = classmethod(ReadConsistency_Name)
4792 has_read_consistency_ = 0
4793 read_consistency_ = 0
4794 has_transaction_ = 0
4795 transaction_ = ""
4797 def __init__(self, contents=None):
4798 if contents is not None: self.MergeFromString(contents)
4800 def read_consistency(self): return self.read_consistency_
4802 def set_read_consistency(self, x):
4803 self.has_read_consistency_ = 1
4804 self.read_consistency_ = x
4806 def clear_read_consistency(self):
4807 if self.has_read_consistency_:
4808 self.has_read_consistency_ = 0
4809 self.read_consistency_ = 0
4811 def has_read_consistency(self): return self.has_read_consistency_
4813 def transaction(self): return self.transaction_
4815 def set_transaction(self, x):
4816 self.has_transaction_ = 1
4817 self.transaction_ = x
4819 def clear_transaction(self):
4820 if self.has_transaction_:
4821 self.has_transaction_ = 0
4822 self.transaction_ = ""
4824 def has_transaction(self): return self.has_transaction_
4827 def MergeFrom(self, x):
4828 assert x is not self
4829 if (x.has_read_consistency()): self.set_read_consistency(x.read_consistency())
4830 if (x.has_transaction()): self.set_transaction(x.transaction())
4832 if _net_proto___parse__python is not None:
4833 def _CMergeFromString(self, s):
4834 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.ReadOptions', s)
4836 if _net_proto___parse__python is not None:
4837 def _CEncode(self):
4838 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.ReadOptions')
4840 if _net_proto___parse__python is not None:
4841 def _CEncodePartial(self):
4842 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.ReadOptions')
4844 if _net_proto___parse__python is not None:
4845 def _CToASCII(self, output_format):
4846 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.ReadOptions', output_format)
4849 if _net_proto___parse__python is not None:
4850 def ParseASCII(self, s):
4851 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.ReadOptions', s)
4854 if _net_proto___parse__python is not None:
4855 def ParseASCIIIgnoreUnknown(self, s):
4856 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.ReadOptions', s)
4859 def Equals(self, x):
4860 if x is self: return 1
4861 if self.has_read_consistency_ != x.has_read_consistency_: return 0
4862 if self.has_read_consistency_ and self.read_consistency_ != x.read_consistency_: return 0
4863 if self.has_transaction_ != x.has_transaction_: return 0
4864 if self.has_transaction_ and self.transaction_ != x.transaction_: return 0
4865 return 1
4867 def IsInitialized(self, debug_strs=None):
4868 initialized = 1
4869 return initialized
4871 def ByteSize(self):
4872 n = 0
4873 if (self.has_read_consistency_): n += 1 + self.lengthVarInt64(self.read_consistency_)
4874 if (self.has_transaction_): n += 1 + self.lengthString(len(self.transaction_))
4875 return n
4877 def ByteSizePartial(self):
4878 n = 0
4879 if (self.has_read_consistency_): n += 1 + self.lengthVarInt64(self.read_consistency_)
4880 if (self.has_transaction_): n += 1 + self.lengthString(len(self.transaction_))
4881 return n
4883 def Clear(self):
4884 self.clear_read_consistency()
4885 self.clear_transaction()
4887 def OutputUnchecked(self, out):
4888 if (self.has_read_consistency_):
4889 out.putVarInt32(8)
4890 out.putVarInt32(self.read_consistency_)
4891 if (self.has_transaction_):
4892 out.putVarInt32(18)
4893 out.putPrefixedString(self.transaction_)
4895 def OutputPartial(self, out):
4896 if (self.has_read_consistency_):
4897 out.putVarInt32(8)
4898 out.putVarInt32(self.read_consistency_)
4899 if (self.has_transaction_):
4900 out.putVarInt32(18)
4901 out.putPrefixedString(self.transaction_)
4903 def TryMerge(self, d):
4904 while d.avail() > 0:
4905 tt = d.getVarInt32()
4906 if tt == 8:
4907 self.set_read_consistency(d.getVarInt32())
4908 continue
4909 if tt == 18:
4910 self.set_transaction(d.getPrefixedString())
4911 continue
4914 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
4915 d.skipData(tt)
4918 def __str__(self, prefix="", printElemNumber=0):
4919 res=""
4920 if self.has_read_consistency_: res+=prefix+("read_consistency: %s\n" % self.DebugFormatInt32(self.read_consistency_))
4921 if self.has_transaction_: res+=prefix+("transaction: %s\n" % self.DebugFormatString(self.transaction_))
4922 return res
4925 def _BuildTagLookupTable(sparse, maxtag, default=None):
4926 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
4928 kread_consistency = 1
4929 ktransaction = 2
4931 _TEXT = _BuildTagLookupTable({
4932 0: "ErrorCode",
4933 1: "read_consistency",
4934 2: "transaction",
4935 }, 2)
4937 _TYPES = _BuildTagLookupTable({
4938 0: ProtocolBuffer.Encoder.NUMERIC,
4939 1: ProtocolBuffer.Encoder.NUMERIC,
4940 2: ProtocolBuffer.Encoder.STRING,
4941 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
4944 _STYLE = """"""
4945 _STYLE_CONTENT_TYPE = """"""
4946 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.ReadOptions'
4947 _SERIALIZED_DESCRIPTOR = array.array('B')
4948 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KI2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJlYWRPcHRpb25zExoQcmVhZF9jb25zaXN0ZW5jeSABKAAwBTgBQgEwaACjAaoBB2RlZmF1bHSyAQdERUZBVUxUpAEUExoLdHJhbnNhY3Rpb24gAigCMAk4ARRzeg9SZWFkQ29uc2lzdGVuY3mLAZIBB0RFRkFVTFSYAQCMAYsBkgEGU1RST05HmAEBjAGLAZIBCEVWRU5UVUFMmAECjAF0wgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
4949 if _net_proto___parse__python is not None:
4950 _net_proto___parse__python.RegisterType(
4951 _SERIALIZED_DESCRIPTOR.tostring())
4953 class LookupRequest(ProtocolBuffer.ProtocolMessage):
4954 has_read_options_ = 0
4955 read_options_ = None
4957 def __init__(self, contents=None):
4958 self.key_ = []
4959 self.lazy_init_lock_ = thread.allocate_lock()
4960 if contents is not None: self.MergeFromString(contents)
4962 def read_options(self):
4963 if self.read_options_ is None:
4964 self.lazy_init_lock_.acquire()
4965 try:
4966 if self.read_options_ is None: self.read_options_ = ReadOptions()
4967 finally:
4968 self.lazy_init_lock_.release()
4969 return self.read_options_
4971 def mutable_read_options(self): self.has_read_options_ = 1; return self.read_options()
4973 def clear_read_options(self):
4975 if self.has_read_options_:
4976 self.has_read_options_ = 0;
4977 if self.read_options_ is not None: self.read_options_.Clear()
4979 def has_read_options(self): return self.has_read_options_
4981 def key_size(self): return len(self.key_)
4982 def key_list(self): return self.key_
4984 def key(self, i):
4985 return self.key_[i]
4987 def mutable_key(self, i):
4988 return self.key_[i]
4990 def add_key(self):
4991 x = google.appengine.datastore.entity_v4_pb.Key()
4992 self.key_.append(x)
4993 return x
4995 def clear_key(self):
4996 self.key_ = []
4998 def MergeFrom(self, x):
4999 assert x is not self
5000 if (x.has_read_options()): self.mutable_read_options().MergeFrom(x.read_options())
5001 for i in xrange(x.key_size()): self.add_key().CopyFrom(x.key(i))
5003 if _net_proto___parse__python is not None:
5004 def _CMergeFromString(self, s):
5005 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.LookupRequest', s)
5007 if _net_proto___parse__python is not None:
5008 def _CEncode(self):
5009 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.LookupRequest')
5011 if _net_proto___parse__python is not None:
5012 def _CEncodePartial(self):
5013 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.LookupRequest')
5015 if _net_proto___parse__python is not None:
5016 def _CToASCII(self, output_format):
5017 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.LookupRequest', output_format)
5020 if _net_proto___parse__python is not None:
5021 def ParseASCII(self, s):
5022 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.LookupRequest', s)
5025 if _net_proto___parse__python is not None:
5026 def ParseASCIIIgnoreUnknown(self, s):
5027 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.LookupRequest', s)
5030 def Equals(self, x):
5031 if x is self: return 1
5032 if self.has_read_options_ != x.has_read_options_: return 0
5033 if self.has_read_options_ and self.read_options_ != x.read_options_: return 0
5034 if len(self.key_) != len(x.key_): return 0
5035 for e1, e2 in zip(self.key_, x.key_):
5036 if e1 != e2: return 0
5037 return 1
5039 def IsInitialized(self, debug_strs=None):
5040 initialized = 1
5041 if (self.has_read_options_ and not self.read_options_.IsInitialized(debug_strs)): initialized = 0
5042 for p in self.key_:
5043 if not p.IsInitialized(debug_strs): initialized=0
5044 return initialized
5046 def ByteSize(self):
5047 n = 0
5048 if (self.has_read_options_): n += 1 + self.lengthString(self.read_options_.ByteSize())
5049 n += 1 * len(self.key_)
5050 for i in xrange(len(self.key_)): n += self.lengthString(self.key_[i].ByteSize())
5051 return n
5053 def ByteSizePartial(self):
5054 n = 0
5055 if (self.has_read_options_): n += 1 + self.lengthString(self.read_options_.ByteSizePartial())
5056 n += 1 * len(self.key_)
5057 for i in xrange(len(self.key_)): n += self.lengthString(self.key_[i].ByteSizePartial())
5058 return n
5060 def Clear(self):
5061 self.clear_read_options()
5062 self.clear_key()
5064 def OutputUnchecked(self, out):
5065 if (self.has_read_options_):
5066 out.putVarInt32(10)
5067 out.putVarInt32(self.read_options_.ByteSize())
5068 self.read_options_.OutputUnchecked(out)
5069 for i in xrange(len(self.key_)):
5070 out.putVarInt32(26)
5071 out.putVarInt32(self.key_[i].ByteSize())
5072 self.key_[i].OutputUnchecked(out)
5074 def OutputPartial(self, out):
5075 if (self.has_read_options_):
5076 out.putVarInt32(10)
5077 out.putVarInt32(self.read_options_.ByteSizePartial())
5078 self.read_options_.OutputPartial(out)
5079 for i in xrange(len(self.key_)):
5080 out.putVarInt32(26)
5081 out.putVarInt32(self.key_[i].ByteSizePartial())
5082 self.key_[i].OutputPartial(out)
5084 def TryMerge(self, d):
5085 while d.avail() > 0:
5086 tt = d.getVarInt32()
5087 if tt == 10:
5088 length = d.getVarInt32()
5089 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
5090 d.skip(length)
5091 self.mutable_read_options().TryMerge(tmp)
5092 continue
5093 if tt == 26:
5094 length = d.getVarInt32()
5095 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
5096 d.skip(length)
5097 self.add_key().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_read_options_:
5108 res+=prefix+"read_options <\n"
5109 res+=self.read_options_.__str__(prefix + " ", printElemNumber)
5110 res+=prefix+">\n"
5111 cnt=0
5112 for e in self.key_:
5113 elm=""
5114 if printElemNumber: elm="(%d)" % cnt
5115 res+=prefix+("key%s <\n" % elm)
5116 res+=e.__str__(prefix + " ", printElemNumber)
5117 res+=prefix+">\n"
5118 cnt+=1
5119 return res
5122 def _BuildTagLookupTable(sparse, maxtag, default=None):
5123 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
5125 kread_options = 1
5126 kkey = 3
5128 _TEXT = _BuildTagLookupTable({
5129 0: "ErrorCode",
5130 1: "read_options",
5131 3: "key",
5132 }, 3)
5134 _TYPES = _BuildTagLookupTable({
5135 0: ProtocolBuffer.Encoder.NUMERIC,
5136 1: ProtocolBuffer.Encoder.STRING,
5137 3: ProtocolBuffer.Encoder.STRING,
5138 }, 3, ProtocolBuffer.Encoder.MAX_TYPE)
5141 _STYLE = """"""
5142 _STYLE_CONTENT_TYPE = """"""
5143 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.LookupRequest'
5144 _SERIALIZED_DESCRIPTOR = array.array('B')
5145 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lkxvb2t1cFJlcXVlc3QTGgxyZWFkX29wdGlvbnMgASgCMAs4AUojYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUmVhZE9wdGlvbnOjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoDa2V5IAMoAjALOANKG2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleaMBqgEFY3R5cGWyAQZwcm90bzKkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
5146 if _net_proto___parse__python is not None:
5147 _net_proto___parse__python.RegisterType(
5148 _SERIALIZED_DESCRIPTOR.tostring())
5150 class LookupResponse(ProtocolBuffer.ProtocolMessage):
5152 def __init__(self, contents=None):
5153 self.found_ = []
5154 self.missing_ = []
5155 self.deferred_ = []
5156 if contents is not None: self.MergeFromString(contents)
5158 def found_size(self): return len(self.found_)
5159 def found_list(self): return self.found_
5161 def found(self, i):
5162 return self.found_[i]
5164 def mutable_found(self, i):
5165 return self.found_[i]
5167 def add_found(self):
5168 x = EntityResult()
5169 self.found_.append(x)
5170 return x
5172 def clear_found(self):
5173 self.found_ = []
5174 def missing_size(self): return len(self.missing_)
5175 def missing_list(self): return self.missing_
5177 def missing(self, i):
5178 return self.missing_[i]
5180 def mutable_missing(self, i):
5181 return self.missing_[i]
5183 def add_missing(self):
5184 x = EntityResult()
5185 self.missing_.append(x)
5186 return x
5188 def clear_missing(self):
5189 self.missing_ = []
5190 def deferred_size(self): return len(self.deferred_)
5191 def deferred_list(self): return self.deferred_
5193 def deferred(self, i):
5194 return self.deferred_[i]
5196 def mutable_deferred(self, i):
5197 return self.deferred_[i]
5199 def add_deferred(self):
5200 x = google.appengine.datastore.entity_v4_pb.Key()
5201 self.deferred_.append(x)
5202 return x
5204 def clear_deferred(self):
5205 self.deferred_ = []
5207 def MergeFrom(self, x):
5208 assert x is not self
5209 for i in xrange(x.found_size()): self.add_found().CopyFrom(x.found(i))
5210 for i in xrange(x.missing_size()): self.add_missing().CopyFrom(x.missing(i))
5211 for i in xrange(x.deferred_size()): self.add_deferred().CopyFrom(x.deferred(i))
5213 if _net_proto___parse__python is not None:
5214 def _CMergeFromString(self, s):
5215 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.LookupResponse', s)
5217 if _net_proto___parse__python is not None:
5218 def _CEncode(self):
5219 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.LookupResponse')
5221 if _net_proto___parse__python is not None:
5222 def _CEncodePartial(self):
5223 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.LookupResponse')
5225 if _net_proto___parse__python is not None:
5226 def _CToASCII(self, output_format):
5227 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.LookupResponse', output_format)
5230 if _net_proto___parse__python is not None:
5231 def ParseASCII(self, s):
5232 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.LookupResponse', s)
5235 if _net_proto___parse__python is not None:
5236 def ParseASCIIIgnoreUnknown(self, s):
5237 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.LookupResponse', s)
5240 def Equals(self, x):
5241 if x is self: return 1
5242 if len(self.found_) != len(x.found_): return 0
5243 for e1, e2 in zip(self.found_, x.found_):
5244 if e1 != e2: return 0
5245 if len(self.missing_) != len(x.missing_): return 0
5246 for e1, e2 in zip(self.missing_, x.missing_):
5247 if e1 != e2: return 0
5248 if len(self.deferred_) != len(x.deferred_): return 0
5249 for e1, e2 in zip(self.deferred_, x.deferred_):
5250 if e1 != e2: return 0
5251 return 1
5253 def IsInitialized(self, debug_strs=None):
5254 initialized = 1
5255 for p in self.found_:
5256 if not p.IsInitialized(debug_strs): initialized=0
5257 for p in self.missing_:
5258 if not p.IsInitialized(debug_strs): initialized=0
5259 for p in self.deferred_:
5260 if not p.IsInitialized(debug_strs): initialized=0
5261 return initialized
5263 def ByteSize(self):
5264 n = 0
5265 n += 1 * len(self.found_)
5266 for i in xrange(len(self.found_)): n += self.lengthString(self.found_[i].ByteSize())
5267 n += 1 * len(self.missing_)
5268 for i in xrange(len(self.missing_)): n += self.lengthString(self.missing_[i].ByteSize())
5269 n += 1 * len(self.deferred_)
5270 for i in xrange(len(self.deferred_)): n += self.lengthString(self.deferred_[i].ByteSize())
5271 return n
5273 def ByteSizePartial(self):
5274 n = 0
5275 n += 1 * len(self.found_)
5276 for i in xrange(len(self.found_)): n += self.lengthString(self.found_[i].ByteSizePartial())
5277 n += 1 * len(self.missing_)
5278 for i in xrange(len(self.missing_)): n += self.lengthString(self.missing_[i].ByteSizePartial())
5279 n += 1 * len(self.deferred_)
5280 for i in xrange(len(self.deferred_)): n += self.lengthString(self.deferred_[i].ByteSizePartial())
5281 return n
5283 def Clear(self):
5284 self.clear_found()
5285 self.clear_missing()
5286 self.clear_deferred()
5288 def OutputUnchecked(self, out):
5289 for i in xrange(len(self.found_)):
5290 out.putVarInt32(10)
5291 out.putVarInt32(self.found_[i].ByteSize())
5292 self.found_[i].OutputUnchecked(out)
5293 for i in xrange(len(self.missing_)):
5294 out.putVarInt32(18)
5295 out.putVarInt32(self.missing_[i].ByteSize())
5296 self.missing_[i].OutputUnchecked(out)
5297 for i in xrange(len(self.deferred_)):
5298 out.putVarInt32(26)
5299 out.putVarInt32(self.deferred_[i].ByteSize())
5300 self.deferred_[i].OutputUnchecked(out)
5302 def OutputPartial(self, out):
5303 for i in xrange(len(self.found_)):
5304 out.putVarInt32(10)
5305 out.putVarInt32(self.found_[i].ByteSizePartial())
5306 self.found_[i].OutputPartial(out)
5307 for i in xrange(len(self.missing_)):
5308 out.putVarInt32(18)
5309 out.putVarInt32(self.missing_[i].ByteSizePartial())
5310 self.missing_[i].OutputPartial(out)
5311 for i in xrange(len(self.deferred_)):
5312 out.putVarInt32(26)
5313 out.putVarInt32(self.deferred_[i].ByteSizePartial())
5314 self.deferred_[i].OutputPartial(out)
5316 def TryMerge(self, d):
5317 while d.avail() > 0:
5318 tt = d.getVarInt32()
5319 if tt == 10:
5320 length = d.getVarInt32()
5321 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
5322 d.skip(length)
5323 self.add_found().TryMerge(tmp)
5324 continue
5325 if tt == 18:
5326 length = d.getVarInt32()
5327 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
5328 d.skip(length)
5329 self.add_missing().TryMerge(tmp)
5330 continue
5331 if tt == 26:
5332 length = d.getVarInt32()
5333 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
5334 d.skip(length)
5335 self.add_deferred().TryMerge(tmp)
5336 continue
5339 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
5340 d.skipData(tt)
5343 def __str__(self, prefix="", printElemNumber=0):
5344 res=""
5345 cnt=0
5346 for e in self.found_:
5347 elm=""
5348 if printElemNumber: elm="(%d)" % cnt
5349 res+=prefix+("found%s <\n" % elm)
5350 res+=e.__str__(prefix + " ", printElemNumber)
5351 res+=prefix+">\n"
5352 cnt+=1
5353 cnt=0
5354 for e in self.missing_:
5355 elm=""
5356 if printElemNumber: elm="(%d)" % cnt
5357 res+=prefix+("missing%s <\n" % elm)
5358 res+=e.__str__(prefix + " ", printElemNumber)
5359 res+=prefix+">\n"
5360 cnt+=1
5361 cnt=0
5362 for e in self.deferred_:
5363 elm=""
5364 if printElemNumber: elm="(%d)" % cnt
5365 res+=prefix+("deferred%s <\n" % elm)
5366 res+=e.__str__(prefix + " ", printElemNumber)
5367 res+=prefix+">\n"
5368 cnt+=1
5369 return res
5372 def _BuildTagLookupTable(sparse, maxtag, default=None):
5373 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
5375 kfound = 1
5376 kmissing = 2
5377 kdeferred = 3
5379 _TEXT = _BuildTagLookupTable({
5380 0: "ErrorCode",
5381 1: "found",
5382 2: "missing",
5383 3: "deferred",
5384 }, 3)
5386 _TYPES = _BuildTagLookupTable({
5387 0: ProtocolBuffer.Encoder.NUMERIC,
5388 1: ProtocolBuffer.Encoder.STRING,
5389 2: ProtocolBuffer.Encoder.STRING,
5390 3: ProtocolBuffer.Encoder.STRING,
5391 }, 3, ProtocolBuffer.Encoder.MAX_TYPE)
5394 _STYLE = """"""
5395 _STYLE_CONTENT_TYPE = """"""
5396 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.LookupResponse'
5397 _SERIALIZED_DESCRIPTOR = array.array('B')
5398 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lkxvb2t1cFJlc3BvbnNlExoFZm91bmQgASgCMAs4A0okYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5UmVzdWx0owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaB21pc3NpbmcgAigCMAs4A0okYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRW50aXR5UmVzdWx0owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaCGRlZmVycmVkIAMoAjALOANKG2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleaMBqgEFY3R5cGWyAQZwcm90bzKkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
5399 if _net_proto___parse__python is not None:
5400 _net_proto___parse__python.RegisterType(
5401 _SERIALIZED_DESCRIPTOR.tostring())
5403 class RunQueryRequest(ProtocolBuffer.ProtocolMessage):
5404 has_read_options_ = 0
5405 read_options_ = None
5406 has_partition_id_ = 0
5407 partition_id_ = None
5408 has_query_ = 0
5409 query_ = None
5410 has_gql_query_ = 0
5411 gql_query_ = None
5412 has_min_safe_time_seconds_ = 0
5413 min_safe_time_seconds_ = 0
5414 has_suggested_batch_size_ = 0
5415 suggested_batch_size_ = 0
5417 def __init__(self, contents=None):
5418 self.lazy_init_lock_ = thread.allocate_lock()
5419 if contents is not None: self.MergeFromString(contents)
5421 def read_options(self):
5422 if self.read_options_ is None:
5423 self.lazy_init_lock_.acquire()
5424 try:
5425 if self.read_options_ is None: self.read_options_ = ReadOptions()
5426 finally:
5427 self.lazy_init_lock_.release()
5428 return self.read_options_
5430 def mutable_read_options(self): self.has_read_options_ = 1; return self.read_options()
5432 def clear_read_options(self):
5434 if self.has_read_options_:
5435 self.has_read_options_ = 0;
5436 if self.read_options_ is not None: self.read_options_.Clear()
5438 def has_read_options(self): return self.has_read_options_
5440 def partition_id(self):
5441 if self.partition_id_ is None:
5442 self.lazy_init_lock_.acquire()
5443 try:
5444 if self.partition_id_ is None: self.partition_id_ = google.appengine.datastore.entity_v4_pb.PartitionId()
5445 finally:
5446 self.lazy_init_lock_.release()
5447 return self.partition_id_
5449 def mutable_partition_id(self): self.has_partition_id_ = 1; return self.partition_id()
5451 def clear_partition_id(self):
5453 if self.has_partition_id_:
5454 self.has_partition_id_ = 0;
5455 if self.partition_id_ is not None: self.partition_id_.Clear()
5457 def has_partition_id(self): return self.has_partition_id_
5459 def query(self):
5460 if self.query_ is None:
5461 self.lazy_init_lock_.acquire()
5462 try:
5463 if self.query_ is None: self.query_ = Query()
5464 finally:
5465 self.lazy_init_lock_.release()
5466 return self.query_
5468 def mutable_query(self): self.has_query_ = 1; return self.query()
5470 def clear_query(self):
5472 if self.has_query_:
5473 self.has_query_ = 0;
5474 if self.query_ is not None: self.query_.Clear()
5476 def has_query(self): return self.has_query_
5478 def gql_query(self):
5479 if self.gql_query_ is None:
5480 self.lazy_init_lock_.acquire()
5481 try:
5482 if self.gql_query_ is None: self.gql_query_ = GqlQuery()
5483 finally:
5484 self.lazy_init_lock_.release()
5485 return self.gql_query_
5487 def mutable_gql_query(self): self.has_gql_query_ = 1; return self.gql_query()
5489 def clear_gql_query(self):
5491 if self.has_gql_query_:
5492 self.has_gql_query_ = 0;
5493 if self.gql_query_ is not None: self.gql_query_.Clear()
5495 def has_gql_query(self): return self.has_gql_query_
5497 def min_safe_time_seconds(self): return self.min_safe_time_seconds_
5499 def set_min_safe_time_seconds(self, x):
5500 self.has_min_safe_time_seconds_ = 1
5501 self.min_safe_time_seconds_ = x
5503 def clear_min_safe_time_seconds(self):
5504 if self.has_min_safe_time_seconds_:
5505 self.has_min_safe_time_seconds_ = 0
5506 self.min_safe_time_seconds_ = 0
5508 def has_min_safe_time_seconds(self): return self.has_min_safe_time_seconds_
5510 def suggested_batch_size(self): return self.suggested_batch_size_
5512 def set_suggested_batch_size(self, x):
5513 self.has_suggested_batch_size_ = 1
5514 self.suggested_batch_size_ = x
5516 def clear_suggested_batch_size(self):
5517 if self.has_suggested_batch_size_:
5518 self.has_suggested_batch_size_ = 0
5519 self.suggested_batch_size_ = 0
5521 def has_suggested_batch_size(self): return self.has_suggested_batch_size_
5524 def MergeFrom(self, x):
5525 assert x is not self
5526 if (x.has_read_options()): self.mutable_read_options().MergeFrom(x.read_options())
5527 if (x.has_partition_id()): self.mutable_partition_id().MergeFrom(x.partition_id())
5528 if (x.has_query()): self.mutable_query().MergeFrom(x.query())
5529 if (x.has_gql_query()): self.mutable_gql_query().MergeFrom(x.gql_query())
5530 if (x.has_min_safe_time_seconds()): self.set_min_safe_time_seconds(x.min_safe_time_seconds())
5531 if (x.has_suggested_batch_size()): self.set_suggested_batch_size(x.suggested_batch_size())
5533 if _net_proto___parse__python is not None:
5534 def _CMergeFromString(self, s):
5535 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.RunQueryRequest', s)
5537 if _net_proto___parse__python is not None:
5538 def _CEncode(self):
5539 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.RunQueryRequest')
5541 if _net_proto___parse__python is not None:
5542 def _CEncodePartial(self):
5543 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.RunQueryRequest')
5545 if _net_proto___parse__python is not None:
5546 def _CToASCII(self, output_format):
5547 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.RunQueryRequest', output_format)
5550 if _net_proto___parse__python is not None:
5551 def ParseASCII(self, s):
5552 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.RunQueryRequest', s)
5555 if _net_proto___parse__python is not None:
5556 def ParseASCIIIgnoreUnknown(self, s):
5557 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.RunQueryRequest', s)
5560 def Equals(self, x):
5561 if x is self: return 1
5562 if self.has_read_options_ != x.has_read_options_: return 0
5563 if self.has_read_options_ and self.read_options_ != x.read_options_: return 0
5564 if self.has_partition_id_ != x.has_partition_id_: return 0
5565 if self.has_partition_id_ and self.partition_id_ != x.partition_id_: return 0
5566 if self.has_query_ != x.has_query_: return 0
5567 if self.has_query_ and self.query_ != x.query_: return 0
5568 if self.has_gql_query_ != x.has_gql_query_: return 0
5569 if self.has_gql_query_ and self.gql_query_ != x.gql_query_: return 0
5570 if self.has_min_safe_time_seconds_ != x.has_min_safe_time_seconds_: return 0
5571 if self.has_min_safe_time_seconds_ and self.min_safe_time_seconds_ != x.min_safe_time_seconds_: return 0
5572 if self.has_suggested_batch_size_ != x.has_suggested_batch_size_: return 0
5573 if self.has_suggested_batch_size_ and self.suggested_batch_size_ != x.suggested_batch_size_: return 0
5574 return 1
5576 def IsInitialized(self, debug_strs=None):
5577 initialized = 1
5578 if (self.has_read_options_ and not self.read_options_.IsInitialized(debug_strs)): initialized = 0
5579 if (self.has_partition_id_ and not self.partition_id_.IsInitialized(debug_strs)): initialized = 0
5580 if (self.has_query_ and not self.query_.IsInitialized(debug_strs)): initialized = 0
5581 if (self.has_gql_query_ and not self.gql_query_.IsInitialized(debug_strs)): initialized = 0
5582 return initialized
5584 def ByteSize(self):
5585 n = 0
5586 if (self.has_read_options_): n += 1 + self.lengthString(self.read_options_.ByteSize())
5587 if (self.has_partition_id_): n += 1 + self.lengthString(self.partition_id_.ByteSize())
5588 if (self.has_query_): n += 1 + self.lengthString(self.query_.ByteSize())
5589 if (self.has_gql_query_): n += 1 + self.lengthString(self.gql_query_.ByteSize())
5590 if (self.has_min_safe_time_seconds_): n += 1 + self.lengthVarInt64(self.min_safe_time_seconds_)
5591 if (self.has_suggested_batch_size_): n += 1 + self.lengthVarInt64(self.suggested_batch_size_)
5592 return n
5594 def ByteSizePartial(self):
5595 n = 0
5596 if (self.has_read_options_): n += 1 + self.lengthString(self.read_options_.ByteSizePartial())
5597 if (self.has_partition_id_): n += 1 + self.lengthString(self.partition_id_.ByteSizePartial())
5598 if (self.has_query_): n += 1 + self.lengthString(self.query_.ByteSizePartial())
5599 if (self.has_gql_query_): n += 1 + self.lengthString(self.gql_query_.ByteSizePartial())
5600 if (self.has_min_safe_time_seconds_): n += 1 + self.lengthVarInt64(self.min_safe_time_seconds_)
5601 if (self.has_suggested_batch_size_): n += 1 + self.lengthVarInt64(self.suggested_batch_size_)
5602 return n
5604 def Clear(self):
5605 self.clear_read_options()
5606 self.clear_partition_id()
5607 self.clear_query()
5608 self.clear_gql_query()
5609 self.clear_min_safe_time_seconds()
5610 self.clear_suggested_batch_size()
5612 def OutputUnchecked(self, out):
5613 if (self.has_read_options_):
5614 out.putVarInt32(10)
5615 out.putVarInt32(self.read_options_.ByteSize())
5616 self.read_options_.OutputUnchecked(out)
5617 if (self.has_partition_id_):
5618 out.putVarInt32(18)
5619 out.putVarInt32(self.partition_id_.ByteSize())
5620 self.partition_id_.OutputUnchecked(out)
5621 if (self.has_query_):
5622 out.putVarInt32(26)
5623 out.putVarInt32(self.query_.ByteSize())
5624 self.query_.OutputUnchecked(out)
5625 if (self.has_min_safe_time_seconds_):
5626 out.putVarInt32(32)
5627 out.putVarInt64(self.min_safe_time_seconds_)
5628 if (self.has_suggested_batch_size_):
5629 out.putVarInt32(40)
5630 out.putVarInt32(self.suggested_batch_size_)
5631 if (self.has_gql_query_):
5632 out.putVarInt32(58)
5633 out.putVarInt32(self.gql_query_.ByteSize())
5634 self.gql_query_.OutputUnchecked(out)
5636 def OutputPartial(self, out):
5637 if (self.has_read_options_):
5638 out.putVarInt32(10)
5639 out.putVarInt32(self.read_options_.ByteSizePartial())
5640 self.read_options_.OutputPartial(out)
5641 if (self.has_partition_id_):
5642 out.putVarInt32(18)
5643 out.putVarInt32(self.partition_id_.ByteSizePartial())
5644 self.partition_id_.OutputPartial(out)
5645 if (self.has_query_):
5646 out.putVarInt32(26)
5647 out.putVarInt32(self.query_.ByteSizePartial())
5648 self.query_.OutputPartial(out)
5649 if (self.has_min_safe_time_seconds_):
5650 out.putVarInt32(32)
5651 out.putVarInt64(self.min_safe_time_seconds_)
5652 if (self.has_suggested_batch_size_):
5653 out.putVarInt32(40)
5654 out.putVarInt32(self.suggested_batch_size_)
5655 if (self.has_gql_query_):
5656 out.putVarInt32(58)
5657 out.putVarInt32(self.gql_query_.ByteSizePartial())
5658 self.gql_query_.OutputPartial(out)
5660 def TryMerge(self, d):
5661 while d.avail() > 0:
5662 tt = d.getVarInt32()
5663 if tt == 10:
5664 length = d.getVarInt32()
5665 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
5666 d.skip(length)
5667 self.mutable_read_options().TryMerge(tmp)
5668 continue
5669 if tt == 18:
5670 length = d.getVarInt32()
5671 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
5672 d.skip(length)
5673 self.mutable_partition_id().TryMerge(tmp)
5674 continue
5675 if tt == 26:
5676 length = d.getVarInt32()
5677 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
5678 d.skip(length)
5679 self.mutable_query().TryMerge(tmp)
5680 continue
5681 if tt == 32:
5682 self.set_min_safe_time_seconds(d.getVarInt64())
5683 continue
5684 if tt == 40:
5685 self.set_suggested_batch_size(d.getVarInt32())
5686 continue
5687 if tt == 58:
5688 length = d.getVarInt32()
5689 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
5690 d.skip(length)
5691 self.mutable_gql_query().TryMerge(tmp)
5692 continue
5695 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
5696 d.skipData(tt)
5699 def __str__(self, prefix="", printElemNumber=0):
5700 res=""
5701 if self.has_read_options_:
5702 res+=prefix+"read_options <\n"
5703 res+=self.read_options_.__str__(prefix + " ", printElemNumber)
5704 res+=prefix+">\n"
5705 if self.has_partition_id_:
5706 res+=prefix+"partition_id <\n"
5707 res+=self.partition_id_.__str__(prefix + " ", printElemNumber)
5708 res+=prefix+">\n"
5709 if self.has_query_:
5710 res+=prefix+"query <\n"
5711 res+=self.query_.__str__(prefix + " ", printElemNumber)
5712 res+=prefix+">\n"
5713 if self.has_gql_query_:
5714 res+=prefix+"gql_query <\n"
5715 res+=self.gql_query_.__str__(prefix + " ", printElemNumber)
5716 res+=prefix+">\n"
5717 if self.has_min_safe_time_seconds_: res+=prefix+("min_safe_time_seconds: %s\n" % self.DebugFormatInt64(self.min_safe_time_seconds_))
5718 if self.has_suggested_batch_size_: res+=prefix+("suggested_batch_size: %s\n" % self.DebugFormatInt32(self.suggested_batch_size_))
5719 return res
5722 def _BuildTagLookupTable(sparse, maxtag, default=None):
5723 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
5725 kread_options = 1
5726 kpartition_id = 2
5727 kquery = 3
5728 kgql_query = 7
5729 kmin_safe_time_seconds = 4
5730 ksuggested_batch_size = 5
5732 _TEXT = _BuildTagLookupTable({
5733 0: "ErrorCode",
5734 1: "read_options",
5735 2: "partition_id",
5736 3: "query",
5737 4: "min_safe_time_seconds",
5738 5: "suggested_batch_size",
5739 7: "gql_query",
5740 }, 7)
5742 _TYPES = _BuildTagLookupTable({
5743 0: ProtocolBuffer.Encoder.NUMERIC,
5744 1: ProtocolBuffer.Encoder.STRING,
5745 2: ProtocolBuffer.Encoder.STRING,
5746 3: ProtocolBuffer.Encoder.STRING,
5747 4: ProtocolBuffer.Encoder.NUMERIC,
5748 5: ProtocolBuffer.Encoder.NUMERIC,
5749 7: ProtocolBuffer.Encoder.STRING,
5750 }, 7, ProtocolBuffer.Encoder.MAX_TYPE)
5753 _STYLE = """"""
5754 _STYLE_CONTENT_TYPE = """"""
5755 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.RunQueryRequest'
5756 _SERIALIZED_DESCRIPTOR = array.array('B')
5757 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJ2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJ1blF1ZXJ5UmVxdWVzdBMaDHJlYWRfb3B0aW9ucyABKAIwCzgBSiNhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5SZWFkT3B0aW9uc6MBqgEFY3R5cGWyAQZwcm90bzKkARQTGgxwYXJ0aXRpb25faWQgAigCMAs4AUojYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUGFydGl0aW9uSWSjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoFcXVlcnkgAygCMAs4AUodYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUXVlcnmjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoJZ3FsX3F1ZXJ5IAcoAjALOAFKIGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkdxbFF1ZXJ5owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaFW1pbl9zYWZlX3RpbWVfc2Vjb25kcyAEKAAwAzgBFBMaFHN1Z2dlc3RlZF9iYXRjaF9zaXplIAUoADAFOAEUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
5758 if _net_proto___parse__python is not None:
5759 _net_proto___parse__python.RegisterType(
5760 _SERIALIZED_DESCRIPTOR.tostring())
5762 class RunQueryResponse(ProtocolBuffer.ProtocolMessage):
5763 has_batch_ = 0
5764 has_query_handle_ = 0
5765 query_handle_ = ""
5767 def __init__(self, contents=None):
5768 self.batch_ = QueryResultBatch()
5769 if contents is not None: self.MergeFromString(contents)
5771 def batch(self): return self.batch_
5773 def mutable_batch(self): self.has_batch_ = 1; return self.batch_
5775 def clear_batch(self):self.has_batch_ = 0; self.batch_.Clear()
5777 def has_batch(self): return self.has_batch_
5779 def query_handle(self): return self.query_handle_
5781 def set_query_handle(self, x):
5782 self.has_query_handle_ = 1
5783 self.query_handle_ = x
5785 def clear_query_handle(self):
5786 if self.has_query_handle_:
5787 self.has_query_handle_ = 0
5788 self.query_handle_ = ""
5790 def has_query_handle(self): return self.has_query_handle_
5793 def MergeFrom(self, x):
5794 assert x is not self
5795 if (x.has_batch()): self.mutable_batch().MergeFrom(x.batch())
5796 if (x.has_query_handle()): self.set_query_handle(x.query_handle())
5798 if _net_proto___parse__python is not None:
5799 def _CMergeFromString(self, s):
5800 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.RunQueryResponse', s)
5802 if _net_proto___parse__python is not None:
5803 def _CEncode(self):
5804 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.RunQueryResponse')
5806 if _net_proto___parse__python is not None:
5807 def _CEncodePartial(self):
5808 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.RunQueryResponse')
5810 if _net_proto___parse__python is not None:
5811 def _CToASCII(self, output_format):
5812 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.RunQueryResponse', output_format)
5815 if _net_proto___parse__python is not None:
5816 def ParseASCII(self, s):
5817 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.RunQueryResponse', s)
5820 if _net_proto___parse__python is not None:
5821 def ParseASCIIIgnoreUnknown(self, s):
5822 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.RunQueryResponse', s)
5825 def Equals(self, x):
5826 if x is self: return 1
5827 if self.has_batch_ != x.has_batch_: return 0
5828 if self.has_batch_ and self.batch_ != x.batch_: return 0
5829 if self.has_query_handle_ != x.has_query_handle_: return 0
5830 if self.has_query_handle_ and self.query_handle_ != x.query_handle_: return 0
5831 return 1
5833 def IsInitialized(self, debug_strs=None):
5834 initialized = 1
5835 if (not self.has_batch_):
5836 initialized = 0
5837 if debug_strs is not None:
5838 debug_strs.append('Required field: batch not set.')
5839 elif not self.batch_.IsInitialized(debug_strs): initialized = 0
5840 return initialized
5842 def ByteSize(self):
5843 n = 0
5844 n += self.lengthString(self.batch_.ByteSize())
5845 if (self.has_query_handle_): n += 1 + self.lengthString(len(self.query_handle_))
5846 return n + 1
5848 def ByteSizePartial(self):
5849 n = 0
5850 if (self.has_batch_):
5851 n += 1
5852 n += self.lengthString(self.batch_.ByteSizePartial())
5853 if (self.has_query_handle_): n += 1 + self.lengthString(len(self.query_handle_))
5854 return n
5856 def Clear(self):
5857 self.clear_batch()
5858 self.clear_query_handle()
5860 def OutputUnchecked(self, out):
5861 out.putVarInt32(10)
5862 out.putVarInt32(self.batch_.ByteSize())
5863 self.batch_.OutputUnchecked(out)
5864 if (self.has_query_handle_):
5865 out.putVarInt32(18)
5866 out.putPrefixedString(self.query_handle_)
5868 def OutputPartial(self, out):
5869 if (self.has_batch_):
5870 out.putVarInt32(10)
5871 out.putVarInt32(self.batch_.ByteSizePartial())
5872 self.batch_.OutputPartial(out)
5873 if (self.has_query_handle_):
5874 out.putVarInt32(18)
5875 out.putPrefixedString(self.query_handle_)
5877 def TryMerge(self, d):
5878 while d.avail() > 0:
5879 tt = d.getVarInt32()
5880 if tt == 10:
5881 length = d.getVarInt32()
5882 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
5883 d.skip(length)
5884 self.mutable_batch().TryMerge(tmp)
5885 continue
5886 if tt == 18:
5887 self.set_query_handle(d.getPrefixedString())
5888 continue
5891 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
5892 d.skipData(tt)
5895 def __str__(self, prefix="", printElemNumber=0):
5896 res=""
5897 if self.has_batch_:
5898 res+=prefix+"batch <\n"
5899 res+=self.batch_.__str__(prefix + " ", printElemNumber)
5900 res+=prefix+">\n"
5901 if self.has_query_handle_: res+=prefix+("query_handle: %s\n" % self.DebugFormatString(self.query_handle_))
5902 return res
5905 def _BuildTagLookupTable(sparse, maxtag, default=None):
5906 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
5908 kbatch = 1
5909 kquery_handle = 2
5911 _TEXT = _BuildTagLookupTable({
5912 0: "ErrorCode",
5913 1: "batch",
5914 2: "query_handle",
5915 }, 2)
5917 _TYPES = _BuildTagLookupTable({
5918 0: ProtocolBuffer.Encoder.NUMERIC,
5919 1: ProtocolBuffer.Encoder.STRING,
5920 2: ProtocolBuffer.Encoder.STRING,
5921 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
5924 _STYLE = """"""
5925 _STYLE_CONTENT_TYPE = """"""
5926 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.RunQueryResponse'
5927 _SERIALIZED_DESCRIPTOR = array.array('B')
5928 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJ1blF1ZXJ5UmVzcG9uc2UTGgViYXRjaCABKAIwCzgCSihhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5RdWVyeVJlc3VsdEJhdGNoowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaDHF1ZXJ5X2hhbmRsZSACKAIwCTgBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
5929 if _net_proto___parse__python is not None:
5930 _net_proto___parse__python.RegisterType(
5931 _SERIALIZED_DESCRIPTOR.tostring())
5933 class ContinueQueryRequest(ProtocolBuffer.ProtocolMessage):
5934 has_query_handle_ = 0
5935 query_handle_ = ""
5937 def __init__(self, contents=None):
5938 if contents is not None: self.MergeFromString(contents)
5940 def query_handle(self): return self.query_handle_
5942 def set_query_handle(self, x):
5943 self.has_query_handle_ = 1
5944 self.query_handle_ = x
5946 def clear_query_handle(self):
5947 if self.has_query_handle_:
5948 self.has_query_handle_ = 0
5949 self.query_handle_ = ""
5951 def has_query_handle(self): return self.has_query_handle_
5954 def MergeFrom(self, x):
5955 assert x is not self
5956 if (x.has_query_handle()): self.set_query_handle(x.query_handle())
5958 if _net_proto___parse__python is not None:
5959 def _CMergeFromString(self, s):
5960 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.ContinueQueryRequest', s)
5962 if _net_proto___parse__python is not None:
5963 def _CEncode(self):
5964 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.ContinueQueryRequest')
5966 if _net_proto___parse__python is not None:
5967 def _CEncodePartial(self):
5968 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.ContinueQueryRequest')
5970 if _net_proto___parse__python is not None:
5971 def _CToASCII(self, output_format):
5972 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.ContinueQueryRequest', output_format)
5975 if _net_proto___parse__python is not None:
5976 def ParseASCII(self, s):
5977 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.ContinueQueryRequest', s)
5980 if _net_proto___parse__python is not None:
5981 def ParseASCIIIgnoreUnknown(self, s):
5982 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.ContinueQueryRequest', s)
5985 def Equals(self, x):
5986 if x is self: return 1
5987 if self.has_query_handle_ != x.has_query_handle_: return 0
5988 if self.has_query_handle_ and self.query_handle_ != x.query_handle_: return 0
5989 return 1
5991 def IsInitialized(self, debug_strs=None):
5992 initialized = 1
5993 if (not self.has_query_handle_):
5994 initialized = 0
5995 if debug_strs is not None:
5996 debug_strs.append('Required field: query_handle not set.')
5997 return initialized
5999 def ByteSize(self):
6000 n = 0
6001 n += self.lengthString(len(self.query_handle_))
6002 return n + 1
6004 def ByteSizePartial(self):
6005 n = 0
6006 if (self.has_query_handle_):
6007 n += 1
6008 n += self.lengthString(len(self.query_handle_))
6009 return n
6011 def Clear(self):
6012 self.clear_query_handle()
6014 def OutputUnchecked(self, out):
6015 out.putVarInt32(10)
6016 out.putPrefixedString(self.query_handle_)
6018 def OutputPartial(self, out):
6019 if (self.has_query_handle_):
6020 out.putVarInt32(10)
6021 out.putPrefixedString(self.query_handle_)
6023 def TryMerge(self, d):
6024 while d.avail() > 0:
6025 tt = d.getVarInt32()
6026 if tt == 10:
6027 self.set_query_handle(d.getPrefixedString())
6028 continue
6031 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
6032 d.skipData(tt)
6035 def __str__(self, prefix="", printElemNumber=0):
6036 res=""
6037 if self.has_query_handle_: res+=prefix+("query_handle: %s\n" % self.DebugFormatString(self.query_handle_))
6038 return res
6041 def _BuildTagLookupTable(sparse, maxtag, default=None):
6042 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
6044 kquery_handle = 1
6046 _TEXT = _BuildTagLookupTable({
6047 0: "ErrorCode",
6048 1: "query_handle",
6049 }, 1)
6051 _TYPES = _BuildTagLookupTable({
6052 0: ProtocolBuffer.Encoder.NUMERIC,
6053 1: ProtocolBuffer.Encoder.STRING,
6054 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
6057 _STYLE = """"""
6058 _STYLE_CONTENT_TYPE = """"""
6059 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.ContinueQueryRequest'
6060 _SERIALIZED_DESCRIPTOR = array.array('B')
6061 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KLGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbnRpbnVlUXVlcnlSZXF1ZXN0ExoMcXVlcnlfaGFuZGxlIAEoAjAJOAIUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
6062 if _net_proto___parse__python is not None:
6063 _net_proto___parse__python.RegisterType(
6064 _SERIALIZED_DESCRIPTOR.tostring())
6066 class ContinueQueryResponse(ProtocolBuffer.ProtocolMessage):
6067 has_batch_ = 0
6069 def __init__(self, contents=None):
6070 self.batch_ = QueryResultBatch()
6071 if contents is not None: self.MergeFromString(contents)
6073 def batch(self): return self.batch_
6075 def mutable_batch(self): self.has_batch_ = 1; return self.batch_
6077 def clear_batch(self):self.has_batch_ = 0; self.batch_.Clear()
6079 def has_batch(self): return self.has_batch_
6082 def MergeFrom(self, x):
6083 assert x is not self
6084 if (x.has_batch()): self.mutable_batch().MergeFrom(x.batch())
6086 if _net_proto___parse__python is not None:
6087 def _CMergeFromString(self, s):
6088 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.ContinueQueryResponse', s)
6090 if _net_proto___parse__python is not None:
6091 def _CEncode(self):
6092 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.ContinueQueryResponse')
6094 if _net_proto___parse__python is not None:
6095 def _CEncodePartial(self):
6096 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.ContinueQueryResponse')
6098 if _net_proto___parse__python is not None:
6099 def _CToASCII(self, output_format):
6100 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.ContinueQueryResponse', output_format)
6103 if _net_proto___parse__python is not None:
6104 def ParseASCII(self, s):
6105 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.ContinueQueryResponse', s)
6108 if _net_proto___parse__python is not None:
6109 def ParseASCIIIgnoreUnknown(self, s):
6110 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.ContinueQueryResponse', s)
6113 def Equals(self, x):
6114 if x is self: return 1
6115 if self.has_batch_ != x.has_batch_: return 0
6116 if self.has_batch_ and self.batch_ != x.batch_: return 0
6117 return 1
6119 def IsInitialized(self, debug_strs=None):
6120 initialized = 1
6121 if (not self.has_batch_):
6122 initialized = 0
6123 if debug_strs is not None:
6124 debug_strs.append('Required field: batch not set.')
6125 elif not self.batch_.IsInitialized(debug_strs): initialized = 0
6126 return initialized
6128 def ByteSize(self):
6129 n = 0
6130 n += self.lengthString(self.batch_.ByteSize())
6131 return n + 1
6133 def ByteSizePartial(self):
6134 n = 0
6135 if (self.has_batch_):
6136 n += 1
6137 n += self.lengthString(self.batch_.ByteSizePartial())
6138 return n
6140 def Clear(self):
6141 self.clear_batch()
6143 def OutputUnchecked(self, out):
6144 out.putVarInt32(10)
6145 out.putVarInt32(self.batch_.ByteSize())
6146 self.batch_.OutputUnchecked(out)
6148 def OutputPartial(self, out):
6149 if (self.has_batch_):
6150 out.putVarInt32(10)
6151 out.putVarInt32(self.batch_.ByteSizePartial())
6152 self.batch_.OutputPartial(out)
6154 def TryMerge(self, d):
6155 while d.avail() > 0:
6156 tt = d.getVarInt32()
6157 if tt == 10:
6158 length = d.getVarInt32()
6159 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
6160 d.skip(length)
6161 self.mutable_batch().TryMerge(tmp)
6162 continue
6165 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
6166 d.skipData(tt)
6169 def __str__(self, prefix="", printElemNumber=0):
6170 res=""
6171 if self.has_batch_:
6172 res+=prefix+"batch <\n"
6173 res+=self.batch_.__str__(prefix + " ", printElemNumber)
6174 res+=prefix+">\n"
6175 return res
6178 def _BuildTagLookupTable(sparse, maxtag, default=None):
6179 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
6181 kbatch = 1
6183 _TEXT = _BuildTagLookupTable({
6184 0: "ErrorCode",
6185 1: "batch",
6186 }, 1)
6188 _TYPES = _BuildTagLookupTable({
6189 0: ProtocolBuffer.Encoder.NUMERIC,
6190 1: ProtocolBuffer.Encoder.STRING,
6191 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
6194 _STYLE = """"""
6195 _STYLE_CONTENT_TYPE = """"""
6196 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.ContinueQueryResponse'
6197 _SERIALIZED_DESCRIPTOR = array.array('B')
6198 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KLWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbnRpbnVlUXVlcnlSZXNwb25zZRMaBWJhdGNoIAEoAjALOAJKKGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlF1ZXJ5UmVzdWx0QmF0Y2ijAaoBBWN0eXBlsgEGcHJvdG8ypAEUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
6199 if _net_proto___parse__python is not None:
6200 _net_proto___parse__python.RegisterType(
6201 _SERIALIZED_DESCRIPTOR.tostring())
6203 class BeginTransactionRequest(ProtocolBuffer.ProtocolMessage):
6204 has_cross_group_ = 0
6205 cross_group_ = 0
6206 has_cross_request_ = 0
6207 cross_request_ = 0
6209 def __init__(self, contents=None):
6210 if contents is not None: self.MergeFromString(contents)
6212 def cross_group(self): return self.cross_group_
6214 def set_cross_group(self, x):
6215 self.has_cross_group_ = 1
6216 self.cross_group_ = x
6218 def clear_cross_group(self):
6219 if self.has_cross_group_:
6220 self.has_cross_group_ = 0
6221 self.cross_group_ = 0
6223 def has_cross_group(self): return self.has_cross_group_
6225 def cross_request(self): return self.cross_request_
6227 def set_cross_request(self, x):
6228 self.has_cross_request_ = 1
6229 self.cross_request_ = x
6231 def clear_cross_request(self):
6232 if self.has_cross_request_:
6233 self.has_cross_request_ = 0
6234 self.cross_request_ = 0
6236 def has_cross_request(self): return self.has_cross_request_
6239 def MergeFrom(self, x):
6240 assert x is not self
6241 if (x.has_cross_group()): self.set_cross_group(x.cross_group())
6242 if (x.has_cross_request()): self.set_cross_request(x.cross_request())
6244 if _net_proto___parse__python is not None:
6245 def _CMergeFromString(self, s):
6246 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.BeginTransactionRequest', s)
6248 if _net_proto___parse__python is not None:
6249 def _CEncode(self):
6250 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.BeginTransactionRequest')
6252 if _net_proto___parse__python is not None:
6253 def _CEncodePartial(self):
6254 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.BeginTransactionRequest')
6256 if _net_proto___parse__python is not None:
6257 def _CToASCII(self, output_format):
6258 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.BeginTransactionRequest', output_format)
6261 if _net_proto___parse__python is not None:
6262 def ParseASCII(self, s):
6263 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.BeginTransactionRequest', s)
6266 if _net_proto___parse__python is not None:
6267 def ParseASCIIIgnoreUnknown(self, s):
6268 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.BeginTransactionRequest', s)
6271 def Equals(self, x):
6272 if x is self: return 1
6273 if self.has_cross_group_ != x.has_cross_group_: return 0
6274 if self.has_cross_group_ and self.cross_group_ != x.cross_group_: return 0
6275 if self.has_cross_request_ != x.has_cross_request_: return 0
6276 if self.has_cross_request_ and self.cross_request_ != x.cross_request_: return 0
6277 return 1
6279 def IsInitialized(self, debug_strs=None):
6280 initialized = 1
6281 return initialized
6283 def ByteSize(self):
6284 n = 0
6285 if (self.has_cross_group_): n += 2
6286 if (self.has_cross_request_): n += 2
6287 return n
6289 def ByteSizePartial(self):
6290 n = 0
6291 if (self.has_cross_group_): n += 2
6292 if (self.has_cross_request_): n += 2
6293 return n
6295 def Clear(self):
6296 self.clear_cross_group()
6297 self.clear_cross_request()
6299 def OutputUnchecked(self, out):
6300 if (self.has_cross_group_):
6301 out.putVarInt32(8)
6302 out.putBoolean(self.cross_group_)
6303 if (self.has_cross_request_):
6304 out.putVarInt32(16)
6305 out.putBoolean(self.cross_request_)
6307 def OutputPartial(self, out):
6308 if (self.has_cross_group_):
6309 out.putVarInt32(8)
6310 out.putBoolean(self.cross_group_)
6311 if (self.has_cross_request_):
6312 out.putVarInt32(16)
6313 out.putBoolean(self.cross_request_)
6315 def TryMerge(self, d):
6316 while d.avail() > 0:
6317 tt = d.getVarInt32()
6318 if tt == 8:
6319 self.set_cross_group(d.getBoolean())
6320 continue
6321 if tt == 16:
6322 self.set_cross_request(d.getBoolean())
6323 continue
6326 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
6327 d.skipData(tt)
6330 def __str__(self, prefix="", printElemNumber=0):
6331 res=""
6332 if self.has_cross_group_: res+=prefix+("cross_group: %s\n" % self.DebugFormatBool(self.cross_group_))
6333 if self.has_cross_request_: res+=prefix+("cross_request: %s\n" % self.DebugFormatBool(self.cross_request_))
6334 return res
6337 def _BuildTagLookupTable(sparse, maxtag, default=None):
6338 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
6340 kcross_group = 1
6341 kcross_request = 2
6343 _TEXT = _BuildTagLookupTable({
6344 0: "ErrorCode",
6345 1: "cross_group",
6346 2: "cross_request",
6347 }, 2)
6349 _TYPES = _BuildTagLookupTable({
6350 0: ProtocolBuffer.Encoder.NUMERIC,
6351 1: ProtocolBuffer.Encoder.NUMERIC,
6352 2: ProtocolBuffer.Encoder.NUMERIC,
6353 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
6356 _STYLE = """"""
6357 _STYLE_CONTENT_TYPE = """"""
6358 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.BeginTransactionRequest'
6359 _SERIALIZED_DESCRIPTOR = array.array('B')
6360 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KL2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkJlZ2luVHJhbnNhY3Rpb25SZXF1ZXN0ExoLY3Jvc3NfZ3JvdXAgASgAMAg4AUIFZmFsc2WjAaoBB2RlZmF1bHSyAQVmYWxzZaQBFBMaDWNyb3NzX3JlcXVlc3QgAigAMAg4AUIFZmFsc2WjAaoBB2RlZmF1bHSyAQVmYWxzZaQBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
6361 if _net_proto___parse__python is not None:
6362 _net_proto___parse__python.RegisterType(
6363 _SERIALIZED_DESCRIPTOR.tostring())
6365 class BeginTransactionResponse(ProtocolBuffer.ProtocolMessage):
6366 has_transaction_ = 0
6367 transaction_ = ""
6369 def __init__(self, contents=None):
6370 if contents is not None: self.MergeFromString(contents)
6372 def transaction(self): return self.transaction_
6374 def set_transaction(self, x):
6375 self.has_transaction_ = 1
6376 self.transaction_ = x
6378 def clear_transaction(self):
6379 if self.has_transaction_:
6380 self.has_transaction_ = 0
6381 self.transaction_ = ""
6383 def has_transaction(self): return self.has_transaction_
6386 def MergeFrom(self, x):
6387 assert x is not self
6388 if (x.has_transaction()): self.set_transaction(x.transaction())
6390 if _net_proto___parse__python is not None:
6391 def _CMergeFromString(self, s):
6392 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.BeginTransactionResponse', s)
6394 if _net_proto___parse__python is not None:
6395 def _CEncode(self):
6396 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.BeginTransactionResponse')
6398 if _net_proto___parse__python is not None:
6399 def _CEncodePartial(self):
6400 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.BeginTransactionResponse')
6402 if _net_proto___parse__python is not None:
6403 def _CToASCII(self, output_format):
6404 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.BeginTransactionResponse', output_format)
6407 if _net_proto___parse__python is not None:
6408 def ParseASCII(self, s):
6409 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.BeginTransactionResponse', s)
6412 if _net_proto___parse__python is not None:
6413 def ParseASCIIIgnoreUnknown(self, s):
6414 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.BeginTransactionResponse', s)
6417 def Equals(self, x):
6418 if x is self: return 1
6419 if self.has_transaction_ != x.has_transaction_: return 0
6420 if self.has_transaction_ and self.transaction_ != x.transaction_: return 0
6421 return 1
6423 def IsInitialized(self, debug_strs=None):
6424 initialized = 1
6425 if (not self.has_transaction_):
6426 initialized = 0
6427 if debug_strs is not None:
6428 debug_strs.append('Required field: transaction not set.')
6429 return initialized
6431 def ByteSize(self):
6432 n = 0
6433 n += self.lengthString(len(self.transaction_))
6434 return n + 1
6436 def ByteSizePartial(self):
6437 n = 0
6438 if (self.has_transaction_):
6439 n += 1
6440 n += self.lengthString(len(self.transaction_))
6441 return n
6443 def Clear(self):
6444 self.clear_transaction()
6446 def OutputUnchecked(self, out):
6447 out.putVarInt32(10)
6448 out.putPrefixedString(self.transaction_)
6450 def OutputPartial(self, out):
6451 if (self.has_transaction_):
6452 out.putVarInt32(10)
6453 out.putPrefixedString(self.transaction_)
6455 def TryMerge(self, d):
6456 while d.avail() > 0:
6457 tt = d.getVarInt32()
6458 if tt == 10:
6459 self.set_transaction(d.getPrefixedString())
6460 continue
6463 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
6464 d.skipData(tt)
6467 def __str__(self, prefix="", printElemNumber=0):
6468 res=""
6469 if self.has_transaction_: res+=prefix+("transaction: %s\n" % self.DebugFormatString(self.transaction_))
6470 return res
6473 def _BuildTagLookupTable(sparse, maxtag, default=None):
6474 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
6476 ktransaction = 1
6478 _TEXT = _BuildTagLookupTable({
6479 0: "ErrorCode",
6480 1: "transaction",
6481 }, 1)
6483 _TYPES = _BuildTagLookupTable({
6484 0: ProtocolBuffer.Encoder.NUMERIC,
6485 1: ProtocolBuffer.Encoder.STRING,
6486 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
6489 _STYLE = """"""
6490 _STYLE_CONTENT_TYPE = """"""
6491 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.BeginTransactionResponse'
6492 _SERIALIZED_DESCRIPTOR = array.array('B')
6493 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KMGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkJlZ2luVHJhbnNhY3Rpb25SZXNwb25zZRMaC3RyYW5zYWN0aW9uIAEoAjAJOAIUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
6494 if _net_proto___parse__python is not None:
6495 _net_proto___parse__python.RegisterType(
6496 _SERIALIZED_DESCRIPTOR.tostring())
6498 class RollbackRequest(ProtocolBuffer.ProtocolMessage):
6499 has_transaction_ = 0
6500 transaction_ = ""
6502 def __init__(self, contents=None):
6503 if contents is not None: self.MergeFromString(contents)
6505 def transaction(self): return self.transaction_
6507 def set_transaction(self, x):
6508 self.has_transaction_ = 1
6509 self.transaction_ = x
6511 def clear_transaction(self):
6512 if self.has_transaction_:
6513 self.has_transaction_ = 0
6514 self.transaction_ = ""
6516 def has_transaction(self): return self.has_transaction_
6519 def MergeFrom(self, x):
6520 assert x is not self
6521 if (x.has_transaction()): self.set_transaction(x.transaction())
6523 if _net_proto___parse__python is not None:
6524 def _CMergeFromString(self, s):
6525 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.RollbackRequest', s)
6527 if _net_proto___parse__python is not None:
6528 def _CEncode(self):
6529 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.RollbackRequest')
6531 if _net_proto___parse__python is not None:
6532 def _CEncodePartial(self):
6533 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.RollbackRequest')
6535 if _net_proto___parse__python is not None:
6536 def _CToASCII(self, output_format):
6537 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.RollbackRequest', output_format)
6540 if _net_proto___parse__python is not None:
6541 def ParseASCII(self, s):
6542 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.RollbackRequest', s)
6545 if _net_proto___parse__python is not None:
6546 def ParseASCIIIgnoreUnknown(self, s):
6547 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.RollbackRequest', s)
6550 def Equals(self, x):
6551 if x is self: return 1
6552 if self.has_transaction_ != x.has_transaction_: return 0
6553 if self.has_transaction_ and self.transaction_ != x.transaction_: return 0
6554 return 1
6556 def IsInitialized(self, debug_strs=None):
6557 initialized = 1
6558 if (not self.has_transaction_):
6559 initialized = 0
6560 if debug_strs is not None:
6561 debug_strs.append('Required field: transaction not set.')
6562 return initialized
6564 def ByteSize(self):
6565 n = 0
6566 n += self.lengthString(len(self.transaction_))
6567 return n + 1
6569 def ByteSizePartial(self):
6570 n = 0
6571 if (self.has_transaction_):
6572 n += 1
6573 n += self.lengthString(len(self.transaction_))
6574 return n
6576 def Clear(self):
6577 self.clear_transaction()
6579 def OutputUnchecked(self, out):
6580 out.putVarInt32(10)
6581 out.putPrefixedString(self.transaction_)
6583 def OutputPartial(self, out):
6584 if (self.has_transaction_):
6585 out.putVarInt32(10)
6586 out.putPrefixedString(self.transaction_)
6588 def TryMerge(self, d):
6589 while d.avail() > 0:
6590 tt = d.getVarInt32()
6591 if tt == 10:
6592 self.set_transaction(d.getPrefixedString())
6593 continue
6596 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
6597 d.skipData(tt)
6600 def __str__(self, prefix="", printElemNumber=0):
6601 res=""
6602 if self.has_transaction_: res+=prefix+("transaction: %s\n" % self.DebugFormatString(self.transaction_))
6603 return res
6606 def _BuildTagLookupTable(sparse, maxtag, default=None):
6607 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
6609 ktransaction = 1
6611 _TEXT = _BuildTagLookupTable({
6612 0: "ErrorCode",
6613 1: "transaction",
6614 }, 1)
6616 _TYPES = _BuildTagLookupTable({
6617 0: ProtocolBuffer.Encoder.NUMERIC,
6618 1: ProtocolBuffer.Encoder.STRING,
6619 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
6622 _STYLE = """"""
6623 _STYLE_CONTENT_TYPE = """"""
6624 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.RollbackRequest'
6625 _SERIALIZED_DESCRIPTOR = array.array('B')
6626 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJ2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJvbGxiYWNrUmVxdWVzdBMaC3RyYW5zYWN0aW9uIAEoAjAJOAIUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
6627 if _net_proto___parse__python is not None:
6628 _net_proto___parse__python.RegisterType(
6629 _SERIALIZED_DESCRIPTOR.tostring())
6631 class RollbackResponse(ProtocolBuffer.ProtocolMessage):
6633 def __init__(self, contents=None):
6634 pass
6635 if contents is not None: self.MergeFromString(contents)
6638 def MergeFrom(self, x):
6639 assert x is not self
6641 if _net_proto___parse__python is not None:
6642 def _CMergeFromString(self, s):
6643 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.RollbackResponse', s)
6645 if _net_proto___parse__python is not None:
6646 def _CEncode(self):
6647 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.RollbackResponse')
6649 if _net_proto___parse__python is not None:
6650 def _CEncodePartial(self):
6651 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.RollbackResponse')
6653 if _net_proto___parse__python is not None:
6654 def _CToASCII(self, output_format):
6655 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.RollbackResponse', output_format)
6658 if _net_proto___parse__python is not None:
6659 def ParseASCII(self, s):
6660 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.RollbackResponse', s)
6663 if _net_proto___parse__python is not None:
6664 def ParseASCIIIgnoreUnknown(self, s):
6665 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.RollbackResponse', s)
6668 def Equals(self, x):
6669 if x is self: return 1
6670 return 1
6672 def IsInitialized(self, debug_strs=None):
6673 initialized = 1
6674 return initialized
6676 def ByteSize(self):
6677 n = 0
6678 return n
6680 def ByteSizePartial(self):
6681 n = 0
6682 return n
6684 def Clear(self):
6685 pass
6687 def OutputUnchecked(self, out):
6688 pass
6690 def OutputPartial(self, out):
6691 pass
6693 def TryMerge(self, d):
6694 while d.avail() > 0:
6695 tt = d.getVarInt32()
6698 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
6699 d.skipData(tt)
6702 def __str__(self, prefix="", printElemNumber=0):
6703 res=""
6704 return res
6707 def _BuildTagLookupTable(sparse, maxtag, default=None):
6708 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
6711 _TEXT = _BuildTagLookupTable({
6712 0: "ErrorCode",
6713 }, 0)
6715 _TYPES = _BuildTagLookupTable({
6716 0: ProtocolBuffer.Encoder.NUMERIC,
6717 }, 0, ProtocolBuffer.Encoder.MAX_TYPE)
6720 _STYLE = """"""
6721 _STYLE_CONTENT_TYPE = """"""
6722 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.RollbackResponse'
6723 _SERIALIZED_DESCRIPTOR = array.array('B')
6724 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlJvbGxiYWNrUmVzcG9uc2XCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
6725 if _net_proto___parse__python is not None:
6726 _net_proto___parse__python.RegisterType(
6727 _SERIALIZED_DESCRIPTOR.tostring())
6729 class CommitRequest(ProtocolBuffer.ProtocolMessage):
6732 TRANSACTIONAL = 1
6733 NON_TRANSACTIONAL = 2
6735 _Mode_NAMES = {
6736 1: "TRANSACTIONAL",
6737 2: "NON_TRANSACTIONAL",
6740 def Mode_Name(cls, x): return cls._Mode_NAMES.get(x, "")
6741 Mode_Name = classmethod(Mode_Name)
6743 has_transaction_ = 0
6744 transaction_ = ""
6745 has_deprecated_mutation_ = 0
6746 deprecated_mutation_ = None
6747 has_mode_ = 0
6748 mode_ = 1
6749 has_ignore_read_only_ = 0
6750 ignore_read_only_ = 0
6752 def __init__(self, contents=None):
6753 self.mutation_ = []
6754 self.lazy_init_lock_ = thread.allocate_lock()
6755 if contents is not None: self.MergeFromString(contents)
6757 def transaction(self): return self.transaction_
6759 def set_transaction(self, x):
6760 self.has_transaction_ = 1
6761 self.transaction_ = x
6763 def clear_transaction(self):
6764 if self.has_transaction_:
6765 self.has_transaction_ = 0
6766 self.transaction_ = ""
6768 def has_transaction(self): return self.has_transaction_
6770 def mutation_size(self): return len(self.mutation_)
6771 def mutation_list(self): return self.mutation_
6773 def mutation(self, i):
6774 return self.mutation_[i]
6776 def mutable_mutation(self, i):
6777 return self.mutation_[i]
6779 def add_mutation(self):
6780 x = Mutation()
6781 self.mutation_.append(x)
6782 return x
6784 def clear_mutation(self):
6785 self.mutation_ = []
6786 def deprecated_mutation(self):
6787 if self.deprecated_mutation_ is None:
6788 self.lazy_init_lock_.acquire()
6789 try:
6790 if self.deprecated_mutation_ is None: self.deprecated_mutation_ = DeprecatedMutation()
6791 finally:
6792 self.lazy_init_lock_.release()
6793 return self.deprecated_mutation_
6795 def mutable_deprecated_mutation(self): self.has_deprecated_mutation_ = 1; return self.deprecated_mutation()
6797 def clear_deprecated_mutation(self):
6799 if self.has_deprecated_mutation_:
6800 self.has_deprecated_mutation_ = 0;
6801 if self.deprecated_mutation_ is not None: self.deprecated_mutation_.Clear()
6803 def has_deprecated_mutation(self): return self.has_deprecated_mutation_
6805 def mode(self): return self.mode_
6807 def set_mode(self, x):
6808 self.has_mode_ = 1
6809 self.mode_ = x
6811 def clear_mode(self):
6812 if self.has_mode_:
6813 self.has_mode_ = 0
6814 self.mode_ = 1
6816 def has_mode(self): return self.has_mode_
6818 def ignore_read_only(self): return self.ignore_read_only_
6820 def set_ignore_read_only(self, x):
6821 self.has_ignore_read_only_ = 1
6822 self.ignore_read_only_ = x
6824 def clear_ignore_read_only(self):
6825 if self.has_ignore_read_only_:
6826 self.has_ignore_read_only_ = 0
6827 self.ignore_read_only_ = 0
6829 def has_ignore_read_only(self): return self.has_ignore_read_only_
6832 def MergeFrom(self, x):
6833 assert x is not self
6834 if (x.has_transaction()): self.set_transaction(x.transaction())
6835 for i in xrange(x.mutation_size()): self.add_mutation().CopyFrom(x.mutation(i))
6836 if (x.has_deprecated_mutation()): self.mutable_deprecated_mutation().MergeFrom(x.deprecated_mutation())
6837 if (x.has_mode()): self.set_mode(x.mode())
6838 if (x.has_ignore_read_only()): self.set_ignore_read_only(x.ignore_read_only())
6840 if _net_proto___parse__python is not None:
6841 def _CMergeFromString(self, s):
6842 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.CommitRequest', s)
6844 if _net_proto___parse__python is not None:
6845 def _CEncode(self):
6846 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.CommitRequest')
6848 if _net_proto___parse__python is not None:
6849 def _CEncodePartial(self):
6850 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.CommitRequest')
6852 if _net_proto___parse__python is not None:
6853 def _CToASCII(self, output_format):
6854 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.CommitRequest', output_format)
6857 if _net_proto___parse__python is not None:
6858 def ParseASCII(self, s):
6859 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.CommitRequest', s)
6862 if _net_proto___parse__python is not None:
6863 def ParseASCIIIgnoreUnknown(self, s):
6864 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.CommitRequest', s)
6867 def Equals(self, x):
6868 if x is self: return 1
6869 if self.has_transaction_ != x.has_transaction_: return 0
6870 if self.has_transaction_ and self.transaction_ != x.transaction_: return 0
6871 if len(self.mutation_) != len(x.mutation_): return 0
6872 for e1, e2 in zip(self.mutation_, x.mutation_):
6873 if e1 != e2: return 0
6874 if self.has_deprecated_mutation_ != x.has_deprecated_mutation_: return 0
6875 if self.has_deprecated_mutation_ and self.deprecated_mutation_ != x.deprecated_mutation_: return 0
6876 if self.has_mode_ != x.has_mode_: return 0
6877 if self.has_mode_ and self.mode_ != x.mode_: return 0
6878 if self.has_ignore_read_only_ != x.has_ignore_read_only_: return 0
6879 if self.has_ignore_read_only_ and self.ignore_read_only_ != x.ignore_read_only_: return 0
6880 return 1
6882 def IsInitialized(self, debug_strs=None):
6883 initialized = 1
6884 for p in self.mutation_:
6885 if not p.IsInitialized(debug_strs): initialized=0
6886 if (self.has_deprecated_mutation_ and not self.deprecated_mutation_.IsInitialized(debug_strs)): initialized = 0
6887 return initialized
6889 def ByteSize(self):
6890 n = 0
6891 if (self.has_transaction_): n += 1 + self.lengthString(len(self.transaction_))
6892 n += 1 * len(self.mutation_)
6893 for i in xrange(len(self.mutation_)): n += self.lengthString(self.mutation_[i].ByteSize())
6894 if (self.has_deprecated_mutation_): n += 1 + self.lengthString(self.deprecated_mutation_.ByteSize())
6895 if (self.has_mode_): n += 1 + self.lengthVarInt64(self.mode_)
6896 if (self.has_ignore_read_only_): n += 2
6897 return n
6899 def ByteSizePartial(self):
6900 n = 0
6901 if (self.has_transaction_): n += 1 + self.lengthString(len(self.transaction_))
6902 n += 1 * len(self.mutation_)
6903 for i in xrange(len(self.mutation_)): n += self.lengthString(self.mutation_[i].ByteSizePartial())
6904 if (self.has_deprecated_mutation_): n += 1 + self.lengthString(self.deprecated_mutation_.ByteSizePartial())
6905 if (self.has_mode_): n += 1 + self.lengthVarInt64(self.mode_)
6906 if (self.has_ignore_read_only_): n += 2
6907 return n
6909 def Clear(self):
6910 self.clear_transaction()
6911 self.clear_mutation()
6912 self.clear_deprecated_mutation()
6913 self.clear_mode()
6914 self.clear_ignore_read_only()
6916 def OutputUnchecked(self, out):
6917 if (self.has_transaction_):
6918 out.putVarInt32(10)
6919 out.putPrefixedString(self.transaction_)
6920 if (self.has_deprecated_mutation_):
6921 out.putVarInt32(18)
6922 out.putVarInt32(self.deprecated_mutation_.ByteSize())
6923 self.deprecated_mutation_.OutputUnchecked(out)
6924 if (self.has_mode_):
6925 out.putVarInt32(32)
6926 out.putVarInt32(self.mode_)
6927 for i in xrange(len(self.mutation_)):
6928 out.putVarInt32(42)
6929 out.putVarInt32(self.mutation_[i].ByteSize())
6930 self.mutation_[i].OutputUnchecked(out)
6931 if (self.has_ignore_read_only_):
6932 out.putVarInt32(48)
6933 out.putBoolean(self.ignore_read_only_)
6935 def OutputPartial(self, out):
6936 if (self.has_transaction_):
6937 out.putVarInt32(10)
6938 out.putPrefixedString(self.transaction_)
6939 if (self.has_deprecated_mutation_):
6940 out.putVarInt32(18)
6941 out.putVarInt32(self.deprecated_mutation_.ByteSizePartial())
6942 self.deprecated_mutation_.OutputPartial(out)
6943 if (self.has_mode_):
6944 out.putVarInt32(32)
6945 out.putVarInt32(self.mode_)
6946 for i in xrange(len(self.mutation_)):
6947 out.putVarInt32(42)
6948 out.putVarInt32(self.mutation_[i].ByteSizePartial())
6949 self.mutation_[i].OutputPartial(out)
6950 if (self.has_ignore_read_only_):
6951 out.putVarInt32(48)
6952 out.putBoolean(self.ignore_read_only_)
6954 def TryMerge(self, d):
6955 while d.avail() > 0:
6956 tt = d.getVarInt32()
6957 if tt == 10:
6958 self.set_transaction(d.getPrefixedString())
6959 continue
6960 if tt == 18:
6961 length = d.getVarInt32()
6962 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
6963 d.skip(length)
6964 self.mutable_deprecated_mutation().TryMerge(tmp)
6965 continue
6966 if tt == 32:
6967 self.set_mode(d.getVarInt32())
6968 continue
6969 if tt == 42:
6970 length = d.getVarInt32()
6971 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
6972 d.skip(length)
6973 self.add_mutation().TryMerge(tmp)
6974 continue
6975 if tt == 48:
6976 self.set_ignore_read_only(d.getBoolean())
6977 continue
6980 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
6981 d.skipData(tt)
6984 def __str__(self, prefix="", printElemNumber=0):
6985 res=""
6986 if self.has_transaction_: res+=prefix+("transaction: %s\n" % self.DebugFormatString(self.transaction_))
6987 cnt=0
6988 for e in self.mutation_:
6989 elm=""
6990 if printElemNumber: elm="(%d)" % cnt
6991 res+=prefix+("mutation%s <\n" % elm)
6992 res+=e.__str__(prefix + " ", printElemNumber)
6993 res+=prefix+">\n"
6994 cnt+=1
6995 if self.has_deprecated_mutation_:
6996 res+=prefix+"deprecated_mutation <\n"
6997 res+=self.deprecated_mutation_.__str__(prefix + " ", printElemNumber)
6998 res+=prefix+">\n"
6999 if self.has_mode_: res+=prefix+("mode: %s\n" % self.DebugFormatInt32(self.mode_))
7000 if self.has_ignore_read_only_: res+=prefix+("ignore_read_only: %s\n" % self.DebugFormatBool(self.ignore_read_only_))
7001 return res
7004 def _BuildTagLookupTable(sparse, maxtag, default=None):
7005 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
7007 ktransaction = 1
7008 kmutation = 5
7009 kdeprecated_mutation = 2
7010 kmode = 4
7011 kignore_read_only = 6
7013 _TEXT = _BuildTagLookupTable({
7014 0: "ErrorCode",
7015 1: "transaction",
7016 2: "deprecated_mutation",
7017 4: "mode",
7018 5: "mutation",
7019 6: "ignore_read_only",
7020 }, 6)
7022 _TYPES = _BuildTagLookupTable({
7023 0: ProtocolBuffer.Encoder.NUMERIC,
7024 1: ProtocolBuffer.Encoder.STRING,
7025 2: ProtocolBuffer.Encoder.STRING,
7026 4: ProtocolBuffer.Encoder.NUMERIC,
7027 5: ProtocolBuffer.Encoder.STRING,
7028 6: ProtocolBuffer.Encoder.NUMERIC,
7029 }, 6, ProtocolBuffer.Encoder.MAX_TYPE)
7032 _STYLE = """"""
7033 _STYLE_CONTENT_TYPE = """"""
7034 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.CommitRequest'
7035 _SERIALIZED_DESCRIPTOR = array.array('B')
7036 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbW1pdFJlcXVlc3QTGgt0cmFuc2FjdGlvbiABKAIwCTgBFBMaCG11dGF0aW9uIAUoAjALOANKIGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaE2RlcHJlY2F0ZWRfbXV0YXRpb24gAigCMAs4AUoqYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRGVwcmVjYXRlZE11dGF0aW9uowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaBG1vZGUgBCgAMAU4AUIBMWgAowGqAQdkZWZhdWx0sgENVFJBTlNBQ1RJT05BTKQBFBMaEGlnbm9yZV9yZWFkX29ubHkgBigAMAg4AUIFZmFsc2WjAaoBB2RlZmF1bHSyAQVmYWxzZaQBFHN6BE1vZGWLAZIBDVRSQU5TQUNUSU9OQUyYAQGMAYsBkgERTk9OX1RSQU5TQUNUSU9OQUyYAQKMAXTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
7037 if _net_proto___parse__python is not None:
7038 _net_proto___parse__python.RegisterType(
7039 _SERIALIZED_DESCRIPTOR.tostring())
7041 class CommitResponse(ProtocolBuffer.ProtocolMessage):
7042 has_deprecated_mutation_result_ = 0
7043 deprecated_mutation_result_ = None
7044 has_index_updates_ = 0
7045 index_updates_ = 0
7047 def __init__(self, contents=None):
7048 self.mutation_result_ = []
7049 self.lazy_init_lock_ = thread.allocate_lock()
7050 if contents is not None: self.MergeFromString(contents)
7052 def mutation_result_size(self): return len(self.mutation_result_)
7053 def mutation_result_list(self): return self.mutation_result_
7055 def mutation_result(self, i):
7056 return self.mutation_result_[i]
7058 def mutable_mutation_result(self, i):
7059 return self.mutation_result_[i]
7061 def add_mutation_result(self):
7062 x = MutationResult()
7063 self.mutation_result_.append(x)
7064 return x
7066 def clear_mutation_result(self):
7067 self.mutation_result_ = []
7068 def deprecated_mutation_result(self):
7069 if self.deprecated_mutation_result_ is None:
7070 self.lazy_init_lock_.acquire()
7071 try:
7072 if self.deprecated_mutation_result_ is None: self.deprecated_mutation_result_ = DeprecatedMutationResult()
7073 finally:
7074 self.lazy_init_lock_.release()
7075 return self.deprecated_mutation_result_
7077 def mutable_deprecated_mutation_result(self): self.has_deprecated_mutation_result_ = 1; return self.deprecated_mutation_result()
7079 def clear_deprecated_mutation_result(self):
7081 if self.has_deprecated_mutation_result_:
7082 self.has_deprecated_mutation_result_ = 0;
7083 if self.deprecated_mutation_result_ is not None: self.deprecated_mutation_result_.Clear()
7085 def has_deprecated_mutation_result(self): return self.has_deprecated_mutation_result_
7087 def index_updates(self): return self.index_updates_
7089 def set_index_updates(self, x):
7090 self.has_index_updates_ = 1
7091 self.index_updates_ = x
7093 def clear_index_updates(self):
7094 if self.has_index_updates_:
7095 self.has_index_updates_ = 0
7096 self.index_updates_ = 0
7098 def has_index_updates(self): return self.has_index_updates_
7101 def MergeFrom(self, x):
7102 assert x is not self
7103 for i in xrange(x.mutation_result_size()): self.add_mutation_result().CopyFrom(x.mutation_result(i))
7104 if (x.has_deprecated_mutation_result()): self.mutable_deprecated_mutation_result().MergeFrom(x.deprecated_mutation_result())
7105 if (x.has_index_updates()): self.set_index_updates(x.index_updates())
7107 if _net_proto___parse__python is not None:
7108 def _CMergeFromString(self, s):
7109 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.CommitResponse', s)
7111 if _net_proto___parse__python is not None:
7112 def _CEncode(self):
7113 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.CommitResponse')
7115 if _net_proto___parse__python is not None:
7116 def _CEncodePartial(self):
7117 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.CommitResponse')
7119 if _net_proto___parse__python is not None:
7120 def _CToASCII(self, output_format):
7121 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.CommitResponse', output_format)
7124 if _net_proto___parse__python is not None:
7125 def ParseASCII(self, s):
7126 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.CommitResponse', s)
7129 if _net_proto___parse__python is not None:
7130 def ParseASCIIIgnoreUnknown(self, s):
7131 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.CommitResponse', s)
7134 def Equals(self, x):
7135 if x is self: return 1
7136 if len(self.mutation_result_) != len(x.mutation_result_): return 0
7137 for e1, e2 in zip(self.mutation_result_, x.mutation_result_):
7138 if e1 != e2: return 0
7139 if self.has_deprecated_mutation_result_ != x.has_deprecated_mutation_result_: return 0
7140 if self.has_deprecated_mutation_result_ and self.deprecated_mutation_result_ != x.deprecated_mutation_result_: return 0
7141 if self.has_index_updates_ != x.has_index_updates_: return 0
7142 if self.has_index_updates_ and self.index_updates_ != x.index_updates_: return 0
7143 return 1
7145 def IsInitialized(self, debug_strs=None):
7146 initialized = 1
7147 for p in self.mutation_result_:
7148 if not p.IsInitialized(debug_strs): initialized=0
7149 if (self.has_deprecated_mutation_result_ and not self.deprecated_mutation_result_.IsInitialized(debug_strs)): initialized = 0
7150 return initialized
7152 def ByteSize(self):
7153 n = 0
7154 n += 1 * len(self.mutation_result_)
7155 for i in xrange(len(self.mutation_result_)): n += self.lengthString(self.mutation_result_[i].ByteSize())
7156 if (self.has_deprecated_mutation_result_): n += 1 + self.lengthString(self.deprecated_mutation_result_.ByteSize())
7157 if (self.has_index_updates_): n += 1 + self.lengthVarInt64(self.index_updates_)
7158 return n
7160 def ByteSizePartial(self):
7161 n = 0
7162 n += 1 * len(self.mutation_result_)
7163 for i in xrange(len(self.mutation_result_)): n += self.lengthString(self.mutation_result_[i].ByteSizePartial())
7164 if (self.has_deprecated_mutation_result_): n += 1 + self.lengthString(self.deprecated_mutation_result_.ByteSizePartial())
7165 if (self.has_index_updates_): n += 1 + self.lengthVarInt64(self.index_updates_)
7166 return n
7168 def Clear(self):
7169 self.clear_mutation_result()
7170 self.clear_deprecated_mutation_result()
7171 self.clear_index_updates()
7173 def OutputUnchecked(self, out):
7174 if (self.has_deprecated_mutation_result_):
7175 out.putVarInt32(10)
7176 out.putVarInt32(self.deprecated_mutation_result_.ByteSize())
7177 self.deprecated_mutation_result_.OutputUnchecked(out)
7178 for i in xrange(len(self.mutation_result_)):
7179 out.putVarInt32(26)
7180 out.putVarInt32(self.mutation_result_[i].ByteSize())
7181 self.mutation_result_[i].OutputUnchecked(out)
7182 if (self.has_index_updates_):
7183 out.putVarInt32(32)
7184 out.putVarInt32(self.index_updates_)
7186 def OutputPartial(self, out):
7187 if (self.has_deprecated_mutation_result_):
7188 out.putVarInt32(10)
7189 out.putVarInt32(self.deprecated_mutation_result_.ByteSizePartial())
7190 self.deprecated_mutation_result_.OutputPartial(out)
7191 for i in xrange(len(self.mutation_result_)):
7192 out.putVarInt32(26)
7193 out.putVarInt32(self.mutation_result_[i].ByteSizePartial())
7194 self.mutation_result_[i].OutputPartial(out)
7195 if (self.has_index_updates_):
7196 out.putVarInt32(32)
7197 out.putVarInt32(self.index_updates_)
7199 def TryMerge(self, d):
7200 while d.avail() > 0:
7201 tt = d.getVarInt32()
7202 if tt == 10:
7203 length = d.getVarInt32()
7204 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
7205 d.skip(length)
7206 self.mutable_deprecated_mutation_result().TryMerge(tmp)
7207 continue
7208 if tt == 26:
7209 length = d.getVarInt32()
7210 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
7211 d.skip(length)
7212 self.add_mutation_result().TryMerge(tmp)
7213 continue
7214 if tt == 32:
7215 self.set_index_updates(d.getVarInt32())
7216 continue
7219 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
7220 d.skipData(tt)
7223 def __str__(self, prefix="", printElemNumber=0):
7224 res=""
7225 cnt=0
7226 for e in self.mutation_result_:
7227 elm=""
7228 if printElemNumber: elm="(%d)" % cnt
7229 res+=prefix+("mutation_result%s <\n" % elm)
7230 res+=e.__str__(prefix + " ", printElemNumber)
7231 res+=prefix+">\n"
7232 cnt+=1
7233 if self.has_deprecated_mutation_result_:
7234 res+=prefix+"deprecated_mutation_result <\n"
7235 res+=self.deprecated_mutation_result_.__str__(prefix + " ", printElemNumber)
7236 res+=prefix+">\n"
7237 if self.has_index_updates_: res+=prefix+("index_updates: %s\n" % self.DebugFormatInt32(self.index_updates_))
7238 return res
7241 def _BuildTagLookupTable(sparse, maxtag, default=None):
7242 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
7244 kmutation_result = 3
7245 kdeprecated_mutation_result = 1
7246 kindex_updates = 4
7248 _TEXT = _BuildTagLookupTable({
7249 0: "ErrorCode",
7250 1: "deprecated_mutation_result",
7251 3: "mutation_result",
7252 4: "index_updates",
7253 }, 4)
7255 _TYPES = _BuildTagLookupTable({
7256 0: ProtocolBuffer.Encoder.NUMERIC,
7257 1: ProtocolBuffer.Encoder.STRING,
7258 3: ProtocolBuffer.Encoder.STRING,
7259 4: ProtocolBuffer.Encoder.NUMERIC,
7260 }, 4, ProtocolBuffer.Encoder.MAX_TYPE)
7263 _STYLE = """"""
7264 _STYLE_CONTENT_TYPE = """"""
7265 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.CommitResponse'
7266 _SERIALIZED_DESCRIPTOR = array.array('B')
7267 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbW1pdFJlc3BvbnNlExoPbXV0YXRpb25fcmVzdWx0IAMoAjALOANKJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uUmVzdWx0owGqAQVjdHlwZbIBBnByb3RvMqQBFBMaGmRlcHJlY2F0ZWRfbXV0YXRpb25fcmVzdWx0IAEoAjALOAFKMGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkRlcHJlY2F0ZWRNdXRhdGlvblJlc3VsdKMBqgEFY3R5cGWyAQZwcm90bzKkARQTGg1pbmRleF91cGRhdGVzIAQoADAFOAEUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
7268 if _net_proto___parse__python is not None:
7269 _net_proto___parse__python.RegisterType(
7270 _SERIALIZED_DESCRIPTOR.tostring())
7272 class AllocateIdsRequest(ProtocolBuffer.ProtocolMessage):
7274 def __init__(self, contents=None):
7275 self.allocate_ = []
7276 self.reserve_ = []
7277 if contents is not None: self.MergeFromString(contents)
7279 def allocate_size(self): return len(self.allocate_)
7280 def allocate_list(self): return self.allocate_
7282 def allocate(self, i):
7283 return self.allocate_[i]
7285 def mutable_allocate(self, i):
7286 return self.allocate_[i]
7288 def add_allocate(self):
7289 x = google.appengine.datastore.entity_v4_pb.Key()
7290 self.allocate_.append(x)
7291 return x
7293 def clear_allocate(self):
7294 self.allocate_ = []
7295 def reserve_size(self): return len(self.reserve_)
7296 def reserve_list(self): return self.reserve_
7298 def reserve(self, i):
7299 return self.reserve_[i]
7301 def mutable_reserve(self, i):
7302 return self.reserve_[i]
7304 def add_reserve(self):
7305 x = google.appengine.datastore.entity_v4_pb.Key()
7306 self.reserve_.append(x)
7307 return x
7309 def clear_reserve(self):
7310 self.reserve_ = []
7312 def MergeFrom(self, x):
7313 assert x is not self
7314 for i in xrange(x.allocate_size()): self.add_allocate().CopyFrom(x.allocate(i))
7315 for i in xrange(x.reserve_size()): self.add_reserve().CopyFrom(x.reserve(i))
7317 if _net_proto___parse__python is not None:
7318 def _CMergeFromString(self, s):
7319 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.AllocateIdsRequest', s)
7321 if _net_proto___parse__python is not None:
7322 def _CEncode(self):
7323 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.AllocateIdsRequest')
7325 if _net_proto___parse__python is not None:
7326 def _CEncodePartial(self):
7327 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.AllocateIdsRequest')
7329 if _net_proto___parse__python is not None:
7330 def _CToASCII(self, output_format):
7331 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.AllocateIdsRequest', output_format)
7334 if _net_proto___parse__python is not None:
7335 def ParseASCII(self, s):
7336 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.AllocateIdsRequest', s)
7339 if _net_proto___parse__python is not None:
7340 def ParseASCIIIgnoreUnknown(self, s):
7341 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.AllocateIdsRequest', s)
7344 def Equals(self, x):
7345 if x is self: return 1
7346 if len(self.allocate_) != len(x.allocate_): return 0
7347 for e1, e2 in zip(self.allocate_, x.allocate_):
7348 if e1 != e2: return 0
7349 if len(self.reserve_) != len(x.reserve_): return 0
7350 for e1, e2 in zip(self.reserve_, x.reserve_):
7351 if e1 != e2: return 0
7352 return 1
7354 def IsInitialized(self, debug_strs=None):
7355 initialized = 1
7356 for p in self.allocate_:
7357 if not p.IsInitialized(debug_strs): initialized=0
7358 for p in self.reserve_:
7359 if not p.IsInitialized(debug_strs): initialized=0
7360 return initialized
7362 def ByteSize(self):
7363 n = 0
7364 n += 1 * len(self.allocate_)
7365 for i in xrange(len(self.allocate_)): n += self.lengthString(self.allocate_[i].ByteSize())
7366 n += 1 * len(self.reserve_)
7367 for i in xrange(len(self.reserve_)): n += self.lengthString(self.reserve_[i].ByteSize())
7368 return n
7370 def ByteSizePartial(self):
7371 n = 0
7372 n += 1 * len(self.allocate_)
7373 for i in xrange(len(self.allocate_)): n += self.lengthString(self.allocate_[i].ByteSizePartial())
7374 n += 1 * len(self.reserve_)
7375 for i in xrange(len(self.reserve_)): n += self.lengthString(self.reserve_[i].ByteSizePartial())
7376 return n
7378 def Clear(self):
7379 self.clear_allocate()
7380 self.clear_reserve()
7382 def OutputUnchecked(self, out):
7383 for i in xrange(len(self.allocate_)):
7384 out.putVarInt32(10)
7385 out.putVarInt32(self.allocate_[i].ByteSize())
7386 self.allocate_[i].OutputUnchecked(out)
7387 for i in xrange(len(self.reserve_)):
7388 out.putVarInt32(18)
7389 out.putVarInt32(self.reserve_[i].ByteSize())
7390 self.reserve_[i].OutputUnchecked(out)
7392 def OutputPartial(self, out):
7393 for i in xrange(len(self.allocate_)):
7394 out.putVarInt32(10)
7395 out.putVarInt32(self.allocate_[i].ByteSizePartial())
7396 self.allocate_[i].OutputPartial(out)
7397 for i in xrange(len(self.reserve_)):
7398 out.putVarInt32(18)
7399 out.putVarInt32(self.reserve_[i].ByteSizePartial())
7400 self.reserve_[i].OutputPartial(out)
7402 def TryMerge(self, d):
7403 while d.avail() > 0:
7404 tt = d.getVarInt32()
7405 if tt == 10:
7406 length = d.getVarInt32()
7407 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
7408 d.skip(length)
7409 self.add_allocate().TryMerge(tmp)
7410 continue
7411 if tt == 18:
7412 length = d.getVarInt32()
7413 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
7414 d.skip(length)
7415 self.add_reserve().TryMerge(tmp)
7416 continue
7419 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
7420 d.skipData(tt)
7423 def __str__(self, prefix="", printElemNumber=0):
7424 res=""
7425 cnt=0
7426 for e in self.allocate_:
7427 elm=""
7428 if printElemNumber: elm="(%d)" % cnt
7429 res+=prefix+("allocate%s <\n" % elm)
7430 res+=e.__str__(prefix + " ", printElemNumber)
7431 res+=prefix+">\n"
7432 cnt+=1
7433 cnt=0
7434 for e in self.reserve_:
7435 elm=""
7436 if printElemNumber: elm="(%d)" % cnt
7437 res+=prefix+("reserve%s <\n" % elm)
7438 res+=e.__str__(prefix + " ", printElemNumber)
7439 res+=prefix+">\n"
7440 cnt+=1
7441 return res
7444 def _BuildTagLookupTable(sparse, maxtag, default=None):
7445 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
7447 kallocate = 1
7448 kreserve = 2
7450 _TEXT = _BuildTagLookupTable({
7451 0: "ErrorCode",
7452 1: "allocate",
7453 2: "reserve",
7454 }, 2)
7456 _TYPES = _BuildTagLookupTable({
7457 0: ProtocolBuffer.Encoder.NUMERIC,
7458 1: ProtocolBuffer.Encoder.STRING,
7459 2: ProtocolBuffer.Encoder.STRING,
7460 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
7463 _STYLE = """"""
7464 _STYLE_CONTENT_TYPE = """"""
7465 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.AllocateIdsRequest'
7466 _SERIALIZED_DESCRIPTOR = array.array('B')
7467 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkFsbG9jYXRlSWRzUmVxdWVzdBMaCGFsbG9jYXRlIAEoAjALOANKG2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleaMBqgEFY3R5cGWyAQZwcm90bzKkARQTGgdyZXNlcnZlIAIoAjALOANKG2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleaMBqgEFY3R5cGWyAQZwcm90bzKkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
7468 if _net_proto___parse__python is not None:
7469 _net_proto___parse__python.RegisterType(
7470 _SERIALIZED_DESCRIPTOR.tostring())
7472 class AllocateIdsResponse(ProtocolBuffer.ProtocolMessage):
7474 def __init__(self, contents=None):
7475 self.allocated_ = []
7476 if contents is not None: self.MergeFromString(contents)
7478 def allocated_size(self): return len(self.allocated_)
7479 def allocated_list(self): return self.allocated_
7481 def allocated(self, i):
7482 return self.allocated_[i]
7484 def mutable_allocated(self, i):
7485 return self.allocated_[i]
7487 def add_allocated(self):
7488 x = google.appengine.datastore.entity_v4_pb.Key()
7489 self.allocated_.append(x)
7490 return x
7492 def clear_allocated(self):
7493 self.allocated_ = []
7495 def MergeFrom(self, x):
7496 assert x is not self
7497 for i in xrange(x.allocated_size()): self.add_allocated().CopyFrom(x.allocated(i))
7499 if _net_proto___parse__python is not None:
7500 def _CMergeFromString(self, s):
7501 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.AllocateIdsResponse', s)
7503 if _net_proto___parse__python is not None:
7504 def _CEncode(self):
7505 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.AllocateIdsResponse')
7507 if _net_proto___parse__python is not None:
7508 def _CEncodePartial(self):
7509 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.AllocateIdsResponse')
7511 if _net_proto___parse__python is not None:
7512 def _CToASCII(self, output_format):
7513 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.AllocateIdsResponse', output_format)
7516 if _net_proto___parse__python is not None:
7517 def ParseASCII(self, s):
7518 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.AllocateIdsResponse', s)
7521 if _net_proto___parse__python is not None:
7522 def ParseASCIIIgnoreUnknown(self, s):
7523 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.AllocateIdsResponse', s)
7526 def Equals(self, x):
7527 if x is self: return 1
7528 if len(self.allocated_) != len(x.allocated_): return 0
7529 for e1, e2 in zip(self.allocated_, x.allocated_):
7530 if e1 != e2: return 0
7531 return 1
7533 def IsInitialized(self, debug_strs=None):
7534 initialized = 1
7535 for p in self.allocated_:
7536 if not p.IsInitialized(debug_strs): initialized=0
7537 return initialized
7539 def ByteSize(self):
7540 n = 0
7541 n += 1 * len(self.allocated_)
7542 for i in xrange(len(self.allocated_)): n += self.lengthString(self.allocated_[i].ByteSize())
7543 return n
7545 def ByteSizePartial(self):
7546 n = 0
7547 n += 1 * len(self.allocated_)
7548 for i in xrange(len(self.allocated_)): n += self.lengthString(self.allocated_[i].ByteSizePartial())
7549 return n
7551 def Clear(self):
7552 self.clear_allocated()
7554 def OutputUnchecked(self, out):
7555 for i in xrange(len(self.allocated_)):
7556 out.putVarInt32(10)
7557 out.putVarInt32(self.allocated_[i].ByteSize())
7558 self.allocated_[i].OutputUnchecked(out)
7560 def OutputPartial(self, out):
7561 for i in xrange(len(self.allocated_)):
7562 out.putVarInt32(10)
7563 out.putVarInt32(self.allocated_[i].ByteSizePartial())
7564 self.allocated_[i].OutputPartial(out)
7566 def TryMerge(self, d):
7567 while d.avail() > 0:
7568 tt = d.getVarInt32()
7569 if tt == 10:
7570 length = d.getVarInt32()
7571 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
7572 d.skip(length)
7573 self.add_allocated().TryMerge(tmp)
7574 continue
7577 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
7578 d.skipData(tt)
7581 def __str__(self, prefix="", printElemNumber=0):
7582 res=""
7583 cnt=0
7584 for e in self.allocated_:
7585 elm=""
7586 if printElemNumber: elm="(%d)" % cnt
7587 res+=prefix+("allocated%s <\n" % elm)
7588 res+=e.__str__(prefix + " ", printElemNumber)
7589 res+=prefix+">\n"
7590 cnt+=1
7591 return res
7594 def _BuildTagLookupTable(sparse, maxtag, default=None):
7595 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
7597 kallocated = 1
7599 _TEXT = _BuildTagLookupTable({
7600 0: "ErrorCode",
7601 1: "allocated",
7602 }, 1)
7604 _TYPES = _BuildTagLookupTable({
7605 0: ProtocolBuffer.Encoder.NUMERIC,
7606 1: ProtocolBuffer.Encoder.STRING,
7607 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
7610 _STYLE = """"""
7611 _STYLE_CONTENT_TYPE = """"""
7612 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.AllocateIdsResponse'
7613 _SERIALIZED_DESCRIPTOR = array.array('B')
7614 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KK2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkFsbG9jYXRlSWRzUmVzcG9uc2UTGglhbGxvY2F0ZWQgASgCMAs4A0obYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuS2V5owGqAQVjdHlwZbIBBnByb3RvMqQBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
7615 if _net_proto___parse__python is not None:
7616 _net_proto___parse__python.RegisterType(
7617 _SERIALIZED_DESCRIPTOR.tostring())
7619 class WriteRequest(ProtocolBuffer.ProtocolMessage):
7620 has_deprecated_mutation_ = 0
7622 def __init__(self, contents=None):
7623 self.deprecated_mutation_ = DeprecatedMutation()
7624 if contents is not None: self.MergeFromString(contents)
7626 def deprecated_mutation(self): return self.deprecated_mutation_
7628 def mutable_deprecated_mutation(self): self.has_deprecated_mutation_ = 1; return self.deprecated_mutation_
7630 def clear_deprecated_mutation(self):self.has_deprecated_mutation_ = 0; self.deprecated_mutation_.Clear()
7632 def has_deprecated_mutation(self): return self.has_deprecated_mutation_
7635 def MergeFrom(self, x):
7636 assert x is not self
7637 if (x.has_deprecated_mutation()): self.mutable_deprecated_mutation().MergeFrom(x.deprecated_mutation())
7639 if _net_proto___parse__python is not None:
7640 def _CMergeFromString(self, s):
7641 _net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.WriteRequest', s)
7643 if _net_proto___parse__python is not None:
7644 def _CEncode(self):
7645 return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.WriteRequest')
7647 if _net_proto___parse__python is not None:
7648 def _CEncodePartial(self):
7649 return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.WriteRequest')
7651 if _net_proto___parse__python is not None:
7652 def _CToASCII(self, output_format):
7653 return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.WriteRequest', output_format)
7656 if _net_proto___parse__python is not None:
7657 def ParseASCII(self, s):
7658 _net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.WriteRequest', s)
7661 if _net_proto___parse__python is not None:
7662 def ParseASCIIIgnoreUnknown(self, s):
7663 _net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.WriteRequest', s)
7666 def Equals(self, x):
7667 if x is self: return 1
7668 if self.has_deprecated_mutation_ != x.has_deprecated_mutation_: return 0
7669 if self.has_deprecated_mutation_ and self.deprecated_mutation_ != x.deprecated_mutation_: return 0
7670 return 1
7672 def IsInitialized(self, debug_strs=None):
7673 initialized = 1
7674 if (not self.has_deprecated_mutation_):
7675 initialized = 0
7676 if debug_strs is not None:
7677 debug_strs.append('Required field: deprecated_mutation not set.')
7678 elif not self.deprecated_mutation_.IsInitialized(debug_strs): initialized = 0
7679 return initialized
7681 def ByteSize(self):
7682 n = 0
7683 n += self.lengthString(self.deprecated_mutation_.ByteSize())
7684 return n + 1
7686 def ByteSizePartial(self):
7687 n = 0
7688 if (self.has_deprecated_mutation_):
7689 n += 1
7690 n += self.lengthString(self.deprecated_mutation_.ByteSizePartial())
7691 return n
7693 def Clear(self):
7694 self.clear_deprecated_mutation()
7696 def OutputUnchecked(self, out):
7697 out.putVarInt32(10)
7698 out.putVarInt32(self.deprecated_mutation_.ByteSize())
7699 self.deprecated_mutation_.OutputUnchecked(out)
7701 def OutputPartial(self, out):
7702 if (self.has_deprecated_mutation_):
7703 out.putVarInt32(10)
7704 out.putVarInt32(self.deprecated_mutation_.ByteSizePartial())
7705 self.deprecated_mutation_.OutputPartial(out)
7707 def TryMerge(self, d):
7708 while d.avail() > 0:
7709 tt = d.getVarInt32()
7710 if tt == 10:
7711 length = d.getVarInt32()
7712 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
7713 d.skip(length)
7714 self.mutable_deprecated_mutation().TryMerge(tmp)
7715 continue
7718 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
7719 d.skipData(tt)
7722 def __str__(self, prefix="", printElemNumber=0):
7723 res=""
7724 if self.has_deprecated_mutation_:
7725 res+=prefix+"deprecated_mutation <\n"
7726 res+=self.deprecated_mutation_.__str__(prefix + " ", printElemNumber)
7727 res+=prefix+">\n"
7728 return res
7731 def _BuildTagLookupTable(sparse, maxtag, default=None):
7732 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
7734 kdeprecated_mutation = 1
7736 _TEXT = _BuildTagLookupTable({
7737 0: "ErrorCode",
7738 1: "deprecated_mutation",
7739 }, 1)
7741 _TYPES = _BuildTagLookupTable({
7742 0: ProtocolBuffer.Encoder.NUMERIC,
7743 1: ProtocolBuffer.Encoder.STRING,
7744 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
7747 _STYLE = """"""
7748 _STYLE_CONTENT_TYPE = """"""
7749 _PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.WriteRequest'
7750 _SERIALIZED_DESCRIPTOR = array.array('B')
7751 _SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LldyaXRlUmVxdWVzdBMaE2RlcHJlY2F0ZWRfbXV0YXRpb24gASgCMAs4AkoqYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRGVwcmVjYXRlZE11dGF0aW9uowGqAQVjdHlwZbIBBnByb3RvMqQBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
7752 if _net_proto___parse__python is not None:
7753 _net_proto___parse__python.RegisterType(
7754 _SERIALIZED_DESCRIPTOR.tostring())
7758 class _DatastoreV4Service_ClientBaseStub(_client_stub_base_class):
7759 """Makes Stubby RPC calls to a DatastoreV4Service server."""
7761 __slots__ = (
7762 '_protorpc_BeginTransaction', '_full_name_BeginTransaction',
7763 '_protorpc_Rollback', '_full_name_Rollback',
7764 '_protorpc_Commit', '_full_name_Commit',
7765 '_protorpc_RunQuery', '_full_name_RunQuery',
7766 '_protorpc_ContinueQuery', '_full_name_ContinueQuery',
7767 '_protorpc_Lookup', '_full_name_Lookup',
7768 '_protorpc_AllocateIds', '_full_name_AllocateIds',
7769 '_protorpc_Get', '_full_name_Get',
7770 '_protorpc_Write', '_full_name_Write',
7773 def __init__(self, rpc_stub):
7774 self._stub = rpc_stub
7776 self._protorpc_BeginTransaction = pywraprpc.RPC()
7777 self._full_name_BeginTransaction = self._stub.GetFullMethodName(
7778 'BeginTransaction')
7780 self._protorpc_Rollback = pywraprpc.RPC()
7781 self._full_name_Rollback = self._stub.GetFullMethodName(
7782 'Rollback')
7784 self._protorpc_Commit = pywraprpc.RPC()
7785 self._full_name_Commit = self._stub.GetFullMethodName(
7786 'Commit')
7788 self._protorpc_RunQuery = pywraprpc.RPC()
7789 self._full_name_RunQuery = self._stub.GetFullMethodName(
7790 'RunQuery')
7792 self._protorpc_ContinueQuery = pywraprpc.RPC()
7793 self._full_name_ContinueQuery = self._stub.GetFullMethodName(
7794 'ContinueQuery')
7796 self._protorpc_Lookup = pywraprpc.RPC()
7797 self._full_name_Lookup = self._stub.GetFullMethodName(
7798 'Lookup')
7800 self._protorpc_AllocateIds = pywraprpc.RPC()
7801 self._full_name_AllocateIds = self._stub.GetFullMethodName(
7802 'AllocateIds')
7804 self._protorpc_Get = pywraprpc.RPC()
7805 self._full_name_Get = self._stub.GetFullMethodName(
7806 'Get')
7808 self._protorpc_Write = pywraprpc.RPC()
7809 self._full_name_Write = self._stub.GetFullMethodName(
7810 'Write')
7812 def BeginTransaction(self, request, rpc=None, callback=None, response=None):
7813 """Make a BeginTransaction RPC call.
7815 Args:
7816 request: a BeginTransactionRequest instance.
7817 rpc: Optional RPC instance to use for the call.
7818 callback: Optional final callback. Will be called as
7819 callback(rpc, result) when the rpc completes. If None, the
7820 call is synchronous.
7821 response: Optional ProtocolMessage to be filled in with response.
7823 Returns:
7824 The BeginTransactionResponse if callback is None. Otherwise, returns None.
7827 if response is None:
7828 response = BeginTransactionResponse
7829 return self._MakeCall(rpc,
7830 self._full_name_BeginTransaction,
7831 'BeginTransaction',
7832 request,
7833 response,
7834 callback,
7835 self._protorpc_BeginTransaction)
7837 def Rollback(self, request, rpc=None, callback=None, response=None):
7838 """Make a Rollback RPC call.
7840 Args:
7841 request: a RollbackRequest instance.
7842 rpc: Optional RPC instance to use for the call.
7843 callback: Optional final callback. Will be called as
7844 callback(rpc, result) when the rpc completes. If None, the
7845 call is synchronous.
7846 response: Optional ProtocolMessage to be filled in with response.
7848 Returns:
7849 The RollbackResponse if callback is None. Otherwise, returns None.
7852 if response is None:
7853 response = RollbackResponse
7854 return self._MakeCall(rpc,
7855 self._full_name_Rollback,
7856 'Rollback',
7857 request,
7858 response,
7859 callback,
7860 self._protorpc_Rollback)
7862 def Commit(self, request, rpc=None, callback=None, response=None):
7863 """Make a Commit RPC call.
7865 Args:
7866 request: a CommitRequest instance.
7867 rpc: Optional RPC instance to use for the call.
7868 callback: Optional final callback. Will be called as
7869 callback(rpc, result) when the rpc completes. If None, the
7870 call is synchronous.
7871 response: Optional ProtocolMessage to be filled in with response.
7873 Returns:
7874 The CommitResponse if callback is None. Otherwise, returns None.
7877 if response is None:
7878 response = CommitResponse
7879 return self._MakeCall(rpc,
7880 self._full_name_Commit,
7881 'Commit',
7882 request,
7883 response,
7884 callback,
7885 self._protorpc_Commit)
7887 def RunQuery(self, request, rpc=None, callback=None, response=None):
7888 """Make a RunQuery RPC call.
7890 Args:
7891 request: a RunQueryRequest instance.
7892 rpc: Optional RPC instance to use for the call.
7893 callback: Optional final callback. Will be called as
7894 callback(rpc, result) when the rpc completes. If None, the
7895 call is synchronous.
7896 response: Optional ProtocolMessage to be filled in with response.
7898 Returns:
7899 The RunQueryResponse if callback is None. Otherwise, returns None.
7902 if response is None:
7903 response = RunQueryResponse
7904 return self._MakeCall(rpc,
7905 self._full_name_RunQuery,
7906 'RunQuery',
7907 request,
7908 response,
7909 callback,
7910 self._protorpc_RunQuery)
7912 def ContinueQuery(self, request, rpc=None, callback=None, response=None):
7913 """Make a ContinueQuery RPC call.
7915 Args:
7916 request: a ContinueQueryRequest instance.
7917 rpc: Optional RPC instance to use for the call.
7918 callback: Optional final callback. Will be called as
7919 callback(rpc, result) when the rpc completes. If None, the
7920 call is synchronous.
7921 response: Optional ProtocolMessage to be filled in with response.
7923 Returns:
7924 The ContinueQueryResponse if callback is None. Otherwise, returns None.
7927 if response is None:
7928 response = ContinueQueryResponse
7929 return self._MakeCall(rpc,
7930 self._full_name_ContinueQuery,
7931 'ContinueQuery',
7932 request,
7933 response,
7934 callback,
7935 self._protorpc_ContinueQuery)
7937 def Lookup(self, request, rpc=None, callback=None, response=None):
7938 """Make a Lookup RPC call.
7940 Args:
7941 request: a LookupRequest instance.
7942 rpc: Optional RPC instance to use for the call.
7943 callback: Optional final callback. Will be called as
7944 callback(rpc, result) when the rpc completes. If None, the
7945 call is synchronous.
7946 response: Optional ProtocolMessage to be filled in with response.
7948 Returns:
7949 The LookupResponse if callback is None. Otherwise, returns None.
7952 if response is None:
7953 response = LookupResponse
7954 return self._MakeCall(rpc,
7955 self._full_name_Lookup,
7956 'Lookup',
7957 request,
7958 response,
7959 callback,
7960 self._protorpc_Lookup)
7962 def AllocateIds(self, request, rpc=None, callback=None, response=None):
7963 """Make a AllocateIds RPC call.
7965 Args:
7966 request: a AllocateIdsRequest instance.
7967 rpc: Optional RPC instance to use for the call.
7968 callback: Optional final callback. Will be called as
7969 callback(rpc, result) when the rpc completes. If None, the
7970 call is synchronous.
7971 response: Optional ProtocolMessage to be filled in with response.
7973 Returns:
7974 The AllocateIdsResponse if callback is None. Otherwise, returns None.
7977 if response is None:
7978 response = AllocateIdsResponse
7979 return self._MakeCall(rpc,
7980 self._full_name_AllocateIds,
7981 'AllocateIds',
7982 request,
7983 response,
7984 callback,
7985 self._protorpc_AllocateIds)
7987 def Get(self, request, rpc=None, callback=None, response=None):
7988 """Make a Get RPC call.
7990 Args:
7991 request: a LookupRequest instance.
7992 rpc: Optional RPC instance to use for the call.
7993 callback: Optional final callback. Will be called as
7994 callback(rpc, result) when the rpc completes. If None, the
7995 call is synchronous.
7996 response: Optional ProtocolMessage to be filled in with response.
7998 Returns:
7999 The LookupResponse if callback is None. Otherwise, returns None.
8002 if response is None:
8003 response = LookupResponse
8004 return self._MakeCall(rpc,
8005 self._full_name_Get,
8006 'Get',
8007 request,
8008 response,
8009 callback,
8010 self._protorpc_Get)
8012 def Write(self, request, rpc=None, callback=None, response=None):
8013 """Make a Write RPC call.
8015 Args:
8016 request: a WriteRequest instance.
8017 rpc: Optional RPC instance to use for the call.
8018 callback: Optional final callback. Will be called as
8019 callback(rpc, result) when the rpc completes. If None, the
8020 call is synchronous.
8021 response: Optional ProtocolMessage to be filled in with response.
8023 Returns:
8024 The CommitResponse if callback is None. Otherwise, returns None.
8027 if response is None:
8028 response = CommitResponse
8029 return self._MakeCall(rpc,
8030 self._full_name_Write,
8031 'Write',
8032 request,
8033 response,
8034 callback,
8035 self._protorpc_Write)
8038 class _DatastoreV4Service_ClientStub(_DatastoreV4Service_ClientBaseStub):
8039 __slots__ = ('_params',)
8040 def __init__(self, rpc_stub_parameters, service_name):
8041 if service_name is None:
8042 service_name = 'DatastoreV4Service'
8043 _DatastoreV4Service_ClientBaseStub.__init__(self, pywraprpc.RPC_GenericStub(service_name, rpc_stub_parameters))
8044 self._params = rpc_stub_parameters
8047 class _DatastoreV4Service_RPC2ClientStub(_DatastoreV4Service_ClientBaseStub):
8048 __slots__ = ()
8049 def __init__(self, server, channel, service_name):
8050 if service_name is None:
8051 service_name = 'DatastoreV4Service'
8052 if channel is not None:
8053 if channel.version() == 1:
8054 raise RuntimeError('Expecting an RPC2 channel to create the stub')
8055 _DatastoreV4Service_ClientBaseStub.__init__(self, pywraprpc.RPC_GenericStub(service_name, channel))
8056 elif server is not None:
8057 _DatastoreV4Service_ClientBaseStub.__init__(self, pywraprpc.RPC_GenericStub(service_name, pywraprpc.NewClientChannel(server)))
8058 else:
8059 raise RuntimeError('Invalid argument combination to create a stub')
8062 class DatastoreV4Service(_server_stub_base_class):
8063 """Base class for DatastoreV4Service Stubby servers."""
8065 @classmethod
8066 def _MethodSignatures(cls):
8067 """Returns a dict of {<method-name>: (<request-type>, <response-type>)}."""
8068 return {
8069 'BeginTransaction': (BeginTransactionRequest, BeginTransactionResponse),
8070 'Rollback': (RollbackRequest, RollbackResponse),
8071 'Commit': (CommitRequest, CommitResponse),
8072 'RunQuery': (RunQueryRequest, RunQueryResponse),
8073 'ContinueQuery': (ContinueQueryRequest, ContinueQueryResponse),
8074 'Lookup': (LookupRequest, LookupResponse),
8075 'AllocateIds': (AllocateIdsRequest, AllocateIdsResponse),
8076 'Get': (LookupRequest, LookupResponse),
8077 'Write': (WriteRequest, CommitResponse),
8080 @classmethod
8081 def _StreamMethodSignatures(cls):
8082 """Returns a dict of {<method-name>: (<request-type>, <stream-type>, <response-type>)}."""
8083 return {
8086 def __init__(self, *args, **kwargs):
8087 """Creates a Stubby RPC server.
8089 See BaseRpcServer.__init__ in rpcserver.py for detail on arguments.
8091 if _server_stub_base_class is object:
8092 raise NotImplementedError('Add //net/rpc/python:rpcserver as a '
8093 'dependency for Stubby server support.')
8094 _server_stub_base_class.__init__(self, 'apphosting.datastore.v4.DatastoreV4Service', *args, **kwargs)
8096 @staticmethod
8097 def NewStub(rpc_stub_parameters, service_name=None):
8098 """Creates a new DatastoreV4Service Stubby client stub.
8100 Args:
8101 rpc_stub_parameters: an RPC_StubParameter instance.
8102 service_name: the service name used by the Stubby server.
8105 if _client_stub_base_class is object:
8106 raise RuntimeError('Add //net/rpc/python as a dependency to use Stubby')
8107 return _DatastoreV4Service_ClientStub(rpc_stub_parameters, service_name)
8109 @staticmethod
8110 def NewRPC2Stub(server=None, channel=None, service_name=None):
8111 """Creates a new DatastoreV4Service Stubby2 client stub.
8113 Args:
8114 server: host:port or bns address.
8115 channel: directly use a channel to create a stub. Will ignore server
8116 argument if this is specified.
8117 service_name: the service name used by the Stubby server.
8120 if _client_stub_base_class is object:
8121 raise RuntimeError('Add //net/rpc/python as a dependency to use Stubby')
8122 return _DatastoreV4Service_RPC2ClientStub(server, channel, service_name)
8124 def BeginTransaction(self, rpc, request, response):
8125 """Handles a BeginTransaction RPC call. You should override this.
8127 Args:
8128 rpc: a Stubby RPC object
8129 request: a BeginTransactionRequest that contains the client request
8130 response: a BeginTransactionResponse that should be modified to send the response
8132 raise NotImplementedError
8135 def Rollback(self, rpc, request, response):
8136 """Handles a Rollback RPC call. You should override this.
8138 Args:
8139 rpc: a Stubby RPC object
8140 request: a RollbackRequest that contains the client request
8141 response: a RollbackResponse that should be modified to send the response
8143 raise NotImplementedError
8146 def Commit(self, rpc, request, response):
8147 """Handles a Commit RPC call. You should override this.
8149 Args:
8150 rpc: a Stubby RPC object
8151 request: a CommitRequest that contains the client request
8152 response: a CommitResponse that should be modified to send the response
8154 raise NotImplementedError
8157 def RunQuery(self, rpc, request, response):
8158 """Handles a RunQuery RPC call. You should override this.
8160 Args:
8161 rpc: a Stubby RPC object
8162 request: a RunQueryRequest that contains the client request
8163 response: a RunQueryResponse that should be modified to send the response
8165 raise NotImplementedError
8168 def ContinueQuery(self, rpc, request, response):
8169 """Handles a ContinueQuery RPC call. You should override this.
8171 Args:
8172 rpc: a Stubby RPC object
8173 request: a ContinueQueryRequest that contains the client request
8174 response: a ContinueQueryResponse that should be modified to send the response
8176 raise NotImplementedError
8179 def Lookup(self, rpc, request, response):
8180 """Handles a Lookup RPC call. You should override this.
8182 Args:
8183 rpc: a Stubby RPC object
8184 request: a LookupRequest that contains the client request
8185 response: a LookupResponse that should be modified to send the response
8187 raise NotImplementedError
8190 def AllocateIds(self, rpc, request, response):
8191 """Handles a AllocateIds RPC call. You should override this.
8193 Args:
8194 rpc: a Stubby RPC object
8195 request: a AllocateIdsRequest that contains the client request
8196 response: a AllocateIdsResponse that should be modified to send the response
8198 raise NotImplementedError
8201 def Get(self, rpc, request, response):
8202 """Handles a Get RPC call. You should override this.
8204 Args:
8205 rpc: a Stubby RPC object
8206 request: a LookupRequest that contains the client request
8207 response: a LookupResponse that should be modified to send the response
8209 raise NotImplementedError
8212 def Write(self, rpc, request, response):
8213 """Handles a Write RPC call. You should override this.
8215 Args:
8216 rpc: a Stubby RPC object
8217 request: a WriteRequest that contains the client request
8218 response: a CommitResponse that should be modified to send the response
8220 raise NotImplementedError
8222 def _AddMethodAttributes(self):
8223 """Sets attributes on Python RPC handlers.
8225 See BaseRpcServer in rpcserver.py for details.
8227 rpcserver._GetHandlerDecorator(
8228 getattr(self.BeginTransaction, '__func__'),
8229 BeginTransactionRequest,
8230 BeginTransactionResponse,
8231 None,
8232 'INTEGRITY')
8233 rpcserver._GetHandlerDecorator(
8234 getattr(self.Rollback, '__func__'),
8235 RollbackRequest,
8236 RollbackResponse,
8237 None,
8238 'INTEGRITY')
8239 rpcserver._GetHandlerDecorator(
8240 getattr(self.Commit, '__func__'),
8241 CommitRequest,
8242 CommitResponse,
8243 None,
8244 'INTEGRITY')
8245 rpcserver._GetHandlerDecorator(
8246 getattr(self.RunQuery, '__func__'),
8247 RunQueryRequest,
8248 RunQueryResponse,
8249 None,
8250 'INTEGRITY')
8251 rpcserver._GetHandlerDecorator(
8252 getattr(self.ContinueQuery, '__func__'),
8253 ContinueQueryRequest,
8254 ContinueQueryResponse,
8255 None,
8256 'INTEGRITY')
8257 rpcserver._GetHandlerDecorator(
8258 getattr(self.Lookup, '__func__'),
8259 LookupRequest,
8260 LookupResponse,
8261 None,
8262 'INTEGRITY')
8263 rpcserver._GetHandlerDecorator(
8264 getattr(self.AllocateIds, '__func__'),
8265 AllocateIdsRequest,
8266 AllocateIdsResponse,
8267 None,
8268 'INTEGRITY')
8269 rpcserver._GetHandlerDecorator(
8270 getattr(self.Get, '__func__'),
8271 LookupRequest,
8272 LookupResponse,
8273 None,
8274 'INTEGRITY')
8275 rpcserver._GetHandlerDecorator(
8276 getattr(self.Write, '__func__'),
8277 WriteRequest,
8278 CommitResponse,
8279 None,
8280 'INTEGRITY')
8282 if _extension_runtime:
8283 pass
8285 __all__ = ['Error','EntityResult','Query','KindExpression','PropertyReference','PropertyExpression','PropertyOrder','Filter','CompositeFilter','PropertyFilter','BoundingCircleFilter','BoundingBoxFilter','GqlQuery','GqlQueryArg','QueryResultBatch','Mutation','MutationResult','DeprecatedMutation','DeprecatedMutationResult','ReadOptions','LookupRequest','LookupResponse','RunQueryRequest','RunQueryResponse','ContinueQueryRequest','ContinueQueryResponse','BeginTransactionRequest','BeginTransactionResponse','RollbackRequest','RollbackResponse','CommitRequest','CommitResponse','AllocateIdsRequest','AllocateIdsResponse','WriteRequest','DatastoreV4Service']