blob: 749f8aab794dcd9b8f8ec48576f02a9c7c062b59 [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 dummy_thread as thread
__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.document_pb import *
import google.appengine.datastore.document_pb
class SearchServiceError(ProtocolBuffer.ProtocolMessage):
OK = 0
INVALID_REQUEST = 1
TRANSIENT_ERROR = 2
INTERNAL_ERROR = 3
PERMISSION_DENIED = 4
TIMEOUT = 5
CONCURRENT_TRANSACTION = 6
_ErrorCode_NAMES = {
0: "OK",
1: "INVALID_REQUEST",
2: "TRANSIENT_ERROR",
3: "INTERNAL_ERROR",
4: "PERMISSION_DENIED",
5: "TIMEOUT",
6: "CONCURRENT_TRANSACTION",
}
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
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.SearchServiceError'
class RequestStatus(ProtocolBuffer.ProtocolMessage):
has_code_ = 0
code_ = 0
has_error_detail_ = 0
error_detail_ = ""
has_canonical_code_ = 0
canonical_code_ = 0
def __init__(self, contents=None):
if contents is not None: self.MergeFromString(contents)
def code(self): return self.code_
def set_code(self, x):
self.has_code_ = 1
self.code_ = x
def clear_code(self):
if self.has_code_:
self.has_code_ = 0
self.code_ = 0
def has_code(self): return self.has_code_
def error_detail(self): return self.error_detail_
def set_error_detail(self, x):
self.has_error_detail_ = 1
self.error_detail_ = x
def clear_error_detail(self):
if self.has_error_detail_:
self.has_error_detail_ = 0
self.error_detail_ = ""
def has_error_detail(self): return self.has_error_detail_
def canonical_code(self): return self.canonical_code_
def set_canonical_code(self, x):
self.has_canonical_code_ = 1
self.canonical_code_ = x
def clear_canonical_code(self):
if self.has_canonical_code_:
self.has_canonical_code_ = 0
self.canonical_code_ = 0
def has_canonical_code(self): return self.has_canonical_code_
def MergeFrom(self, x):
assert x is not self
if (x.has_code()): self.set_code(x.code())
if (x.has_error_detail()): self.set_error_detail(x.error_detail())
if (x.has_canonical_code()): self.set_canonical_code(x.canonical_code())
def Equals(self, x):
if x is self: return 1
if self.has_code_ != x.has_code_: return 0
if self.has_code_ and self.code_ != x.code_: return 0
if self.has_error_detail_ != x.has_error_detail_: return 0
if self.has_error_detail_ and self.error_detail_ != x.error_detail_: return 0
if self.has_canonical_code_ != x.has_canonical_code_: return 0
if self.has_canonical_code_ and self.canonical_code_ != x.canonical_code_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_code_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: code not set.')
return initialized
def ByteSize(self):
n = 0
n += self.lengthVarInt64(self.code_)
if (self.has_error_detail_): n += 1 + self.lengthString(len(self.error_detail_))
if (self.has_canonical_code_): n += 1 + self.lengthVarInt64(self.canonical_code_)
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_code_):
n += 1
n += self.lengthVarInt64(self.code_)
if (self.has_error_detail_): n += 1 + self.lengthString(len(self.error_detail_))
if (self.has_canonical_code_): n += 1 + self.lengthVarInt64(self.canonical_code_)
return n
def Clear(self):
self.clear_code()
self.clear_error_detail()
self.clear_canonical_code()
def OutputUnchecked(self, out):
out.putVarInt32(8)
out.putVarInt32(self.code_)
if (self.has_error_detail_):
out.putVarInt32(18)
out.putPrefixedString(self.error_detail_)
if (self.has_canonical_code_):
out.putVarInt32(24)
out.putVarInt32(self.canonical_code_)
def OutputPartial(self, out):
if (self.has_code_):
out.putVarInt32(8)
out.putVarInt32(self.code_)
if (self.has_error_detail_):
out.putVarInt32(18)
out.putPrefixedString(self.error_detail_)
if (self.has_canonical_code_):
out.putVarInt32(24)
out.putVarInt32(self.canonical_code_)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 8:
self.set_code(d.getVarInt32())
continue
if tt == 18:
self.set_error_detail(d.getPrefixedString())
continue
if tt == 24:
self.set_canonical_code(d.getVarInt32())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_code_: res+=prefix+("code: %s\n" % self.DebugFormatInt32(self.code_))
if self.has_error_detail_: res+=prefix+("error_detail: %s\n" % self.DebugFormatString(self.error_detail_))
if self.has_canonical_code_: res+=prefix+("canonical_code: %s\n" % self.DebugFormatInt32(self.canonical_code_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kcode = 1
kerror_detail = 2
kcanonical_code = 3
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "code",
2: "error_detail",
3: "canonical_code",
}, 3)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.NUMERIC,
2: ProtocolBuffer.Encoder.STRING,
3: ProtocolBuffer.Encoder.NUMERIC,
}, 3, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.RequestStatus'
class IndexSpec(ProtocolBuffer.ProtocolMessage):
GLOBAL = 0
PER_DOCUMENT = 1
_Consistency_NAMES = {
0: "GLOBAL",
1: "PER_DOCUMENT",
}
def Consistency_Name(cls, x): return cls._Consistency_NAMES.get(x, "")
Consistency_Name = classmethod(Consistency_Name)
SEARCH = 0
DATASTORE = 1
CLOUD_STORAGE = 2
_Source_NAMES = {
0: "SEARCH",
1: "DATASTORE",
2: "CLOUD_STORAGE",
}
def Source_Name(cls, x): return cls._Source_NAMES.get(x, "")
Source_Name = classmethod(Source_Name)
PRIORITY = 0
BACKGROUND = 1
_Mode_NAMES = {
0: "PRIORITY",
1: "BACKGROUND",
}
def Mode_Name(cls, x): return cls._Mode_NAMES.get(x, "")
Mode_Name = classmethod(Mode_Name)
has_name_ = 0
name_ = ""
has_consistency_ = 0
consistency_ = 1
has_namespace_ = 0
namespace_ = ""
has_version_ = 0
version_ = 0
has_source_ = 0
source_ = 0
has_mode_ = 0
mode_ = 0
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 consistency(self): return self.consistency_
def set_consistency(self, x):
self.has_consistency_ = 1
self.consistency_ = x
def clear_consistency(self):
if self.has_consistency_:
self.has_consistency_ = 0
self.consistency_ = 1
def has_consistency(self): return self.has_consistency_
def namespace(self): return self.namespace_
def set_namespace(self, x):
self.has_namespace_ = 1
self.namespace_ = x
def clear_namespace(self):
if self.has_namespace_:
self.has_namespace_ = 0
self.namespace_ = ""
def has_namespace(self): return self.has_namespace_
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 source(self): return self.source_
def set_source(self, x):
self.has_source_ = 1
self.source_ = x
def clear_source(self):
if self.has_source_:
self.has_source_ = 0
self.source_ = 0
def has_source(self): return self.has_source_
def mode(self): return self.mode_
def set_mode(self, x):
self.has_mode_ = 1
self.mode_ = x
def clear_mode(self):
if self.has_mode_:
self.has_mode_ = 0
self.mode_ = 0
def has_mode(self): return self.has_mode_
def MergeFrom(self, x):
assert x is not self
if (x.has_name()): self.set_name(x.name())
if (x.has_consistency()): self.set_consistency(x.consistency())
if (x.has_namespace()): self.set_namespace(x.namespace())
if (x.has_version()): self.set_version(x.version())
if (x.has_source()): self.set_source(x.source())
if (x.has_mode()): self.set_mode(x.mode())
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_consistency_ != x.has_consistency_: return 0
if self.has_consistency_ and self.consistency_ != x.consistency_: return 0
if self.has_namespace_ != x.has_namespace_: return 0
if self.has_namespace_ and self.namespace_ != x.namespace_: return 0
if self.has_version_ != x.has_version_: return 0
if self.has_version_ and self.version_ != x.version_: return 0
if self.has_source_ != x.has_source_: return 0
if self.has_source_ and self.source_ != x.source_: return 0
if self.has_mode_ != x.has_mode_: return 0
if self.has_mode_ and self.mode_ != x.mode_: 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_))
if (self.has_consistency_): n += 1 + self.lengthVarInt64(self.consistency_)
if (self.has_namespace_): n += 1 + self.lengthString(len(self.namespace_))
if (self.has_version_): n += 1 + self.lengthVarInt64(self.version_)
if (self.has_source_): n += 1 + self.lengthVarInt64(self.source_)
if (self.has_mode_): n += 1 + self.lengthVarInt64(self.mode_)
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_name_):
n += 1
n += self.lengthString(len(self.name_))
if (self.has_consistency_): n += 1 + self.lengthVarInt64(self.consistency_)
if (self.has_namespace_): n += 1 + self.lengthString(len(self.namespace_))
if (self.has_version_): n += 1 + self.lengthVarInt64(self.version_)
if (self.has_source_): n += 1 + self.lengthVarInt64(self.source_)
if (self.has_mode_): n += 1 + self.lengthVarInt64(self.mode_)
return n
def Clear(self):
self.clear_name()
self.clear_consistency()
self.clear_namespace()
self.clear_version()
self.clear_source()
self.clear_mode()
def OutputUnchecked(self, out):
out.putVarInt32(10)
out.putPrefixedString(self.name_)
if (self.has_consistency_):
out.putVarInt32(16)
out.putVarInt32(self.consistency_)
if (self.has_namespace_):
out.putVarInt32(26)
out.putPrefixedString(self.namespace_)
if (self.has_version_):
out.putVarInt32(32)
out.putVarInt32(self.version_)
if (self.has_source_):
out.putVarInt32(40)
out.putVarInt32(self.source_)
if (self.has_mode_):
out.putVarInt32(48)
out.putVarInt32(self.mode_)
def OutputPartial(self, out):
if (self.has_name_):
out.putVarInt32(10)
out.putPrefixedString(self.name_)
if (self.has_consistency_):
out.putVarInt32(16)
out.putVarInt32(self.consistency_)
if (self.has_namespace_):
out.putVarInt32(26)
out.putPrefixedString(self.namespace_)
if (self.has_version_):
out.putVarInt32(32)
out.putVarInt32(self.version_)
if (self.has_source_):
out.putVarInt32(40)
out.putVarInt32(self.source_)
if (self.has_mode_):
out.putVarInt32(48)
out.putVarInt32(self.mode_)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 10:
self.set_name(d.getPrefixedString())
continue
if tt == 16:
self.set_consistency(d.getVarInt32())
continue
if tt == 26:
self.set_namespace(d.getPrefixedString())
continue
if tt == 32:
self.set_version(d.getVarInt32())
continue
if tt == 40:
self.set_source(d.getVarInt32())
continue
if tt == 48:
self.set_mode(d.getVarInt32())
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_consistency_: res+=prefix+("consistency: %s\n" % self.DebugFormatInt32(self.consistency_))
if self.has_namespace_: res+=prefix+("namespace: %s\n" % self.DebugFormatString(self.namespace_))
if self.has_version_: res+=prefix+("version: %s\n" % self.DebugFormatInt32(self.version_))
if self.has_source_: res+=prefix+("source: %s\n" % self.DebugFormatInt32(self.source_))
if self.has_mode_: res+=prefix+("mode: %s\n" % self.DebugFormatInt32(self.mode_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kname = 1
kconsistency = 2
knamespace = 3
kversion = 4
ksource = 5
kmode = 6
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "name",
2: "consistency",
3: "namespace",
4: "version",
5: "source",
6: "mode",
}, 6)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.STRING,
2: ProtocolBuffer.Encoder.NUMERIC,
3: ProtocolBuffer.Encoder.STRING,
4: ProtocolBuffer.Encoder.NUMERIC,
5: ProtocolBuffer.Encoder.NUMERIC,
6: ProtocolBuffer.Encoder.NUMERIC,
}, 6, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.IndexSpec'
class IndexMetadata_Storage(ProtocolBuffer.ProtocolMessage):
has_amount_used_ = 0
amount_used_ = 0
has_limit_ = 0
limit_ = 0
def __init__(self, contents=None):
if contents is not None: self.MergeFromString(contents)
def amount_used(self): return self.amount_used_
def set_amount_used(self, x):
self.has_amount_used_ = 1
self.amount_used_ = x
def clear_amount_used(self):
if self.has_amount_used_:
self.has_amount_used_ = 0
self.amount_used_ = 0
def has_amount_used(self): return self.has_amount_used_
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
if (x.has_amount_used()): self.set_amount_used(x.amount_used())
if (x.has_limit()): self.set_limit(x.limit())
def Equals(self, x):
if x is self: return 1
if self.has_amount_used_ != x.has_amount_used_: return 0
if self.has_amount_used_ and self.amount_used_ != x.amount_used_: 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
return initialized
def ByteSize(self):
n = 0
if (self.has_amount_used_): n += 1 + self.lengthVarInt64(self.amount_used_)
if (self.has_limit_): n += 1 + self.lengthVarInt64(self.limit_)
return n
def ByteSizePartial(self):
n = 0
if (self.has_amount_used_): n += 1 + self.lengthVarInt64(self.amount_used_)
if (self.has_limit_): n += 1 + self.lengthVarInt64(self.limit_)
return n
def Clear(self):
self.clear_amount_used()
self.clear_limit()
def OutputUnchecked(self, out):
if (self.has_amount_used_):
out.putVarInt32(8)
out.putVarInt64(self.amount_used_)
if (self.has_limit_):
out.putVarInt32(16)
out.putVarInt64(self.limit_)
def OutputPartial(self, out):
if (self.has_amount_used_):
out.putVarInt32(8)
out.putVarInt64(self.amount_used_)
if (self.has_limit_):
out.putVarInt32(16)
out.putVarInt64(self.limit_)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 8:
self.set_amount_used(d.getVarInt64())
continue
if tt == 16:
self.set_limit(d.getVarInt64())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_amount_used_: res+=prefix+("amount_used: %s\n" % self.DebugFormatInt64(self.amount_used_))
if self.has_limit_: res+=prefix+("limit: %s\n" % self.DebugFormatInt64(self.limit_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kamount_used = 1
klimit = 2
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "amount_used",
2: "limit",
}, 2)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.NUMERIC,
2: ProtocolBuffer.Encoder.NUMERIC,
}, 2, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.IndexMetadata_Storage'
class IndexMetadata(ProtocolBuffer.ProtocolMessage):
has_index_spec_ = 0
has_storage_ = 0
storage_ = None
def __init__(self, contents=None):
self.index_spec_ = IndexSpec()
self.field_ = []
self.lazy_init_lock_ = thread.allocate_lock()
if contents is not None: self.MergeFromString(contents)
def index_spec(self): return self.index_spec_
def mutable_index_spec(self): self.has_index_spec_ = 1; return self.index_spec_
def clear_index_spec(self):self.has_index_spec_ = 0; self.index_spec_.Clear()
def has_index_spec(self): return self.has_index_spec_
def field_size(self): return len(self.field_)
def field_list(self): return self.field_
def field(self, i):
return self.field_[i]
def mutable_field(self, i):
return self.field_[i]
def add_field(self):
x = FieldTypes()
self.field_.append(x)
return x
def clear_field(self):
self.field_ = []
def storage(self):
if self.storage_ is None:
self.lazy_init_lock_.acquire()
try:
if self.storage_ is None: self.storage_ = IndexMetadata_Storage()
finally:
self.lazy_init_lock_.release()
return self.storage_
def mutable_storage(self): self.has_storage_ = 1; return self.storage()
def clear_storage(self):
if self.has_storage_:
self.has_storage_ = 0;
if self.storage_ is not None: self.storage_.Clear()
def has_storage(self): return self.has_storage_
def MergeFrom(self, x):
assert x is not self
if (x.has_index_spec()): self.mutable_index_spec().MergeFrom(x.index_spec())
for i in xrange(x.field_size()): self.add_field().CopyFrom(x.field(i))
if (x.has_storage()): self.mutable_storage().MergeFrom(x.storage())
def Equals(self, x):
if x is self: return 1
if self.has_index_spec_ != x.has_index_spec_: return 0
if self.has_index_spec_ and self.index_spec_ != x.index_spec_: return 0
if len(self.field_) != len(x.field_): return 0
for e1, e2 in zip(self.field_, x.field_):
if e1 != e2: return 0
if self.has_storage_ != x.has_storage_: return 0
if self.has_storage_ and self.storage_ != x.storage_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_index_spec_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: index_spec not set.')
elif not self.index_spec_.IsInitialized(debug_strs): initialized = 0
for p in self.field_:
if not p.IsInitialized(debug_strs): initialized=0
if (self.has_storage_ and not self.storage_.IsInitialized(debug_strs)): initialized = 0
return initialized
def ByteSize(self):
n = 0
n += self.lengthString(self.index_spec_.ByteSize())
n += 1 * len(self.field_)
for i in xrange(len(self.field_)): n += self.lengthString(self.field_[i].ByteSize())
if (self.has_storage_): n += 1 + self.lengthString(self.storage_.ByteSize())
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_index_spec_):
n += 1
n += self.lengthString(self.index_spec_.ByteSizePartial())
n += 1 * len(self.field_)
for i in xrange(len(self.field_)): n += self.lengthString(self.field_[i].ByteSizePartial())
if (self.has_storage_): n += 1 + self.lengthString(self.storage_.ByteSizePartial())
return n
def Clear(self):
self.clear_index_spec()
self.clear_field()
self.clear_storage()
def OutputUnchecked(self, out):
out.putVarInt32(10)
out.putVarInt32(self.index_spec_.ByteSize())
self.index_spec_.OutputUnchecked(out)
for i in xrange(len(self.field_)):
out.putVarInt32(18)
out.putVarInt32(self.field_[i].ByteSize())
self.field_[i].OutputUnchecked(out)
if (self.has_storage_):
out.putVarInt32(26)
out.putVarInt32(self.storage_.ByteSize())
self.storage_.OutputUnchecked(out)
def OutputPartial(self, out):
if (self.has_index_spec_):
out.putVarInt32(10)
out.putVarInt32(self.index_spec_.ByteSizePartial())
self.index_spec_.OutputPartial(out)
for i in xrange(len(self.field_)):
out.putVarInt32(18)
out.putVarInt32(self.field_[i].ByteSizePartial())
self.field_[i].OutputPartial(out)
if (self.has_storage_):
out.putVarInt32(26)
out.putVarInt32(self.storage_.ByteSizePartial())
self.storage_.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_index_spec().TryMerge(tmp)
continue
if tt == 18:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_field().TryMerge(tmp)
continue
if tt == 26:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_storage().TryMerge(tmp)
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_index_spec_:
res+=prefix+"index_spec <\n"
res+=self.index_spec_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt=0
for e in self.field_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("field%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
if self.has_storage_:
res+=prefix+"storage <\n"
res+=self.storage_.__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)])
kindex_spec = 1
kfield = 2
kstorage = 3
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "index_spec",
2: "field",
3: "storage",
}, 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.IndexMetadata'
class IndexDocumentParams(ProtocolBuffer.ProtocolMessage):
SYNCHRONOUSLY = 0
WHEN_CONVENIENT = 1
_Freshness_NAMES = {
0: "SYNCHRONOUSLY",
1: "WHEN_CONVENIENT",
}
def Freshness_Name(cls, x): return cls._Freshness_NAMES.get(x, "")
Freshness_Name = classmethod(Freshness_Name)
has_freshness_ = 0
freshness_ = 0
has_index_spec_ = 0
def __init__(self, contents=None):
self.document_ = []
self.index_spec_ = IndexSpec()
if contents is not None: self.MergeFromString(contents)
def document_size(self): return len(self.document_)
def document_list(self): return self.document_
def document(self, i):
return self.document_[i]
def mutable_document(self, i):
return self.document_[i]
def add_document(self):
x = Document()
self.document_.append(x)
return x
def clear_document(self):
self.document_ = []
def freshness(self): return self.freshness_
def set_freshness(self, x):
self.has_freshness_ = 1
self.freshness_ = x
def clear_freshness(self):
if self.has_freshness_:
self.has_freshness_ = 0
self.freshness_ = 0
def has_freshness(self): return self.has_freshness_
def index_spec(self): return self.index_spec_
def mutable_index_spec(self): self.has_index_spec_ = 1; return self.index_spec_
def clear_index_spec(self):self.has_index_spec_ = 0; self.index_spec_.Clear()
def has_index_spec(self): return self.has_index_spec_
def MergeFrom(self, x):
assert x is not self
for i in xrange(x.document_size()): self.add_document().CopyFrom(x.document(i))
if (x.has_freshness()): self.set_freshness(x.freshness())
if (x.has_index_spec()): self.mutable_index_spec().MergeFrom(x.index_spec())
def Equals(self, x):
if x is self: return 1
if len(self.document_) != len(x.document_): return 0
for e1, e2 in zip(self.document_, x.document_):
if e1 != e2: return 0
if self.has_freshness_ != x.has_freshness_: return 0
if self.has_freshness_ and self.freshness_ != x.freshness_: return 0
if self.has_index_spec_ != x.has_index_spec_: return 0
if self.has_index_spec_ and self.index_spec_ != x.index_spec_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
for p in self.document_:
if not p.IsInitialized(debug_strs): initialized=0
if (not self.has_index_spec_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: index_spec not set.')
elif not self.index_spec_.IsInitialized(debug_strs): initialized = 0
return initialized
def ByteSize(self):
n = 0
n += 1 * len(self.document_)
for i in xrange(len(self.document_)): n += self.lengthString(self.document_[i].ByteSize())
if (self.has_freshness_): n += 1 + self.lengthVarInt64(self.freshness_)
n += self.lengthString(self.index_spec_.ByteSize())
return n + 1
def ByteSizePartial(self):
n = 0
n += 1 * len(self.document_)
for i in xrange(len(self.document_)): n += self.lengthString(self.document_[i].ByteSizePartial())
if (self.has_freshness_): n += 1 + self.lengthVarInt64(self.freshness_)
if (self.has_index_spec_):
n += 1
n += self.lengthString(self.index_spec_.ByteSizePartial())
return n
def Clear(self):
self.clear_document()
self.clear_freshness()
self.clear_index_spec()
def OutputUnchecked(self, out):
for i in xrange(len(self.document_)):
out.putVarInt32(10)
out.putVarInt32(self.document_[i].ByteSize())
self.document_[i].OutputUnchecked(out)
if (self.has_freshness_):
out.putVarInt32(16)
out.putVarInt32(self.freshness_)
out.putVarInt32(26)
out.putVarInt32(self.index_spec_.ByteSize())
self.index_spec_.OutputUnchecked(out)
def OutputPartial(self, out):
for i in xrange(len(self.document_)):
out.putVarInt32(10)
out.putVarInt32(self.document_[i].ByteSizePartial())
self.document_[i].OutputPartial(out)
if (self.has_freshness_):
out.putVarInt32(16)
out.putVarInt32(self.freshness_)
if (self.has_index_spec_):
out.putVarInt32(26)
out.putVarInt32(self.index_spec_.ByteSizePartial())
self.index_spec_.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.add_document().TryMerge(tmp)
continue
if tt == 16:
self.set_freshness(d.getVarInt32())
continue
if tt == 26:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_index_spec().TryMerge(tmp)
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
cnt=0
for e in self.document_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("document%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
if self.has_freshness_: res+=prefix+("freshness: %s\n" % self.DebugFormatInt32(self.freshness_))
if self.has_index_spec_:
res+=prefix+"index_spec <\n"
res+=self.index_spec_.__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)])
kdocument = 1
kfreshness = 2
kindex_spec = 3
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "document",
2: "freshness",
3: "index_spec",
}, 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.IndexDocumentParams'
class IndexDocumentRequest(ProtocolBuffer.ProtocolMessage):
has_params_ = 0
has_app_id_ = 0
app_id_ = ""
def __init__(self, contents=None):
self.params_ = IndexDocumentParams()
if contents is not None: self.MergeFromString(contents)
def params(self): return self.params_
def mutable_params(self): self.has_params_ = 1; return self.params_
def clear_params(self):self.has_params_ = 0; self.params_.Clear()
def has_params(self): return self.has_params_
def app_id(self): return self.app_id_
def set_app_id(self, x):
self.has_app_id_ = 1
self.app_id_ = x
def clear_app_id(self):
if self.has_app_id_:
self.has_app_id_ = 0
self.app_id_ = ""
def has_app_id(self): return self.has_app_id_
def MergeFrom(self, x):
assert x is not self
if (x.has_params()): self.mutable_params().MergeFrom(x.params())
if (x.has_app_id()): self.set_app_id(x.app_id())
def Equals(self, x):
if x is self: return 1
if self.has_params_ != x.has_params_: return 0
if self.has_params_ and self.params_ != x.params_: return 0
if self.has_app_id_ != x.has_app_id_: return 0
if self.has_app_id_ and self.app_id_ != x.app_id_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_params_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: params not set.')
elif not self.params_.IsInitialized(debug_strs): initialized = 0
return initialized
def ByteSize(self):
n = 0
n += self.lengthString(self.params_.ByteSize())
if (self.has_app_id_): n += 1 + self.lengthString(len(self.app_id_))
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_params_):
n += 1
n += self.lengthString(self.params_.ByteSizePartial())
if (self.has_app_id_): n += 1 + self.lengthString(len(self.app_id_))
return n
def Clear(self):
self.clear_params()
self.clear_app_id()
def OutputUnchecked(self, out):
out.putVarInt32(10)
out.putVarInt32(self.params_.ByteSize())
self.params_.OutputUnchecked(out)
if (self.has_app_id_):
out.putVarInt32(26)
out.putPrefixedString(self.app_id_)
def OutputPartial(self, out):
if (self.has_params_):
out.putVarInt32(10)
out.putVarInt32(self.params_.ByteSizePartial())
self.params_.OutputPartial(out)
if (self.has_app_id_):
out.putVarInt32(26)
out.putPrefixedString(self.app_id_)
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_params().TryMerge(tmp)
continue
if tt == 26:
self.set_app_id(d.getPrefixedString())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_params_:
res+=prefix+"params <\n"
res+=self.params_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
if self.has_app_id_: res+=prefix+("app_id: %s\n" % self.DebugFormatString(self.app_id_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kparams = 1
kapp_id = 3
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "params",
3: "app_id",
}, 3)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.STRING,
3: ProtocolBuffer.Encoder.STRING,
}, 3, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.IndexDocumentRequest'
class IndexDocumentResponse(ProtocolBuffer.ProtocolMessage):
def __init__(self, contents=None):
self.status_ = []
self.doc_id_ = []
if contents is not None: self.MergeFromString(contents)
def status_size(self): return len(self.status_)
def status_list(self): return self.status_
def status(self, i):
return self.status_[i]
def mutable_status(self, i):
return self.status_[i]
def add_status(self):
x = RequestStatus()
self.status_.append(x)
return x
def clear_status(self):
self.status_ = []
def doc_id_size(self): return len(self.doc_id_)
def doc_id_list(self): return self.doc_id_
def doc_id(self, i):
return self.doc_id_[i]
def set_doc_id(self, i, x):
self.doc_id_[i] = x
def add_doc_id(self, x):
self.doc_id_.append(x)
def clear_doc_id(self):
self.doc_id_ = []
def MergeFrom(self, x):
assert x is not self
for i in xrange(x.status_size()): self.add_status().CopyFrom(x.status(i))
for i in xrange(x.doc_id_size()): self.add_doc_id(x.doc_id(i))
def Equals(self, x):
if x is self: return 1
if len(self.status_) != len(x.status_): return 0
for e1, e2 in zip(self.status_, x.status_):
if e1 != e2: return 0
if len(self.doc_id_) != len(x.doc_id_): return 0
for e1, e2 in zip(self.doc_id_, x.doc_id_):
if e1 != e2: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
for p in self.status_:
if not p.IsInitialized(debug_strs): initialized=0
return initialized
def ByteSize(self):
n = 0
n += 1 * len(self.status_)
for i in xrange(len(self.status_)): n += self.lengthString(self.status_[i].ByteSize())
n += 1 * len(self.doc_id_)
for i in xrange(len(self.doc_id_)): n += self.lengthString(len(self.doc_id_[i]))
return n
def ByteSizePartial(self):
n = 0
n += 1 * len(self.status_)
for i in xrange(len(self.status_)): n += self.lengthString(self.status_[i].ByteSizePartial())
n += 1 * len(self.doc_id_)
for i in xrange(len(self.doc_id_)): n += self.lengthString(len(self.doc_id_[i]))
return n
def Clear(self):
self.clear_status()
self.clear_doc_id()
def OutputUnchecked(self, out):
for i in xrange(len(self.status_)):
out.putVarInt32(10)
out.putVarInt32(self.status_[i].ByteSize())
self.status_[i].OutputUnchecked(out)
for i in xrange(len(self.doc_id_)):
out.putVarInt32(18)
out.putPrefixedString(self.doc_id_[i])
def OutputPartial(self, out):
for i in xrange(len(self.status_)):
out.putVarInt32(10)
out.putVarInt32(self.status_[i].ByteSizePartial())
self.status_[i].OutputPartial(out)
for i in xrange(len(self.doc_id_)):
out.putVarInt32(18)
out.putPrefixedString(self.doc_id_[i])
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_status().TryMerge(tmp)
continue
if tt == 18:
self.add_doc_id(d.getPrefixedString())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
cnt=0
for e in self.status_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("status%s <\n" % elm)
res+=e.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt+=1
cnt=0
for e in self.doc_id_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("doc_id%s: %s\n" % (elm, self.DebugFormatString(e)))
cnt+=1
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kstatus = 1
kdoc_id = 2
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "status",
2: "doc_id",
}, 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.IndexDocumentResponse'
class DeleteDocumentParams(ProtocolBuffer.ProtocolMessage):
has_index_spec_ = 0
def __init__(self, contents=None):
self.doc_id_ = []
self.index_spec_ = IndexSpec()
if contents is not None: self.MergeFromString(contents)
def doc_id_size(self): return len(self.doc_id_)
def doc_id_list(self): return self.doc_id_
def doc_id(self, i):
return self.doc_id_[i]
def set_doc_id(self, i, x):
self.doc_id_[i] = x
def add_doc_id(self, x):
self.doc_id_.append(x)
def clear_doc_id(self):
self.doc_id_ = []
def index_spec(self): return self.index_spec_
def mutable_index_spec(self): self.has_index_spec_ = 1; return self.index_spec_
def clear_index_spec(self):self.has_index_spec_ = 0; self.index_spec_.Clear()
def has_index_spec(self): return self.has_index_spec_
def MergeFrom(self, x):
assert x is not self
for i in xrange(x.doc_id_size()): self.add_doc_id(x.doc_id(i))
if (x.has_index_spec()): self.mutable_index_spec().MergeFrom(x.index_spec())
def Equals(self, x):
if x is self: return 1
if len(self.doc_id_) != len(x.doc_id_): return 0
for e1, e2 in zip(self.doc_id_, x.doc_id_):
if e1 != e2: return 0
if self.has_index_spec_ != x.has_index_spec_: return 0
if self.has_index_spec_ and self.index_spec_ != x.index_spec_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_index_spec_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: index_spec not set.')
elif not self.index_spec_.IsInitialized(debug_strs): initialized = 0
return initialized
def ByteSize(self):
n = 0
n += 1 * len(self.doc_id_)
for i in xrange(len(self.doc_id_)): n += self.lengthString(len(self.doc_id_[i]))
n += self.lengthString(self.index_spec_.ByteSize())
return n + 1
def ByteSizePartial(self):
n = 0
n += 1 * len(self.doc_id_)
for i in xrange(len(self.doc_id_)): n += self.lengthString(len(self.doc_id_[i]))
if (self.has_index_spec_):
n += 1
n += self.lengthString(self.index_spec_.ByteSizePartial())
return n
def Clear(self):
self.clear_doc_id()
self.clear_index_spec()
def OutputUnchecked(self, out):
for i in xrange(len(self.doc_id_)):
out.putVarInt32(10)
out.putPrefixedString(self.doc_id_[i])
out.putVarInt32(18)
out.putVarInt32(self.index_spec_.ByteSize())
self.index_spec_.OutputUnchecked(out)
def OutputPartial(self, out):
for i in xrange(len(self.doc_id_)):
out.putVarInt32(10)
out.putPrefixedString(self.doc_id_[i])
if (self.has_index_spec_):
out.putVarInt32(18)
out.putVarInt32(self.index_spec_.ByteSizePartial())
self.index_spec_.OutputPartial(out)
def TryMerge(self, d):
while d.avail() > 0:
tt = d.getVarInt32()
if tt == 10:
self.add_doc_id(d.getPrefixedString())
continue
if tt == 18:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.mutable_index_spec().TryMerge(tmp)
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
cnt=0
for e in self.doc_id_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("doc_id%s: %s\n" % (elm, self.DebugFormatString(e)))
cnt+=1
if self.has_index_spec_:
res+=prefix+"index_spec <\n"
res+=self.index_spec_.__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)])
kdoc_id = 1
kindex_spec = 2
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "doc_id",
2: "index_spec",
}, 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.DeleteDocumentParams'
class DeleteDocumentRequest(ProtocolBuffer.ProtocolMessage):
has_params_ = 0
has_app_id_ = 0
app_id_ = ""
def __init__(self, contents=None):
self.params_ = DeleteDocumentParams()
if contents is not None: self.MergeFromString(contents)
def params(self): return self.params_
def mutable_params(self): self.has_params_ = 1; return self.params_
def clear_params(self):self.has_params_ = 0; self.params_.Clear()
def has_params(self): return self.has_params_
def app_id(self): return self.app_id_
def set_app_id(self, x):
self.has_app_id_ = 1
self.app_id_ = x
def clear_app_id(self):
if self.has_app_id_:
self.has_app_id_ = 0
self.app_id_ = ""
def has_app_id(self): return self.has_app_id_
def MergeFrom(self, x):
assert x is not self
if (x.has_params()): self.mutable_params().MergeFrom(x.params())
if (x.has_app_id()): self.set_app_id(x.app_id())
def Equals(self, x):
if x is self: return 1
if self.has_params_ != x.has_params_: return 0
if self.has_params_ and self.params_ != x.params_: return 0
if self.has_app_id_ != x.has_app_id_: return 0
if self.has_app_id_ and self.app_id_ != x.app_id_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_params_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: params not set.')
elif not self.params_.IsInitialized(debug_strs): initialized = 0
return initialized
def ByteSize(self):
n = 0
n += self.lengthString(self.params_.ByteSize())
if (self.has_app_id_): n += 1 + self.lengthString(len(self.app_id_))
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_params_):
n += 1
n += self.lengthString(self.params_.ByteSizePartial())
if (self.has_app_id_): n += 1 + self.lengthString(len(self.app_id_))
return n
def Clear(self):
self.clear_params()
self.clear_app_id()
def OutputUnchecked(self, out):
out.putVarInt32(10)
out.putVarInt32(self.params_.ByteSize())
self.params_.OutputUnchecked(out)
if (self.has_app_id_):
out.putVarInt32(26)
out.putPrefixedString(self.app_id_)
def OutputPartial(self, out):
if (self.has_params_):
out.putVarInt32(10)
out.putVarInt32(self.params_.ByteSizePartial())
self.params_.OutputPartial(out)
if (self.has_app_id_):
out.putVarInt32(26)
out.putPrefixedString(self.app_id_)
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_params().TryMerge(tmp)
continue
if tt == 26:
self.set_app_id(d.getPrefixedString())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_params_:
res+=prefix+"params <\n"
res+=self.params_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
if self.has_app_id_: res+=prefix+("app_id: %s\n" % self.DebugFormatString(self.app_id_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kparams = 1
kapp_id = 3
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "params",
3: "app_id",
}, 3)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.STRING,
3: ProtocolBuffer.Encoder.STRING,
}, 3, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.DeleteDocumentRequest'
class DeleteDocumentResponse(ProtocolBuffer.ProtocolMessage):
def __init__(self, contents=None):
self.status_ = []
if contents is not None: self.MergeFromString(contents)
def status_size(self): return len(self.status_)
def status_list(self): return self.status_
def status(self, i):
return self.status_[i]
def mutable_status(self, i):
return self.status_[i]
def add_status(self):
x = RequestStatus()
self.status_.append(x)
return x
def clear_status(self):
self.status_ = []
def MergeFrom(self, x):
assert x is not self
for i in xrange(x.status_size()): self.add_status().CopyFrom(x.status(i))
def Equals(self, x):
if x is self: return 1
if len(self.status_) != len(x.status_): return 0
for e1, e2 in zip(self.status_, x.status_):
if e1 != e2: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
for p in self.status_:
if not p.IsInitialized(debug_strs): initialized=0
return initialized
def ByteSize(self):
n = 0
n += 1 * len(self.status_)
for i in xrange(len(self.status_)): n += self.lengthString(self.status_[i].ByteSize())
return n
def ByteSizePartial(self):
n = 0
n += 1 * len(self.status_)
for i in xrange(len(self.status_)): n += self.lengthString(self.status_[i].ByteSizePartial())
return n
def Clear(self):
self.clear_status()
def OutputUnchecked(self, out):
for i in xrange(len(self.status_)):
out.putVarInt32(10)
out.putVarInt32(self.status_[i].ByteSize())
self.status_[i].OutputUnchecked(out)
def OutputPartial(self, out):
for i in xrange(len(self.status_)):
out.putVarInt32(10)
out.putVarInt32(self.status_[i].ByteSizePartial())
self.status_[i].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.add_status().TryMerge(tmp)
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
cnt=0
for e in self.status_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("status%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)])
kstatus = 1
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "status",
}, 1)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.STRING,
}, 1, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.DeleteDocumentResponse'
class ListDocumentsParams(ProtocolBuffer.ProtocolMessage):
has_index_spec_ = 0
has_start_doc_id_ = 0
start_doc_id_ = ""
has_include_start_doc_ = 0
include_start_doc_ = 1
has_limit_ = 0
limit_ = 100
has_keys_only_ = 0
keys_only_ = 0
def __init__(self, contents=None):
self.index_spec_ = IndexSpec()
if contents is not None: self.MergeFromString(contents)
def index_spec(self): return self.index_spec_
def mutable_index_spec(self): self.has_index_spec_ = 1; return self.index_spec_
def clear_index_spec(self):self.has_index_spec_ = 0; self.index_spec_.Clear()
def has_index_spec(self): return self.has_index_spec_
def start_doc_id(self): return self.start_doc_id_
def set_start_doc_id(self, x):
self.has_start_doc_id_ = 1
self.start_doc_id_ = x
def clear_start_doc_id(self):
if self.has_start_doc_id_:
self.has_start_doc_id_ = 0
self.start_doc_id_ = ""
def has_start_doc_id(self): return self.has_start_doc_id_
def include_start_doc(self): return self.include_start_doc_
def set_include_start_doc(self, x):
self.has_include_start_doc_ = 1
self.include_start_doc_ = x
def clear_include_start_doc(self):
if self.has_include_start_doc_:
self.has_include_start_doc_ = 0
self.include_start_doc_ = 1
def has_include_start_doc(self): return self.has_include_start_doc_
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_ = 100
def has_limit(self): return self.has_limit_
def keys_only(self): return self.keys_only_
def set_keys_only(self, x):
self.has_keys_only_ = 1
self.keys_only_ = x
def clear_keys_only(self):
if self.has_keys_only_:
self.has_keys_only_ = 0
self.keys_only_ = 0
def has_keys_only(self): return self.has_keys_only_
def MergeFrom(self, x):
assert x is not self
if (x.has_index_spec()): self.mutable_index_spec().MergeFrom(x.index_spec())
if (x.has_start_doc_id()): self.set_start_doc_id(x.start_doc_id())
if (x.has_include_start_doc()): self.set_include_start_doc(x.include_start_doc())
if (x.has_limit()): self.set_limit(x.limit())
if (x.has_keys_only()): self.set_keys_only(x.keys_only())
def Equals(self, x):
if x is self: return 1
if self.has_index_spec_ != x.has_index_spec_: return 0
if self.has_index_spec_ and self.index_spec_ != x.index_spec_: return 0
if self.has_start_doc_id_ != x.has_start_doc_id_: return 0
if self.has_start_doc_id_ and self.start_doc_id_ != x.start_doc_id_: return 0
if self.has_include_start_doc_ != x.has_include_start_doc_: return 0
if self.has_include_start_doc_ and self.include_start_doc_ != x.include_start_doc_: return 0
if self.has_limit_ != x.has_limit_: return 0
if self.has_limit_ and self.limit_ != x.limit_: return 0
if self.has_keys_only_ != x.has_keys_only_: return 0
if self.has_keys_only_ and self.keys_only_ != x.keys_only_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_index_spec_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: index_spec not set.')
elif not self.index_spec_.IsInitialized(debug_strs): initialized = 0
return initialized
def ByteSize(self):
n = 0
n += self.lengthString(self.index_spec_.ByteSize())
if (self.has_start_doc_id_): n += 1 + self.lengthString(len(self.start_doc_id_))
if (self.has_include_start_doc_): n += 2
if (self.has_limit_): n += 1 + self.lengthVarInt64(self.limit_)
if (self.has_keys_only_): n += 2
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_index_spec_):
n += 1
n += self.lengthString(self.index_spec_.ByteSizePartial())
if (self.has_start_doc_id_): n += 1 + self.lengthString(len(self.start_doc_id_))
if (self.has_include_start_doc_): n += 2
if (self.has_limit_): n += 1 + self.lengthVarInt64(self.limit_)
if (self.has_keys_only_): n += 2
return n
def Clear(self):
self.clear_index_spec()
self.clear_start_doc_id()
self.clear_include_start_doc()
self.clear_limit()
self.clear_keys_only()
def OutputUnchecked(self, out):
out.putVarInt32(10)
out.putVarInt32(self.index_spec_.ByteSize())
self.index_spec_.OutputUnchecked(out)
if (self.has_start_doc_id_):
out.putVarInt32(18)
out.putPrefixedString(self.start_doc_id_)
if (self.has_include_start_doc_):
out.putVarInt32(24)
out.putBoolean(self.include_start_doc_)
if (self.has_limit_):
out.putVarInt32(32)
out.putVarInt32(self.limit_)
if (self.has_keys_only_):
out.putVarInt32(40)
out.putBoolean(self.keys_only_)
def OutputPartial(self, out):
if (self.has_index_spec_):
out.putVarInt32(10)
out.putVarInt32(self.index_spec_.ByteSizePartial())
self.index_spec_.OutputPartial(out)
if (self.has_start_doc_id_):
out.putVarInt32(18)
out.putPrefixedString(self.start_doc_id_)
if (self.has_include_start_doc_):
out.putVarInt32(24)
out.putBoolean(self.include_start_doc_)
if (self.has_limit_):
out.putVarInt32(32)
out.putVarInt32(self.limit_)
if (self.has_keys_only_):
out.putVarInt32(40)
out.putBoolean(self.keys_only_)
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_index_spec().TryMerge(tmp)
continue
if tt == 18:
self.set_start_doc_id(d.getPrefixedString())
continue
if tt == 24:
self.set_include_start_doc(d.getBoolean())
continue
if tt == 32:
self.set_limit(d.getVarInt32())
continue
if tt == 40:
self.set_keys_only(d.getBoolean())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_index_spec_:
res+=prefix+"index_spec <\n"
res+=self.index_spec_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
if self.has_start_doc_id_: res+=prefix+("start_doc_id: %s\n" % self.DebugFormatString(self.start_doc_id_))
if self.has_include_start_doc_: res+=prefix+("include_start_doc: %s\n" % self.DebugFormatBool(self.include_start_doc_))
if self.has_limit_: res+=prefix+("limit: %s\n" % self.DebugFormatInt32(self.limit_))
if self.has_keys_only_: res+=prefix+("keys_only: %s\n" % self.DebugFormatBool(self.keys_only_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kindex_spec = 1
kstart_doc_id = 2
kinclude_start_doc = 3
klimit = 4
kkeys_only = 5
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "index_spec",
2: "start_doc_id",
3: "include_start_doc",
4: "limit",
5: "keys_only",
}, 5)
_TYPES = _BuildTagLookupTable({
0: ProtocolBuffer.Encoder.NUMERIC,
1: ProtocolBuffer.Encoder.STRING,
2: ProtocolBuffer.Encoder.STRING,
3: ProtocolBuffer.Encoder.NUMERIC,
4: ProtocolBuffer.Encoder.NUMERIC,
5: ProtocolBuffer.Encoder.NUMERIC,
}, 5, ProtocolBuffer.Encoder.MAX_TYPE)
_STYLE = """"""
_STYLE_CONTENT_TYPE = """"""
_PROTO_DESCRIPTOR_NAME = 'apphosting.ListDocumentsParams'
class ListDocumentsRequest(ProtocolBuffer.ProtocolMessage):
has_params_ = 0
has_app_id_ = 0
app_id_ = ""
def __init__(self, contents=None):
self.params_ = ListDocumentsParams()
if contents is not None: self.MergeFromString(contents)
def params(self): return self.params_
def mutable_params(self): self.has_params_ = 1; return self.params_
def clear_params(self):self.has_params_ = 0; self.params_.Clear()
def has_params(self): return self.has_params_
def app_id(self): return self.app_id_
def set_app_id(self, x):
self.has_app_id_ = 1
self.app_id_ = x
def clear_app_id(self):
if self.has_app_id_:
self.has_app_id_ = 0
self.app_id_ = ""
def has_app_id(self): return self.has_app_id_
def MergeFrom(self, x):
assert x is not self
if (x.has_params()): self.mutable_params().MergeFrom(x.params())
if (x.has_app_id()): self.set_app_id(x.app_id())
def Equals(self, x):
if x is self: return 1
if self.has_params_ != x.has_params_: return 0
if self.has_params_ and self.params_ != x.params_: return 0
if self.has_app_id_ != x.has_app_id_: return 0
if self.has_app_id_ and self.app_id_ != x.app_id_: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_params_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: params not set.')
elif not self.params_.IsInitialized(debug_strs): initialized = 0
return initialized
def ByteSize(self):
n = 0
n += self.lengthString(self.params_.ByteSize())
if (self.has_app_id_): n += 1 + self.lengthString(len(self.app_id_))
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_params_):
n += 1
n += self.lengthString(self.params_.ByteSizePartial())
if (self.has_app_id_): n += 1 + self.lengthString(len(self.app_id_))
return n
def Clear(self):
self.clear_params()
self.clear_app_id()
def OutputUnchecked(self, out):
out.putVarInt32(10)
out.putVarInt32(self.params_.ByteSize())
self.params_.OutputUnchecked(out)
if (self.has_app_id_):
out.putVarInt32(18)
out.putPrefixedString(self.app_id_)
def OutputPartial(self, out):
if (self.has_params_):
out.putVarInt32(10)
out.putVarInt32(self.params_.ByteSizePartial())
self.params_.OutputPartial(out)
if (self.has_app_id_):
out.putVarInt32(18)
out.putPrefixedString(self.app_id_)
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_params().TryMerge(tmp)
continue
if tt == 18:
self.set_app_id(d.getPrefixedString())
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_params_:
res+=prefix+"params <\n"
res+=self.params_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
if self.has_app_id_: res+=prefix+("app_id: %s\n" % self.DebugFormatString(self.app_id_))
return res
def _BuildTagLookupTable(sparse, maxtag, default=None):
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
kparams = 1
kapp_id = 2
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "params",
2: "app_id",
}, 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.ListDocumentsRequest'
class ListDocumentsResponse(ProtocolBuffer.ProtocolMessage):
has_status_ = 0
def __init__(self, contents=None):
self.status_ = RequestStatus()
self.document_ = []
if contents is not None: self.MergeFromString(contents)
def status(self): return self.status_
def mutable_status(self): self.has_status_ = 1; return self.status_
def clear_status(self):self.has_status_ = 0; self.status_.Clear()
def has_status(self): return self.has_status_
def document_size(self): return len(self.document_)
def document_list(self): return self.document_
def document(self, i):
return self.document_[i]
def mutable_document(self, i):
return self.document_[i]
def add_document(self):
x = Document()
self.document_.append(x)
return x
def clear_document(self):
self.document_ = []
def MergeFrom(self, x):
assert x is not self
if (x.has_status()): self.mutable_status().MergeFrom(x.status())
for i in xrange(x.document_size()): self.add_document().CopyFrom(x.document(i))
def Equals(self, x):
if x is self: return 1
if self.has_status_ != x.has_status_: return 0
if self.has_status_ and self.status_ != x.status_: return 0
if len(self.document_) != len(x.document_): return 0
for e1, e2 in zip(self.document_, x.document_):
if e1 != e2: return 0
return 1
def IsInitialized(self, debug_strs=None):
initialized = 1
if (not self.has_status_):
initialized = 0
if debug_strs is not None:
debug_strs.append('Required field: status not set.')
elif not self.status_.IsInitialized(debug_strs): initialized = 0
for p in self.document_:
if not p.IsInitialized(debug_strs): initialized=0
return initialized
def ByteSize(self):
n = 0
n += self.lengthString(self.status_.ByteSize())
n += 1 * len(self.document_)
for i in xrange(len(self.document_)): n += self.lengthString(self.document_[i].ByteSize())
return n + 1
def ByteSizePartial(self):
n = 0
if (self.has_status_):
n += 1
n += self.lengthString(self.status_.ByteSizePartial())
n += 1 * len(self.document_)
for i in xrange(len(self.document_)): n += self.lengthString(self.document_[i].ByteSizePartial())
return n
def Clear(self):
self.clear_status()
self.clear_document()
def OutputUnchecked(self, out):
out.putVarInt32(10)
out.putVarInt32(self.status_.ByteSize())
self.status_.OutputUnchecked(out)
for i in xrange(len(self.document_)):
out.putVarInt32(18)
out.putVarInt32(self.document_[i].ByteSize())
self.document_[i].OutputUnchecked(out)
def OutputPartial(self, out):
if (self.has_status_):
out.putVarInt32(10)
out.putVarInt32(self.status_.ByteSizePartial())
self.status_.OutputPartial(out)
for i in xrange(len(self.document_)):
out.putVarInt32(18)
out.putVarInt32(self.document_[i].ByteSizePartial())
self.document_[i].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_status().TryMerge(tmp)
continue
if tt == 18:
length = d.getVarInt32()
tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
d.skip(length)
self.add_document().TryMerge(tmp)
continue
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
d.skipData(tt)
def __str__(self, prefix="", printElemNumber=0):
res=""
if self.has_status_:
res+=prefix+"status <\n"
res+=self.status_.__str__(prefix + " ", printElemNumber)
res+=prefix+">\n"
cnt=0
for e in self.document_:
elm=""
if printElemNumber: elm="(%d)" % cnt
res+=prefix+("document%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)])
kstatus = 1
kdocument = 2
_TEXT = _BuildTagLookupTable({
0: "ErrorCode",
1: "status",
2: "document",
}, 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.ListDocumentsResponse'
class ListIndexesParams(ProtocolBuffer.ProtocolMessage):
has_fetch_schema_ = 0
fetch_schema_ = 0
has_limit_ = 0
limit_ = 20
has_namespace_ = 0
namespace_ = ""
has_start_index_name_ = 0
start_index_name_ = ""
has_include_start_index_ = 0
include_start_index_ = 1
has_index_name_prefix_ = 0
index_name_prefix_ = ""
has_offset_ = 0
offset_ = 0
has_source_ = 0
source_ = 0
def __init__(self, contents=None):
if contents is not None: self.MergeFromString(contents)
def fetch_schema(self): return self.fetch_schema_
def set_fetch_schema(self, x):
self.has_fetch_schema_ = 1
self.fetch_schema_ = x
def clear_fetch_schema(self):
if self.has_fetch_schema_:
self.has_fetch_schema_ = 0
self.fetch_schema_ = 0
def has_fetch_schema(self): return self.has_fetch_schema_
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_ = 20
def has_limit(self): return self.has_limit_
def namespace(self): return self.namespace_
def set_namespace(self, x):
self.has_namespace_ = 1
self.namespace_ = x
def clear_namespace(self):
if self.has_namespace_:
self.has_namespace_ = 0
self.namespace_ = ""
def has_namespace(self): return self.has_namespace_
def start_index_name(self): return self.start_index_name_
def set_start_index_name(self, x):
self.has_start_index_name_ = 1
self.start_index_name_ = x
def clear_start_index_name(self):
if self.has_start_index_name_:
self.has_start_index_name_ = 0
self.start_index_name_ = ""
def has_start_index_name(self): return self.has_start_index_name_
def include_start_index(self): return self.include_start_index_
def set_include_start_index(self, x):
self.has_include_start_index_ = 1
self.include_start_index_ = x
def clear_include_start_index(self):
if self.has_include_start_index_:
self.has_include_start_index_ = 0
self.include_start_index_ = 1
def has_include_start_index(self): return self.has_include_start_index_