blob: 3dfcc9ce37f4bda4f98aeb5a6cb35c3a7d5c6291 [file] [log] [blame]
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.net.proto import ProtocolBuffer
import array
import base64
import dummy_thread as thread
try:
from google3.net.proto import _net_proto___parse__python
except ImportError:
_net_proto___parse__python = None
import sys
try:
__import__('google.net.rpc.python.rpc_internals_lite')
__import__('google.net.rpc.python.pywraprpc_lite')
rpc_internals = sys.modules.get('google.net.rpc.python.rpc_internals_lite')
pywraprpc = sys.modules.get('google.net.rpc.python.pywraprpc_lite')
_client_stub_base_class = rpc_internals.StubbyRPCBaseStub
except ImportError:
_client_stub_base_class = object
try:
__import__('google.net.rpc.python.rpcserver')
rpcserver = sys.modules.get('google.net.rpc.python.rpcserver')
_server_stub_base_class = rpcserver.BaseRpcServer
except ImportError:
_server_stub_base_class = object
__pychecker__ = """maxreturns=0 maxbranches=0 no-callinit
unusednames=printElemNumber,debug_strs no-special"""
if hasattr(ProtocolBuffer, 'ExtendableProtocolMessage'):
_extension_runtime = True
_ExtendableProtocolMessage = ProtocolBuffer.ExtendableProtocolMessage
else:
_extension_runtime = False
_ExtendableProtocolMessage = ProtocolBuffer.ProtocolMessage
from google.appengine.datastore.entity_v4_pb import *
import google.appengine.datastore.entity_v4_pb
class Error(ProtocolBuffer.ProtocolMessage):
BAD_REQUEST = 1
CONCURRENT_TRANSACTION = 2
INTERNAL_ERROR = 3
NEED_INDEX = 4
TIMEOUT = 5
PERMISSION_DENIED = 6
BIGTABLE_ERROR = 7
COMMITTED_BUT_STILL_APPLYING = 8
CAPABILITY_DISABLED = 9
TRY_ALTERNATE_BACKEND = 10
SAFE_TIME_TOO_OLD = 11
_ErrorCode_NAMES = {
1: "BAD_REQUEST",
2: "CONCURRENT_TRANSACTION",
3: "INTERNAL_ERROR",
4: "NEED_INDEX",
5: "TIMEOUT",
6: "PERMISSION_DENIED",
7: "BIGTABLE_ERROR",
8: "COMMITTED_BUT_STILL_APPLYING",
9: "CAPABILITY_DISABLED",
10: "TRY_ALTERNATE_BACKEND",
11: "SAFE_TIME_TOO_OLD",
}
def ErrorCode_Name(cls, x): return cls._ErrorCode_NAMES.get(x, "")
ErrorCode_Name = classmethod(ErrorCode_Name)
def __init__(self, contents=None):
pass
if contents is not None: self.MergeFromString(contents)
def MergeFrom(self, x):
assert x is not self
if _net_proto___parse__python is not None:
def _CMergeFromString(self, s):
_net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.Error', s)
if _net_proto___parse__python is not None:
def _CEncode(self):
return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.Error')
if _net_proto___parse__python is not None:
def _CEncodePartial(self):
return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.Error')
if _net_proto___parse__python is not None:
def _CToASCII(self, output_format):
return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.Error', output_format)
if _net_proto___parse__python is not None:
def ParseASCII(self, s):
_net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.Error', s)
if _net_proto___parse__python is not None:
def ParseASCIIIgnoreUnknown(self, s):
_net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.Error', s)
def Equals(self, x):
if x is self: return 1
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
return initialized
def ByteSize(self):
n = 0
return n
def ByteSizePartial(self):
n = 0
return n
def Clear(self):
pass
def OutputUnchecked(self, out):
pass
def OutputPartial(self, out):
pass
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
}, 0)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
}, 0, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.Error'
_SERIALIZED_DESCRIPTOR = array.array('B')
_SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9yc3oJRXJyb3JDb2RliwGSAQtCQURfUkVRVUVTVJgBAYwBiwGSARZDT05DVVJSRU5UX1RSQU5TQUNUSU9OmAECjAGLAZIBDklOVEVSTkFMX0VSUk9SmAEDjAGLAZIBCk5FRURfSU5ERViYAQSMAYsBkgEHVElNRU9VVJgBBYwBiwGSARFQRVJNSVNTSU9OX0RFTklFRJgBBowBiwGSAQ5CSUdUQUJMRV9FUlJPUpgBB4wBiwGSARxDT01NSVRURURfQlVUX1NUSUxMX0FQUExZSU5HmAEIjAGLAZIBE0NBUEFCSUxJVFlfRElTQUJMRUSYAQmMAYsBkgEVVFJZX0FMVEVSTkFURV9CQUNLRU5EmAEKjAGLAZIBEVNBRkVfVElNRV9UT09fT0xEmAELjAF0ugHPMgonYXBwaG9zdGluZy9kYXRhc3RvcmUvZGF0YXN0b3JlX3Y0LnByb3RvEhdhcHBob3N0aW5nLmRhdGFzdG9yZS52NBokYXBwaG9zdGluZy9kYXRhc3RvcmUvZW50aXR5X3Y0LnByb3RvIosCCgVFcnJvciKBAgoJRXJyb3JDb2RlEg8KC0JBRF9SRVFVRVNUEAESGgoWQ09OQ1VSUkVOVF9UUkFOU0FDVElPThACE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BkNvbW1pdBImLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbW1pdFJlcXVlc3QaJy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Db21taXRSZXNwb25zZSIAEmEKCFJ1blF1ZXJ5EiguYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUnVuUXVlcnlSZXF1ZXN0GikuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUnVuUXVlcnlSZXNwb25zZSIAEnAKDUNvbnRpbnVlUXVlcnkSLS5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Db250aW51ZVF1ZXJ5UmVxdWVzdBouLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbnRpbnVlUXVlcnlSZXNwb25zZSIAElsKBkxvb2t1cBImLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lkxvb2t1cFJlcXVlc3QaJy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Mb29rdXBSZXNwb25zZSIAEmoKC0FsbG9jYXRlSWRzEisuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQWxsb2NhdGVJZHNSZXF1ZXN0GiwuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQWxsb2NhdGVJZHNSZXNwb25zZSIAElgKA0dldBImLmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lkxvb2t1cFJlcXVlc3QaJy5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Mb29rdXBSZXNwb25zZSIAElkKBVdyaXRlEiUuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuV3JpdGVSZXF1ZXN0GicuYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQ29tbWl0UmVzcG9uc2UiAEIhCh9jb20uZ29vZ2xlLmFwcGhvc3RpbmcuZGF0YXN0b3Jl"))
if _net_proto___parse__python is not None:
_net_proto___parse__python.RegisterType(
_SERIALIZED_DESCRIPTOR.tostring())
class EntityResult(ProtocolBuffer.ProtocolMessage):
FULL = 1
PROJECTION = 2
KEY_ONLY = 3
_ResultType_NAMES = {
1: "FULL",
2: "PROJECTION",
3: "KEY_ONLY",
}
def ResultType_Name(cls, x): return cls._ResultType_NAMES.get(x, "")
ResultType_Name = classmethod(ResultType_Name)
has_entity_ = 0
has_version_ = 0
version_ = 0
def __init__(self, contents=None):
self.entity_ = google.appengine.datastore.entity_v4_pb.Entity()
if contents is not None: self.MergeFromString(contents)
def entity(self): return self.entity_
def mutable_entity(self): self.has_entity_ = 1; return self.entity_
def clear_entity(self):self.has_entity_ = 0; self.entity_.Clear()
def has_entity(self): return self.has_entity_
def version(self): return self.version_
def set_version(self, x):
self.has_version_ = 1
self.version_ = x
def clear_version(self):
if self.has_version_:
self.has_version_ = 0
self.version_ = 0
def has_version(self): return self.has_version_
def MergeFrom(self, x):
assert x is not self
if (x.has_entity()): self.mutable_entity().MergeFrom(x.entity())
if (x.has_version()): self.set_version(x.version())
if _net_proto___parse__python is not None:
def _CMergeFromString(self, s):
_net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.EntityResult', s)
if _net_proto___parse__python is not None:
def _CEncode(self):
return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.EntityResult')
if _net_proto___parse__python is not None:
def _CEncodePartial(self):
return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.EntityResult')
if _net_proto___parse__python is not None:
def _CToASCII(self, output_format):
return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.EntityResult', output_format)
if _net_proto___parse__python is not None:
def ParseASCII(self, s):
_net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.EntityResult', s)
if _net_proto___parse__python is not None:
def ParseASCIIIgnoreUnknown(self, s):
_net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.EntityResult', s)
def Equals(self, x):
if x is self: return 1
if self.has_entity_ != x.has_entity_: return 0
if self.has_entity_ and self.entity_ != x.entity_: return 0
if self.has_version_ != x.has_version_: return 0
if self.has_version_ and self.version_ != x.version_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_entity_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: entity not set.')
elif not self.entity_.IsInitialized(debug_strs): initialized = 0
return initialized
def ByteSize(self):
n = 0
n += self.lengthString(self.entity_.ByteSize())
if (self.has_version_): n += 1 + self.lengthVarInt64(self.version_)
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_entity_):
n += 1
n += self.lengthString(self.entity_.ByteSizePartial())
if (self.has_version_): n += 1 + self.lengthVarInt64(self.version_)
return n
def Clear(self):
self.clear_entity()
self.clear_version()
def OutputUnchecked(self, out):
out.putVarInt32(10)
out.putVarInt32(self.entity_.ByteSize())
self.entity_.OutputUnchecked(out)
if (self.has_version_):
out.putVarInt32(16)
out.putVarInt64(self.version_)
def OutputPartial(self, out):
if (self.has_entity_):
out.putVarInt32(10)
out.putVarInt32(self.entity_.ByteSizePartial())
self.entity_.OutputPartial(out)
if (self.has_version_):
out.putVarInt32(16)
out.putVarInt64(self.version_)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 10:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_entity().TryMerge(tmp)
continue
if tt == 16:
self.set_version(d.getVarInt64())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_entity_:
res+=prefix+"entity <\n"
res+=self.entity_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
if self.has_version_: res+=prefix+("version: %s\n" % self.DebugFormatInt64(self.version_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kentity = 1
kversion = 2
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "entity",
2: "version",
}, 2)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.STRING,
2: ProtocolBuffer.Encoder.NUMERIC,
}, 2, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.EntityResult'
_SERIALIZED_DESCRIPTOR = array.array('B')
_SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eVJlc3VsdBMaBmVudGl0eSABKAIwCzgCSh5hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FbnRpdHmjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoHdmVyc2lvbiACKAAwAzgBFHN6ClJlc3VsdFR5cGWLAZIBBEZVTEyYAQGMAYsBkgEKUFJPSkVDVElPTpgBAowBiwGSAQhLRVlfT05MWZgBA4wBdMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
if _net_proto___parse__python is not None:
_net_proto___parse__python.RegisterType(
_SERIALIZED_DESCRIPTOR.tostring())
class Query(ProtocolBuffer.ProtocolMessage):
has_filter_ = 0
filter_ = None
has_start_cursor_ = 0
start_cursor_ = ""
has_end_cursor_ = 0
end_cursor_ = ""
has_offset_ = 0
offset_ = 0
has_limit_ = 0
limit_ = 0
def __init__(self, contents=None):
self.projection_ = []
self.kind_ = []
self.order_ = []
self.group_by_ = []
self.lazy_init_lock_ = thread.allocate_lock()
if contents is not None: self.MergeFromString(contents)
def projection_size(self): return len(self.projection_)
def projection_list(self): return self.projection_
def projection(self, i):
return self.projection_[i]
def mutable_projection(self, i):
return self.projection_[i]
def add_projection(self):
x = PropertyExpression()
self.projection_.append(x)
return x
def clear_projection(self):
self.projection_ = []
def kind_size(self): return len(self.kind_)
def kind_list(self): return self.kind_
def kind(self, i):
return self.kind_[i]
def mutable_kind(self, i):
return self.kind_[i]
def add_kind(self):
x = KindExpression()
self.kind_.append(x)
return x
def clear_kind(self):
self.kind_ = []
def filter(self):
if self.filter_ is None:
self.lazy_init_lock_.acquire()
try:
if self.filter_ is None: self.filter_ = Filter()
finally:
self.lazy_init_lock_.release()
return self.filter_
def mutable_filter(self): self.has_filter_ = 1; return self.filter()
def clear_filter(self):
if self.has_filter_:
self.has_filter_ = 0;
if self.filter_ is not None: self.filter_.Clear()
def has_filter(self): return self.has_filter_
def order_size(self): return len(self.order_)
def order_list(self): return self.order_
def order(self, i):
return self.order_[i]
def mutable_order(self, i):
return self.order_[i]
def add_order(self):
x = PropertyOrder()
self.order_.append(x)
return x
def clear_order(self):
self.order_ = []
def group_by_size(self): return len(self.group_by_)
def group_by_list(self): return self.group_by_
def group_by(self, i):
return self.group_by_[i]
def mutable_group_by(self, i):
return self.group_by_[i]
def add_group_by(self):
x = PropertyReference()
self.group_by_.append(x)
return x
def clear_group_by(self):
self.group_by_ = []
def start_cursor(self): return self.start_cursor_
def set_start_cursor(self, x):
self.has_start_cursor_ = 1
self.start_cursor_ = x
def clear_start_cursor(self):
if self.has_start_cursor_:
self.has_start_cursor_ = 0
self.start_cursor_ = ""
def has_start_cursor(self): return self.has_start_cursor_
def end_cursor(self): return self.end_cursor_
def set_end_cursor(self, x):
self.has_end_cursor_ = 1
self.end_cursor_ = x
def clear_end_cursor(self):
if self.has_end_cursor_:
self.has_end_cursor_ = 0
self.end_cursor_ = ""
def has_end_cursor(self): return self.has_end_cursor_
def offset(self): return self.offset_
def set_offset(self, x):
self.has_offset_ = 1
self.offset_ = x
def clear_offset(self):
if self.has_offset_:
self.has_offset_ = 0
self.offset_ = 0
def has_offset(self): return self.has_offset_
def limit(self): return self.limit_
def set_limit(self, x):
self.has_limit_ = 1
self.limit_ = x
def clear_limit(self):
if self.has_limit_:
self.has_limit_ = 0
self.limit_ = 0
def has_limit(self): return self.has_limit_
def MergeFrom(self, x):
assert x is not self
for i in xrange(x.projection_size()): self.add_projection().CopyFrom(x.projection(i))
for i in xrange(x.kind_size()): self.add_kind().CopyFrom(x.kind(i))
if (x.has_filter()): self.mutable_filter().MergeFrom(x.filter())
for i in xrange(x.order_size()): self.add_order().CopyFrom(x.order(i))
for i in xrange(x.group_by_size()): self.add_group_by().CopyFrom(x.group_by(i))
if (x.has_start_cursor()): self.set_start_cursor(x.start_cursor())
if (x.has_end_cursor()): self.set_end_cursor(x.end_cursor())
if (x.has_offset()): self.set_offset(x.offset())
if (x.has_limit()): self.set_limit(x.limit())
if _net_proto___parse__python is not None:
def _CMergeFromString(self, s):
_net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.Query', s)
if _net_proto___parse__python is not None:
def _CEncode(self):
return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.Query')
if _net_proto___parse__python is not None:
def _CEncodePartial(self):
return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.Query')
if _net_proto___parse__python is not None:
def _CToASCII(self, output_format):
return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.Query', output_format)
if _net_proto___parse__python is not None:
def ParseASCII(self, s):
_net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.Query', s)
if _net_proto___parse__python is not None:
def ParseASCIIIgnoreUnknown(self, s):
_net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.Query', s)
def Equals(self, x):
if x is self: return 1
if len(self.projection_) != len(x.projection_): return 0
for e1, e2 in zip(self.projection_, x.projection_):
if e1 != e2: return 0
if len(self.kind_) != len(x.kind_): return 0
for e1, e2 in zip(self.kind_, x.kind_):
if e1 != e2: return 0
if self.has_filter_ != x.has_filter_: return 0
if self.has_filter_ and self.filter_ != x.filter_: return 0
if len(self.order_) != len(x.order_): return 0
for e1, e2 in zip(self.order_, x.order_):
if e1 != e2: return 0
if len(self.group_by_) != len(x.group_by_): return 0
for e1, e2 in zip(self.group_by_, x.group_by_):
if e1 != e2: return 0
if self.has_start_cursor_ != x.has_start_cursor_: return 0
if self.has_start_cursor_ and self.start_cursor_ != x.start_cursor_: return 0
if self.has_end_cursor_ != x.has_end_cursor_: return 0
if self.has_end_cursor_ and self.end_cursor_ != x.end_cursor_: return 0
if self.has_offset_ != x.has_offset_: return 0
if self.has_offset_ and self.offset_ != x.offset_: return 0
if self.has_limit_ != x.has_limit_: return 0
if self.has_limit_ and self.limit_ != x.limit_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
for p in self.projection_:
if not p.IsInitialized(debug_strs): initialized=0
for p in self.kind_:
if not p.IsInitialized(debug_strs): initialized=0
if (self.has_filter_ and not self.filter_.IsInitialized(debug_strs)): initialized = 0
for p in self.order_:
if not p.IsInitialized(debug_strs): initialized=0
for p in self.group_by_:
if not p.IsInitialized(debug_strs): initialized=0
return initialized
def ByteSize(self):
n = 0
n += 1 * len(self.projection_)
for i in xrange(len(self.projection_)): n += self.lengthString(self.projection_[i].ByteSize())
n += 1 * len(self.kind_)
for i in xrange(len(self.kind_)): n += self.lengthString(self.kind_[i].ByteSize())
if (self.has_filter_): n += 1 + self.lengthString(self.filter_.ByteSize())
n += 1 * len(self.order_)
for i in xrange(len(self.order_)): n += self.lengthString(self.order_[i].ByteSize())
n += 1 * len(self.group_by_)
for i in xrange(len(self.group_by_)): n += self.lengthString(self.group_by_[i].ByteSize())
if (self.has_start_cursor_): n += 1 + self.lengthString(len(self.start_cursor_))
if (self.has_end_cursor_): n += 1 + self.lengthString(len(self.end_cursor_))
if (self.has_offset_): n += 1 + self.lengthVarInt64(self.offset_)
if (self.has_limit_): n += 1 + self.lengthVarInt64(self.limit_)
return n
def ByteSizePartial(self):
n = 0
n += 1 * len(self.projection_)
for i in xrange(len(self.projection_)): n += self.lengthString(self.projection_[i].ByteSizePartial())
n += 1 * len(self.kind_)
for i in xrange(len(self.kind_)): n += self.lengthString(self.kind_[i].ByteSizePartial())
if (self.has_filter_): n += 1 + self.lengthString(self.filter_.ByteSizePartial())
n += 1 * len(self.order_)
for i in xrange(len(self.order_)): n += self.lengthString(self.order_[i].ByteSizePartial())
n += 1 * len(self.group_by_)
for i in xrange(len(self.group_by_)): n += self.lengthString(self.group_by_[i].ByteSizePartial())
if (self.has_start_cursor_): n += 1 + self.lengthString(len(self.start_cursor_))
if (self.has_end_cursor_): n += 1 + self.lengthString(len(self.end_cursor_))
if (self.has_offset_): n += 1 + self.lengthVarInt64(self.offset_)
if (self.has_limit_): n += 1 + self.lengthVarInt64(self.limit_)
return n
def Clear(self):
self.clear_projection()
self.clear_kind()
self.clear_filter()
self.clear_order()
self.clear_group_by()
self.clear_start_cursor()
self.clear_end_cursor()
self.clear_offset()
self.clear_limit()
def OutputUnchecked(self, out):
for i in xrange(len(self.projection_)):
out.putVarInt32(18)
out.putVarInt32(self.projection_[i].ByteSize())
self.projection_[i].OutputUnchecked(out)
for i in xrange(len(self.kind_)):
out.putVarInt32(26)
out.putVarInt32(self.kind_[i].ByteSize())
self.kind_[i].OutputUnchecked(out)
if (self.has_filter_):
out.putVarInt32(34)
out.putVarInt32(self.filter_.ByteSize())
self.filter_.OutputUnchecked(out)
for i in xrange(len(self.order_)):
out.putVarInt32(42)
out.putVarInt32(self.order_[i].ByteSize())
self.order_[i].OutputUnchecked(out)
for i in xrange(len(self.group_by_)):
out.putVarInt32(50)
out.putVarInt32(self.group_by_[i].ByteSize())
self.group_by_[i].OutputUnchecked(out)
if (self.has_start_cursor_):
out.putVarInt32(58)
out.putPrefixedString(self.start_cursor_)
if (self.has_end_cursor_):
out.putVarInt32(66)
out.putPrefixedString(self.end_cursor_)
if (self.has_offset_):
out.putVarInt32(80)
out.putVarInt32(self.offset_)
if (self.has_limit_):
out.putVarInt32(88)
out.putVarInt32(self.limit_)
def OutputPartial(self, out):
for i in xrange(len(self.projection_)):
out.putVarInt32(18)
out.putVarInt32(self.projection_[i].ByteSizePartial())
self.projection_[i].OutputPartial(out)
for i in xrange(len(self.kind_)):
out.putVarInt32(26)
out.putVarInt32(self.kind_[i].ByteSizePartial())
self.kind_[i].OutputPartial(out)
if (self.has_filter_):
out.putVarInt32(34)
out.putVarInt32(self.filter_.ByteSizePartial())
self.filter_.OutputPartial(out)
for i in xrange(len(self.order_)):
out.putVarInt32(42)
out.putVarInt32(self.order_[i].ByteSizePartial())
self.order_[i].OutputPartial(out)
for i in xrange(len(self.group_by_)):
out.putVarInt32(50)
out.putVarInt32(self.group_by_[i].ByteSizePartial())
self.group_by_[i].OutputPartial(out)
if (self.has_start_cursor_):
out.putVarInt32(58)
out.putPrefixedString(self.start_cursor_)
if (self.has_end_cursor_):
out.putVarInt32(66)
out.putPrefixedString(self.end_cursor_)
if (self.has_offset_):
out.putVarInt32(80)
out.putVarInt32(self.offset_)
if (self.has_limit_):
out.putVarInt32(88)
out.putVarInt32(self.limit_)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 18:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_projection().TryMerge(tmp)
continue
if tt == 26:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_kind().TryMerge(tmp)
continue
if tt == 34:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_filter().TryMerge(tmp)
continue
if tt == 42:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_order().TryMerge(tmp)
continue
if tt == 50:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_group_by().TryMerge(tmp)
continue
if tt == 58:
self.set_start_cursor(d.getPrefixedString())
continue
if tt == 66:
self.set_end_cursor(d.getPrefixedString())
continue
if tt == 80:
self.set_offset(d.getVarInt32())
continue
if tt == 88:
self.set_limit(d.getVarInt32())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
cnt=0
for e in self.projection_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("projection%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
cnt=0
for e in self.kind_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("kind%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
if self.has_filter_:
res+=prefix+"filter <\n"
res+=self.filter_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt=0
for e in self.order_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("order%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
cnt=0
for e in self.group_by_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("group_by%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
if self.has_start_cursor_: res+=prefix+("start_cursor: %s\n" % self.DebugFormatString(self.start_cursor_))
if self.has_end_cursor_: res+=prefix+("end_cursor: %s\n" % self.DebugFormatString(self.end_cursor_))
if self.has_offset_: res+=prefix+("offset: %s\n" % self.DebugFormatInt32(self.offset_))
if self.has_limit_: res+=prefix+("limit: %s\n" % self.DebugFormatInt32(self.limit_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kprojection = 2
kkind = 3
kfilter = 4
korder = 5
kgroup_by = 6
kstart_cursor = 7
kend_cursor = 8
koffset = 10
klimit = 11
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
2: "projection",
3: "kind",
4: "filter",
5: "order",
6: "group_by",
7: "start_cursor",
8: "end_cursor",
10: "offset",
11: "limit",
}, 11)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
2: ProtocolBuffer.Encoder.STRING,
3: ProtocolBuffer.Encoder.STRING,
4: ProtocolBuffer.Encoder.STRING,
5: ProtocolBuffer.Encoder.STRING,
6: ProtocolBuffer.Encoder.STRING,
7: ProtocolBuffer.Encoder.STRING,
8: ProtocolBuffer.Encoder.STRING,
10: ProtocolBuffer.Encoder.NUMERIC,
11: ProtocolBuffer.Encoder.NUMERIC,
}, 11, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.Query'
_SERIALIZED_DESCRIPTOR = array.array('B')
_SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlF1ZXJ5ExoKcHJvamVjdGlvbiACKAIwCzgDSiphcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eUV4cHJlc3Npb26jAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoEa2luZCADKAIwCzgDSiZhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LaW5kRXhwcmVzc2lvbqMBqgEFY3R5cGWyAQZwcm90bzKkARQTGgZmaWx0ZXIgBCgCMAs4AUoeYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRmlsdGVyowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaBW9yZGVyIAUoAjALOANKJWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5T3JkZXKjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoIZ3JvdXBfYnkgBigCMAs4A0opYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlSZWZlcmVuY2WjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoMc3RhcnRfY3Vyc29yIAcoAjAJOAEUExoKZW5kX2N1cnNvciAIKAIwCTgBFBMaBm9mZnNldCAKKAAwBTgBQgEwowGqAQdkZWZhdWx0sgEBMKQBFBMaBWxpbWl0IAsoADAFOAEUwgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
if _net_proto___parse__python is not None:
_net_proto___parse__python.RegisterType(
_SERIALIZED_DESCRIPTOR.tostring())
class KindExpression(ProtocolBuffer.ProtocolMessage):
has_name_ = 0
name_ = ""
def __init__(self, contents=None):
if contents is not None: self.MergeFromString(contents)
def name(self): return self.name_
def set_name(self, x):
self.has_name_ = 1
self.name_ = x
def clear_name(self):
if self.has_name_:
self.has_name_ = 0
self.name_ = ""
def has_name(self): return self.has_name_
def MergeFrom(self, x):
assert x is not self
if (x.has_name()): self.set_name(x.name())
if _net_proto___parse__python is not None:
def _CMergeFromString(self, s):
_net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.KindExpression', s)
if _net_proto___parse__python is not None:
def _CEncode(self):
return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.KindExpression')
if _net_proto___parse__python is not None:
def _CEncodePartial(self):
return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.KindExpression')
if _net_proto___parse__python is not None:
def _CToASCII(self, output_format):
return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.KindExpression', output_format)
if _net_proto___parse__python is not None:
def ParseASCII(self, s):
_net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.KindExpression', s)
if _net_proto___parse__python is not None:
def ParseASCIIIgnoreUnknown(self, s):
_net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.KindExpression', s)
def Equals(self, x):
if x is self: return 1
if self.has_name_ != x.has_name_: return 0
if self.has_name_ and self.name_ != x.name_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_name_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: name not set.')
return initialized
def ByteSize(self):
n = 0
n += self.lengthString(len(self.name_))
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_name_):
n += 1
n += self.lengthString(len(self.name_))
return n
def Clear(self):
self.clear_name()
def OutputUnchecked(self, out):
out.putVarInt32(10)
out.putPrefixedString(self.name_)
def OutputPartial(self, out):
if (self.has_name_):
out.putVarInt32(10)
out.putPrefixedString(self.name_)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 10:
self.set_name(d.getPrefixedString())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_name_: res+=prefix+("name: %s\n" % self.DebugFormatString(self.name_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kname = 1
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "name",
}, 1)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.STRING,
}, 1, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.KindExpression'
_SERIALIZED_DESCRIPTOR = array.array('B')
_SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktpbmRFeHByZXNzaW9uExoEbmFtZSABKAIwCTgCFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
if _net_proto___parse__python is not None:
_net_proto___parse__python.RegisterType(
_SERIALIZED_DESCRIPTOR.tostring())
class PropertyReference(ProtocolBuffer.ProtocolMessage):
has_name_ = 0
name_ = ""
def __init__(self, contents=None):
if contents is not None: self.MergeFromString(contents)
def name(self): return self.name_
def set_name(self, x):
self.has_name_ = 1
self.name_ = x
def clear_name(self):
if self.has_name_:
self.has_name_ = 0
self.name_ = ""
def has_name(self): return self.has_name_
def MergeFrom(self, x):
assert x is not self
if (x.has_name()): self.set_name(x.name())
if _net_proto___parse__python is not None:
def _CMergeFromString(self, s):
_net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.PropertyReference', s)
if _net_proto___parse__python is not None:
def _CEncode(self):
return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.PropertyReference')
if _net_proto___parse__python is not None:
def _CEncodePartial(self):
return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.PropertyReference')
if _net_proto___parse__python is not None:
def _CToASCII(self, output_format):
return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.PropertyReference', output_format)
if _net_proto___parse__python is not None:
def ParseASCII(self, s):
_net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.PropertyReference', s)
if _net_proto___parse__python is not None:
def ParseASCIIIgnoreUnknown(self, s):
_net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.PropertyReference', s)
def Equals(self, x):
if x is self: return 1
if self.has_name_ != x.has_name_: return 0
if self.has_name_ and self.name_ != x.name_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_name_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: name not set.')
return initialized
def ByteSize(self):
n = 0
n += self.lengthString(len(self.name_))
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_name_):
n += 1
n += self.lengthString(len(self.name_))
return n
def Clear(self):
self.clear_name()
def OutputUnchecked(self, out):
out.putVarInt32(18)
out.putPrefixedString(self.name_)
def OutputPartial(self, out):
if (self.has_name_):
out.putVarInt32(18)
out.putPrefixedString(self.name_)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 18:
self.set_name(d.getPrefixedString())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_name_: res+=prefix+("name: %s\n" % self.DebugFormatString(self.name_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kname = 2
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
2: "name",
}, 2)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
2: ProtocolBuffer.Encoder.STRING,
}, 2, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.PropertyReference'
_SERIALIZED_DESCRIPTOR = array.array('B')
_SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5UmVmZXJlbmNlExoEbmFtZSACKAIwCTgCFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
if _net_proto___parse__python is not None:
_net_proto___parse__python.RegisterType(
_SERIALIZED_DESCRIPTOR.tostring())
class PropertyExpression(ProtocolBuffer.ProtocolMessage):
FIRST = 1
_AggregationFunction_NAMES = {
1: "FIRST",
}
def AggregationFunction_Name(cls, x): return cls._AggregationFunction_NAMES.get(x, "")
AggregationFunction_Name = classmethod(AggregationFunction_Name)
has_property_ = 0
has_aggregation_function_ = 0
aggregation_function_ = 0
def __init__(self, contents=None):
self.property_ = PropertyReference()
if contents is not None: self.MergeFromString(contents)
def property(self): return self.property_
def mutable_property(self): self.has_property_ = 1; return self.property_
def clear_property(self):self.has_property_ = 0; self.property_.Clear()
def has_property(self): return self.has_property_
def aggregation_function(self): return self.aggregation_function_
def set_aggregation_function(self, x):
self.has_aggregation_function_ = 1
self.aggregation_function_ = x
def clear_aggregation_function(self):
if self.has_aggregation_function_:
self.has_aggregation_function_ = 0
self.aggregation_function_ = 0
def has_aggregation_function(self): return self.has_aggregation_function_
def MergeFrom(self, x):
assert x is not self
if (x.has_property()): self.mutable_property().MergeFrom(x.property())
if (x.has_aggregation_function()): self.set_aggregation_function(x.aggregation_function())
if _net_proto___parse__python is not None:
def _CMergeFromString(self, s):
_net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.PropertyExpression', s)
if _net_proto___parse__python is not None:
def _CEncode(self):
return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.PropertyExpression')
if _net_proto___parse__python is not None:
def _CEncodePartial(self):
return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.PropertyExpression')
if _net_proto___parse__python is not None:
def _CToASCII(self, output_format):
return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.PropertyExpression', output_format)
if _net_proto___parse__python is not None:
def ParseASCII(self, s):
_net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.PropertyExpression', s)
if _net_proto___parse__python is not None:
def ParseASCIIIgnoreUnknown(self, s):
_net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.PropertyExpression', s)
def Equals(self, x):
if x is self: return 1
if self.has_property_ != x.has_property_: return 0
if self.has_property_ and self.property_ != x.property_: return 0
if self.has_aggregation_function_ != x.has_aggregation_function_: return 0
if self.has_aggregation_function_ and self.aggregation_function_ != x.aggregation_function_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_property_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: property not set.')
elif not self.property_.IsInitialized(debug_strs): initialized = 0
return initialized
def ByteSize(self):
n = 0
n += self.lengthString(self.property_.ByteSize())
if (self.has_aggregation_function_): n += 1 + self.lengthVarInt64(self.aggregation_function_)
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_property_):
n += 1
n += self.lengthString(self.property_.ByteSizePartial())
if (self.has_aggregation_function_): n += 1 + self.lengthVarInt64(self.aggregation_function_)
return n
def Clear(self):
self.clear_property()
self.clear_aggregation_function()
def OutputUnchecked(self, out):
out.putVarInt32(10)
out.putVarInt32(self.property_.ByteSize())
self.property_.OutputUnchecked(out)
if (self.has_aggregation_function_):
out.putVarInt32(16)
out.putVarInt32(self.aggregation_function_)
def OutputPartial(self, out):
if (self.has_property_):
out.putVarInt32(10)
out.putVarInt32(self.property_.ByteSizePartial())
self.property_.OutputPartial(out)
if (self.has_aggregation_function_):
out.putVarInt32(16)
out.putVarInt32(self.aggregation_function_)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 10:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_property().TryMerge(tmp)
continue
if tt == 16:
self.set_aggregation_function(d.getVarInt32())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_property_:
res+=prefix+"property <\n"
res+=self.property_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
if self.has_aggregation_function_: res+=prefix+("aggregation_function: %s\n" % self.DebugFormatInt32(self.aggregation_function_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kproperty = 1
kaggregation_function = 2
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "property",
2: "aggregation_function",
}, 2)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.STRING,
2: ProtocolBuffer.Encoder.NUMERIC,
}, 2, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.PropertyExpression'
_SERIALIZED_DESCRIPTOR = array.array('B')
_SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5RXhwcmVzc2lvbhMaCHByb3BlcnR5IAEoAjALOAJKKWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5UmVmZXJlbmNlowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaFGFnZ3JlZ2F0aW9uX2Z1bmN0aW9uIAIoADAFOAFoABRzehNBZ2dyZWdhdGlvbkZ1bmN0aW9uiwGSAQVGSVJTVJgBAYwBdMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
if _net_proto___parse__python is not None:
_net_proto___parse__python.RegisterType(
_SERIALIZED_DESCRIPTOR.tostring())
class PropertyOrder(ProtocolBuffer.ProtocolMessage):
ASCENDING = 1
DESCENDING = 2
_Direction_NAMES = {
1: "ASCENDING",
2: "DESCENDING",
}
def Direction_Name(cls, x): return cls._Direction_NAMES.get(x, "")
Direction_Name = classmethod(Direction_Name)
has_property_ = 0
has_direction_ = 0
direction_ = 1
def __init__(self, contents=None):
self.property_ = PropertyReference()
if contents is not None: self.MergeFromString(contents)
def property(self): return self.property_
def mutable_property(self): self.has_property_ = 1; return self.property_
def clear_property(self):self.has_property_ = 0; self.property_.Clear()
def has_property(self): return self.has_property_
def direction(self): return self.direction_
def set_direction(self, x):
self.has_direction_ = 1
self.direction_ = x
def clear_direction(self):
if self.has_direction_:
self.has_direction_ = 0
self.direction_ = 1
def has_direction(self): return self.has_direction_
def MergeFrom(self, x):
assert x is not self
if (x.has_property()): self.mutable_property().MergeFrom(x.property())
if (x.has_direction()): self.set_direction(x.direction())
if _net_proto___parse__python is not None:
def _CMergeFromString(self, s):
_net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.PropertyOrder', s)
if _net_proto___parse__python is not None:
def _CEncode(self):
return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.PropertyOrder')
if _net_proto___parse__python is not None:
def _CEncodePartial(self):
return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.PropertyOrder')
if _net_proto___parse__python is not None:
def _CToASCII(self, output_format):
return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.PropertyOrder', output_format)
if _net_proto___parse__python is not None:
def ParseASCII(self, s):
_net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.PropertyOrder', s)
if _net_proto___parse__python is not None:
def ParseASCIIIgnoreUnknown(self, s):
_net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.PropertyOrder', s)
def Equals(self, x):
if x is self: return 1
if self.has_property_ != x.has_property_: return 0
if self.has_property_ and self.property_ != x.property_: return 0
if self.has_direction_ != x.has_direction_: return 0
if self.has_direction_ and self.direction_ != x.direction_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_property_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: property not set.')
elif not self.property_.IsInitialized(debug_strs): initialized = 0
return initialized
def ByteSize(self):
n = 0
n += self.lengthString(self.property_.ByteSize())
if (self.has_direction_): n += 1 + self.lengthVarInt64(self.direction_)
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_property_):
n += 1
n += self.lengthString(self.property_.ByteSizePartial())
if (self.has_direction_): n += 1 + self.lengthVarInt64(self.direction_)
return n
def Clear(self):
self.clear_property()
self.clear_direction()
def OutputUnchecked(self, out):
out.putVarInt32(10)
out.putVarInt32(self.property_.ByteSize())
self.property_.OutputUnchecked(out)
if (self.has_direction_):
out.putVarInt32(16)
out.putVarInt32(self.direction_)
def OutputPartial(self, out):
if (self.has_property_):
out.putVarInt32(10)
out.putVarInt32(self.property_.ByteSizePartial())
self.property_.OutputPartial(out)
if (self.has_direction_):
out.putVarInt32(16)
out.putVarInt32(self.direction_)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 10:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_property().TryMerge(tmp)
continue
if tt == 16:
self.set_direction(d.getVarInt32())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_property_:
res+=prefix+"property <\n"
res+=self.property_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
if self.has_direction_: res+=prefix+("direction: %s\n" % self.DebugFormatInt32(self.direction_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kproperty = 1
kdirection = 2
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "property",
2: "direction",
}, 2)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.STRING,
2: ProtocolBuffer.Encoder.NUMERIC,
}, 2, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.PropertyOrder'
_SERIALIZED_DESCRIPTOR = array.array('B')
_SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5T3JkZXITGghwcm9wZXJ0eSABKAIwCzgCSilhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eVJlZmVyZW5jZaMBqgEFY3R5cGWyAQZwcm90bzKkARQTGglkaXJlY3Rpb24gAigAMAU4AUIBMWgAowGqAQdkZWZhdWx0sgEJQVNDRU5ESU5HpAEUc3oJRGlyZWN0aW9uiwGSAQlBU0NFTkRJTkeYAQGMAYsBkgEKREVTQ0VORElOR5gBAowBdMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
if _net_proto___parse__python is not None:
_net_proto___parse__python.RegisterType(
_SERIALIZED_DESCRIPTOR.tostring())
class Filter(ProtocolBuffer.ProtocolMessage):
has_composite_filter_ = 0
composite_filter_ = None
has_property_filter_ = 0
property_filter_ = None
def __init__(self, contents=None):
self.lazy_init_lock_ = thread.allocate_lock()
if contents is not None: self.MergeFromString(contents)
def composite_filter(self):
if self.composite_filter_ is None:
self.lazy_init_lock_.acquire()
try:
if self.composite_filter_ is None: self.composite_filter_ = CompositeFilter()
finally:
self.lazy_init_lock_.release()
return self.composite_filter_
def mutable_composite_filter(self): self.has_composite_filter_ = 1; return self.composite_filter()
def clear_composite_filter(self):
if self.has_composite_filter_:
self.has_composite_filter_ = 0;
if self.composite_filter_ is not None: self.composite_filter_.Clear()
def has_composite_filter(self): return self.has_composite_filter_
def property_filter(self):
if self.property_filter_ is None:
self.lazy_init_lock_.acquire()
try:
if self.property_filter_ is None: self.property_filter_ = PropertyFilter()
finally:
self.lazy_init_lock_.release()
return self.property_filter_
def mutable_property_filter(self): self.has_property_filter_ = 1; return self.property_filter()
def clear_property_filter(self):
if self.has_property_filter_:
self.has_property_filter_ = 0;
if self.property_filter_ is not None: self.property_filter_.Clear()
def has_property_filter(self): return self.has_property_filter_
def MergeFrom(self, x):
assert x is not self
if (x.has_composite_filter()): self.mutable_composite_filter().MergeFrom(x.composite_filter())
if (x.has_property_filter()): self.mutable_property_filter().MergeFrom(x.property_filter())
if _net_proto___parse__python is not None:
def _CMergeFromString(self, s):
_net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.Filter', s)
if _net_proto___parse__python is not None:
def _CEncode(self):
return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.Filter')
if _net_proto___parse__python is not None:
def _CEncodePartial(self):
return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.Filter')
if _net_proto___parse__python is not None:
def _CToASCII(self, output_format):
return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.Filter', output_format)
if _net_proto___parse__python is not None:
def ParseASCII(self, s):
_net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.Filter', s)
if _net_proto___parse__python is not None:
def ParseASCIIIgnoreUnknown(self, s):
_net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.Filter', s)
def Equals(self, x):
if x is self: return 1
if self.has_composite_filter_ != x.has_composite_filter_: return 0
if self.has_composite_filter_ and self.composite_filter_ != x.composite_filter_: return 0
if self.has_property_filter_ != x.has_property_filter_: return 0
if self.has_property_filter_ and self.property_filter_ != x.property_filter_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (self.has_composite_filter_ and not self.composite_filter_.IsInitialized(debug_strs)): initialized = 0
if (self.has_property_filter_ and not self.property_filter_.IsInitialized(debug_strs)): initialized = 0
return initialized
def ByteSize(self):
n = 0
if (self.has_composite_filter_): n += 1 + self.lengthString(self.composite_filter_.ByteSize())
if (self.has_property_filter_): n += 1 + self.lengthString(self.property_filter_.ByteSize())
return n
def ByteSizePartial(self):
n = 0
if (self.has_composite_filter_): n += 1 + self.lengthString(self.composite_filter_.ByteSizePartial())
if (self.has_property_filter_): n += 1 + self.lengthString(self.property_filter_.ByteSizePartial())
return n
def Clear(self):
self.clear_composite_filter()
self.clear_property_filter()
def OutputUnchecked(self, out):
if (self.has_composite_filter_):
out.putVarInt32(10)
out.putVarInt32(self.composite_filter_.ByteSize())
self.composite_filter_.OutputUnchecked(out)
if (self.has_property_filter_):
out.putVarInt32(18)
out.putVarInt32(self.property_filter_.ByteSize())
self.property_filter_.OutputUnchecked(out)
def OutputPartial(self, out):
if (self.has_composite_filter_):
out.putVarInt32(10)
out.putVarInt32(self.composite_filter_.ByteSizePartial())
self.composite_filter_.OutputPartial(out)
if (self.has_property_filter_):
out.putVarInt32(18)
out.putVarInt32(self.property_filter_.ByteSizePartial())
self.property_filter_.OutputPartial(out)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 10:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_composite_filter().TryMerge(tmp)
continue
if tt == 18:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_property_filter().TryMerge(tmp)
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_composite_filter_:
res+=prefix+"composite_filter <\n"
res+=self.composite_filter_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
if self.has_property_filter_:
res+=prefix+"property_filter <\n"
res+=self.property_filter_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kcomposite_filter = 1
kproperty_filter = 2
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "composite_filter",
2: "property_filter",
}, 2)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.STRING,
2: ProtocolBuffer.Encoder.STRING,
}, 2, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.Filter'
_SERIALIZED_DESCRIPTOR = array.array('B')
_SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KHmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkZpbHRlchMaEGNvbXBvc2l0ZV9maWx0ZXIgASgCMAs4AUonYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuQ29tcG9zaXRlRmlsdGVyowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaD3Byb3BlcnR5X2ZpbHRlciACKAIwCzgBSiZhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5Qcm9wZXJ0eUZpbHRlcqMBqgEFY3R5cGWyAQZwcm90bzKkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
if _net_proto___parse__python is not None:
_net_proto___parse__python.RegisterType(
_SERIALIZED_DESCRIPTOR.tostring())
class CompositeFilter(ProtocolBuffer.ProtocolMessage):
AND = 1
_Operator_NAMES = {
1: "AND",
}
def Operator_Name(cls, x): return cls._Operator_NAMES.get(x, "")
Operator_Name = classmethod(Operator_Name)
has_operator_ = 0
operator_ = 0
def __init__(self, contents=None):
self.filter_ = []
if contents is not None: self.MergeFromString(contents)
def operator(self): return self.operator_
def set_operator(self, x):
self.has_operator_ = 1
self.operator_ = x
def clear_operator(self):
if self.has_operator_:
self.has_operator_ = 0
self.operator_ = 0
def has_operator(self): return self.has_operator_
def filter_size(self): return len(self.filter_)
def filter_list(self): return self.filter_
def filter(self, i):
return self.filter_[i]
def mutable_filter(self, i):
return self.filter_[i]
def add_filter(self):
x = Filter()
self.filter_.append(x)
return x
def clear_filter(self):
self.filter_ = []
def MergeFrom(self, x):
assert x is not self
if (x.has_operator()): self.set_operator(x.operator())
for i in xrange(x.filter_size()): self.add_filter().CopyFrom(x.filter(i))
if _net_proto___parse__python is not None:
def _CMergeFromString(self, s):
_net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.CompositeFilter', s)
if _net_proto___parse__python is not None:
def _CEncode(self):
return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.CompositeFilter')
if _net_proto___parse__python is not None:
def _CEncodePartial(self):
return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.CompositeFilter')
if _net_proto___parse__python is not None:
def _CToASCII(self, output_format):
return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.CompositeFilter', output_format)
if _net_proto___parse__python is not None:
def ParseASCII(self, s):
_net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.CompositeFilter', s)
if _net_proto___parse__python is not None:
def ParseASCIIIgnoreUnknown(self, s):
_net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.CompositeFilter', s)
def Equals(self, x):
if x is self: return 1
if self.has_operator_ != x.has_operator_: return 0
if self.has_operator_ and self.operator_ != x.operator_: return 0
if len(self.filter_) != len(x.filter_): return 0
for e1, e2 in zip(self.filter_, x.filter_):
if e1 != e2: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_operator_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: operator not set.')
for p in self.filter_:
if not p.IsInitialized(debug_strs): initialized=0
return initialized
def ByteSize(self):
n = 0
n += self.lengthVarInt64(self.operator_)
n += 1 * len(self.filter_)
for i in xrange(len(self.filter_)): n += self.lengthString(self.filter_[i].ByteSize())
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_operator_):
n += 1
n += self.lengthVarInt64(self.operator_)
n += 1 * len(self.filter_)
for i in xrange(len(self.filter_)): n += self.lengthString(self.filter_[i].ByteSizePartial())
return n
def Clear(self):
self.clear_operator()
self.clear_filter()
def OutputUnchecked(self, out):
out.putVarInt32(8)
out.putVarInt32(self.operator_)
for i in xrange(len(self.filter_)):
out.putVarInt32(18)
out.putVarInt32(self.filter_[i].ByteSize())
self.filter_[i].OutputUnchecked(out)
def OutputPartial(self, out):
if (self.has_operator_):
out.putVarInt32(8)
out.putVarInt32(self.operator_)
for i in xrange(len(self.filter_)):
out.putVarInt32(18)
out.putVarInt32(self.filter_[i].ByteSizePartial())
self.filter_[i].OutputPartial(out)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 8:
self.set_operator(d.getVarInt32())
continue
if tt == 18:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_filter().TryMerge(tmp)
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_operator_: res+=prefix+("operator: %s\n" % self.DebugFormatInt32(self.operator_))
cnt=0
for e in self.filter_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("filter%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
koperator = 1
kfilter = 2
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "operator",
2: "filter",
}, 2)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.NUMERIC,
2: ProtocolBuffer.Encoder.STRING,
}, 2, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.CompositeFilter'
_SERIALIZED_DESCRIPTOR = array.array('B')
_SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJ2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkNvbXBvc2l0ZUZpbHRlchMaCG9wZXJhdG9yIAEoADAFOAJoABQTGgZmaWx0ZXIgAigCMAs4A0oeYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRmlsdGVyowGqAQVjdHlwZbIBBnByb3RvMqQBFHN6CE9wZXJhdG9yiwGSAQNBTkSYAQGMAXTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
if _net_proto___parse__python is not None:
_net_proto___parse__python.RegisterType(
_SERIALIZED_DESCRIPTOR.tostring())
class PropertyFilter(ProtocolBuffer.ProtocolMessage):
LESS_THAN = 1
LESS_THAN_OR_EQUAL = 2
GREATER_THAN = 3
GREATER_THAN_OR_EQUAL = 4
EQUAL = 5
HAS_ANCESTOR = 11
_Operator_NAMES = {
1: "LESS_THAN",
2: "LESS_THAN_OR_EQUAL",
3: "GREATER_THAN",
4: "GREATER_THAN_OR_EQUAL",
5: "EQUAL",
11: "HAS_ANCESTOR",
}
def Operator_Name(cls, x): return cls._Operator_NAMES.get(x, "")
Operator_Name = classmethod(Operator_Name)
has_property_ = 0
has_operator_ = 0
operator_ = 0
has_value_ = 0
def __init__(self, contents=None):
self.property_ = PropertyReference()
self.value_ = google.appengine.datastore.entity_v4_pb.Value()
if contents is not None: self.MergeFromString(contents)
def property(self): return self.property_
def mutable_property(self): self.has_property_ = 1; return self.property_
def clear_property(self):self.has_property_ = 0; self.property_.Clear()
def has_property(self): return self.has_property_
def operator(self): return self.operator_
def set_operator(self, x):
self.has_operator_ = 1
self.operator_ = x
def clear_operator(self):
if self.has_operator_:
self.has_operator_ = 0
self.operator_ = 0
def has_operator(self): return self.has_operator_
def value(self): return self.value_
def mutable_value(self): self.has_value_ = 1; return self.value_
def clear_value(self):self.has_value_ = 0; self.value_.Clear()
def has_value(self): return self.has_value_
def MergeFrom(self, x):
assert x is not self
if (x.has_property()): self.mutable_property().MergeFrom(x.property())
if (x.has_operator()): self.set_operator(x.operator())
if (x.has_value()): self.mutable_value().MergeFrom(x.value())
if _net_proto___parse__python is not None:
def _CMergeFromString(self, s):
_net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.PropertyFilter', s)
if _net_proto___parse__python is not None:
def _CEncode(self):
return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.PropertyFilter')
if _net_proto___parse__python is not None:
def _CEncodePartial(self):
return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.PropertyFilter')
if _net_proto___parse__python is not None:
def _CToASCII(self, output_format):
return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.PropertyFilter', output_format)
if _net_proto___parse__python is not None:
def ParseASCII(self, s):
_net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.PropertyFilter', s)
if _net_proto___parse__python is not None:
def ParseASCIIIgnoreUnknown(self, s):
_net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.PropertyFilter', s)
def Equals(self, x):
if x is self: return 1
if self.has_property_ != x.has_property_: return 0
if self.has_property_ and self.property_ != x.property_: return 0
if self.has_operator_ != x.has_operator_: return 0
if self.has_operator_ and self.operator_ != x.operator_: return 0
if self.has_value_ != x.has_value_: return 0
if self.has_value_ and self.value_ != x.value_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_property_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: property not set.')
elif not self.property_.IsInitialized(debug_strs): initialized = 0
if (not self.has_operator_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: operator not set.')
if (not self.has_value_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: value not set.')
elif not self.value_.IsInitialized(debug_strs): initialized = 0
return initialized
def ByteSize(self):
n = 0
n += self.lengthString(self.property_.ByteSize())
n += self.lengthVarInt64(self.operator_)
n += self.lengthString(self.value_.ByteSize())
return n + 3
def ByteSizePartial(self):
n = 0
if (self.has_property_):
n += 1
n += self.lengthString(self.property_.ByteSizePartial())
if (self.has_operator_):
n += 1
n += self.lengthVarInt64(self.operator_)
if (self.has_value_):
n += 1
n += self.lengthString(self.value_.ByteSizePartial())
return n
def Clear(self):
self.clear_property()
self.clear_operator()
self.clear_value()
def OutputUnchecked(self, out):
out.putVarInt32(10)
out.putVarInt32(self.property_.ByteSize())
self.property_.OutputUnchecked(out)
out.putVarInt32(16)
out.putVarInt32(self.operator_)
out.putVarInt32(26)
out.putVarInt32(self.value_.ByteSize())
self.value_.OutputUnchecked(out)
def OutputPartial(self, out):
if (self.has_property_):
out.putVarInt32(10)
out.putVarInt32(self.property_.ByteSizePartial())
self.property_.OutputPartial(out)
if (self.has_operator_):
out.putVarInt32(16)
out.putVarInt32(self.operator_)
if (self.has_value_):
out.putVarInt32(26)
out.putVarInt32(self.value_.ByteSizePartial())
self.value_.OutputPartial(out)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 10:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_property().TryMerge(tmp)
continue
if tt == 16:
self.set_operator(d.getVarInt32())
continue
if tt == 26:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_value().TryMerge(tmp)
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_property_:
res+=prefix+"property <\n"
res+=self.property_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
if self.has_operator_: res+=prefix+("operator: %s\n" % self.DebugFormatInt32(self.operator_))
if self.has_value_:
res+=prefix+"value <\n"
res+=self.value_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kproperty = 1
koperator = 2
kvalue = 3
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "property",
2: "operator",
3: "value",
}, 3)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.STRING,
2: ProtocolBuffer.Encoder.NUMERIC,
3: ProtocolBuffer.Encoder.STRING,
}, 3, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.PropertyFilter'
_SERIALIZED_DESCRIPTOR = array.array('B')
_SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlByb3BlcnR5RmlsdGVyExoIcHJvcGVydHkgASgCMAs4AkopYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuUHJvcGVydHlSZWZlcmVuY2WjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoIb3BlcmF0b3IgAigAMAU4AmgAFBMaBXZhbHVlIAMoAjALOAJKHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlZhbHVlowGqAQVjdHlwZbIBBnByb3RvMqQBFHN6CE9wZXJhdG9yiwGSAQlMRVNTX1RIQU6YAQGMAYsBkgESTEVTU19USEFOX09SX0VRVUFMmAECjAGLAZIBDEdSRUFURVJfVEhBTpgBA4wBiwGSARVHUkVBVEVSX1RIQU5fT1JfRVFVQUyYAQSMAYsBkgEFRVFVQUyYAQWMAYsBkgEMSEFTX0FOQ0VTVE9SmAELjAF0wgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
if _net_proto___parse__python is not None:
_net_proto___parse__python.RegisterType(
_SERIALIZED_DESCRIPTOR.tostring())
class GqlQuery(ProtocolBuffer.ProtocolMessage):
has_query_string_ = 0
query_string_ = ""
has_allow_literal_ = 0
allow_literal_ = 0
def __init__(self, contents=None):
self.name_arg_ = []
self.number_arg_ = []
if contents is not None: self.MergeFromString(contents)
def query_string(self): return self.query_string_
def set_query_string(self, x):
self.has_query_string_ = 1
self.query_string_ = x
def clear_query_string(self):
if self.has_query_string_:
self.has_query_string_ = 0
self.query_string_ = ""
def has_query_string(self): return self.has_query_string_
def allow_literal(self): return self.allow_literal_
def set_allow_literal(self, x):
self.has_allow_literal_ = 1
self.allow_literal_ = x
def clear_allow_literal(self):
if self.has_allow_literal_:
self.has_allow_literal_ = 0
self.allow_literal_ = 0
def has_allow_literal(self): return self.has_allow_literal_
def name_arg_size(self): return len(self.name_arg_)
def name_arg_list(self): return self.name_arg_
def name_arg(self, i):
return self.name_arg_[i]
def mutable_name_arg(self, i):
return self.name_arg_[i]
def add_name_arg(self):
x = GqlQueryArg()
self.name_arg_.append(x)
return x
def clear_name_arg(self):
self.name_arg_ = []
def number_arg_size(self): return len(self.number_arg_)
def number_arg_list(self): return self.number_arg_
def number_arg(self, i):
return self.number_arg_[i]
def mutable_number_arg(self, i):
return self.number_arg_[i]
def add_number_arg(self):
x = GqlQueryArg()
self.number_arg_.append(x)
return x
def clear_number_arg(self):
self.number_arg_ = []
def MergeFrom(self, x):
assert x is not self
if (x.has_query_string()): self.set_query_string(x.query_string())
if (x.has_allow_literal()): self.set_allow_literal(x.allow_literal())
for i in xrange(x.name_arg_size()): self.add_name_arg().CopyFrom(x.name_arg(i))
for i in xrange(x.number_arg_size()): self.add_number_arg().CopyFrom(x.number_arg(i))
if _net_proto___parse__python is not None:
def _CMergeFromString(self, s):
_net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.GqlQuery', s)
if _net_proto___parse__python is not None:
def _CEncode(self):
return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.GqlQuery')
if _net_proto___parse__python is not None:
def _CEncodePartial(self):
return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.GqlQuery')
if _net_proto___parse__python is not None:
def _CToASCII(self, output_format):
return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.GqlQuery', output_format)
if _net_proto___parse__python is not None:
def ParseASCII(self, s):
_net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.GqlQuery', s)
if _net_proto___parse__python is not None:
def ParseASCIIIgnoreUnknown(self, s):
_net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.GqlQuery', s)
def Equals(self, x):
if x is self: return 1
if self.has_query_string_ != x.has_query_string_: return 0
if self.has_query_string_ and self.query_string_ != x.query_string_: return 0
if self.has_allow_literal_ != x.has_allow_literal_: return 0
if self.has_allow_literal_ and self.allow_literal_ != x.allow_literal_: return 0
if len(self.name_arg_) != len(x.name_arg_): return 0
for e1, e2 in zip(self.name_arg_, x.name_arg_):
if e1 != e2: return 0
if len(self.number_arg_) != len(x.number_arg_): return 0
for e1, e2 in zip(self.number_arg_, x.number_arg_):
if e1 != e2: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_query_string_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: query_string not set.')
for p in self.name_arg_:
if not p.IsInitialized(debug_strs): initialized=0
for p in self.number_arg_:
if not p.IsInitialized(debug_strs): initialized=0
return initialized
def ByteSize(self):
n = 0
n += self.lengthString(len(self.query_string_))
if (self.has_allow_literal_): n += 2
n += 1 * len(self.name_arg_)
for i in xrange(len(self.name_arg_)): n += self.lengthString(self.name_arg_[i].ByteSize())
n += 1 * len(self.number_arg_)
for i in xrange(len(self.number_arg_)): n += self.lengthString(self.number_arg_[i].ByteSize())
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_query_string_):
n += 1
n += self.lengthString(len(self.query_string_))
if (self.has_allow_literal_): n += 2
n += 1 * len(self.name_arg_)
for i in xrange(len(self.name_arg_)): n += self.lengthString(self.name_arg_[i].ByteSizePartial())
n += 1 * len(self.number_arg_)
for i in xrange(len(self.number_arg_)): n += self.lengthString(self.number_arg_[i].ByteSizePartial())
return n
def Clear(self):
self.clear_query_string()
self.clear_allow_literal()
self.clear_name_arg()
self.clear_number_arg()
def OutputUnchecked(self, out):
out.putVarInt32(10)
out.putPrefixedString(self.query_string_)
if (self.has_allow_literal_):
out.putVarInt32(16)
out.putBoolean(self.allow_literal_)
for i in xrange(len(self.name_arg_)):
out.putVarInt32(26)
out.putVarInt32(self.name_arg_[i].ByteSize())
self.name_arg_[i].OutputUnchecked(out)
for i in xrange(len(self.number_arg_)):
out.putVarInt32(34)
out.putVarInt32(self.number_arg_[i].ByteSize())
self.number_arg_[i].OutputUnchecked(out)
def OutputPartial(self, out):
if (self.has_query_string_):
out.putVarInt32(10)
out.putPrefixedString(self.query_string_)
if (self.has_allow_literal_):
out.putVarInt32(16)
out.putBoolean(self.allow_literal_)
for i in xrange(len(self.name_arg_)):
out.putVarInt32(26)
out.putVarInt32(self.name_arg_[i].ByteSizePartial())
self.name_arg_[i].OutputPartial(out)
for i in xrange(len(self.number_arg_)):
out.putVarInt32(34)
out.putVarInt32(self.number_arg_[i].ByteSizePartial())
self.number_arg_[i].OutputPartial(out)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 10:
self.set_query_string(d.getPrefixedString())
continue
if tt == 16:
self.set_allow_literal(d.getBoolean())
continue
if tt == 26:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_name_arg().TryMerge(tmp)
continue
if tt == 34:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_number_arg().TryMerge(tmp)
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_query_string_: res+=prefix+("query_string: %s\n" % self.DebugFormatString(self.query_string_))
if self.has_allow_literal_: res+=prefix+("allow_literal: %s\n" % self.DebugFormatBool(self.allow_literal_))
cnt=0
for e in self.name_arg_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("name_arg%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
cnt=0
for e in self.number_arg_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("number_arg%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kquery_string = 1
kallow_literal = 2
kname_arg = 3
knumber_arg = 4
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "query_string",
2: "allow_literal",
3: "name_arg",
4: "number_arg",
}, 4)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.STRING,
2: ProtocolBuffer.Encoder.NUMERIC,
3: ProtocolBuffer.Encoder.STRING,
4: ProtocolBuffer.Encoder.STRING,
}, 4, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.GqlQuery'
_SERIALIZED_DESCRIPTOR = array.array('B')
_SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KIGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkdxbFF1ZXJ5ExoMcXVlcnlfc3RyaW5nIAEoAjAJOAIUExoNYWxsb3dfbGl0ZXJhbCACKAAwCDgBQgVmYWxzZaMBqgEHZGVmYXVsdLIBBWZhbHNlpAEUExoIbmFtZV9hcmcgAygCMAs4A0ojYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuR3FsUXVlcnlBcmejAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoKbnVtYmVyX2FyZyAEKAIwCzgDSiNhcHBob3N0aW5nLmRhdGFzdG9yZS52NC5HcWxRdWVyeUFyZ6MBqgEFY3R5cGWyAQZwcm90bzKkARTCAR1hcHBob3N0aW5nLmRhdGFzdG9yZS52NC5FcnJvcg=="))
if _net_proto___parse__python is not None:
_net_proto___parse__python.RegisterType(
_SERIALIZED_DESCRIPTOR.tostring())
class GqlQueryArg(ProtocolBuffer.ProtocolMessage):
has_name_ = 0
name_ = ""
has_value_ = 0
value_ = None
has_cursor_ = 0
cursor_ = ""
def __init__(self, contents=None):
self.lazy_init_lock_ = thread.allocate_lock()
if contents is not None: self.MergeFromString(contents)
def name(self): return self.name_
def set_name(self, x):
self.has_name_ = 1
self.name_ = x
def clear_name(self):
if self.has_name_:
self.has_name_ = 0
self.name_ = ""
def has_name(self): return self.has_name_
def value(self):
if self.value_ is None:
self.lazy_init_lock_.acquire()
try:
if self.value_ is None: self.value_ = google.appengine.datastore.entity_v4_pb.Value()
finally:
self.lazy_init_lock_.release()
return self.value_
def mutable_value(self): self.has_value_ = 1; return self.value()
def clear_value(self):
if self.has_value_:
self.has_value_ = 0;
if self.value_ is not None: self.value_.Clear()
def has_value(self): return self.has_value_
def cursor(self): return self.cursor_
def set_cursor(self, x):
self.has_cursor_ = 1
self.cursor_ = x
def clear_cursor(self):
if self.has_cursor_:
self.has_cursor_ = 0
self.cursor_ = ""
def has_cursor(self): return self.has_cursor_
def MergeFrom(self, x):
assert x is not self
if (x.has_name()): self.set_name(x.name())
if (x.has_value()): self.mutable_value().MergeFrom(x.value())
if (x.has_cursor()): self.set_cursor(x.cursor())
if _net_proto___parse__python is not None:
def _CMergeFromString(self, s):
_net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.GqlQueryArg', s)
if _net_proto___parse__python is not None:
def _CEncode(self):
return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.GqlQueryArg')
if _net_proto___parse__python is not None:
def _CEncodePartial(self):
return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.GqlQueryArg')
if _net_proto___parse__python is not None:
def _CToASCII(self, output_format):
return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.GqlQueryArg', output_format)
if _net_proto___parse__python is not None:
def ParseASCII(self, s):
_net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.GqlQueryArg', s)
if _net_proto___parse__python is not None:
def ParseASCIIIgnoreUnknown(self, s):
_net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.GqlQueryArg', s)
def Equals(self, x):
if x is self: return 1
if self.has_name_ != x.has_name_: return 0
if self.has_name_ and self.name_ != x.name_: return 0
if self.has_value_ != x.has_value_: return 0
if self.has_value_ and self.value_ != x.value_: return 0
if self.has_cursor_ != x.has_cursor_: return 0
if self.has_cursor_ and self.cursor_ != x.cursor_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (self.has_value_ and not self.value_.IsInitialized(debug_strs)): initialized = 0
return initialized
def ByteSize(self):
n = 0
if (self.has_name_): n += 1 + self.lengthString(len(self.name_))
if (self.has_value_): n += 1 + self.lengthString(self.value_.ByteSize())
if (self.has_cursor_): n += 1 + self.lengthString(len(self.cursor_))
return n
def ByteSizePartial(self):
n = 0
if (self.has_name_): n += 1 + self.lengthString(len(self.name_))
if (self.has_value_): n += 1 + self.lengthString(self.value_.ByteSizePartial())
if (self.has_cursor_): n += 1 + self.lengthString(len(self.cursor_))
return n
def Clear(self):
self.clear_name()
self.clear_value()
self.clear_cursor()
def OutputUnchecked(self, out):
if (self.has_name_):
out.putVarInt32(10)
out.putPrefixedString(self.name_)
if (self.has_value_):
out.putVarInt32(18)
out.putVarInt32(self.value_.ByteSize())
self.value_.OutputUnchecked(out)
if (self.has_cursor_):
out.putVarInt32(26)
out.putPrefixedString(self.cursor_)
def OutputPartial(self, out):
if (self.has_name_):
out.putVarInt32(10)
out.putPrefixedString(self.name_)
if (self.has_value_):
out.putVarInt32(18)
out.putVarInt32(self.value_.ByteSizePartial())
self.value_.OutputPartial(out)
if (self.has_cursor_):
out.putVarInt32(26)
out.putPrefixedString(self.cursor_)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 10:
self.set_name(d.getPrefixedString())
continue
if tt == 18:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_value().TryMerge(tmp)
continue
if tt == 26:
self.set_cursor(d.getPrefixedString())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_name_: res+=prefix+("name: %s\n" % self.DebugFormatString(self.name_))
if self.has_value_:
res+=prefix+"value <\n"
res+=self.value_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
if self.has_cursor_: res+=prefix+("cursor: %s\n" % self.DebugFormatString(self.cursor_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kname = 1
kvalue = 2
kcursor = 3
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "name",
2: "value",
3: "cursor",
}, 3)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.STRING,
2: ProtocolBuffer.Encoder.STRING,
3: ProtocolBuffer.Encoder.STRING,
}, 3, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.GqlQueryArg'
_SERIALIZED_DESCRIPTOR = array.array('B')
_SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KI2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkdxbFF1ZXJ5QXJnExoEbmFtZSABKAIwCTgBFBMaBXZhbHVlIAIoAjALOAFKHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlZhbHVlowGqAQVjdHlwZbIBBnByb3RvMqQBFBMaBmN1cnNvciADKAIwCTgBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
if _net_proto___parse__python is not None:
_net_proto___parse__python.RegisterType(
_SERIALIZED_DESCRIPTOR.tostring())
class QueryResultBatch(ProtocolBuffer.ProtocolMessage):
NOT_FINISHED = 1
MORE_RESULTS_AFTER_LIMIT = 2
NO_MORE_RESULTS = 3
_MoreResultsType_NAMES = {
1: "NOT_FINISHED",
2: "MORE_RESULTS_AFTER_LIMIT",
3: "NO_MORE_RESULTS",
}
def MoreResultsType_Name(cls, x): return cls._MoreResultsType_NAMES.get(x, "")
MoreResultsType_Name = classmethod(MoreResultsType_Name)
has_entity_result_type_ = 0
entity_result_type_ = 0
has_end_cursor_ = 0
end_cursor_ = ""
has_more_results_ = 0
more_results_ = 0
has_skipped_results_ = 0
skipped_results_ = 0
def __init__(self, contents=None):
self.entity_result_ = []
if contents is not None: self.MergeFromString(contents)
def entity_result_type(self): return self.entity_result_type_
def set_entity_result_type(self, x):
self.has_entity_result_type_ = 1
self.entity_result_type_ = x
def clear_entity_result_type(self):
if self.has_entity_result_type_:
self.has_entity_result_type_ = 0
self.entity_result_type_ = 0
def has_entity_result_type(self): return self.has_entity_result_type_
def entity_result_size(self): return len(self.entity_result_)
def entity_result_list(self): return self.entity_result_
def entity_result(self, i):
return self.entity_result_[i]
def mutable_entity_result(self, i):
return self.entity_result_[i]
def add_entity_result(self):
x = EntityResult()
self.entity_result_.append(x)
return x
def clear_entity_result(self):
self.entity_result_ = []
def end_cursor(self): return self.end_cursor_
def set_end_cursor(self, x):
self.has_end_cursor_ = 1
self.end_cursor_ = x
def clear_end_cursor(self):
if self.has_end_cursor_:
self.has_end_cursor_ = 0
self.end_cursor_ = ""
def has_end_cursor(self): return self.has_end_cursor_
def more_results(self): return self.more_results_
def set_more_results(self, x):
self.has_more_results_ = 1
self.more_results_ = x
def clear_more_results(self):
if self.has_more_results_:
self.has_more_results_ = 0
self.more_results_ = 0
def has_more_results(self): return self.has_more_results_
def skipped_results(self): return self.skipped_results_
def set_skipped_results(self, x):
self.has_skipped_results_ = 1
self.skipped_results_ = x
def clear_skipped_results(self):
if self.has_skipped_results_:
self.has_skipped_results_ = 0
self.skipped_results_ = 0
def has_skipped_results(self): return self.has_skipped_results_
def MergeFrom(self, x):
assert x is not self
if (x.has_entity_result_type()): self.set_entity_result_type(x.entity_result_type())
for i in xrange(x.entity_result_size()): self.add_entity_result().CopyFrom(x.entity_result(i))
if (x.has_end_cursor()): self.set_end_cursor(x.end_cursor())
if (x.has_more_results()): self.set_more_results(x.more_results())
if (x.has_skipped_results()): self.set_skipped_results(x.skipped_results())
if _net_proto___parse__python is not None:
def _CMergeFromString(self, s):
_net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.QueryResultBatch', s)
if _net_proto___parse__python is not None:
def _CEncode(self):
return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.QueryResultBatch')
if _net_proto___parse__python is not None:
def _CEncodePartial(self):
return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.QueryResultBatch')
if _net_proto___parse__python is not None:
def _CToASCII(self, output_format):
return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.QueryResultBatch', output_format)
if _net_proto___parse__python is not None:
def ParseASCII(self, s):
_net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.QueryResultBatch', s)
if _net_proto___parse__python is not None:
def ParseASCIIIgnoreUnknown(self, s):
_net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.QueryResultBatch', s)
def Equals(self, x):
if x is self: return 1
if self.has_entity_result_type_ != x.has_entity_result_type_: return 0
if self.has_entity_result_type_ and self.entity_result_type_ != x.entity_result_type_: return 0
if len(self.entity_result_) != len(x.entity_result_): return 0
for e1, e2 in zip(self.entity_result_, x.entity_result_):
if e1 != e2: return 0
if self.has_end_cursor_ != x.has_end_cursor_: return 0
if self.has_end_cursor_ and self.end_cursor_ != x.end_cursor_: return 0
if self.has_more_results_ != x.has_more_results_: return 0
if self.has_more_results_ and self.more_results_ != x.more_results_: return 0
if self.has_skipped_results_ != x.has_skipped_results_: return 0
if self.has_skipped_results_ and self.skipped_results_ != x.skipped_results_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_entity_result_type_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: entity_result_type not set.')
for p in self.entity_result_:
if not p.IsInitialized(debug_strs): initialized=0
if (not self.has_more_results_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: more_results not set.')
return initialized
def ByteSize(self):
n = 0
n += self.lengthVarInt64(self.entity_result_type_)
n += 1 * len(self.entity_result_)
for i in xrange(len(self.entity_result_)): n += self.lengthString(self.entity_result_[i].ByteSize())
if (self.has_end_cursor_): n += 1 + self.lengthString(len(self.end_cursor_))
n += self.lengthVarInt64(self.more_results_)
if (self.has_skipped_results_): n += 1 + self.lengthVarInt64(self.skipped_results_)
return n + 2
def ByteSizePartial(self):
n = 0
if (self.has_entity_result_type_):
n += 1
n += self.lengthVarInt64(self.entity_result_type_)
n += 1 * len(self.entity_result_)
for i in xrange(len(self.entity_result_)): n += self.lengthString(self.entity_result_[i].ByteSizePartial())
if (self.has_end_cursor_): n += 1 + self.lengthString(len(self.end_cursor_))
if (self.has_more_results_):
n += 1
n += self.lengthVarInt64(self.more_results_)
if (self.has_skipped_results_): n += 1 + self.lengthVarInt64(self.skipped_results_)
return n
def Clear(self):
self.clear_entity_result_type()
self.clear_entity_result()
self.clear_end_cursor()
self.clear_more_results()
self.clear_skipped_results()
def OutputUnchecked(self, out):
out.putVarInt32(8)
out.putVarInt32(self.entity_result_type_)
for i in xrange(len(self.entity_result_)):
out.putVarInt32(18)
out.putVarInt32(self.entity_result_[i].ByteSize())
self.entity_result_[i].OutputUnchecked(out)
if (self.has_end_cursor_):
out.putVarInt32(34)
out.putPrefixedString(self.end_cursor_)
out.putVarInt32(40)
out.putVarInt32(self.more_results_)
if (self.has_skipped_results_):
out.putVarInt32(48)
out.putVarInt32(self.skipped_results_)
def OutputPartial(self, out):
if (self.has_entity_result_type_):
out.putVarInt32(8)
out.putVarInt32(self.entity_result_type_)
for i in xrange(len(self.entity_result_)):
out.putVarInt32(18)
out.putVarInt32(self.entity_result_[i].ByteSizePartial())
self.entity_result_[i].OutputPartial(out)
if (self.has_end_cursor_):
out.putVarInt32(34)
out.putPrefixedString(self.end_cursor_)
if (self.has_more_results_):
out.putVarInt32(40)
out.putVarInt32(self.more_results_)
if (self.has_skipped_results_):
out.putVarInt32(48)
out.putVarInt32(self.skipped_results_)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 8:
self.set_entity_result_type(d.getVarInt32())
continue
if tt == 18:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_entity_result().TryMerge(tmp)
continue
if tt == 34:
self.set_end_cursor(d.getPrefixedString())
continue
if tt == 40:
self.set_more_results(d.getVarInt32())
continue
if tt == 48:
self.set_skipped_results(d.getVarInt32())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_entity_result_type_: res+=prefix+("entity_result_type: %s\n" % self.DebugFormatInt32(self.entity_result_type_))
cnt=0
for e in self.entity_result_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("entity_result%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
if self.has_end_cursor_: res+=prefix+("end_cursor: %s\n" % self.DebugFormatString(self.end_cursor_))
if self.has_more_results_: res+=prefix+("more_results: %s\n" % self.DebugFormatInt32(self.more_results_))
if self.has_skipped_results_: res+=prefix+("skipped_results: %s\n" % self.DebugFormatInt32(self.skipped_results_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kentity_result_type = 1
kentity_result = 2
kend_cursor = 4
kmore_results = 5
kskipped_results = 6
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "entity_result_type",
2: "entity_result",
4: "end_cursor",
5: "more_results",
6: "skipped_results",
}, 6)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.NUMERIC,
2: ProtocolBuffer.Encoder.STRING,
4: ProtocolBuffer.Encoder.STRING,
5: ProtocolBuffer.Encoder.NUMERIC,
6: ProtocolBuffer.Encoder.NUMERIC,
}, 6, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.QueryResultBatch'
_SERIALIZED_DESCRIPTOR = array.array('B')
_SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KKGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LlF1ZXJ5UmVzdWx0QmF0Y2gTGhJlbnRpdHlfcmVzdWx0X3R5cGUgASgAMAU4AhQTGg1lbnRpdHlfcmVzdWx0IAIoAjALOANKJGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eVJlc3VsdKMBqgEFY3R5cGWyAQZwcm90bzKkARQTGgplbmRfY3Vyc29yIAQoAjAJOAEUExoMbW9yZV9yZXN1bHRzIAUoADAFOAJoABQTGg9za2lwcGVkX3Jlc3VsdHMgBigAMAU4AUIBMKMBqgEHZGVmYXVsdLIBATCkARRzeg9Nb3JlUmVzdWx0c1R5cGWLAZIBDE5PVF9GSU5JU0hFRJgBAYwBiwGSARhNT1JFX1JFU1VMVFNfQUZURVJfTElNSVSYAQKMAYsBkgEPTk9fTU9SRV9SRVNVTFRTmAEDjAF0wgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
if _net_proto___parse__python is not None:
_net_proto___parse__python.RegisterType(
_SERIALIZED_DESCRIPTOR.tostring())
class Mutation(ProtocolBuffer.ProtocolMessage):
INSERT = 1
UPDATE = 2
UPSERT = 3
DELETE = 4
INSERT_WITH_AUTO_ID = 99
_Operation_NAMES = {
1: "INSERT",
2: "UPDATE",
3: "UPSERT",
4: "DELETE",
99: "INSERT_WITH_AUTO_ID",
}
def Operation_Name(cls, x): return cls._Operation_NAMES.get(x, "")
Operation_Name = classmethod(Operation_Name)
has_op_ = 0
op_ = 0
has_key_ = 0
key_ = None
has_entity_ = 0
entity_ = None
def __init__(self, contents=None):
self.lazy_init_lock_ = thread.allocate_lock()
if contents is not None: self.MergeFromString(contents)
def op(self): return self.op_
def set_op(self, x):
self.has_op_ = 1
self.op_ = x
def clear_op(self):
if self.has_op_:
self.has_op_ = 0
self.op_ = 0
def has_op(self): return self.has_op_
def key(self):
if self.key_ is None:
self.lazy_init_lock_.acquire()
try:
if self.key_ is None: self.key_ = google.appengine.datastore.entity_v4_pb.Key()
finally:
self.lazy_init_lock_.release()
return self.key_
def mutable_key(self): self.has_key_ = 1; return self.key()
def clear_key(self):
if self.has_key_:
self.has_key_ = 0;
if self.key_ is not None: self.key_.Clear()
def has_key(self): return self.has_key_
def entity(self):
if self.entity_ is None:
self.lazy_init_lock_.acquire()
try:
if self.entity_ is None: self.entity_ = google.appengine.datastore.entity_v4_pb.Entity()
finally:
self.lazy_init_lock_.release()
return self.entity_
def mutable_entity(self): self.has_entity_ = 1; return self.entity()
def clear_entity(self):
if self.has_entity_:
self.has_entity_ = 0;
if self.entity_ is not None: self.entity_.Clear()
def has_entity(self): return self.has_entity_
def MergeFrom(self, x):
assert x is not self
if (x.has_op()): self.set_op(x.op())
if (x.has_key()): self.mutable_key().MergeFrom(x.key())
if (x.has_entity()): self.mutable_entity().MergeFrom(x.entity())
if _net_proto___parse__python is not None:
def _CMergeFromString(self, s):
_net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.Mutation', s)
if _net_proto___parse__python is not None:
def _CEncode(self):
return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.Mutation')
if _net_proto___parse__python is not None:
def _CEncodePartial(self):
return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.Mutation')
if _net_proto___parse__python is not None:
def _CToASCII(self, output_format):
return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.Mutation', output_format)
if _net_proto___parse__python is not None:
def ParseASCII(self, s):
_net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.Mutation', s)
if _net_proto___parse__python is not None:
def ParseASCIIIgnoreUnknown(self, s):
_net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.Mutation', s)
def Equals(self, x):
if x is self: return 1
if self.has_op_ != x.has_op_: return 0
if self.has_op_ and self.op_ != x.op_: return 0
if self.has_key_ != x.has_key_: return 0
if self.has_key_ and self.key_ != x.key_: return 0
if self.has_entity_ != x.has_entity_: return 0
if self.has_entity_ and self.entity_ != x.entity_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_op_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: op not set.')
if (self.has_key_ and not self.key_.IsInitialized(debug_strs)): initialized = 0
if (self.has_entity_ and not self.entity_.IsInitialized(debug_strs)): initialized = 0
return initialized
def ByteSize(self):
n = 0
n += self.lengthVarInt64(self.op_)
if (self.has_key_): n += 1 + self.lengthString(self.key_.ByteSize())
if (self.has_entity_): n += 1 + self.lengthString(self.entity_.ByteSize())
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_op_):
n += 1
n += self.lengthVarInt64(self.op_)
if (self.has_key_): n += 1 + self.lengthString(self.key_.ByteSizePartial())
if (self.has_entity_): n += 1 + self.lengthString(self.entity_.ByteSizePartial())
return n
def Clear(self):
self.clear_op()
self.clear_key()
self.clear_entity()
def OutputUnchecked(self, out):
out.putVarInt32(8)
out.putVarInt32(self.op_)
if (self.has_key_):
out.putVarInt32(18)
out.putVarInt32(self.key_.ByteSize())
self.key_.OutputUnchecked(out)
if (self.has_entity_):
out.putVarInt32(26)
out.putVarInt32(self.entity_.ByteSize())
self.entity_.OutputUnchecked(out)
def OutputPartial(self, out):
if (self.has_op_):
out.putVarInt32(8)
out.putVarInt32(self.op_)
if (self.has_key_):
out.putVarInt32(18)
out.putVarInt32(self.key_.ByteSizePartial())
self.key_.OutputPartial(out)
if (self.has_entity_):
out.putVarInt32(26)
out.putVarInt32(self.entity_.ByteSizePartial())
self.entity_.OutputPartial(out)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 8:
self.set_op(d.getVarInt32())
continue
if tt == 18:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_key().TryMerge(tmp)
continue
if tt == 26:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_entity().TryMerge(tmp)
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_op_: res+=prefix+("op: %s\n" % self.DebugFormatInt32(self.op_))
if self.has_key_:
res+=prefix+"key <\n"
res+=self.key_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
if self.has_entity_:
res+=prefix+"entity <\n"
res+=self.entity_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kop = 1
kkey = 2
kentity = 3
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "op",
2: "key",
3: "entity",
}, 3)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.NUMERIC,
2: ProtocolBuffer.Encoder.STRING,
3: ProtocolBuffer.Encoder.STRING,
}, 3, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.Mutation'
_SERIALIZED_DESCRIPTOR = array.array('B')
_SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KIGFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uExoCb3AgASgAMAU4AmgAFBMaA2tleSACKAIwCzgBShthcHBob3N0aW5nLmRhdGFzdG9yZS52NC5LZXmjAaoBBWN0eXBlsgEGcHJvdG8ypAEUExoGZW50aXR5IAMoAjALOAFKHmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVudGl0eaMBqgEFY3R5cGWyAQZwcm90bzKkARRzeglPcGVyYXRpb26LAZIBBklOU0VSVJgBAYwBiwGSAQZVUERBVEWYAQKMAYsBkgEGVVBTRVJUmAEDjAGLAZIBBkRFTEVURZgBBIwBiwGSARNJTlNFUlRfV0lUSF9BVVRPX0lEmAFjjAF0wgEdYXBwaG9zdGluZy5kYXRhc3RvcmUudjQuRXJyb3I="))
if _net_proto___parse__python is not None:
_net_proto___parse__python.RegisterType(
_SERIALIZED_DESCRIPTOR.tostring())
class MutationResult(ProtocolBuffer.ProtocolMessage):
has_key_ = 0
key_ = None
has_new_version_ = 0
new_version_ = 0
def __init__(self, contents=None):
self.lazy_init_lock_ = thread.allocate_lock()
if contents is not None: self.MergeFromString(contents)
def key(self):
if self.key_ is None:
self.lazy_init_lock_.acquire()
try:
if self.key_ is None: self.key_ = google.appengine.datastore.entity_v4_pb.Key()
finally:
self.lazy_init_lock_.release()
return self.key_
def mutable_key(self): self.has_key_ = 1; return self.key()
def clear_key(self):
if self.has_key_:
self.has_key_ = 0;
if self.key_ is not None: self.key_.Clear()
def has_key(self): return self.has_key_
def new_version(self): return self.new_version_
def set_new_version(self, x):
self.has_new_version_ = 1
self.new_version_ = x
def clear_new_version(self):
if self.has_new_version_:
self.has_new_version_ = 0
self.new_version_ = 0
def has_new_version(self): return self.has_new_version_
def MergeFrom(self, x):
assert x is not self
if (x.has_key()): self.mutable_key().MergeFrom(x.key())
if (x.has_new_version()): self.set_new_version(x.new_version())
if _net_proto___parse__python is not None:
def _CMergeFromString(self, s):
_net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.MutationResult', s)
if _net_proto___parse__python is not None:
def _CEncode(self):
return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.MutationResult')
if _net_proto___parse__python is not None:
def _CEncodePartial(self):
return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.MutationResult')
if _net_proto___parse__python is not None:
def _CToASCII(self, output_format):
return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.MutationResult', output_format)
if _net_proto___parse__python is not None:
def ParseASCII(self, s):
_net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.MutationResult', s)
if _net_proto___parse__python is not None:
def ParseASCIIIgnoreUnknown(self, s):
_net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.MutationResult', s)
def Equals(self, x):
if x is self: return 1
if self.has_key_ != x.has_key_: return 0
if self.has_key_ and self.key_ != x.key_: return 0
if self.has_new_version_ != x.has_new_version_: return 0
if self.has_new_version_ and self.new_version_ != x.new_version_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (self.has_key_ and not self.key_.IsInitialized(debug_strs)): initialized = 0
return initialized
def ByteSize(self):
n = 0
if (self.has_key_): n += 1 + self.lengthString(self.key_.ByteSize())
if (self.has_new_version_): n += 1 + self.lengthVarInt64(self.new_version_)
return n
def ByteSizePartial(self):
n = 0
if (self.has_key_): n += 1 + self.lengthString(self.key_.ByteSizePartial())
if (self.has_new_version_): n += 1 + self.lengthVarInt64(self.new_version_)
return n
def Clear(self):
self.clear_key()
self.clear_new_version()
def OutputUnchecked(self, out):
if (self.has_key_):
out.putVarInt32(26)
out.putVarInt32(self.key_.ByteSize())
self.key_.OutputUnchecked(out)
if (self.has_new_version_):
out.putVarInt32(32)
out.putVarInt64(self.new_version_)
def OutputPartial(self, out):
if (self.has_key_):
out.putVarInt32(26)
out.putVarInt32(self.key_.ByteSizePartial())
self.key_.OutputPartial(out)
if (self.has_new_version_):
out.putVarInt32(32)
out.putVarInt64(self.new_version_)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 26:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_key().TryMerge(tmp)
continue
if tt == 32:
self.set_new_version(d.getVarInt64())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_key_:
res+=prefix+"key <\n"
res+=self.key_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
if self.has_new_version_: res+=prefix+("new_version: %s\n" % self.DebugFormatInt64(self.new_version_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kkey = 3
knew_version = 4
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
3: "key",
4: "new_version",
}, 4)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
3: ProtocolBuffer.Encoder.STRING,
4: ProtocolBuffer.Encoder.NUMERIC,
}, 4, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.MutationResult'
_SERIALIZED_DESCRIPTOR = array.array('B')
_SERIALIZED_DESCRIPTOR.fromstring(base64.decodestring("WidhcHBob3N0aW5nL2RhdGFzdG9yZS9kYXRhc3RvcmVfdjQucHJvdG8KJmFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0Lk11dGF0aW9uUmVzdWx0ExoDa2V5IAMoAjALOAFKG2FwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LktleaMBqgEFY3R5cGWyAQZwcm90bzKkARQTGgtuZXdfdmVyc2lvbiAEKAAwAzgBQgEwowGqAQdkZWZhdWx0sgEBMKQBFMIBHWFwcGhvc3RpbmcuZGF0YXN0b3JlLnY0LkVycm9y"))
if _net_proto___parse__python is not None:
_net_proto___parse__python.RegisterType(
_SERIALIZED_DESCRIPTOR.tostring())
class DeprecatedMutation(ProtocolBuffer.ProtocolMessage):
has_force_ = 0
force_ = 0
def __init__(self, contents=None):
self.upsert_ = []
self.update_ = []
self.insert_ = []
self.insert_auto_id_ = []
self.delete_ = []
if contents is not None: self.MergeFromString(contents)
def upsert_size(self): return len(self.upsert_)
def upsert_list(self): return self.upsert_
def upsert(self, i):
return self.upsert_[i]
def mutable_upsert(self, i):
return self.upsert_[i]
def add_upsert(self):
x = google.appengine.datastore.entity_v4_pb.Entity()
self.upsert_.append(x)
return x
def clear_upsert(self):
self.upsert_ = []
def update_size(self): return len(self.update_)
def update_list(self): return self.update_
def update(self, i):
return self.update_[i]
def mutable_update(self, i):
return self.update_[i]
def add_update(self):
x = google.appengine.datastore.entity_v4_pb.Entity()
self.update_.append(x)
return x
def clear_update(self):
self.update_ = []
def insert_size(self): return len(self.insert_)
def insert_list(self): return self.insert_
def insert(self, i):
return self.insert_[i]
def mutable_insert(self, i):
return self.insert_[i]
def add_insert(self):
x = google.appengine.datastore.entity_v4_pb.Entity()
self.insert_.append(x)
return x
def clear_insert(self):
self.insert_ = []
def insert_auto_id_size(self): return len(self.insert_auto_id_)
def insert_auto_id_list(self): return self.insert_auto_id_
def insert_auto_id(self, i):
return self.insert_auto_id_[i]
def mutable_insert_auto_id(self, i):
return self.insert_auto_id_[i]
def add_insert_auto_id(self):
x = google.appengine.datastore.entity_v4_pb.Entity()
self.insert_auto_id_.append(x)
return x
def clear_insert_auto_id(self):
self.insert_auto_id_ = []
def delete_size(self): return len(self.delete_)
def delete_list(self): return self.delete_
def delete(self, i):
return self.delete_[i]
def mutable_delete(self, i):
return self.delete_[i]
def add_delete(self):
x = google.appengine.datastore.entity_v4_pb.Key()
self.delete_.append(x)
return x
def clear_delete(self):
self.delete_ = []
def force(self): return self.force_
def set_force(self, x):
self.has_force_ = 1
self.force_ = x
def clear_force(self):
if self.has_force_:
self.has_force_ = 0
self.force_ = 0
def has_force(self): return self.has_force_
def MergeFrom(self, x):
assert x is not self
for i in xrange(x.upsert_size()): self.add_upsert().CopyFrom(x.upsert(i))
for i in xrange(x.update_size()): self.add_update().CopyFrom(x.update(i))
for i in xrange(x.insert_size()): self.add_insert().CopyFrom(x.insert(i))
for i in xrange(x.insert_auto_id_size()): self.add_insert_auto_id().CopyFrom(x.insert_auto_id(i))
for i in xrange(x.delete_size()): self.add_delete().CopyFrom(x.delete(i))
if (x.has_force()): self.set_force(x.force())
if _net_proto___parse__python is not None:
def _CMergeFromString(self, s):
_net_proto___parse__python.MergeFromString(self, 'apphosting.datastore.v4.DeprecatedMutation', s)
if _net_proto___parse__python is not None:
def _CEncode(self):
return _net_proto___parse__python.Encode(self, 'apphosting.datastore.v4.DeprecatedMutation')
if _net_proto___parse__python is not None:
def _CEncodePartial(self):
return _net_proto___parse__python.EncodePartial(self, 'apphosting.datastore.v4.DeprecatedMutation')
if _net_proto___parse__python is not None:
def _CToASCII(self, output_format):
return _net_proto___parse__python.ToASCII(self, 'apphosting.datastore.v4.DeprecatedMutation', output_format)
if _net_proto___parse__python is not None:
def ParseASCII(self, s):
_net_proto___parse__python.ParseASCII(self, 'apphosting.datastore.v4.DeprecatedMutation', s)
if _net_proto___parse__python is not None:
def ParseASCIIIgnoreUnknown(self, s):
_net_proto___parse__python.ParseASCIIIgnoreUnknown(self, 'apphosting.datastore.v4.DeprecatedMutation', s)
def Equals(self, x):
if x is self: return 1
if len(self.upsert_) != len(x.upsert_): return 0
for e1, e2 in zip(self.upsert_, x.upsert_):
if e1 != e2: return 0
if len(self.update_) != len(x.update_): return 0
for e1, e2 in zip(self.update_, x.update_):
if e1 != e2: return 0
if len(self.insert_) != len(x.insert_): return 0
for e1, e2 in zip(self.insert_, x.insert_):
if e1 != e2: return 0
if len(self.insert_auto_id_) != len(x.insert_auto_id_): return 0
for e1, e2 in zip(self.insert_auto_id_, x.insert_auto_id_):
if e1 != e2: return 0
if len(self.delete_) != len(x.delete_): return 0
for e1, e2 in zip(self.delete_, x.delete_):
if e1 != e2: return 0
if self.has_force_ != x.has_force_: return 0
if self.has_force_ and self.force_ != x.force_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
for p in self.upsert_:
if not p.IsInitialized(debug_strs): initialized=0
for p in self.update_:
if not p.IsInitialized(debug_strs): initialized=0
for p in self.insert_:
if not p.IsInitialized(debug_strs): initialized=0
for p in self.insert_auto_id_:
if not p.IsInitialized(debug_strs): initialized=0
for p in self.delete_:
if not p.IsInitialized(debug_strs): initialized=0
return initialized
def ByteSize(self):
n = 0
n += 1 * len(self.upsert_)
for i in xrange(len(self.upsert_)): n += self.lengthString(self.upsert_[i].ByteSize())
n += 1 * len(self.update_)
for i in xrange(len(self.update_)): n += self.lengthString(self.update_[i].ByteSize())
n += 1 * len(self.insert_)
for i in xrange(len(self.insert_)): n += self.lengthString(self.insert_[i].ByteSize())
n += 1 * len(self.insert_auto_id_)
for i in xrange(len(self.insert_auto_id_)): n += self.lengthString(self.insert_auto_id_[i].ByteSize())
n += 1 * len(self.delete_)
for i in xrange(len(self.delete_)): n += self.lengthString(self.delete_[i].ByteSize())
if (self.has_force_): n += 2
return n
def ByteSizePartial(self):
n = 0
n += 1 * len(self.upsert_)
for i in xrange(len(self.upsert_)): n += self.lengthString(self.upsert_[i].ByteSizePartial())
n += 1 * len(self.update_)
for i in xrange(len(self.update_)): n += self.lengthString(self.update_[i].ByteSizePartial())
n += 1 * len(self.insert_)
for i in xrange(len(self.insert_)): n += self.lengthString(self.insert_[i].ByteSizePartial())
n += 1 * len(self.insert_auto_id_)
for i in xrange(len(self.insert_auto_id_)): n += self.lengthString(self.insert_auto_id_[i].ByteSizePartial())
n += 1 * len(self.delete_)
for i in xrange(len(self.delete_)): n += self.lengthString(self.delete_[i].ByteSizePartial())
if (self.has_force_): n += 2
return n
def Clear(self):
self.clear_upsert()
self.clear_update()
self.clear_insert()
self.clear_insert_auto_id()
self.clear_delete()
self.clear_force()
def OutputUnchecked(self, out):
for i in xrange(len(self.upsert_)):
out.putVarInt32(10)
out.putVarInt32(self.upsert_[i].ByteSize())
self.upsert_[i].OutputUnchecked(out)
for i in xrange(len(self.update_)):
out.putVarInt32(18)
out.putVarInt32(self.update_[i].ByteSize())
self.update_[i].OutputUnchecked(out)
for i in xrange(len(self.insert_)):
out.putVarInt32(26)
out.putVarInt32(self.insert_[i].ByteSize())
self.insert_[i].OutputUnchecked(out)
for i in xrange(len(self.insert_auto_id_)):
out.putVarInt32(34)
out.putVarInt32(self.insert_auto_id_[i].ByteSize())
self.insert_auto_id_[i].OutputUnchecked(out)
for i in xrange(len(self.delete_)):
out.putVarInt32(42)
out.putVarInt32(self.delete_[i].ByteSize())
self.delete_[i].OutputUnchecked(out)
if (self.has_force_):
out.putVarInt32(48)
out.putBoolean(self.force_)
def OutputPartial(self, out):
for i in xrange(len(self.upsert_)):
out.putVarInt32(10)
out.putVarInt32(self.upsert_[i].ByteSizePartial())
self.upsert_[i].OutputPartial(out)
for i in xrange(len(self.update_)):
out.putVarInt32(18)
out.putVarInt32(self.update_[i].ByteSizePartial())
self.update_[i].OutputPartial(out)
for i in xrange(len(self.insert_)):
out.putVarInt32(26)
out.putVarInt32(self.insert_[i].ByteSizePartial())
self.insert_[i].OutputPartial(out)
for i in xrange(len(self.insert_auto_id_)):
out.putVarInt32(34)
out.putVarInt32(self.insert_auto_id_[i].ByteSizePartial())
self.insert_auto_id_[i].OutputPartial(out)
for i in xrange(len(self.delete_)):
out.putVarInt32(42)
out.putVarInt32(self.delete_[i].ByteSizePartial())
self.delete_[i].OutputPartial(out)
if (self.has_force_):
out.putVarInt32(48)
out.putBoolean(self.force_)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 10:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_upsert().TryMerge(tmp)
continue
if tt == 18:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_update().TryMerge(tmp)
continue
if tt == 26:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_insert().TryMerge(tmp)
continue
if tt == 34:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_insert_auto_id().TryMerge(tmp)
continue
if tt == 42:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_delete().TryMerge(tmp)
continue
if tt == 48:
self.set_force(d.getBoolean())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
cnt=0
for e in self.upsert_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("upsert%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
cnt=0
for e in self.update_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("update%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
cnt=0
for e in self.insert_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("insert%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
cnt=0
for e in self.insert_auto_id_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("insert_auto_id%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
cnt=0
for e in self.delete_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("delete%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
if self.has_force_: res+=prefix+("force: %s\n" % self.DebugFormatBool(self.force_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):