3 # Copyright 2007 Google Inc.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
20 from google
.net
.proto
import ProtocolBuffer
23 import dummy_thread
as thread
25 from google3
.net
.proto
import _net_proto___parse__python
27 _net_proto___parse__python
= None
30 __import__('google.net.rpc.python.rpc_internals_lite')
31 __import__('google.net.rpc.python.pywraprpc_lite')
32 rpc_internals
= sys
.modules
.get('google.net.rpc.python.rpc_internals_lite')
33 pywraprpc
= sys
.modules
.get('google.net.rpc.python.pywraprpc_lite')
34 _client_stub_base_class
= rpc_internals
.StubbyRPCBaseStub
36 _client_stub_base_class
= object
38 __import__('google.net.rpc.python.rpcserver')
39 rpcserver
= sys
.modules
.get('google.net.rpc.python.rpcserver')
40 _server_stub_base_class
= rpcserver
.BaseRpcServer
42 _server_stub_base_class
= object
44 __pychecker__
= """maxreturns=0 maxbranches=0 no-callinit
45 unusednames=printElemNumber,debug_strs no-special"""
47 if hasattr(ProtocolBuffer
, 'ExtendableProtocolMessage'):
48 _extension_runtime
= True
49 _ExtendableProtocolMessage
= ProtocolBuffer
.ExtendableProtocolMessage
51 _extension_runtime
= False
52 _ExtendableProtocolMessage
= ProtocolBuffer
.ProtocolMessage
54 from google
.appengine
.datastore
.entity_v4_pb
import *
55 import google
.appengine
.datastore
.entity_v4_pb
56 class Error(ProtocolBuffer
.ProtocolMessage
):
60 CONCURRENT_TRANSACTION
= 2
66 COMMITTED_BUT_STILL_APPLYING
= 8
67 CAPABILITY_DISABLED
= 9
68 TRY_ALTERNATE_BACKEND
= 10
69 SAFE_TIME_TOO_OLD
= 11
73 2: "CONCURRENT_TRANSACTION",
77 6: "PERMISSION_DENIED",
79 8: "COMMITTED_BUT_STILL_APPLYING",
80 9: "CAPABILITY_DISABLED",
81 10: "TRY_ALTERNATE_BACKEND",
82 11: "SAFE_TIME_TOO_OLD",
85 def ErrorCode_Name(cls
, x
): return cls
._ErrorCode
_NAMES
.get(x
, "")
86 ErrorCode_Name
= classmethod(ErrorCode_Name
)
89 def __init__(self
, contents
=None):
91 if contents
is not None: self
.MergeFromString(contents
)
94 def MergeFrom(self
, x
):
97 if _net_proto___parse__python
is not None:
98 def _CMergeFromString(self
, s
):
99 _net_proto___parse__python
.MergeFromString(self
, 'apphosting.datastore.v4.Error', s
)
101 if _net_proto___parse__python
is not None:
103 return _net_proto___parse__python
.Encode(self
, 'apphosting.datastore.v4.Error')
105 if _net_proto___parse__python
is not None:
106 def _CEncodePartial(self
):
107 return _net_proto___parse__python
.EncodePartial(self
, 'apphosting.datastore.v4.Error')
109 if _net_proto___parse__python
is not None:
110 def _CToASCII(self
, output_format
):
111 return _net_proto___parse__python
.ToASCII(self
, 'apphosting.datastore.v4.Error', output_format
)
114 if _net_proto___parse__python
is not None:
115 def ParseASCII(self
, s
):
116 _net_proto___parse__python
.ParseASCII(self
, 'apphosting.datastore.v4.Error', s
)
119 if _net_proto___parse__python
is not None:
120 def ParseASCIIIgnoreUnknown(self
, s
):
121 _net_proto___parse__python
.ParseASCIIIgnoreUnknown(self
, 'apphosting.datastore.v4.Error', s
)
125 if x
is self
: return 1
128 def IsInitialized(self
, debug_strs
=None):
136 def ByteSizePartial(self
):
143 def OutputUnchecked(self
, out
):
146 def OutputPartial(self
, out
):
149 def TryMerge(self
, d
):
154 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
158 def __str__(self
, prefix
="", printElemNumber
=0):
163 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
164 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
167 _TEXT
= _BuildTagLookupTable({
171 _TYPES
= _BuildTagLookupTable({
172 0: ProtocolBuffer
.Encoder
.NUMERIC
,
173 }, 0, ProtocolBuffer
.Encoder
.MAX_TYPE
)
177 _STYLE_CONTENT_TYPE
= """"""
178 _PROTO_DESCRIPTOR_NAME
= 'apphosting.datastore.v4.Error'
179 _SERIALIZED_DESCRIPTOR
= array
.array('B')
180 _SERIALIZED_DESCRIPTOR
.fromstring(base64
.decodestring("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
):
192 _ResultType_NAMES
= {
198 def ResultType_Name(cls
, x
): return cls
._ResultType
_NAMES
.get(x
, "")
199 ResultType_Name
= classmethod(ResultType_Name
)
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
225 def clear_version(self
):
226 if self
.has_version_
:
227 self
.has_version_
= 0
230 def has_version(self
): return self
.has_version_
232 def cursor(self
): return self
.cursor_
234 def set_cursor(self
, x
):
238 def clear_cursor(self
):
243 def has_cursor(self
): return self
.has_cursor_
246 def MergeFrom(self
, x
):
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:
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
)
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
289 def IsInitialized(self
, debug_strs
=None):
291 if (not self
.has_entity_
):
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
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_
))
305 def ByteSizePartial(self
):
307 if (self
.has_entity_
):
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_
))
319 def OutputUnchecked(self
, out
):
321 out
.putVarInt32(self
.entity_
.ByteSize())
322 self
.entity_
.OutputUnchecked(out
)
323 if (self
.has_version_
):
325 out
.putVarInt64(self
.version_
)
326 if (self
.has_cursor_
):
328 out
.putPrefixedString(self
.cursor_
)
330 def OutputPartial(self
, out
):
331 if (self
.has_entity_
):
333 out
.putVarInt32(self
.entity_
.ByteSizePartial())
334 self
.entity_
.OutputPartial(out
)
335 if (self
.has_version_
):
337 out
.putVarInt64(self
.version_
)
338 if (self
.has_cursor_
):
340 out
.putPrefixedString(self
.cursor_
)
342 def TryMerge(self
, d
):
346 length
= d
.getVarInt32()
347 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
349 self
.mutable_entity().TryMerge(tmp
)
352 self
.set_version(d
.getVarInt64())
355 self
.set_cursor(d
.getPrefixedString())
359 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
363 def __str__(self
, prefix
="", printElemNumber
=0):
366 res
+=prefix
+"entity <\n"
367 res
+=self
.entity_
.__str
__(prefix
+ " ", printElemNumber
)
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_
))
374 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
375 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
381 _TEXT
= _BuildTagLookupTable({
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
)
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
):
408 has_start_cursor_
= 0
417 def __init__(self
, contents
=None):
418 self
.projection_
= []
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
)
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_
447 def mutable_kind(self
, i
):
455 def clear_kind(self
):
458 if self
.filter_
is None:
459 self
.lazy_init_lock_
.acquire()
461 if self
.filter_
is None: self
.filter_
= Filter()
463 self
.lazy_init_lock_
.release()
466 def mutable_filter(self
): self
.has_filter_
= 1; return self
.filter()
468 def clear_filter(self
):
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_
480 return self
.order_
[i
]
482 def mutable_order(self
, i
):
483 return self
.order_
[i
]
487 self
.order_
.append(x
)
490 def clear_order(self
):
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
)
506 def clear_group_by(self
):
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
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
):
540 def clear_offset(self
):
545 def has_offset(self
): return self
.has_offset_
547 def limit(self
): return self
.limit_
549 def set_limit(self
, x
):
553 def clear_limit(self
):
558 def has_limit(self
): return self
.has_limit_
561 def MergeFrom(self
, x
):
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:
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
)
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
626 def IsInitialized(self
, debug_strs
=None):
628 for p
in self
.projection_
:
629 if not p
.IsInitialized(debug_strs
): initialized
=0
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
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_
)
656 def ByteSizePartial(self
):
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_
)
674 self
.clear_projection()
678 self
.clear_group_by()
679 self
.clear_start_cursor()
680 self
.clear_end_cursor()
684 def OutputUnchecked(self
, out
):
685 for i
in xrange(len(self
.projection_
)):
687 out
.putVarInt32(self
.projection_
[i
].ByteSize())
688 self
.projection_
[i
].OutputUnchecked(out
)
689 for i
in xrange(len(self
.kind_
)):
691 out
.putVarInt32(self
.kind_
[i
].ByteSize())
692 self
.kind_
[i
].OutputUnchecked(out
)
693 if (self
.has_filter_
):
695 out
.putVarInt32(self
.filter_
.ByteSize())
696 self
.filter_
.OutputUnchecked(out
)
697 for i
in xrange(len(self
.order_
)):
699 out
.putVarInt32(self
.order_
[i
].ByteSize())
700 self
.order_
[i
].OutputUnchecked(out
)
701 for i
in xrange(len(self
.group_by_
)):
703 out
.putVarInt32(self
.group_by_
[i
].ByteSize())
704 self
.group_by_
[i
].OutputUnchecked(out
)
705 if (self
.has_start_cursor_
):
707 out
.putPrefixedString(self
.start_cursor_
)
708 if (self
.has_end_cursor_
):
710 out
.putPrefixedString(self
.end_cursor_
)
711 if (self
.has_offset_
):
713 out
.putVarInt32(self
.offset_
)
714 if (self
.has_limit_
):
716 out
.putVarInt32(self
.limit_
)
718 def OutputPartial(self
, out
):
719 for i
in xrange(len(self
.projection_
)):
721 out
.putVarInt32(self
.projection_
[i
].ByteSizePartial())
722 self
.projection_
[i
].OutputPartial(out
)
723 for i
in xrange(len(self
.kind_
)):
725 out
.putVarInt32(self
.kind_
[i
].ByteSizePartial())
726 self
.kind_
[i
].OutputPartial(out
)
727 if (self
.has_filter_
):
729 out
.putVarInt32(self
.filter_
.ByteSizePartial())
730 self
.filter_
.OutputPartial(out
)
731 for i
in xrange(len(self
.order_
)):
733 out
.putVarInt32(self
.order_
[i
].ByteSizePartial())
734 self
.order_
[i
].OutputPartial(out
)
735 for i
in xrange(len(self
.group_by_
)):
737 out
.putVarInt32(self
.group_by_
[i
].ByteSizePartial())
738 self
.group_by_
[i
].OutputPartial(out
)
739 if (self
.has_start_cursor_
):
741 out
.putPrefixedString(self
.start_cursor_
)
742 if (self
.has_end_cursor_
):
744 out
.putPrefixedString(self
.end_cursor_
)
745 if (self
.has_offset_
):
747 out
.putVarInt32(self
.offset_
)
748 if (self
.has_limit_
):
750 out
.putVarInt32(self
.limit_
)
752 def TryMerge(self
, d
):
756 length
= d
.getVarInt32()
757 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
759 self
.add_projection().TryMerge(tmp
)
762 length
= d
.getVarInt32()
763 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
765 self
.add_kind().TryMerge(tmp
)
768 length
= d
.getVarInt32()
769 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
771 self
.mutable_filter().TryMerge(tmp
)
774 length
= d
.getVarInt32()
775 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
777 self
.add_order().TryMerge(tmp
)
780 length
= d
.getVarInt32()
781 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
783 self
.add_group_by().TryMerge(tmp
)
786 self
.set_start_cursor(d
.getPrefixedString())
789 self
.set_end_cursor(d
.getPrefixedString())
792 self
.set_offset(d
.getVarInt32())
795 self
.set_limit(d
.getVarInt32())
799 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
803 def __str__(self
, prefix
="", printElemNumber
=0):
806 for e
in self
.projection_
:
808 if printElemNumber
: elm
="(%d)" % cnt
809 res
+=prefix
+("projection%s <\n" % elm
)
810 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
816 if printElemNumber
: elm
="(%d)" % cnt
817 res
+=prefix
+("kind%s <\n" % elm
)
818 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
822 res
+=prefix
+"filter <\n"
823 res
+=self
.filter_
.__str
__(prefix
+ " ", printElemNumber
)
826 for e
in self
.order_
:
828 if printElemNumber
: elm
="(%d)" % cnt
829 res
+=prefix
+("order%s <\n" % elm
)
830 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
834 for e
in self
.group_by_
:
836 if printElemNumber
: elm
="(%d)" % cnt
837 res
+=prefix
+("group_by%s <\n" % elm
)
838 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
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_
))
848 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
849 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
861 _TEXT
= _BuildTagLookupTable({
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
)
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
):
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
):
910 def clear_name(self
):
915 def has_name(self
): return self
.has_name_
918 def MergeFrom(self
, x
):
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:
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
)
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
955 def IsInitialized(self
, debug_strs
=None):
957 if (not self
.has_name_
):
959 if debug_strs
is not None:
960 debug_strs
.append('Required field: name not set.')
965 n
+= self
.lengthString(len(self
.name_
))
968 def ByteSizePartial(self
):
972 n
+= self
.lengthString(len(self
.name_
))
978 def OutputUnchecked(self
, out
):
980 out
.putPrefixedString(self
.name_
)
982 def OutputPartial(self
, out
):
985 out
.putPrefixedString(self
.name_
)
987 def TryMerge(self
, d
):
991 self
.set_name(d
.getPrefixedString())
995 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
999 def __str__(self
, prefix
="", printElemNumber
=0):
1001 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
1005 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1006 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1010 _TEXT
= _BuildTagLookupTable({
1015 _TYPES
= _BuildTagLookupTable({
1016 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1017 1: ProtocolBuffer
.Encoder
.STRING
,
1018 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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
):
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
):
1043 def clear_name(self
):
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:
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
1088 def IsInitialized(self
, debug_strs
=None):
1090 if (not self
.has_name_
):
1092 if debug_strs
is not None:
1093 debug_strs
.append('Required field: name not set.')
1098 n
+= self
.lengthString(len(self
.name_
))
1101 def ByteSizePartial(self
):
1103 if (self
.has_name_
):
1105 n
+= self
.lengthString(len(self
.name_
))
1111 def OutputUnchecked(self
, out
):
1113 out
.putPrefixedString(self
.name_
)
1115 def OutputPartial(self
, out
):
1116 if (self
.has_name_
):
1118 out
.putPrefixedString(self
.name_
)
1120 def TryMerge(self
, d
):
1121 while d
.avail() > 0:
1122 tt
= d
.getVarInt32()
1124 self
.set_name(d
.getPrefixedString())
1128 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1132 def __str__(self
, prefix
="", printElemNumber
=0):
1134 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
1138 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1139 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1143 _TEXT
= _BuildTagLookupTable({
1148 _TYPES
= _BuildTagLookupTable({
1149 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1150 2: ProtocolBuffer
.Encoder
.STRING
,
1151 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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
):
1168 _AggregationFunction_NAMES
= {
1172 def AggregationFunction_Name(cls
, x
): return cls
._AggregationFunction
_NAMES
.get(x
, "")
1173 AggregationFunction_Name
= classmethod(AggregationFunction_Name
)
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:
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
1245 def IsInitialized(self
, debug_strs
=None):
1247 if (not self
.has_property_
):
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
1256 n
+= self
.lengthString(self
.property_
.ByteSize())
1257 if (self
.has_aggregation_function_
): n
+= 1 + self
.lengthVarInt64(self
.aggregation_function_
)
1260 def ByteSizePartial(self
):
1262 if (self
.has_property_
):
1264 n
+= self
.lengthString(self
.property_
.ByteSizePartial())
1265 if (self
.has_aggregation_function_
): n
+= 1 + self
.lengthVarInt64(self
.aggregation_function_
)
1269 self
.clear_property()
1270 self
.clear_aggregation_function()
1272 def OutputUnchecked(self
, out
):
1274 out
.putVarInt32(self
.property_
.ByteSize())
1275 self
.property_
.OutputUnchecked(out
)
1276 if (self
.has_aggregation_function_
):
1278 out
.putVarInt32(self
.aggregation_function_
)
1280 def OutputPartial(self
, out
):
1281 if (self
.has_property_
):
1283 out
.putVarInt32(self
.property_
.ByteSizePartial())
1284 self
.property_
.OutputPartial(out
)
1285 if (self
.has_aggregation_function_
):
1287 out
.putVarInt32(self
.aggregation_function_
)
1289 def TryMerge(self
, d
):
1290 while d
.avail() > 0:
1291 tt
= d
.getVarInt32()
1293 length
= d
.getVarInt32()
1294 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1296 self
.mutable_property().TryMerge(tmp
)
1299 self
.set_aggregation_function(d
.getVarInt32())
1303 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1307 def __str__(self
, prefix
="", printElemNumber
=0):
1309 if self
.has_property_
:
1310 res
+=prefix
+"property <\n"
1311 res
+=self
.property_
.__str
__(prefix
+ " ", printElemNumber
)
1313 if self
.has_aggregation_function_
: res
+=prefix
+("aggregation_function: %s\n" % self
.DebugFormatInt32(self
.aggregation_function_
))
1317 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1318 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1321 kaggregation_function
= 2
1323 _TEXT
= _BuildTagLookupTable({
1326 2: "aggregation_function",
1329 _TYPES
= _BuildTagLookupTable({
1330 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1331 1: ProtocolBuffer
.Encoder
.STRING
,
1332 2: ProtocolBuffer
.Encoder
.NUMERIC
,
1333 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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
):
1351 _Direction_NAMES
= {
1356 def Direction_Name(cls
, x
): return cls
._Direction
_NAMES
.get(x
, "")
1357 Direction_Name
= classmethod(Direction_Name
)
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
1381 def clear_direction(self
):
1382 if self
.has_direction_
:
1383 self
.has_direction_
= 0
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:
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
1429 def IsInitialized(self
, debug_strs
=None):
1431 if (not self
.has_property_
):
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
1440 n
+= self
.lengthString(self
.property_
.ByteSize())
1441 if (self
.has_direction_
): n
+= 1 + self
.lengthVarInt64(self
.direction_
)
1444 def ByteSizePartial(self
):
1446 if (self
.has_property_
):
1448 n
+= self
.lengthString(self
.property_
.ByteSizePartial())
1449 if (self
.has_direction_
): n
+= 1 + self
.lengthVarInt64(self
.direction_
)
1453 self
.clear_property()
1454 self
.clear_direction()
1456 def OutputUnchecked(self
, out
):
1458 out
.putVarInt32(self
.property_
.ByteSize())
1459 self
.property_
.OutputUnchecked(out
)
1460 if (self
.has_direction_
):
1462 out
.putVarInt32(self
.direction_
)
1464 def OutputPartial(self
, out
):
1465 if (self
.has_property_
):
1467 out
.putVarInt32(self
.property_
.ByteSizePartial())
1468 self
.property_
.OutputPartial(out
)
1469 if (self
.has_direction_
):
1471 out
.putVarInt32(self
.direction_
)
1473 def TryMerge(self
, d
):
1474 while d
.avail() > 0:
1475 tt
= d
.getVarInt32()
1477 length
= d
.getVarInt32()
1478 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1480 self
.mutable_property().TryMerge(tmp
)
1483 self
.set_direction(d
.getVarInt32())
1487 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1491 def __str__(self
, prefix
="", printElemNumber
=0):
1493 if self
.has_property_
:
1494 res
+=prefix
+"property <\n"
1495 res
+=self
.property_
.__str
__(prefix
+ " ", printElemNumber
)
1497 if self
.has_direction_
: res
+=prefix
+("direction: %s\n" % self
.DebugFormatInt32(self
.direction_
))
1501 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1502 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1507 _TEXT
= _BuildTagLookupTable({
1513 _TYPES
= _BuildTagLookupTable({
1514 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1515 1: ProtocolBuffer
.Encoder
.STRING
,
1516 2: ProtocolBuffer
.Encoder
.NUMERIC
,
1517 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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()
1547 if self
.composite_filter_
is None: self
.composite_filter_
= CompositeFilter()
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()
1566 if self
.property_filter_
is None: self
.property_filter_
= PropertyFilter()
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()
1585 if self
.bounding_circle_filter_
is None: self
.bounding_circle_filter_
= BoundingCircleFilter()
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()
1604 if self
.bounding_box_filter_
is None: self
.bounding_box_filter_
= BoundingBoxFilter()
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:
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
1666 def IsInitialized(self
, debug_strs
=None):
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
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())
1682 def ByteSizePartial(self
):
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())
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_
):
1699 out
.putVarInt32(self
.composite_filter_
.ByteSize())
1700 self
.composite_filter_
.OutputUnchecked(out
)
1701 if (self
.has_property_filter_
):
1703 out
.putVarInt32(self
.property_filter_
.ByteSize())
1704 self
.property_filter_
.OutputUnchecked(out
)
1705 if (self
.has_bounding_circle_filter_
):
1707 out
.putVarInt32(self
.bounding_circle_filter_
.ByteSize())
1708 self
.bounding_circle_filter_
.OutputUnchecked(out
)
1709 if (self
.has_bounding_box_filter_
):
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_
):
1717 out
.putVarInt32(self
.composite_filter_
.ByteSizePartial())
1718 self
.composite_filter_
.OutputPartial(out
)
1719 if (self
.has_property_filter_
):
1721 out
.putVarInt32(self
.property_filter_
.ByteSizePartial())
1722 self
.property_filter_
.OutputPartial(out
)
1723 if (self
.has_bounding_circle_filter_
):
1725 out
.putVarInt32(self
.bounding_circle_filter_
.ByteSizePartial())
1726 self
.bounding_circle_filter_
.OutputPartial(out
)
1727 if (self
.has_bounding_box_filter_
):
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()
1736 length
= d
.getVarInt32()
1737 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1739 self
.mutable_composite_filter().TryMerge(tmp
)
1742 length
= d
.getVarInt32()
1743 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1745 self
.mutable_property_filter().TryMerge(tmp
)
1748 length
= d
.getVarInt32()
1749 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1751 self
.mutable_bounding_circle_filter().TryMerge(tmp
)
1754 length
= d
.getVarInt32()
1755 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1757 self
.mutable_bounding_box_filter().TryMerge(tmp
)
1761 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1765 def __str__(self
, prefix
="", printElemNumber
=0):
1767 if self
.has_composite_filter_
:
1768 res
+=prefix
+"composite_filter <\n"
1769 res
+=self
.composite_filter_
.__str
__(prefix
+ " ", printElemNumber
)
1771 if self
.has_property_filter_
:
1772 res
+=prefix
+"property_filter <\n"
1773 res
+=self
.property_filter_
.__str
__(prefix
+ " ", printElemNumber
)
1775 if self
.has_bounding_circle_filter_
:
1776 res
+=prefix
+"bounding_circle_filter <\n"
1777 res
+=self
.bounding_circle_filter_
.__str
__(prefix
+ " ", printElemNumber
)
1779 if self
.has_bounding_box_filter_
:
1780 res
+=prefix
+"bounding_box_filter <\n"
1781 res
+=self
.bounding_box_filter_
.__str
__(prefix
+ " ", printElemNumber
)
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({
1796 1: "composite_filter",
1797 2: "property_filter",
1798 3: "bounding_circle_filter",
1799 4: "bounding_box_filter",
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
)
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
):
1829 def Operator_Name(cls
, x
): return cls
._Operator
_NAMES
.get(x
, "")
1830 Operator_Name
= classmethod(Operator_Name
)
1835 def __init__(self
, contents
=None):
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
1845 def clear_operator(self
):
1846 if self
.has_operator_
:
1847 self
.has_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
):
1863 self
.filter_
.append(x
)
1866 def clear_filter(self
):
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:
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
1910 def IsInitialized(self
, debug_strs
=None):
1912 if (not self
.has_operator_
):
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
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())
1927 def ByteSizePartial(self
):
1929 if (self
.has_operator_
):
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())
1937 self
.clear_operator()
1940 def OutputUnchecked(self
, out
):
1942 out
.putVarInt32(self
.operator_
)
1943 for i
in xrange(len(self
.filter_
)):
1945 out
.putVarInt32(self
.filter_
[i
].ByteSize())
1946 self
.filter_
[i
].OutputUnchecked(out
)
1948 def OutputPartial(self
, out
):
1949 if (self
.has_operator_
):
1951 out
.putVarInt32(self
.operator_
)
1952 for i
in xrange(len(self
.filter_
)):
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()
1961 self
.set_operator(d
.getVarInt32())
1964 length
= d
.getVarInt32()
1965 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1967 self
.add_filter().TryMerge(tmp
)
1971 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1975 def __str__(self
, prefix
="", printElemNumber
=0):
1977 if self
.has_operator_
: res
+=prefix
+("operator: %s\n" % self
.DebugFormatInt32(self
.operator_
))
1979 for e
in self
.filter_
:
1981 if printElemNumber
: elm
="(%d)" % cnt
1982 res
+=prefix
+("filter%s <\n" % elm
)
1983 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
1989 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1990 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1995 _TEXT
= _BuildTagLookupTable({
2001 _TYPES
= _BuildTagLookupTable({
2002 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2003 1: ProtocolBuffer
.Encoder
.NUMERIC
,
2004 2: ProtocolBuffer
.Encoder
.STRING
,
2005 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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
):
2021 LESS_THAN_OR_EQUAL
= 2
2023 GREATER_THAN_OR_EQUAL
= 4
2029 2: "LESS_THAN_OR_EQUAL",
2031 4: "GREATER_THAN_OR_EQUAL",
2036 def Operator_Name(cls
, x
): return cls
._Operator
_NAMES
.get(x
, "")
2037 Operator_Name
= classmethod(Operator_Name
)
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
2063 def clear_operator(self
):
2064 if self
.has_operator_
:
2065 self
.has_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:
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
2122 def IsInitialized(self
, debug_strs
=None):
2124 if (not self
.has_property_
):
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_
):
2131 if debug_strs
is not None:
2132 debug_strs
.append('Required field: operator not set.')
2133 if (not self
.has_value_
):
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
2142 n
+= self
.lengthString(self
.property_
.ByteSize())
2143 n
+= self
.lengthVarInt64(self
.operator_
)
2144 n
+= self
.lengthString(self
.value_
.ByteSize())
2147 def ByteSizePartial(self
):
2149 if (self
.has_property_
):
2151 n
+= self
.lengthString(self
.property_
.ByteSizePartial())
2152 if (self
.has_operator_
):
2154 n
+= self
.lengthVarInt64(self
.operator_
)
2155 if (self
.has_value_
):
2157 n
+= self
.lengthString(self
.value_
.ByteSizePartial())
2161 self
.clear_property()
2162 self
.clear_operator()
2165 def OutputUnchecked(self
, out
):
2167 out
.putVarInt32(self
.property_
.ByteSize())
2168 self
.property_
.OutputUnchecked(out
)
2170 out
.putVarInt32(self
.operator_
)
2172 out
.putVarInt32(self
.value_
.ByteSize())
2173 self
.value_
.OutputUnchecked(out
)
2175 def OutputPartial(self
, out
):
2176 if (self
.has_property_
):
2178 out
.putVarInt32(self
.property_
.ByteSizePartial())
2179 self
.property_
.OutputPartial(out
)
2180 if (self
.has_operator_
):
2182 out
.putVarInt32(self
.operator_
)
2183 if (self
.has_value_
):
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()
2192 length
= d
.getVarInt32()
2193 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2195 self
.mutable_property().TryMerge(tmp
)
2198 self
.set_operator(d
.getVarInt32())
2201 length
= d
.getVarInt32()
2202 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2204 self
.mutable_value().TryMerge(tmp
)
2208 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2212 def __str__(self
, prefix
="", printElemNumber
=0):
2214 if self
.has_property_
:
2215 res
+=prefix
+"property <\n"
2216 res
+=self
.property_
.__str
__(prefix
+ " ", printElemNumber
)
2218 if self
.has_operator_
: res
+=prefix
+("operator: %s\n" % self
.DebugFormatInt32(self
.operator_
))
2220 res
+=prefix
+"value <\n"
2221 res
+=self
.value_
.__str
__(prefix
+ " ", printElemNumber
)
2226 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2227 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2233 _TEXT
= _BuildTagLookupTable({
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
)
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
):
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:
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
2341 def IsInitialized(self
, debug_strs
=None):
2343 if (not self
.has_property_
):
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_
):
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_
):
2355 if debug_strs
is not None:
2356 debug_strs
.append('Required field: radius_meters not set.')
2361 n
+= self
.lengthString(self
.property_
.ByteSize())
2362 n
+= self
.lengthString(self
.center_
.ByteSize())
2365 def ByteSizePartial(self
):
2367 if (self
.has_property_
):
2369 n
+= self
.lengthString(self
.property_
.ByteSizePartial())
2370 if (self
.has_center_
):
2372 n
+= self
.lengthString(self
.center_
.ByteSizePartial())
2373 if (self
.has_radius_meters_
):
2378 self
.clear_property()
2380 self
.clear_radius_meters()
2382 def OutputUnchecked(self
, out
):
2384 out
.putVarInt32(self
.property_
.ByteSize())
2385 self
.property_
.OutputUnchecked(out
)
2387 out
.putVarInt32(self
.center_
.ByteSize())
2388 self
.center_
.OutputUnchecked(out
)
2390 out
.putDouble(self
.radius_meters_
)
2392 def OutputPartial(self
, out
):
2393 if (self
.has_property_
):
2395 out
.putVarInt32(self
.property_
.ByteSizePartial())
2396 self
.property_
.OutputPartial(out
)
2397 if (self
.has_center_
):
2399 out
.putVarInt32(self
.center_
.ByteSizePartial())
2400 self
.center_
.OutputPartial(out
)
2401 if (self
.has_radius_meters_
):
2403 out
.putDouble(self
.radius_meters_
)
2405 def TryMerge(self
, d
):
2406 while d
.avail() > 0:
2407 tt
= d
.getVarInt32()
2409 length
= d
.getVarInt32()
2410 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2412 self
.mutable_property().TryMerge(tmp
)
2415 length
= d
.getVarInt32()
2416 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2418 self
.mutable_center().TryMerge(tmp
)
2421 self
.set_radius_meters(d
.getDouble())
2425 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2429 def __str__(self
, prefix
="", printElemNumber
=0):
2431 if self
.has_property_
:
2432 res
+=prefix
+"property <\n"
2433 res
+=self
.property_
.__str
__(prefix
+ " ", printElemNumber
)
2435 if self
.has_center_
:
2436 res
+=prefix
+"center <\n"
2437 res
+=self
.center_
.__str
__(prefix
+ " ", printElemNumber
)
2439 if self
.has_radius_meters_
: res
+=prefix
+("radius_meters: %s\n" % self
.DebugFormat(self
.radius_meters_
))
2443 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2444 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2450 _TEXT
= _BuildTagLookupTable({
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
)
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
):
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:
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
2553 def IsInitialized(self
, debug_strs
=None):
2555 if (not self
.has_property_
):
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_
):
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_
):
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
2574 n
+= self
.lengthString(self
.property_
.ByteSize())
2575 n
+= self
.lengthString(self
.southwest_
.ByteSize())
2576 n
+= self
.lengthString(self
.northeast_
.ByteSize())
2579 def ByteSizePartial(self
):
2581 if (self
.has_property_
):
2583 n
+= self
.lengthString(self
.property_
.ByteSizePartial())
2584 if (self
.has_southwest_
):
2586 n
+= self
.lengthString(self
.southwest_
.ByteSizePartial())
2587 if (self
.has_northeast_
):
2589 n
+= self
.lengthString(self
.northeast_
.ByteSizePartial())
2593 self
.clear_property()
2594 self
.clear_southwest()
2595 self
.clear_northeast()
2597 def OutputUnchecked(self
, out
):
2599 out
.putVarInt32(self
.property_
.ByteSize())
2600 self
.property_
.OutputUnchecked(out
)
2602 out
.putVarInt32(self
.southwest_
.ByteSize())
2603 self
.southwest_
.OutputUnchecked(out
)
2605 out
.putVarInt32(self
.northeast_
.ByteSize())
2606 self
.northeast_
.OutputUnchecked(out
)
2608 def OutputPartial(self
, out
):
2609 if (self
.has_property_
):
2611 out
.putVarInt32(self
.property_
.ByteSizePartial())
2612 self
.property_
.OutputPartial(out
)
2613 if (self
.has_southwest_
):
2615 out
.putVarInt32(self
.southwest_
.ByteSizePartial())
2616 self
.southwest_
.OutputPartial(out
)
2617 if (self
.has_northeast_
):
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()
2626 length
= d
.getVarInt32()
2627 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2629 self
.mutable_property().TryMerge(tmp
)
2632 length
= d
.getVarInt32()
2633 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2635 self
.mutable_southwest().TryMerge(tmp
)
2638 length
= d
.getVarInt32()
2639 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2641 self
.mutable_northeast().TryMerge(tmp
)
2645 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2649 def __str__(self
, prefix
="", printElemNumber
=0):
2651 if self
.has_property_
:
2652 res
+=prefix
+"property <\n"
2653 res
+=self
.property_
.__str
__(prefix
+ " ", printElemNumber
)
2655 if self
.has_southwest_
:
2656 res
+=prefix
+"southwest <\n"
2657 res
+=self
.southwest_
.__str
__(prefix
+ " ", printElemNumber
)
2659 if self
.has_northeast_
:
2660 res
+=prefix
+"northeast <\n"
2661 res
+=self
.northeast_
.__str
__(prefix
+ " ", printElemNumber
)
2666 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2667 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2673 _TEXT
= _BuildTagLookupTable({
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
)
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
2700 has_allow_literal_
= 0
2703 def __init__(self
, contents
=None):
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
):
2745 self
.name_arg_
.append(x
)
2748 def clear_name_arg(self
):
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
):
2761 self
.number_arg_
.append(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:
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
2815 def IsInitialized(self
, debug_strs
=None):
2817 if (not self
.has_query_string_
):
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
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())
2837 def ByteSizePartial(self
):
2839 if (self
.has_query_string_
):
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())
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
):
2857 out
.putPrefixedString(self
.query_string_
)
2858 if (self
.has_allow_literal_
):
2860 out
.putBoolean(self
.allow_literal_
)
2861 for i
in xrange(len(self
.name_arg_
)):
2863 out
.putVarInt32(self
.name_arg_
[i
].ByteSize())
2864 self
.name_arg_
[i
].OutputUnchecked(out
)
2865 for i
in xrange(len(self
.number_arg_
)):
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_
):
2873 out
.putPrefixedString(self
.query_string_
)
2874 if (self
.has_allow_literal_
):
2876 out
.putBoolean(self
.allow_literal_
)
2877 for i
in xrange(len(self
.name_arg_
)):
2879 out
.putVarInt32(self
.name_arg_
[i
].ByteSizePartial())
2880 self
.name_arg_
[i
].OutputPartial(out
)
2881 for i
in xrange(len(self
.number_arg_
)):
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()
2890 self
.set_query_string(d
.getPrefixedString())
2893 self
.set_allow_literal(d
.getBoolean())
2896 length
= d
.getVarInt32()
2897 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2899 self
.add_name_arg().TryMerge(tmp
)
2902 length
= d
.getVarInt32()
2903 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2905 self
.add_number_arg().TryMerge(tmp
)
2909 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2913 def __str__(self
, prefix
="", printElemNumber
=0):
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_
))
2918 for e
in self
.name_arg_
:
2920 if printElemNumber
: elm
="(%d)" % cnt
2921 res
+=prefix
+("name_arg%s <\n" % elm
)
2922 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2926 for e
in self
.number_arg_
:
2928 if printElemNumber
: elm
="(%d)" % cnt
2929 res
+=prefix
+("number_arg%s <\n" % elm
)
2930 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2936 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2937 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2944 _TEXT
= _BuildTagLookupTable({
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
)
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
):
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
):
2988 def clear_name(self
):
2993 def has_name(self
): return self
.has_name_
2996 if self
.value_
is None:
2997 self
.lazy_init_lock_
.acquire()
2999 if self
.value_
is None: self
.value_
= google
.appengine
.datastore
.entity_v4_pb
.Value()
3001 self
.lazy_init_lock_
.release()
3004 def mutable_value(self
): self
.has_value_
= 1; return self
.value()
3006 def clear_value(self
):
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
3020 def clear_cursor(self
):
3021 if self
.has_cursor_
:
3022 self
.has_cursor_
= 0
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:
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
3071 def IsInitialized(self
, debug_strs
=None):
3073 if (self
.has_value_
and not self
.value_
.IsInitialized(debug_strs
)): initialized
= 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_
))
3083 def ByteSizePartial(self
):
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_
))
3095 def OutputUnchecked(self
, out
):
3096 if (self
.has_name_
):
3098 out
.putPrefixedString(self
.name_
)
3099 if (self
.has_value_
):
3101 out
.putVarInt32(self
.value_
.ByteSize())
3102 self
.value_
.OutputUnchecked(out
)
3103 if (self
.has_cursor_
):
3105 out
.putPrefixedString(self
.cursor_
)
3107 def OutputPartial(self
, out
):
3108 if (self
.has_name_
):
3110 out
.putPrefixedString(self
.name_
)
3111 if (self
.has_value_
):
3113 out
.putVarInt32(self
.value_
.ByteSizePartial())
3114 self
.value_
.OutputPartial(out
)
3115 if (self
.has_cursor_
):
3117 out
.putPrefixedString(self
.cursor_
)
3119 def TryMerge(self
, d
):
3120 while d
.avail() > 0:
3121 tt
= d
.getVarInt32()
3123 self
.set_name(d
.getPrefixedString())
3126 length
= d
.getVarInt32()
3127 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3129 self
.mutable_value().TryMerge(tmp
)
3132 self
.set_cursor(d
.getPrefixedString())
3136 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3140 def __str__(self
, prefix
="", printElemNumber
=0):
3142 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
3144 res
+=prefix
+"value <\n"
3145 res
+=self
.value_
.__str
__(prefix
+ " ", printElemNumber
)
3147 if self
.has_cursor_
: res
+=prefix
+("cursor: %s\n" % self
.DebugFormatString(self
.cursor_
))
3151 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3152 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3158 _TEXT
= _BuildTagLookupTable({
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
)
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
):
3186 MORE_RESULTS_AFTER_LIMIT
= 2
3189 _MoreResultsType_NAMES
= {
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_
= ""
3204 has_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
):
3239 self
.entity_result_
.append(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:
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
3366 def IsInitialized(self
, debug_strs
=None):
3368 if (not self
.has_entity_result_type_
):
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_
):
3376 if debug_strs
is not None:
3377 debug_strs
.append('Required field: more_results not set.')
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_
)
3392 def ByteSizePartial(self
):
3394 if (self
.has_entity_result_type_
):
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_
):
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_
)
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
):
3419 out
.putVarInt32(self
.entity_result_type_
)
3420 for i
in xrange(len(self
.entity_result_
)):
3422 out
.putVarInt32(self
.entity_result_
[i
].ByteSize())
3423 self
.entity_result_
[i
].OutputUnchecked(out
)
3424 if (self
.has_skipped_cursor_
):
3426 out
.putPrefixedString(self
.skipped_cursor_
)
3427 if (self
.has_end_cursor_
):
3429 out
.putPrefixedString(self
.end_cursor_
)
3431 out
.putVarInt32(self
.more_results_
)
3432 if (self
.has_skipped_results_
):
3434 out
.putVarInt32(self
.skipped_results_
)
3435 if (self
.has_snapshot_version_
):
3437 out
.putVarInt64(self
.snapshot_version_
)
3439 def OutputPartial(self
, out
):
3440 if (self
.has_entity_result_type_
):
3442 out
.putVarInt32(self
.entity_result_type_
)
3443 for i
in xrange(len(self
.entity_result_
)):
3445 out
.putVarInt32(self
.entity_result_
[i
].ByteSizePartial())
3446 self
.entity_result_
[i
].OutputPartial(out
)
3447 if (self
.has_skipped_cursor_
):
3449 out
.putPrefixedString(self
.skipped_cursor_
)
3450 if (self
.has_end_cursor_
):
3452 out
.putPrefixedString(self
.end_cursor_
)
3453 if (self
.has_more_results_
):
3455 out
.putVarInt32(self
.more_results_
)
3456 if (self
.has_skipped_results_
):
3458 out
.putVarInt32(self
.skipped_results_
)
3459 if (self
.has_snapshot_version_
):
3461 out
.putVarInt64(self
.snapshot_version_
)
3463 def TryMerge(self
, d
):
3464 while d
.avail() > 0:
3465 tt
= d
.getVarInt32()
3467 self
.set_entity_result_type(d
.getVarInt32())
3470 length
= d
.getVarInt32()
3471 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3473 self
.add_entity_result().TryMerge(tmp
)
3476 self
.set_skipped_cursor(d
.getPrefixedString())
3479 self
.set_end_cursor(d
.getPrefixedString())
3482 self
.set_more_results(d
.getVarInt32())
3485 self
.set_skipped_results(d
.getVarInt32())
3488 self
.set_snapshot_version(d
.getVarInt64())
3492 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3496 def __str__(self
, prefix
="", printElemNumber
=0):
3498 if self
.has_entity_result_type_
: res
+=prefix
+("entity_result_type: %s\n" % self
.DebugFormatInt32(self
.entity_result_type_
))
3500 for e
in self
.entity_result_
:
3502 if printElemNumber
: elm
="(%d)" % cnt
3503 res
+=prefix
+("entity_result%s <\n" % elm
)
3504 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
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_
))
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
3523 kskipped_results
= 6
3524 ksnapshot_version
= 7
3526 _TEXT
= _BuildTagLookupTable({
3528 1: "entity_result_type",
3530 3: "skipped_cursor",
3533 6: "skipped_results",
3534 7: "snapshot_version",
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
)
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
):
3567 _Operation_NAMES
= {
3575 def Operation_Name(cls
, x
): return cls
._Operation
_NAMES
.get(x
, "")
3576 Operation_Name
= classmethod(Operation_Name
)
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
):
3600 def has_op(self
): return self
.has_op_
3603 if self
.key_
is None:
3604 self
.lazy_init_lock_
.acquire()
3606 if self
.key_
is None: self
.key_
= google
.appengine
.datastore
.entity_v4_pb
.Key()
3608 self
.lazy_init_lock_
.release()
3611 def mutable_key(self
): self
.has_key_
= 1; return self
.key()
3613 def clear_key(self
):
3617 if self
.key_
is not None: self
.key_
.Clear()
3619 def has_key(self
): return self
.has_key_
3622 if self
.entity_
is None:
3623 self
.lazy_init_lock_
.acquire()
3625 if self
.entity_
is None: self
.entity_
= google
.appengine
.datastore
.entity_v4_pb
.Entity()
3627 self
.lazy_init_lock_
.release()
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:
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
3684 def IsInitialized(self
, debug_strs
=None):
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
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())
3697 def ByteSizePartial(self
):
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())
3709 def OutputUnchecked(self
, out
):
3712 out
.putVarInt32(self
.op_
)
3715 out
.putVarInt32(self
.key_
.ByteSize())
3716 self
.key_
.OutputUnchecked(out
)
3717 if (self
.has_entity_
):
3719 out
.putVarInt32(self
.entity_
.ByteSize())
3720 self
.entity_
.OutputUnchecked(out
)
3722 def OutputPartial(self
, out
):
3725 out
.putVarInt32(self
.op_
)
3728 out
.putVarInt32(self
.key_
.ByteSizePartial())
3729 self
.key_
.OutputPartial(out
)
3730 if (self
.has_entity_
):
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()
3739 self
.set_op(d
.getVarInt32())
3742 length
= d
.getVarInt32()
3743 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3745 self
.mutable_key().TryMerge(tmp
)
3748 length
= d
.getVarInt32()
3749 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3751 self
.mutable_entity().TryMerge(tmp
)
3755 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3759 def __str__(self
, prefix
="", printElemNumber
=0):
3761 if self
.has_op_
: res
+=prefix
+("op: %s\n" % self
.DebugFormatInt32(self
.op_
))
3763 res
+=prefix
+"key <\n"
3764 res
+=self
.key_
.__str
__(prefix
+ " ", printElemNumber
)
3766 if self
.has_entity_
:
3767 res
+=prefix
+"entity <\n"
3768 res
+=self
.entity_
.__str
__(prefix
+ " ", printElemNumber
)
3773 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3774 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3780 _TEXT
= _BuildTagLookupTable({
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
)
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
):
3807 has_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
)
3815 if self
.key_
is None:
3816 self
.lazy_init_lock_
.acquire()
3818 if self
.key_
is None: self
.key_
= google
.appengine
.datastore
.entity_v4_pb
.Key()
3820 self
.lazy_init_lock_
.release()
3823 def mutable_key(self
): self
.has_key_
= 1; return self
.key()
3825 def clear_key(self
):
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:
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
3887 def IsInitialized(self
, debug_strs
=None):
3889 if (self
.has_key_
and not self
.key_
.IsInitialized(debug_strs
)): initialized
= 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_
)
3898 def ByteSizePartial(self
):
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_
)
3906 self
.clear_new_version()
3908 def OutputUnchecked(self
, out
):
3911 out
.putVarInt32(self
.key_
.ByteSize())
3912 self
.key_
.OutputUnchecked(out
)
3913 if (self
.has_new_version_
):
3915 out
.putVarInt64(self
.new_version_
)
3917 def OutputPartial(self
, out
):
3920 out
.putVarInt32(self
.key_
.ByteSizePartial())
3921 self
.key_
.OutputPartial(out
)
3922 if (self
.has_new_version_
):
3924 out
.putVarInt64(self
.new_version_
)
3926 def TryMerge(self
, d
):
3927 while d
.avail() > 0:
3928 tt
= d
.getVarInt32()
3930 length
= d
.getVarInt32()
3931 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3933 self
.mutable_key().TryMerge(tmp
)
3936 self
.set_new_version(d
.getVarInt64())
3940 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3944 def __str__(self
, prefix
="", printElemNumber
=0):
3947 res
+=prefix
+"key <\n"
3948 res
+=self
.key_
.__str
__(prefix
+ " ", printElemNumber
)
3950 if self
.has_new_version_
: res
+=prefix
+("new_version: %s\n" % self
.DebugFormatInt64(self
.new_version_
))
3954 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3955 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3960 _TEXT
= _BuildTagLookupTable({
3966 _TYPES
= _BuildTagLookupTable({
3967 0: ProtocolBuffer
.Encoder
.NUMERIC
,
3968 3: ProtocolBuffer
.Encoder
.STRING
,
3969 4: ProtocolBuffer
.Encoder
.NUMERIC
,
3970 }, 4, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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
):
3986 def __init__(self
, contents
=None):
3990 self
.insert_auto_id_
= []
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
)
4008 def clear_upsert(self
):
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
)
4024 def clear_update(self
):
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
)
4040 def clear_insert(self
):
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
)
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
)
4072 def clear_delete(self
):
4074 def force(self
): return self
.force_
4076 def set_force(self
, x
):
4080 def clear_force(self
):
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:
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
4145 def IsInitialized(self
, debug_strs
=None):
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
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
4174 def ByteSizePartial(self
):
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
4193 self
.clear_insert_auto_id()
4197 def OutputUnchecked(self
, out
):
4198 for i
in xrange(len(self
.upsert_
)):
4200 out
.putVarInt32(self
.upsert_
[i
].ByteSize())
4201 self
.upsert_
[i
].OutputUnchecked(out
)
4202 for i
in xrange(len(self
.update_
)):
4204 out
.putVarInt32(self
.update_
[i
].ByteSize())
4205 self
.update_
[i
].OutputUnchecked(out
)
4206 for i
in xrange(len(self
.insert_
)):
4208 out
.putVarInt32(self
.insert_
[i
].ByteSize())
4209 self
.insert_
[i
].OutputUnchecked(out
)
4210 for i
in xrange(len(self
.insert_auto_id_
)):
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_
)):
4216 out
.putVarInt32(self
.delete_
[i
].ByteSize())
4217 self
.delete_
[i
].OutputUnchecked(out
)
4218 if (self
.has_force_
):
4220 out
.putBoolean(self
.force_
)
4222 def OutputPartial(self
, out
):
4223 for i
in xrange(len(self
.upsert_
)):
4225 out
.putVarInt32(self
.upsert_
[i
].ByteSizePartial())
4226 self
.upsert_
[i
].OutputPartial(out
)
4227 for i
in xrange(len(self
.update_
)):
4229 out
.putVarInt32(self
.update_
[i
].ByteSizePartial())
4230 self
.update_
[i
].OutputPartial(out
)
4231 for i
in xrange(len(self
.insert_
)):
4233 out
.putVarInt32(self
.insert_
[i
].ByteSizePartial())
4234 self
.insert_
[i
].OutputPartial(out
)
4235 for i
in xrange(len(self
.insert_auto_id_
)):
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_
)):
4241 out
.putVarInt32(self
.delete_
[i
].ByteSizePartial())
4242 self
.delete_
[i
].OutputPartial(out
)
4243 if (self
.has_force_
):
4245 out
.putBoolean(self
.force_
)
4247 def TryMerge(self
, d
):
4248 while d
.avail() > 0:
4249 tt
= d
.getVarInt32()
4251 length
= d
.getVarInt32()
4252 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4254 self
.add_upsert().TryMerge(tmp
)
4257 length
= d
.getVarInt32()
4258 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4260 self
.add_update().TryMerge(tmp
)
4263 length
= d
.getVarInt32()
4264 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4266 self
.add_insert().TryMerge(tmp
)
4269 length
= d
.getVarInt32()
4270 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4272 self
.add_insert_auto_id().TryMerge(tmp
)
4275 length
= d
.getVarInt32()
4276 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4278 self
.add_delete().TryMerge(tmp
)
4281 self
.set_force(d
.getBoolean())
4285 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
4289 def __str__(self
, prefix
="", printElemNumber
=0):
4292 for e
in self
.upsert_
:
4294 if printElemNumber
: elm
="(%d)" % cnt
4295 res
+=prefix
+("upsert%s <\n" % elm
)
4296 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
4300 for e
in self
.update_
:
4302 if printElemNumber
: elm
="(%d)" % cnt
4303 res
+=prefix
+("update%s <\n" % elm
)
4304 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
4308 for e
in self
.insert_
:
4310 if printElemNumber
: elm
="(%d)" % cnt
4311 res
+=prefix
+("insert%s <\n" % elm
)
4312 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
4316 for e
in self
.insert_auto_id_
:
4318 if printElemNumber
: elm
="(%d)" % cnt
4319 res
+=prefix
+("insert_auto_id%s <\n" % elm
)
4320 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
4324 for e
in self
.delete_
:
4326 if printElemNumber
: elm
="(%d)" % cnt
4327 res
+=prefix
+("delete%s <\n" % elm
)
4328 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
4331 if self
.has_force_
: res
+=prefix
+("force: %s\n" % self
.DebugFormatBool(self
.force_
))
4335 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
4336 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
4345 _TEXT
= _BuildTagLookupTable({
4350 4: "insert_auto_id",
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
)
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
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
)
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:
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
4554 def IsInitialized(self
, debug_strs
=None):
4556 if (not self
.has_index_updates_
):
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
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
])
4581 def ByteSizePartial(self
):
4583 if (self
.has_index_updates_
):
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
])
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
):
4611 out
.putVarInt32(self
.index_updates_
)
4612 for i
in xrange(len(self
.insert_auto_id_key_
)):
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_
)):
4618 out
.putVarInt64(self
.upsert_version_
[i
])
4619 for i
in xrange(len(self
.update_version_
)):
4621 out
.putVarInt64(self
.update_version_
[i
])
4622 for i
in xrange(len(self
.insert_version_
)):
4624 out
.putVarInt64(self
.insert_version_
[i
])
4625 for i
in xrange(len(self
.insert_auto_id_version_
)):
4627 out
.putVarInt64(self
.insert_auto_id_version_
[i
])
4628 for i
in xrange(len(self
.delete_version_
)):
4630 out
.putVarInt64(self
.delete_version_
[i
])
4632 def OutputPartial(self
, out
):
4633 if (self
.has_index_updates_
):
4635 out
.putVarInt32(self
.index_updates_
)
4636 for i
in xrange(len(self
.insert_auto_id_key_
)):
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_
)):
4642 out
.putVarInt64(self
.upsert_version_
[i
])
4643 for i
in xrange(len(self
.update_version_
)):
4645 out
.putVarInt64(self
.update_version_
[i
])
4646 for i
in xrange(len(self
.insert_version_
)):
4648 out
.putVarInt64(self
.insert_version_
[i
])
4649 for i
in xrange(len(self
.insert_auto_id_version_
)):
4651 out
.putVarInt64(self
.insert_auto_id_version_
[i
])
4652 for i
in xrange(len(self
.delete_version_
)):
4654 out
.putVarInt64(self
.delete_version_
[i
])
4656 def TryMerge(self
, d
):
4657 while d
.avail() > 0:
4658 tt
= d
.getVarInt32()
4660 self
.set_index_updates(d
.getVarInt32())
4663 length
= d
.getVarInt32()
4664 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4666 self
.add_insert_auto_id_key().TryMerge(tmp
)
4669 self
.add_upsert_version(d
.getVarInt64())
4672 self
.add_update_version(d
.getVarInt64())
4675 self
.add_insert_version(d
.getVarInt64())
4678 self
.add_insert_auto_id_version(d
.getVarInt64())
4681 self
.add_delete_version(d
.getVarInt64())
4685 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
4689 def __str__(self
, prefix
="", printElemNumber
=0):
4691 if self
.has_index_updates_
: res
+=prefix
+("index_updates: %s\n" % self
.DebugFormatInt32(self
.index_updates_
))
4693 for e
in self
.insert_auto_id_key_
:
4695 if printElemNumber
: elm
="(%d)" % cnt
4696 res
+=prefix
+("insert_auto_id_key%s <\n" % elm
)
4697 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
4701 for e
in self
.upsert_version_
:
4703 if printElemNumber
: elm
="(%d)" % cnt
4704 res
+=prefix
+("upsert_version%s: %s\n" % (elm
, self
.DebugFormatInt64(e
)))
4707 for e
in self
.update_version_
:
4709 if printElemNumber
: elm
="(%d)" % cnt
4710 res
+=prefix
+("update_version%s: %s\n" % (elm
, self
.DebugFormatInt64(e
)))
4713 for e
in self
.insert_version_
:
4715 if printElemNumber
: elm
="(%d)" % cnt
4716 res
+=prefix
+("insert_version%s: %s\n" % (elm
, self
.DebugFormatInt64(e
)))
4719 for e
in self
.insert_auto_id_version_
:
4721 if printElemNumber
: elm
="(%d)" % cnt
4722 res
+=prefix
+("insert_auto_id_version%s: %s\n" % (elm
, self
.DebugFormatInt64(e
)))
4725 for e
in self
.delete_version_
:
4727 if printElemNumber
: elm
="(%d)" % cnt
4728 res
+=prefix
+("delete_version%s: %s\n" % (elm
, self
.DebugFormatInt64(e
)))
4733 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
4734 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
4737 kinsert_auto_id_key
= 2
4741 kinsert_auto_id_version
= 6
4744 _TEXT
= _BuildTagLookupTable({
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",
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
)
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
):
4783 _ReadConsistency_NAMES
= {
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
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:
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
4867 def IsInitialized(self
, debug_strs
=None):
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_
))
4877 def ByteSizePartial(self
):
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_
))
4884 self
.clear_read_consistency()
4885 self
.clear_transaction()
4887 def OutputUnchecked(self
, out
):
4888 if (self
.has_read_consistency_
):
4890 out
.putVarInt32(self
.read_consistency_
)
4891 if (self
.has_transaction_
):
4893 out
.putPrefixedString(self
.transaction_
)
4895 def OutputPartial(self
, out
):
4896 if (self
.has_read_consistency_
):
4898 out
.putVarInt32(self
.read_consistency_
)
4899 if (self
.has_transaction_
):
4901 out
.putPrefixedString(self
.transaction_
)
4903 def TryMerge(self
, d
):
4904 while d
.avail() > 0:
4905 tt
= d
.getVarInt32()
4907 self
.set_read_consistency(d
.getVarInt32())
4910 self
.set_transaction(d
.getPrefixedString())
4914 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
4918 def __str__(self
, prefix
="", printElemNumber
=0):
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_
))
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
4931 _TEXT
= _BuildTagLookupTable({
4933 1: "read_consistency",
4937 _TYPES
= _BuildTagLookupTable({
4938 0: ProtocolBuffer
.Encoder
.NUMERIC
,
4939 1: ProtocolBuffer
.Encoder
.NUMERIC
,
4940 2: ProtocolBuffer
.Encoder
.STRING
,
4941 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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):
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()
4966 if self
.read_options_
is None: self
.read_options_
= ReadOptions()
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_
4987 def mutable_key(self
, i
):
4991 x
= google
.appengine
.datastore
.entity_v4_pb
.Key()
4995 def clear_key(self
):
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:
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
5039 def IsInitialized(self
, debug_strs
=None):
5041 if (self
.has_read_options_
and not self
.read_options_
.IsInitialized(debug_strs
)): initialized
= 0
5043 if not p
.IsInitialized(debug_strs
): initialized
=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())
5053 def ByteSizePartial(self
):
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())
5061 self
.clear_read_options()
5064 def OutputUnchecked(self
, out
):
5065 if (self
.has_read_options_
):
5067 out
.putVarInt32(self
.read_options_
.ByteSize())
5068 self
.read_options_
.OutputUnchecked(out
)
5069 for i
in xrange(len(self
.key_
)):
5071 out
.putVarInt32(self
.key_
[i
].ByteSize())
5072 self
.key_
[i
].OutputUnchecked(out
)
5074 def OutputPartial(self
, out
):
5075 if (self
.has_read_options_
):
5077 out
.putVarInt32(self
.read_options_
.ByteSizePartial())
5078 self
.read_options_
.OutputPartial(out
)
5079 for i
in xrange(len(self
.key_
)):
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()
5088 length
= d
.getVarInt32()
5089 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5091 self
.mutable_read_options().TryMerge(tmp
)
5094 length
= d
.getVarInt32()
5095 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5097 self
.add_key().TryMerge(tmp
)
5101 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
5105 def __str__(self
, prefix
="", printElemNumber
=0):
5107 if self
.has_read_options_
:
5108 res
+=prefix
+"read_options <\n"
5109 res
+=self
.read_options_
.__str
__(prefix
+ " ", printElemNumber
)
5114 if printElemNumber
: elm
="(%d)" % cnt
5115 res
+=prefix
+("key%s <\n" % elm
)
5116 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
5122 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
5123 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
5128 _TEXT
= _BuildTagLookupTable({
5134 _TYPES
= _BuildTagLookupTable({
5135 0: ProtocolBuffer
.Encoder
.NUMERIC
,
5136 1: ProtocolBuffer
.Encoder
.STRING
,
5137 3: ProtocolBuffer
.Encoder
.STRING
,
5138 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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):
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_
5162 return self
.found_
[i
]
5164 def mutable_found(self
, i
):
5165 return self
.found_
[i
]
5167 def add_found(self
):
5169 self
.found_
.append(x
)
5172 def clear_found(self
):
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
):
5185 self
.missing_
.append(x
)
5188 def clear_missing(self
):
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
)
5204 def clear_deferred(self
):
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:
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
5253 def IsInitialized(self
, debug_strs
=None):
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
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())
5273 def ByteSizePartial(self
):
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())
5285 self
.clear_missing()
5286 self
.clear_deferred()
5288 def OutputUnchecked(self
, out
):
5289 for i
in xrange(len(self
.found_
)):
5291 out
.putVarInt32(self
.found_
[i
].ByteSize())
5292 self
.found_
[i
].OutputUnchecked(out
)
5293 for i
in xrange(len(self
.missing_
)):
5295 out
.putVarInt32(self
.missing_
[i
].ByteSize())
5296 self
.missing_
[i
].OutputUnchecked(out
)
5297 for i
in xrange(len(self
.deferred_
)):
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_
)):
5305 out
.putVarInt32(self
.found_
[i
].ByteSizePartial())
5306 self
.found_
[i
].OutputPartial(out
)
5307 for i
in xrange(len(self
.missing_
)):
5309 out
.putVarInt32(self
.missing_
[i
].ByteSizePartial())
5310 self
.missing_
[i
].OutputPartial(out
)
5311 for i
in xrange(len(self
.deferred_
)):
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()
5320 length
= d
.getVarInt32()
5321 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5323 self
.add_found().TryMerge(tmp
)
5326 length
= d
.getVarInt32()
5327 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5329 self
.add_missing().TryMerge(tmp
)
5332 length
= d
.getVarInt32()
5333 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5335 self
.add_deferred().TryMerge(tmp
)
5339 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
5343 def __str__(self
, prefix
="", printElemNumber
=0):
5346 for e
in self
.found_
:
5348 if printElemNumber
: elm
="(%d)" % cnt
5349 res
+=prefix
+("found%s <\n" % elm
)
5350 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
5354 for e
in self
.missing_
:
5356 if printElemNumber
: elm
="(%d)" % cnt
5357 res
+=prefix
+("missing%s <\n" % elm
)
5358 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
5362 for e
in self
.deferred_
:
5364 if printElemNumber
: elm
="(%d)" % cnt
5365 res
+=prefix
+("deferred%s <\n" % elm
)
5366 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
5372 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
5373 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
5379 _TEXT
= _BuildTagLookupTable({
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
)
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
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()
5425 if self
.read_options_
is None: self
.read_options_
= ReadOptions()
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()
5444 if self
.partition_id_
is None: self
.partition_id_
= google
.appengine
.datastore
.entity_v4_pb
.PartitionId()
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_
5460 if self
.query_
is None:
5461 self
.lazy_init_lock_
.acquire()
5463 if self
.query_
is None: self
.query_
= Query()
5465 self
.lazy_init_lock_
.release()
5468 def mutable_query(self
): self
.has_query_
= 1; return self
.query()
5470 def clear_query(self
):
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()
5482 if self
.gql_query_
is None: self
.gql_query_
= GqlQuery()
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:
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
5576 def IsInitialized(self
, debug_strs
=None):
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
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_
)
5594 def ByteSizePartial(self
):
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_
)
5605 self
.clear_read_options()
5606 self
.clear_partition_id()
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_
):
5615 out
.putVarInt32(self
.read_options_
.ByteSize())
5616 self
.read_options_
.OutputUnchecked(out
)
5617 if (self
.has_partition_id_
):
5619 out
.putVarInt32(self
.partition_id_
.ByteSize())
5620 self
.partition_id_
.OutputUnchecked(out
)
5621 if (self
.has_query_
):
5623 out
.putVarInt32(self
.query_
.ByteSize())
5624 self
.query_
.OutputUnchecked(out
)
5625 if (self
.has_min_safe_time_seconds_
):
5627 out
.putVarInt64(self
.min_safe_time_seconds_
)
5628 if (self
.has_suggested_batch_size_
):
5630 out
.putVarInt32(self
.suggested_batch_size_
)
5631 if (self
.has_gql_query_
):
5633 out
.putVarInt32(self
.gql_query_
.ByteSize())
5634 self
.gql_query_
.OutputUnchecked(out
)
5636 def OutputPartial(self
, out
):
5637 if (self
.has_read_options_
):
5639 out
.putVarInt32(self
.read_options_
.ByteSizePartial())
5640 self
.read_options_
.OutputPartial(out
)
5641 if (self
.has_partition_id_
):
5643 out
.putVarInt32(self
.partition_id_
.ByteSizePartial())
5644 self
.partition_id_
.OutputPartial(out
)
5645 if (self
.has_query_
):
5647 out
.putVarInt32(self
.query_
.ByteSizePartial())
5648 self
.query_
.OutputPartial(out
)
5649 if (self
.has_min_safe_time_seconds_
):
5651 out
.putVarInt64(self
.min_safe_time_seconds_
)
5652 if (self
.has_suggested_batch_size_
):
5654 out
.putVarInt32(self
.suggested_batch_size_
)
5655 if (self
.has_gql_query_
):
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()
5664 length
= d
.getVarInt32()
5665 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5667 self
.mutable_read_options().TryMerge(tmp
)
5670 length
= d
.getVarInt32()
5671 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5673 self
.mutable_partition_id().TryMerge(tmp
)
5676 length
= d
.getVarInt32()
5677 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5679 self
.mutable_query().TryMerge(tmp
)
5682 self
.set_min_safe_time_seconds(d
.getVarInt64())
5685 self
.set_suggested_batch_size(d
.getVarInt32())
5688 length
= d
.getVarInt32()
5689 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5691 self
.mutable_gql_query().TryMerge(tmp
)
5695 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
5699 def __str__(self
, prefix
="", printElemNumber
=0):
5701 if self
.has_read_options_
:
5702 res
+=prefix
+"read_options <\n"
5703 res
+=self
.read_options_
.__str
__(prefix
+ " ", printElemNumber
)
5705 if self
.has_partition_id_
:
5706 res
+=prefix
+"partition_id <\n"
5707 res
+=self
.partition_id_
.__str
__(prefix
+ " ", printElemNumber
)
5710 res
+=prefix
+"query <\n"
5711 res
+=self
.query_
.__str
__(prefix
+ " ", printElemNumber
)
5713 if self
.has_gql_query_
:
5714 res
+=prefix
+"gql_query <\n"
5715 res
+=self
.gql_query_
.__str
__(prefix
+ " ", printElemNumber
)
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_
))
5722 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
5723 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
5729 kmin_safe_time_seconds
= 4
5730 ksuggested_batch_size
= 5
5732 _TEXT
= _BuildTagLookupTable({
5737 4: "min_safe_time_seconds",
5738 5: "suggested_batch_size",
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
)
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
):
5764 has_query_handle_
= 0
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:
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
5833 def IsInitialized(self
, debug_strs
=None):
5835 if (not self
.has_batch_
):
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
5844 n
+= self
.lengthString(self
.batch_
.ByteSize())
5845 if (self
.has_query_handle_
): n
+= 1 + self
.lengthString(len(self
.query_handle_
))
5848 def ByteSizePartial(self
):
5850 if (self
.has_batch_
):
5852 n
+= self
.lengthString(self
.batch_
.ByteSizePartial())
5853 if (self
.has_query_handle_
): n
+= 1 + self
.lengthString(len(self
.query_handle_
))
5858 self
.clear_query_handle()
5860 def OutputUnchecked(self
, out
):
5862 out
.putVarInt32(self
.batch_
.ByteSize())
5863 self
.batch_
.OutputUnchecked(out
)
5864 if (self
.has_query_handle_
):
5866 out
.putPrefixedString(self
.query_handle_
)
5868 def OutputPartial(self
, out
):
5869 if (self
.has_batch_
):
5871 out
.putVarInt32(self
.batch_
.ByteSizePartial())
5872 self
.batch_
.OutputPartial(out
)
5873 if (self
.has_query_handle_
):
5875 out
.putPrefixedString(self
.query_handle_
)
5877 def TryMerge(self
, d
):
5878 while d
.avail() > 0:
5879 tt
= d
.getVarInt32()
5881 length
= d
.getVarInt32()
5882 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5884 self
.mutable_batch().TryMerge(tmp
)
5887 self
.set_query_handle(d
.getPrefixedString())
5891 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
5895 def __str__(self
, prefix
="", printElemNumber
=0):
5898 res
+=prefix
+"batch <\n"
5899 res
+=self
.batch_
.__str
__(prefix
+ " ", printElemNumber
)
5901 if self
.has_query_handle_
: res
+=prefix
+("query_handle: %s\n" % self
.DebugFormatString(self
.query_handle_
))
5905 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
5906 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
5911 _TEXT
= _BuildTagLookupTable({
5917 _TYPES
= _BuildTagLookupTable({
5918 0: ProtocolBuffer
.Encoder
.NUMERIC
,
5919 1: ProtocolBuffer
.Encoder
.STRING
,
5920 2: ProtocolBuffer
.Encoder
.STRING
,
5921 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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
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:
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
5991 def IsInitialized(self
, debug_strs
=None):
5993 if (not self
.has_query_handle_
):
5995 if debug_strs
is not None:
5996 debug_strs
.append('Required field: query_handle not set.')
6001 n
+= self
.lengthString(len(self
.query_handle_
))
6004 def ByteSizePartial(self
):
6006 if (self
.has_query_handle_
):
6008 n
+= self
.lengthString(len(self
.query_handle_
))
6012 self
.clear_query_handle()
6014 def OutputUnchecked(self
, out
):
6016 out
.putPrefixedString(self
.query_handle_
)
6018 def OutputPartial(self
, out
):
6019 if (self
.has_query_handle_
):
6021 out
.putPrefixedString(self
.query_handle_
)
6023 def TryMerge(self
, d
):
6024 while d
.avail() > 0:
6025 tt
= d
.getVarInt32()
6027 self
.set_query_handle(d
.getPrefixedString())
6031 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6035 def __str__(self
, prefix
="", printElemNumber
=0):
6037 if self
.has_query_handle_
: res
+=prefix
+("query_handle: %s\n" % self
.DebugFormatString(self
.query_handle_
))
6041 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6042 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6046 _TEXT
= _BuildTagLookupTable({
6051 _TYPES
= _BuildTagLookupTable({
6052 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6053 1: ProtocolBuffer
.Encoder
.STRING
,
6054 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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
):
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:
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
6119 def IsInitialized(self
, debug_strs
=None):
6121 if (not self
.has_batch_
):
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
6130 n
+= self
.lengthString(self
.batch_
.ByteSize())
6133 def ByteSizePartial(self
):
6135 if (self
.has_batch_
):
6137 n
+= self
.lengthString(self
.batch_
.ByteSizePartial())
6143 def OutputUnchecked(self
, out
):
6145 out
.putVarInt32(self
.batch_
.ByteSize())
6146 self
.batch_
.OutputUnchecked(out
)
6148 def OutputPartial(self
, out
):
6149 if (self
.has_batch_
):
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()
6158 length
= d
.getVarInt32()
6159 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6161 self
.mutable_batch().TryMerge(tmp
)
6165 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6169 def __str__(self
, prefix
="", printElemNumber
=0):
6172 res
+=prefix
+"batch <\n"
6173 res
+=self
.batch_
.__str
__(prefix
+ " ", printElemNumber
)
6178 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6179 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6183 _TEXT
= _BuildTagLookupTable({
6188 _TYPES
= _BuildTagLookupTable({
6189 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6190 1: ProtocolBuffer
.Encoder
.STRING
,
6191 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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
6206 has_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:
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
6279 def IsInitialized(self
, debug_strs
=None):
6285 if (self
.has_cross_group_
): n
+= 2
6286 if (self
.has_cross_request_
): n
+= 2
6289 def ByteSizePartial(self
):
6291 if (self
.has_cross_group_
): n
+= 2
6292 if (self
.has_cross_request_
): n
+= 2
6296 self
.clear_cross_group()
6297 self
.clear_cross_request()
6299 def OutputUnchecked(self
, out
):
6300 if (self
.has_cross_group_
):
6302 out
.putBoolean(self
.cross_group_
)
6303 if (self
.has_cross_request_
):
6305 out
.putBoolean(self
.cross_request_
)
6307 def OutputPartial(self
, out
):
6308 if (self
.has_cross_group_
):
6310 out
.putBoolean(self
.cross_group_
)
6311 if (self
.has_cross_request_
):
6313 out
.putBoolean(self
.cross_request_
)
6315 def TryMerge(self
, d
):
6316 while d
.avail() > 0:
6317 tt
= d
.getVarInt32()
6319 self
.set_cross_group(d
.getBoolean())
6322 self
.set_cross_request(d
.getBoolean())
6326 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6330 def __str__(self
, prefix
="", printElemNumber
=0):
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_
))
6337 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6338 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6343 _TEXT
= _BuildTagLookupTable({
6349 _TYPES
= _BuildTagLookupTable({
6350 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6351 1: ProtocolBuffer
.Encoder
.NUMERIC
,
6352 2: ProtocolBuffer
.Encoder
.NUMERIC
,
6353 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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
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:
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
6423 def IsInitialized(self
, debug_strs
=None):
6425 if (not self
.has_transaction_
):
6427 if debug_strs
is not None:
6428 debug_strs
.append('Required field: transaction not set.')
6433 n
+= self
.lengthString(len(self
.transaction_
))
6436 def ByteSizePartial(self
):
6438 if (self
.has_transaction_
):
6440 n
+= self
.lengthString(len(self
.transaction_
))
6444 self
.clear_transaction()
6446 def OutputUnchecked(self
, out
):
6448 out
.putPrefixedString(self
.transaction_
)
6450 def OutputPartial(self
, out
):
6451 if (self
.has_transaction_
):
6453 out
.putPrefixedString(self
.transaction_
)
6455 def TryMerge(self
, d
):
6456 while d
.avail() > 0:
6457 tt
= d
.getVarInt32()
6459 self
.set_transaction(d
.getPrefixedString())
6463 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6467 def __str__(self
, prefix
="", printElemNumber
=0):
6469 if self
.has_transaction_
: res
+=prefix
+("transaction: %s\n" % self
.DebugFormatString(self
.transaction_
))
6473 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6474 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6478 _TEXT
= _BuildTagLookupTable({
6483 _TYPES
= _BuildTagLookupTable({
6484 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6485 1: ProtocolBuffer
.Encoder
.STRING
,
6486 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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
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:
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
6556 def IsInitialized(self
, debug_strs
=None):
6558 if (not self
.has_transaction_
):
6560 if debug_strs
is not None:
6561 debug_strs
.append('Required field: transaction not set.')
6566 n
+= self
.lengthString(len(self
.transaction_
))
6569 def ByteSizePartial(self
):
6571 if (self
.has_transaction_
):
6573 n
+= self
.lengthString(len(self
.transaction_
))
6577 self
.clear_transaction()
6579 def OutputUnchecked(self
, out
):
6581 out
.putPrefixedString(self
.transaction_
)
6583 def OutputPartial(self
, out
):
6584 if (self
.has_transaction_
):
6586 out
.putPrefixedString(self
.transaction_
)
6588 def TryMerge(self
, d
):
6589 while d
.avail() > 0:
6590 tt
= d
.getVarInt32()
6592 self
.set_transaction(d
.getPrefixedString())
6596 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6600 def __str__(self
, prefix
="", printElemNumber
=0):
6602 if self
.has_transaction_
: res
+=prefix
+("transaction: %s\n" % self
.DebugFormatString(self
.transaction_
))
6606 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6607 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6611 _TEXT
= _BuildTagLookupTable({
6616 _TYPES
= _BuildTagLookupTable({
6617 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6618 1: ProtocolBuffer
.Encoder
.STRING
,
6619 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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):
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:
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
6672 def IsInitialized(self
, debug_strs
=None):
6680 def ByteSizePartial(self
):
6687 def OutputUnchecked(self
, out
):
6690 def OutputPartial(self
, out
):
6693 def TryMerge(self
, d
):
6694 while d
.avail() > 0:
6695 tt
= d
.getVarInt32()
6698 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6702 def __str__(self
, prefix
="", printElemNumber
=0):
6707 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6708 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6711 _TEXT
= _BuildTagLookupTable({
6715 _TYPES
= _BuildTagLookupTable({
6716 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6717 }, 0, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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
):
6733 NON_TRANSACTIONAL
= 2
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
6745 has_deprecated_mutation_
= 0
6746 deprecated_mutation_
= None
6749 has_ignore_read_only_
= 0
6750 ignore_read_only_
= 0
6752 def __init__(self
, contents
=None):
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
):
6781 self
.mutation_
.append(x
)
6784 def clear_mutation(self
):
6786 def deprecated_mutation(self
):
6787 if self
.deprecated_mutation_
is None:
6788 self
.lazy_init_lock_
.acquire()
6790 if self
.deprecated_mutation_
is None: self
.deprecated_mutation_
= DeprecatedMutation()
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
):
6811 def clear_mode(self
):
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:
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
6882 def IsInitialized(self
, debug_strs
=None):
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
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
6899 def ByteSizePartial(self
):
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
6910 self
.clear_transaction()
6911 self
.clear_mutation()
6912 self
.clear_deprecated_mutation()
6914 self
.clear_ignore_read_only()
6916 def OutputUnchecked(self
, out
):
6917 if (self
.has_transaction_
):
6919 out
.putPrefixedString(self
.transaction_
)
6920 if (self
.has_deprecated_mutation_
):
6922 out
.putVarInt32(self
.deprecated_mutation_
.ByteSize())
6923 self
.deprecated_mutation_
.OutputUnchecked(out
)
6924 if (self
.has_mode_
):
6926 out
.putVarInt32(self
.mode_
)
6927 for i
in xrange(len(self
.mutation_
)):
6929 out
.putVarInt32(self
.mutation_
[i
].ByteSize())
6930 self
.mutation_
[i
].OutputUnchecked(out
)
6931 if (self
.has_ignore_read_only_
):
6933 out
.putBoolean(self
.ignore_read_only_
)
6935 def OutputPartial(self
, out
):
6936 if (self
.has_transaction_
):
6938 out
.putPrefixedString(self
.transaction_
)
6939 if (self
.has_deprecated_mutation_
):
6941 out
.putVarInt32(self
.deprecated_mutation_
.ByteSizePartial())
6942 self
.deprecated_mutation_
.OutputPartial(out
)
6943 if (self
.has_mode_
):
6945 out
.putVarInt32(self
.mode_
)
6946 for i
in xrange(len(self
.mutation_
)):
6948 out
.putVarInt32(self
.mutation_
[i
].ByteSizePartial())
6949 self
.mutation_
[i
].OutputPartial(out
)
6950 if (self
.has_ignore_read_only_
):
6952 out
.putBoolean(self
.ignore_read_only_
)
6954 def TryMerge(self
, d
):
6955 while d
.avail() > 0:
6956 tt
= d
.getVarInt32()
6958 self
.set_transaction(d
.getPrefixedString())
6961 length
= d
.getVarInt32()
6962 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6964 self
.mutable_deprecated_mutation().TryMerge(tmp
)
6967 self
.set_mode(d
.getVarInt32())
6970 length
= d
.getVarInt32()
6971 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6973 self
.add_mutation().TryMerge(tmp
)
6976 self
.set_ignore_read_only(d
.getBoolean())
6980 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6984 def __str__(self
, prefix
="", printElemNumber
=0):
6986 if self
.has_transaction_
: res
+=prefix
+("transaction: %s\n" % self
.DebugFormatString(self
.transaction_
))
6988 for e
in self
.mutation_
:
6990 if printElemNumber
: elm
="(%d)" % cnt
6991 res
+=prefix
+("mutation%s <\n" % elm
)
6992 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
6995 if self
.has_deprecated_mutation_
:
6996 res
+=prefix
+"deprecated_mutation <\n"
6997 res
+=self
.deprecated_mutation_
.__str
__(prefix
+ " ", printElemNumber
)
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_
))
7004 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
7005 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
7009 kdeprecated_mutation
= 2
7011 kignore_read_only
= 6
7013 _TEXT
= _BuildTagLookupTable({
7016 2: "deprecated_mutation",
7019 6: "ignore_read_only",
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
)
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
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
)
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()
7072 if self
.deprecated_mutation_result_
is None: self
.deprecated_mutation_result_
= DeprecatedMutationResult()
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:
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
7145 def IsInitialized(self
, debug_strs
=None):
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
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_
)
7160 def ByteSizePartial(self
):
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_
)
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_
):
7176 out
.putVarInt32(self
.deprecated_mutation_result_
.ByteSize())
7177 self
.deprecated_mutation_result_
.OutputUnchecked(out
)
7178 for i
in xrange(len(self
.mutation_result_
)):
7180 out
.putVarInt32(self
.mutation_result_
[i
].ByteSize())
7181 self
.mutation_result_
[i
].OutputUnchecked(out
)
7182 if (self
.has_index_updates_
):
7184 out
.putVarInt32(self
.index_updates_
)
7186 def OutputPartial(self
, out
):
7187 if (self
.has_deprecated_mutation_result_
):
7189 out
.putVarInt32(self
.deprecated_mutation_result_
.ByteSizePartial())
7190 self
.deprecated_mutation_result_
.OutputPartial(out
)
7191 for i
in xrange(len(self
.mutation_result_
)):
7193 out
.putVarInt32(self
.mutation_result_
[i
].ByteSizePartial())
7194 self
.mutation_result_
[i
].OutputPartial(out
)
7195 if (self
.has_index_updates_
):
7197 out
.putVarInt32(self
.index_updates_
)
7199 def TryMerge(self
, d
):
7200 while d
.avail() > 0:
7201 tt
= d
.getVarInt32()
7203 length
= d
.getVarInt32()
7204 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
7206 self
.mutable_deprecated_mutation_result().TryMerge(tmp
)
7209 length
= d
.getVarInt32()
7210 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
7212 self
.add_mutation_result().TryMerge(tmp
)
7215 self
.set_index_updates(d
.getVarInt32())
7219 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
7223 def __str__(self
, prefix
="", printElemNumber
=0):
7226 for e
in self
.mutation_result_
:
7228 if printElemNumber
: elm
="(%d)" % cnt
7229 res
+=prefix
+("mutation_result%s <\n" % elm
)
7230 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
7233 if self
.has_deprecated_mutation_result_
:
7234 res
+=prefix
+"deprecated_mutation_result <\n"
7235 res
+=self
.deprecated_mutation_result_
.__str
__(prefix
+ " ", printElemNumber
)
7237 if self
.has_index_updates_
: res
+=prefix
+("index_updates: %s\n" % self
.DebugFormatInt32(self
.index_updates_
))
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
7248 _TEXT
= _BuildTagLookupTable({
7250 1: "deprecated_mutation_result",
7251 3: "mutation_result",
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
)
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):
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
)
7293 def clear_allocate(self
):
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
)
7309 def clear_reserve(self
):
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:
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
7354 def IsInitialized(self
, debug_strs
=None):
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
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())
7370 def ByteSizePartial(self
):
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())
7379 self
.clear_allocate()
7380 self
.clear_reserve()
7382 def OutputUnchecked(self
, out
):
7383 for i
in xrange(len(self
.allocate_
)):
7385 out
.putVarInt32(self
.allocate_
[i
].ByteSize())
7386 self
.allocate_
[i
].OutputUnchecked(out
)
7387 for i
in xrange(len(self
.reserve_
)):
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_
)):
7395 out
.putVarInt32(self
.allocate_
[i
].ByteSizePartial())
7396 self
.allocate_
[i
].OutputPartial(out
)
7397 for i
in xrange(len(self
.reserve_
)):
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()
7406 length
= d
.getVarInt32()
7407 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
7409 self
.add_allocate().TryMerge(tmp
)
7412 length
= d
.getVarInt32()
7413 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
7415 self
.add_reserve().TryMerge(tmp
)
7419 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
7423 def __str__(self
, prefix
="", printElemNumber
=0):
7426 for e
in self
.allocate_
:
7428 if printElemNumber
: elm
="(%d)" % cnt
7429 res
+=prefix
+("allocate%s <\n" % elm
)
7430 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
7434 for e
in self
.reserve_
:
7436 if printElemNumber
: elm
="(%d)" % cnt
7437 res
+=prefix
+("reserve%s <\n" % elm
)
7438 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
7444 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
7445 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
7450 _TEXT
= _BuildTagLookupTable({
7456 _TYPES
= _BuildTagLookupTable({
7457 0: ProtocolBuffer
.Encoder
.NUMERIC
,
7458 1: ProtocolBuffer
.Encoder
.STRING
,
7459 2: ProtocolBuffer
.Encoder
.STRING
,
7460 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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
)
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:
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
7533 def IsInitialized(self
, debug_strs
=None):
7535 for p
in self
.allocated_
:
7536 if not p
.IsInitialized(debug_strs
): initialized
=0
7541 n
+= 1 * len(self
.allocated_
)
7542 for i
in xrange(len(self
.allocated_
)): n
+= self
.lengthString(self
.allocated_
[i
].ByteSize())
7545 def ByteSizePartial(self
):
7547 n
+= 1 * len(self
.allocated_
)
7548 for i
in xrange(len(self
.allocated_
)): n
+= self
.lengthString(self
.allocated_
[i
].ByteSizePartial())
7552 self
.clear_allocated()
7554 def OutputUnchecked(self
, out
):
7555 for i
in xrange(len(self
.allocated_
)):
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_
)):
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()
7570 length
= d
.getVarInt32()
7571 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
7573 self
.add_allocated().TryMerge(tmp
)
7577 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
7581 def __str__(self
, prefix
="", printElemNumber
=0):
7584 for e
in self
.allocated_
:
7586 if printElemNumber
: elm
="(%d)" % cnt
7587 res
+=prefix
+("allocated%s <\n" % elm
)
7588 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
7594 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
7595 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
7599 _TEXT
= _BuildTagLookupTable({
7604 _TYPES
= _BuildTagLookupTable({
7605 0: ProtocolBuffer
.Encoder
.NUMERIC
,
7606 1: ProtocolBuffer
.Encoder
.STRING
,
7607 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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:
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
7672 def IsInitialized(self
, debug_strs
=None):
7674 if (not self
.has_deprecated_mutation_
):
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
7683 n
+= self
.lengthString(self
.deprecated_mutation_
.ByteSize())
7686 def ByteSizePartial(self
):
7688 if (self
.has_deprecated_mutation_
):
7690 n
+= self
.lengthString(self
.deprecated_mutation_
.ByteSizePartial())
7694 self
.clear_deprecated_mutation()
7696 def OutputUnchecked(self
, out
):
7698 out
.putVarInt32(self
.deprecated_mutation_
.ByteSize())
7699 self
.deprecated_mutation_
.OutputUnchecked(out
)
7701 def OutputPartial(self
, out
):
7702 if (self
.has_deprecated_mutation_
):
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()
7711 length
= d
.getVarInt32()
7712 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
7714 self
.mutable_deprecated_mutation().TryMerge(tmp
)
7718 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
7722 def __str__(self
, prefix
="", printElemNumber
=0):
7724 if self
.has_deprecated_mutation_
:
7725 res
+=prefix
+"deprecated_mutation <\n"
7726 res
+=self
.deprecated_mutation_
.__str
__(prefix
+ " ", printElemNumber
)
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({
7738 1: "deprecated_mutation",
7741 _TYPES
= _BuildTagLookupTable({
7742 0: ProtocolBuffer
.Encoder
.NUMERIC
,
7743 1: ProtocolBuffer
.Encoder
.STRING
,
7744 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
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."""
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(
7780 self
._protorpc
_Rollback
= pywraprpc
.RPC()
7781 self
._full
_name
_Rollback
= self
._stub
.GetFullMethodName(
7784 self
._protorpc
_Commit
= pywraprpc
.RPC()
7785 self
._full
_name
_Commit
= self
._stub
.GetFullMethodName(
7788 self
._protorpc
_RunQuery
= pywraprpc
.RPC()
7789 self
._full
_name
_RunQuery
= self
._stub
.GetFullMethodName(
7792 self
._protorpc
_ContinueQuery
= pywraprpc
.RPC()
7793 self
._full
_name
_ContinueQuery
= self
._stub
.GetFullMethodName(
7796 self
._protorpc
_Lookup
= pywraprpc
.RPC()
7797 self
._full
_name
_Lookup
= self
._stub
.GetFullMethodName(
7800 self
._protorpc
_AllocateIds
= pywraprpc
.RPC()
7801 self
._full
_name
_AllocateIds
= self
._stub
.GetFullMethodName(
7804 self
._protorpc
_Get
= pywraprpc
.RPC()
7805 self
._full
_name
_Get
= self
._stub
.GetFullMethodName(
7808 self
._protorpc
_Write
= pywraprpc
.RPC()
7809 self
._full
_name
_Write
= self
._stub
.GetFullMethodName(
7812 def BeginTransaction(self
, request
, rpc
=None, callback
=None, response
=None):
7813 """Make a BeginTransaction RPC call.
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.
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
,
7835 self
._protorpc
_BeginTransaction
)
7837 def Rollback(self
, request
, rpc
=None, callback
=None, response
=None):
7838 """Make a Rollback RPC call.
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.
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
,
7860 self
._protorpc
_Rollback
)
7862 def Commit(self
, request
, rpc
=None, callback
=None, response
=None):
7863 """Make a Commit RPC call.
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.
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
,
7885 self
._protorpc
_Commit
)
7887 def RunQuery(self
, request
, rpc
=None, callback
=None, response
=None):
7888 """Make a RunQuery RPC call.
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.
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
,
7910 self
._protorpc
_RunQuery
)
7912 def ContinueQuery(self
, request
, rpc
=None, callback
=None, response
=None):
7913 """Make a ContinueQuery RPC call.
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.
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
,
7935 self
._protorpc
_ContinueQuery
)
7937 def Lookup(self
, request
, rpc
=None, callback
=None, response
=None):
7938 """Make a Lookup RPC call.
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.
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
,
7960 self
._protorpc
_Lookup
)
7962 def AllocateIds(self
, request
, rpc
=None, callback
=None, response
=None):
7963 """Make a AllocateIds RPC call.
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.
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
,
7985 self
._protorpc
_AllocateIds
)
7987 def Get(self
, request
, rpc
=None, callback
=None, response
=None):
7988 """Make a Get RPC call.
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.
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
,
8012 def Write(self
, request
, rpc
=None, callback
=None, response
=None):
8013 """Make a Write RPC call.
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.
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
,
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
):
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
)))
8059 raise RuntimeError('Invalid argument combination to create a stub')
8062 class DatastoreV4Service(_server_stub_base_class
):
8063 """Base class for DatastoreV4Service Stubby servers."""
8066 def _MethodSignatures(cls
):
8067 """Returns a dict of {<method-name>: (<request-type>, <response-type>)}."""
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
),
8081 def _StreamMethodSignatures(cls
):
8082 """Returns a dict of {<method-name>: (<request-type>, <stream-type>, <response-type>)}."""
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
)
8097 def NewStub(rpc_stub_parameters
, service_name
=None):
8098 """Creates a new DatastoreV4Service Stubby client stub.
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
)
8110 def NewRPC2Stub(server
=None, channel
=None, service_name
=None):
8111 """Creates a new DatastoreV4Service Stubby2 client stub.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
,
8233 rpcserver
._GetHandlerDecorator
(
8234 getattr(self
.Rollback
, '__func__'),
8239 rpcserver
._GetHandlerDecorator
(
8240 getattr(self
.Commit
, '__func__'),
8245 rpcserver
._GetHandlerDecorator
(
8246 getattr(self
.RunQuery
, '__func__'),
8251 rpcserver
._GetHandlerDecorator
(
8252 getattr(self
.ContinueQuery
, '__func__'),
8253 ContinueQueryRequest
,
8254 ContinueQueryResponse
,
8257 rpcserver
._GetHandlerDecorator
(
8258 getattr(self
.Lookup
, '__func__'),
8263 rpcserver
._GetHandlerDecorator
(
8264 getattr(self
.AllocateIds
, '__func__'),
8266 AllocateIdsResponse
,
8269 rpcserver
._GetHandlerDecorator
(
8270 getattr(self
.Get
, '__func__'),
8275 rpcserver
._GetHandlerDecorator
(
8276 getattr(self
.Write
, '__func__'),
8282 if _extension_runtime
:
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']