3 # Copyright 2007 Google Inc.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
20 from google
.net
.proto
import ProtocolBuffer
22 import dummy_thread
as thread
24 __pychecker__
= """maxreturns=0 maxbranches=0 no-callinit
25 unusednames=printElemNumber,debug_strs no-special"""
27 if hasattr(ProtocolBuffer
, 'ExtendableProtocolMessage'):
28 _extension_runtime
= True
29 _ExtendableProtocolMessage
= ProtocolBuffer
.ExtendableProtocolMessage
31 _extension_runtime
= False
32 _ExtendableProtocolMessage
= ProtocolBuffer
.ProtocolMessage
34 from google
.appengine
.datastore
.document_pb
import *
35 import google
.appengine
.datastore
.document_pb
36 class SearchServiceError(ProtocolBuffer
.ProtocolMessage
):
45 CONCURRENT_TRANSACTION
= 6
52 4: "PERMISSION_DENIED",
54 6: "CONCURRENT_TRANSACTION",
57 def ErrorCode_Name(cls
, x
): return cls
._ErrorCode
_NAMES
.get(x
, "")
58 ErrorCode_Name
= classmethod(ErrorCode_Name
)
61 def __init__(self
, contents
=None):
63 if contents
is not None: self
.MergeFromString(contents
)
66 def MergeFrom(self
, x
):
70 if x
is self
: return 1
73 def IsInitialized(self
, debug_strs
=None):
81 def ByteSizePartial(self
):
88 def OutputUnchecked(self
, out
):
91 def OutputPartial(self
, out
):
94 def TryMerge(self
, d
):
99 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
103 def __str__(self
, prefix
="", printElemNumber
=0):
108 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
109 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
112 _TEXT
= _BuildTagLookupTable({
116 _TYPES
= _BuildTagLookupTable({
117 0: ProtocolBuffer
.Encoder
.NUMERIC
,
118 }, 0, ProtocolBuffer
.Encoder
.MAX_TYPE
)
122 _STYLE_CONTENT_TYPE
= """"""
123 _PROTO_DESCRIPTOR_NAME
= 'apphosting.SearchServiceError'
124 class RequestStatus(ProtocolBuffer
.ProtocolMessage
):
127 has_error_detail_
= 0
129 has_canonical_code_
= 0
132 def __init__(self
, contents
=None):
133 if contents
is not None: self
.MergeFromString(contents
)
135 def code(self
): return self
.code_
137 def set_code(self
, x
):
141 def clear_code(self
):
146 def has_code(self
): return self
.has_code_
148 def error_detail(self
): return self
.error_detail_
150 def set_error_detail(self
, x
):
151 self
.has_error_detail_
= 1
152 self
.error_detail_
= x
154 def clear_error_detail(self
):
155 if self
.has_error_detail_
:
156 self
.has_error_detail_
= 0
157 self
.error_detail_
= ""
159 def has_error_detail(self
): return self
.has_error_detail_
161 def canonical_code(self
): return self
.canonical_code_
163 def set_canonical_code(self
, x
):
164 self
.has_canonical_code_
= 1
165 self
.canonical_code_
= x
167 def clear_canonical_code(self
):
168 if self
.has_canonical_code_
:
169 self
.has_canonical_code_
= 0
170 self
.canonical_code_
= 0
172 def has_canonical_code(self
): return self
.has_canonical_code_
175 def MergeFrom(self
, x
):
177 if (x
.has_code()): self
.set_code(x
.code())
178 if (x
.has_error_detail()): self
.set_error_detail(x
.error_detail())
179 if (x
.has_canonical_code()): self
.set_canonical_code(x
.canonical_code())
182 if x
is self
: return 1
183 if self
.has_code_
!= x
.has_code_
: return 0
184 if self
.has_code_
and self
.code_
!= x
.code_
: return 0
185 if self
.has_error_detail_
!= x
.has_error_detail_
: return 0
186 if self
.has_error_detail_
and self
.error_detail_
!= x
.error_detail_
: return 0
187 if self
.has_canonical_code_
!= x
.has_canonical_code_
: return 0
188 if self
.has_canonical_code_
and self
.canonical_code_
!= x
.canonical_code_
: return 0
191 def IsInitialized(self
, debug_strs
=None):
193 if (not self
.has_code_
):
195 if debug_strs
is not None:
196 debug_strs
.append('Required field: code not set.')
201 n
+= self
.lengthVarInt64(self
.code_
)
202 if (self
.has_error_detail_
): n
+= 1 + self
.lengthString(len(self
.error_detail_
))
203 if (self
.has_canonical_code_
): n
+= 1 + self
.lengthVarInt64(self
.canonical_code_
)
206 def ByteSizePartial(self
):
210 n
+= self
.lengthVarInt64(self
.code_
)
211 if (self
.has_error_detail_
): n
+= 1 + self
.lengthString(len(self
.error_detail_
))
212 if (self
.has_canonical_code_
): n
+= 1 + self
.lengthVarInt64(self
.canonical_code_
)
217 self
.clear_error_detail()
218 self
.clear_canonical_code()
220 def OutputUnchecked(self
, out
):
222 out
.putVarInt32(self
.code_
)
223 if (self
.has_error_detail_
):
225 out
.putPrefixedString(self
.error_detail_
)
226 if (self
.has_canonical_code_
):
228 out
.putVarInt32(self
.canonical_code_
)
230 def OutputPartial(self
, out
):
233 out
.putVarInt32(self
.code_
)
234 if (self
.has_error_detail_
):
236 out
.putPrefixedString(self
.error_detail_
)
237 if (self
.has_canonical_code_
):
239 out
.putVarInt32(self
.canonical_code_
)
241 def TryMerge(self
, d
):
245 self
.set_code(d
.getVarInt32())
248 self
.set_error_detail(d
.getPrefixedString())
251 self
.set_canonical_code(d
.getVarInt32())
255 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
259 def __str__(self
, prefix
="", printElemNumber
=0):
261 if self
.has_code_
: res
+=prefix
+("code: %s\n" % self
.DebugFormatInt32(self
.code_
))
262 if self
.has_error_detail_
: res
+=prefix
+("error_detail: %s\n" % self
.DebugFormatString(self
.error_detail_
))
263 if self
.has_canonical_code_
: res
+=prefix
+("canonical_code: %s\n" % self
.DebugFormatInt32(self
.canonical_code_
))
267 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
268 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
274 _TEXT
= _BuildTagLookupTable({
281 _TYPES
= _BuildTagLookupTable({
282 0: ProtocolBuffer
.Encoder
.NUMERIC
,
283 1: ProtocolBuffer
.Encoder
.NUMERIC
,
284 2: ProtocolBuffer
.Encoder
.STRING
,
285 3: ProtocolBuffer
.Encoder
.NUMERIC
,
286 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
290 _STYLE_CONTENT_TYPE
= """"""
291 _PROTO_DESCRIPTOR_NAME
= 'apphosting.RequestStatus'
292 class IndexSpec(ProtocolBuffer
.ProtocolMessage
):
298 _Consistency_NAMES
= {
303 def Consistency_Name(cls
, x
): return cls
._Consistency
_NAMES
.get(x
, "")
304 Consistency_Name
= classmethod(Consistency_Name
)
318 def Source_Name(cls
, x
): return cls
._Source
_NAMES
.get(x
, "")
319 Source_Name
= classmethod(Source_Name
)
331 def Mode_Name(cls
, x
): return cls
._Mode
_NAMES
.get(x
, "")
332 Mode_Name
= classmethod(Mode_Name
)
347 def __init__(self
, contents
=None):
348 if contents
is not None: self
.MergeFromString(contents
)
350 def name(self
): return self
.name_
352 def set_name(self
, x
):
356 def clear_name(self
):
361 def has_name(self
): return self
.has_name_
363 def consistency(self
): return self
.consistency_
365 def set_consistency(self
, x
):
366 self
.has_consistency_
= 1
367 self
.consistency_
= x
369 def clear_consistency(self
):
370 if self
.has_consistency_
:
371 self
.has_consistency_
= 0
372 self
.consistency_
= 1
374 def has_consistency(self
): return self
.has_consistency_
376 def namespace(self
): return self
.namespace_
378 def set_namespace(self
, x
):
379 self
.has_namespace_
= 1
382 def clear_namespace(self
):
383 if self
.has_namespace_
:
384 self
.has_namespace_
= 0
387 def has_namespace(self
): return self
.has_namespace_
389 def version(self
): return self
.version_
391 def set_version(self
, x
):
392 self
.has_version_
= 1
395 def clear_version(self
):
396 if self
.has_version_
:
397 self
.has_version_
= 0
400 def has_version(self
): return self
.has_version_
402 def source(self
): return self
.source_
404 def set_source(self
, x
):
408 def clear_source(self
):
413 def has_source(self
): return self
.has_source_
415 def mode(self
): return self
.mode_
417 def set_mode(self
, x
):
421 def clear_mode(self
):
426 def has_mode(self
): return self
.has_mode_
429 def MergeFrom(self
, x
):
431 if (x
.has_name()): self
.set_name(x
.name())
432 if (x
.has_consistency()): self
.set_consistency(x
.consistency())
433 if (x
.has_namespace()): self
.set_namespace(x
.namespace())
434 if (x
.has_version()): self
.set_version(x
.version())
435 if (x
.has_source()): self
.set_source(x
.source())
436 if (x
.has_mode()): self
.set_mode(x
.mode())
439 if x
is self
: return 1
440 if self
.has_name_
!= x
.has_name_
: return 0
441 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
442 if self
.has_consistency_
!= x
.has_consistency_
: return 0
443 if self
.has_consistency_
and self
.consistency_
!= x
.consistency_
: return 0
444 if self
.has_namespace_
!= x
.has_namespace_
: return 0
445 if self
.has_namespace_
and self
.namespace_
!= x
.namespace_
: return 0
446 if self
.has_version_
!= x
.has_version_
: return 0
447 if self
.has_version_
and self
.version_
!= x
.version_
: return 0
448 if self
.has_source_
!= x
.has_source_
: return 0
449 if self
.has_source_
and self
.source_
!= x
.source_
: return 0
450 if self
.has_mode_
!= x
.has_mode_
: return 0
451 if self
.has_mode_
and self
.mode_
!= x
.mode_
: return 0
454 def IsInitialized(self
, debug_strs
=None):
456 if (not self
.has_name_
):
458 if debug_strs
is not None:
459 debug_strs
.append('Required field: name not set.')
464 n
+= self
.lengthString(len(self
.name_
))
465 if (self
.has_consistency_
): n
+= 1 + self
.lengthVarInt64(self
.consistency_
)
466 if (self
.has_namespace_
): n
+= 1 + self
.lengthString(len(self
.namespace_
))
467 if (self
.has_version_
): n
+= 1 + self
.lengthVarInt64(self
.version_
)
468 if (self
.has_source_
): n
+= 1 + self
.lengthVarInt64(self
.source_
)
469 if (self
.has_mode_
): n
+= 1 + self
.lengthVarInt64(self
.mode_
)
472 def ByteSizePartial(self
):
476 n
+= self
.lengthString(len(self
.name_
))
477 if (self
.has_consistency_
): n
+= 1 + self
.lengthVarInt64(self
.consistency_
)
478 if (self
.has_namespace_
): n
+= 1 + self
.lengthString(len(self
.namespace_
))
479 if (self
.has_version_
): n
+= 1 + self
.lengthVarInt64(self
.version_
)
480 if (self
.has_source_
): n
+= 1 + self
.lengthVarInt64(self
.source_
)
481 if (self
.has_mode_
): n
+= 1 + self
.lengthVarInt64(self
.mode_
)
486 self
.clear_consistency()
487 self
.clear_namespace()
492 def OutputUnchecked(self
, out
):
494 out
.putPrefixedString(self
.name_
)
495 if (self
.has_consistency_
):
497 out
.putVarInt32(self
.consistency_
)
498 if (self
.has_namespace_
):
500 out
.putPrefixedString(self
.namespace_
)
501 if (self
.has_version_
):
503 out
.putVarInt32(self
.version_
)
504 if (self
.has_source_
):
506 out
.putVarInt32(self
.source_
)
509 out
.putVarInt32(self
.mode_
)
511 def OutputPartial(self
, out
):
514 out
.putPrefixedString(self
.name_
)
515 if (self
.has_consistency_
):
517 out
.putVarInt32(self
.consistency_
)
518 if (self
.has_namespace_
):
520 out
.putPrefixedString(self
.namespace_
)
521 if (self
.has_version_
):
523 out
.putVarInt32(self
.version_
)
524 if (self
.has_source_
):
526 out
.putVarInt32(self
.source_
)
529 out
.putVarInt32(self
.mode_
)
531 def TryMerge(self
, d
):
535 self
.set_name(d
.getPrefixedString())
538 self
.set_consistency(d
.getVarInt32())
541 self
.set_namespace(d
.getPrefixedString())
544 self
.set_version(d
.getVarInt32())
547 self
.set_source(d
.getVarInt32())
550 self
.set_mode(d
.getVarInt32())
554 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
558 def __str__(self
, prefix
="", printElemNumber
=0):
560 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
561 if self
.has_consistency_
: res
+=prefix
+("consistency: %s\n" % self
.DebugFormatInt32(self
.consistency_
))
562 if self
.has_namespace_
: res
+=prefix
+("namespace: %s\n" % self
.DebugFormatString(self
.namespace_
))
563 if self
.has_version_
: res
+=prefix
+("version: %s\n" % self
.DebugFormatInt32(self
.version_
))
564 if self
.has_source_
: res
+=prefix
+("source: %s\n" % self
.DebugFormatInt32(self
.source_
))
565 if self
.has_mode_
: res
+=prefix
+("mode: %s\n" % self
.DebugFormatInt32(self
.mode_
))
569 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
570 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
579 _TEXT
= _BuildTagLookupTable({
589 _TYPES
= _BuildTagLookupTable({
590 0: ProtocolBuffer
.Encoder
.NUMERIC
,
591 1: ProtocolBuffer
.Encoder
.STRING
,
592 2: ProtocolBuffer
.Encoder
.NUMERIC
,
593 3: ProtocolBuffer
.Encoder
.STRING
,
594 4: ProtocolBuffer
.Encoder
.NUMERIC
,
595 5: ProtocolBuffer
.Encoder
.NUMERIC
,
596 6: ProtocolBuffer
.Encoder
.NUMERIC
,
597 }, 6, ProtocolBuffer
.Encoder
.MAX_TYPE
)
601 _STYLE_CONTENT_TYPE
= """"""
602 _PROTO_DESCRIPTOR_NAME
= 'apphosting.IndexSpec'
603 class IndexMetadata_Storage(ProtocolBuffer
.ProtocolMessage
):
609 def __init__(self
, contents
=None):
610 if contents
is not None: self
.MergeFromString(contents
)
612 def amount_used(self
): return self
.amount_used_
614 def set_amount_used(self
, x
):
615 self
.has_amount_used_
= 1
616 self
.amount_used_
= x
618 def clear_amount_used(self
):
619 if self
.has_amount_used_
:
620 self
.has_amount_used_
= 0
621 self
.amount_used_
= 0
623 def has_amount_used(self
): return self
.has_amount_used_
625 def limit(self
): return self
.limit_
627 def set_limit(self
, x
):
631 def clear_limit(self
):
636 def has_limit(self
): return self
.has_limit_
639 def MergeFrom(self
, x
):
641 if (x
.has_amount_used()): self
.set_amount_used(x
.amount_used())
642 if (x
.has_limit()): self
.set_limit(x
.limit())
645 if x
is self
: return 1
646 if self
.has_amount_used_
!= x
.has_amount_used_
: return 0
647 if self
.has_amount_used_
and self
.amount_used_
!= x
.amount_used_
: return 0
648 if self
.has_limit_
!= x
.has_limit_
: return 0
649 if self
.has_limit_
and self
.limit_
!= x
.limit_
: return 0
652 def IsInitialized(self
, debug_strs
=None):
658 if (self
.has_amount_used_
): n
+= 1 + self
.lengthVarInt64(self
.amount_used_
)
659 if (self
.has_limit_
): n
+= 1 + self
.lengthVarInt64(self
.limit_
)
662 def ByteSizePartial(self
):
664 if (self
.has_amount_used_
): n
+= 1 + self
.lengthVarInt64(self
.amount_used_
)
665 if (self
.has_limit_
): n
+= 1 + self
.lengthVarInt64(self
.limit_
)
669 self
.clear_amount_used()
672 def OutputUnchecked(self
, out
):
673 if (self
.has_amount_used_
):
675 out
.putVarInt64(self
.amount_used_
)
676 if (self
.has_limit_
):
678 out
.putVarInt64(self
.limit_
)
680 def OutputPartial(self
, out
):
681 if (self
.has_amount_used_
):
683 out
.putVarInt64(self
.amount_used_
)
684 if (self
.has_limit_
):
686 out
.putVarInt64(self
.limit_
)
688 def TryMerge(self
, d
):
692 self
.set_amount_used(d
.getVarInt64())
695 self
.set_limit(d
.getVarInt64())
699 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
703 def __str__(self
, prefix
="", printElemNumber
=0):
705 if self
.has_amount_used_
: res
+=prefix
+("amount_used: %s\n" % self
.DebugFormatInt64(self
.amount_used_
))
706 if self
.has_limit_
: res
+=prefix
+("limit: %s\n" % self
.DebugFormatInt64(self
.limit_
))
710 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
711 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
716 _TEXT
= _BuildTagLookupTable({
722 _TYPES
= _BuildTagLookupTable({
723 0: ProtocolBuffer
.Encoder
.NUMERIC
,
724 1: ProtocolBuffer
.Encoder
.NUMERIC
,
725 2: ProtocolBuffer
.Encoder
.NUMERIC
,
726 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
730 _STYLE_CONTENT_TYPE
= """"""
731 _PROTO_DESCRIPTOR_NAME
= 'apphosting.IndexMetadata_Storage'
732 class IndexMetadata(ProtocolBuffer
.ProtocolMessage
):
737 def __init__(self
, contents
=None):
738 self
.index_spec_
= IndexSpec()
740 self
.lazy_init_lock_
= thread
.allocate_lock()
741 if contents
is not None: self
.MergeFromString(contents
)
743 def index_spec(self
): return self
.index_spec_
745 def mutable_index_spec(self
): self
.has_index_spec_
= 1; return self
.index_spec_
747 def clear_index_spec(self
):self
.has_index_spec_
= 0; self
.index_spec_
.Clear()
749 def has_index_spec(self
): return self
.has_index_spec_
751 def field_size(self
): return len(self
.field_
)
752 def field_list(self
): return self
.field_
755 return self
.field_
[i
]
757 def mutable_field(self
, i
):
758 return self
.field_
[i
]
762 self
.field_
.append(x
)
765 def clear_field(self
):
768 if self
.storage_
is None:
769 self
.lazy_init_lock_
.acquire()
771 if self
.storage_
is None: self
.storage_
= IndexMetadata_Storage()
773 self
.lazy_init_lock_
.release()
776 def mutable_storage(self
): self
.has_storage_
= 1; return self
.storage()
778 def clear_storage(self
):
780 if self
.has_storage_
:
781 self
.has_storage_
= 0;
782 if self
.storage_
is not None: self
.storage_
.Clear()
784 def has_storage(self
): return self
.has_storage_
787 def MergeFrom(self
, x
):
789 if (x
.has_index_spec()): self
.mutable_index_spec().MergeFrom(x
.index_spec())
790 for i
in xrange(x
.field_size()): self
.add_field().CopyFrom(x
.field(i
))
791 if (x
.has_storage()): self
.mutable_storage().MergeFrom(x
.storage())
794 if x
is self
: return 1
795 if self
.has_index_spec_
!= x
.has_index_spec_
: return 0
796 if self
.has_index_spec_
and self
.index_spec_
!= x
.index_spec_
: return 0
797 if len(self
.field_
) != len(x
.field_
): return 0
798 for e1
, e2
in zip(self
.field_
, x
.field_
):
799 if e1
!= e2
: return 0
800 if self
.has_storage_
!= x
.has_storage_
: return 0
801 if self
.has_storage_
and self
.storage_
!= x
.storage_
: return 0
804 def IsInitialized(self
, debug_strs
=None):
806 if (not self
.has_index_spec_
):
808 if debug_strs
is not None:
809 debug_strs
.append('Required field: index_spec not set.')
810 elif not self
.index_spec_
.IsInitialized(debug_strs
): initialized
= 0
811 for p
in self
.field_
:
812 if not p
.IsInitialized(debug_strs
): initialized
=0
813 if (self
.has_storage_
and not self
.storage_
.IsInitialized(debug_strs
)): initialized
= 0
818 n
+= self
.lengthString(self
.index_spec_
.ByteSize())
819 n
+= 1 * len(self
.field_
)
820 for i
in xrange(len(self
.field_
)): n
+= self
.lengthString(self
.field_
[i
].ByteSize())
821 if (self
.has_storage_
): n
+= 1 + self
.lengthString(self
.storage_
.ByteSize())
824 def ByteSizePartial(self
):
826 if (self
.has_index_spec_
):
828 n
+= self
.lengthString(self
.index_spec_
.ByteSizePartial())
829 n
+= 1 * len(self
.field_
)
830 for i
in xrange(len(self
.field_
)): n
+= self
.lengthString(self
.field_
[i
].ByteSizePartial())
831 if (self
.has_storage_
): n
+= 1 + self
.lengthString(self
.storage_
.ByteSizePartial())
835 self
.clear_index_spec()
839 def OutputUnchecked(self
, out
):
841 out
.putVarInt32(self
.index_spec_
.ByteSize())
842 self
.index_spec_
.OutputUnchecked(out
)
843 for i
in xrange(len(self
.field_
)):
845 out
.putVarInt32(self
.field_
[i
].ByteSize())
846 self
.field_
[i
].OutputUnchecked(out
)
847 if (self
.has_storage_
):
849 out
.putVarInt32(self
.storage_
.ByteSize())
850 self
.storage_
.OutputUnchecked(out
)
852 def OutputPartial(self
, out
):
853 if (self
.has_index_spec_
):
855 out
.putVarInt32(self
.index_spec_
.ByteSizePartial())
856 self
.index_spec_
.OutputPartial(out
)
857 for i
in xrange(len(self
.field_
)):
859 out
.putVarInt32(self
.field_
[i
].ByteSizePartial())
860 self
.field_
[i
].OutputPartial(out
)
861 if (self
.has_storage_
):
863 out
.putVarInt32(self
.storage_
.ByteSizePartial())
864 self
.storage_
.OutputPartial(out
)
866 def TryMerge(self
, d
):
870 length
= d
.getVarInt32()
871 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
873 self
.mutable_index_spec().TryMerge(tmp
)
876 length
= d
.getVarInt32()
877 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
879 self
.add_field().TryMerge(tmp
)
882 length
= d
.getVarInt32()
883 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
885 self
.mutable_storage().TryMerge(tmp
)
889 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
893 def __str__(self
, prefix
="", printElemNumber
=0):
895 if self
.has_index_spec_
:
896 res
+=prefix
+"index_spec <\n"
897 res
+=self
.index_spec_
.__str
__(prefix
+ " ", printElemNumber
)
900 for e
in self
.field_
:
902 if printElemNumber
: elm
="(%d)" % cnt
903 res
+=prefix
+("field%s <\n" % elm
)
904 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
907 if self
.has_storage_
:
908 res
+=prefix
+"storage <\n"
909 res
+=self
.storage_
.__str
__(prefix
+ " ", printElemNumber
)
914 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
915 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
921 _TEXT
= _BuildTagLookupTable({
928 _TYPES
= _BuildTagLookupTable({
929 0: ProtocolBuffer
.Encoder
.NUMERIC
,
930 1: ProtocolBuffer
.Encoder
.STRING
,
931 2: ProtocolBuffer
.Encoder
.STRING
,
932 3: ProtocolBuffer
.Encoder
.STRING
,
933 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
937 _STYLE_CONTENT_TYPE
= """"""
938 _PROTO_DESCRIPTOR_NAME
= 'apphosting.IndexMetadata'
939 class IndexDocumentParams(ProtocolBuffer
.ProtocolMessage
):
947 1: "WHEN_CONVENIENT",
950 def Freshness_Name(cls
, x
): return cls
._Freshness
_NAMES
.get(x
, "")
951 Freshness_Name
= classmethod(Freshness_Name
)
957 def __init__(self
, contents
=None):
959 self
.index_spec_
= IndexSpec()
960 if contents
is not None: self
.MergeFromString(contents
)
962 def document_size(self
): return len(self
.document_
)
963 def document_list(self
): return self
.document_
965 def document(self
, i
):
966 return self
.document_
[i
]
968 def mutable_document(self
, i
):
969 return self
.document_
[i
]
971 def add_document(self
):
973 self
.document_
.append(x
)
976 def clear_document(self
):
978 def freshness(self
): return self
.freshness_
980 def set_freshness(self
, x
):
981 self
.has_freshness_
= 1
984 def clear_freshness(self
):
985 if self
.has_freshness_
:
986 self
.has_freshness_
= 0
989 def has_freshness(self
): return self
.has_freshness_
991 def index_spec(self
): return self
.index_spec_
993 def mutable_index_spec(self
): self
.has_index_spec_
= 1; return self
.index_spec_
995 def clear_index_spec(self
):self
.has_index_spec_
= 0; self
.index_spec_
.Clear()
997 def has_index_spec(self
): return self
.has_index_spec_
1000 def MergeFrom(self
, x
):
1001 assert x
is not self
1002 for i
in xrange(x
.document_size()): self
.add_document().CopyFrom(x
.document(i
))
1003 if (x
.has_freshness()): self
.set_freshness(x
.freshness())
1004 if (x
.has_index_spec()): self
.mutable_index_spec().MergeFrom(x
.index_spec())
1006 def Equals(self
, x
):
1007 if x
is self
: return 1
1008 if len(self
.document_
) != len(x
.document_
): return 0
1009 for e1
, e2
in zip(self
.document_
, x
.document_
):
1010 if e1
!= e2
: return 0
1011 if self
.has_freshness_
!= x
.has_freshness_
: return 0
1012 if self
.has_freshness_
and self
.freshness_
!= x
.freshness_
: return 0
1013 if self
.has_index_spec_
!= x
.has_index_spec_
: return 0
1014 if self
.has_index_spec_
and self
.index_spec_
!= x
.index_spec_
: return 0
1017 def IsInitialized(self
, debug_strs
=None):
1019 for p
in self
.document_
:
1020 if not p
.IsInitialized(debug_strs
): initialized
=0
1021 if (not self
.has_index_spec_
):
1023 if debug_strs
is not None:
1024 debug_strs
.append('Required field: index_spec not set.')
1025 elif not self
.index_spec_
.IsInitialized(debug_strs
): initialized
= 0
1030 n
+= 1 * len(self
.document_
)
1031 for i
in xrange(len(self
.document_
)): n
+= self
.lengthString(self
.document_
[i
].ByteSize())
1032 if (self
.has_freshness_
): n
+= 1 + self
.lengthVarInt64(self
.freshness_
)
1033 n
+= self
.lengthString(self
.index_spec_
.ByteSize())
1036 def ByteSizePartial(self
):
1038 n
+= 1 * len(self
.document_
)
1039 for i
in xrange(len(self
.document_
)): n
+= self
.lengthString(self
.document_
[i
].ByteSizePartial())
1040 if (self
.has_freshness_
): n
+= 1 + self
.lengthVarInt64(self
.freshness_
)
1041 if (self
.has_index_spec_
):
1043 n
+= self
.lengthString(self
.index_spec_
.ByteSizePartial())
1047 self
.clear_document()
1048 self
.clear_freshness()
1049 self
.clear_index_spec()
1051 def OutputUnchecked(self
, out
):
1052 for i
in xrange(len(self
.document_
)):
1054 out
.putVarInt32(self
.document_
[i
].ByteSize())
1055 self
.document_
[i
].OutputUnchecked(out
)
1056 if (self
.has_freshness_
):
1058 out
.putVarInt32(self
.freshness_
)
1060 out
.putVarInt32(self
.index_spec_
.ByteSize())
1061 self
.index_spec_
.OutputUnchecked(out
)
1063 def OutputPartial(self
, out
):
1064 for i
in xrange(len(self
.document_
)):
1066 out
.putVarInt32(self
.document_
[i
].ByteSizePartial())
1067 self
.document_
[i
].OutputPartial(out
)
1068 if (self
.has_freshness_
):
1070 out
.putVarInt32(self
.freshness_
)
1071 if (self
.has_index_spec_
):
1073 out
.putVarInt32(self
.index_spec_
.ByteSizePartial())
1074 self
.index_spec_
.OutputPartial(out
)
1076 def TryMerge(self
, d
):
1077 while d
.avail() > 0:
1078 tt
= d
.getVarInt32()
1080 length
= d
.getVarInt32()
1081 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1083 self
.add_document().TryMerge(tmp
)
1086 self
.set_freshness(d
.getVarInt32())
1089 length
= d
.getVarInt32()
1090 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1092 self
.mutable_index_spec().TryMerge(tmp
)
1096 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1100 def __str__(self
, prefix
="", printElemNumber
=0):
1103 for e
in self
.document_
:
1105 if printElemNumber
: elm
="(%d)" % cnt
1106 res
+=prefix
+("document%s <\n" % elm
)
1107 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
1110 if self
.has_freshness_
: res
+=prefix
+("freshness: %s\n" % self
.DebugFormatInt32(self
.freshness_
))
1111 if self
.has_index_spec_
:
1112 res
+=prefix
+"index_spec <\n"
1113 res
+=self
.index_spec_
.__str
__(prefix
+ " ", printElemNumber
)
1118 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1119 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1125 _TEXT
= _BuildTagLookupTable({
1132 _TYPES
= _BuildTagLookupTable({
1133 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1134 1: ProtocolBuffer
.Encoder
.STRING
,
1135 2: ProtocolBuffer
.Encoder
.NUMERIC
,
1136 3: ProtocolBuffer
.Encoder
.STRING
,
1137 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1141 _STYLE_CONTENT_TYPE
= """"""
1142 _PROTO_DESCRIPTOR_NAME
= 'apphosting.IndexDocumentParams'
1143 class IndexDocumentRequest(ProtocolBuffer
.ProtocolMessage
):
1148 def __init__(self
, contents
=None):
1149 self
.params_
= IndexDocumentParams()
1150 if contents
is not None: self
.MergeFromString(contents
)
1152 def params(self
): return self
.params_
1154 def mutable_params(self
): self
.has_params_
= 1; return self
.params_
1156 def clear_params(self
):self
.has_params_
= 0; self
.params_
.Clear()
1158 def has_params(self
): return self
.has_params_
1160 def app_id(self
): return self
.app_id_
1162 def set_app_id(self
, x
):
1163 self
.has_app_id_
= 1
1166 def clear_app_id(self
):
1167 if self
.has_app_id_
:
1168 self
.has_app_id_
= 0
1171 def has_app_id(self
): return self
.has_app_id_
1174 def MergeFrom(self
, x
):
1175 assert x
is not self
1176 if (x
.has_params()): self
.mutable_params().MergeFrom(x
.params())
1177 if (x
.has_app_id()): self
.set_app_id(x
.app_id())
1179 def Equals(self
, x
):
1180 if x
is self
: return 1
1181 if self
.has_params_
!= x
.has_params_
: return 0
1182 if self
.has_params_
and self
.params_
!= x
.params_
: return 0
1183 if self
.has_app_id_
!= x
.has_app_id_
: return 0
1184 if self
.has_app_id_
and self
.app_id_
!= x
.app_id_
: return 0
1187 def IsInitialized(self
, debug_strs
=None):
1189 if (not self
.has_params_
):
1191 if debug_strs
is not None:
1192 debug_strs
.append('Required field: params not set.')
1193 elif not self
.params_
.IsInitialized(debug_strs
): initialized
= 0
1198 n
+= self
.lengthString(self
.params_
.ByteSize())
1199 if (self
.has_app_id_
): n
+= 1 + self
.lengthString(len(self
.app_id_
))
1202 def ByteSizePartial(self
):
1204 if (self
.has_params_
):
1206 n
+= self
.lengthString(self
.params_
.ByteSizePartial())
1207 if (self
.has_app_id_
): n
+= 1 + self
.lengthString(len(self
.app_id_
))
1214 def OutputUnchecked(self
, out
):
1216 out
.putVarInt32(self
.params_
.ByteSize())
1217 self
.params_
.OutputUnchecked(out
)
1218 if (self
.has_app_id_
):
1220 out
.putPrefixedString(self
.app_id_
)
1222 def OutputPartial(self
, out
):
1223 if (self
.has_params_
):
1225 out
.putVarInt32(self
.params_
.ByteSizePartial())
1226 self
.params_
.OutputPartial(out
)
1227 if (self
.has_app_id_
):
1229 out
.putPrefixedString(self
.app_id_
)
1231 def TryMerge(self
, d
):
1232 while d
.avail() > 0:
1233 tt
= d
.getVarInt32()
1235 length
= d
.getVarInt32()
1236 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1238 self
.mutable_params().TryMerge(tmp
)
1241 self
.set_app_id(d
.getPrefixedString())
1245 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1249 def __str__(self
, prefix
="", printElemNumber
=0):
1251 if self
.has_params_
:
1252 res
+=prefix
+"params <\n"
1253 res
+=self
.params_
.__str
__(prefix
+ " ", printElemNumber
)
1255 if self
.has_app_id_
: res
+=prefix
+("app_id: %s\n" % self
.DebugFormatString(self
.app_id_
))
1259 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1260 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1265 _TEXT
= _BuildTagLookupTable({
1271 _TYPES
= _BuildTagLookupTable({
1272 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1273 1: ProtocolBuffer
.Encoder
.STRING
,
1274 3: ProtocolBuffer
.Encoder
.STRING
,
1275 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1279 _STYLE_CONTENT_TYPE
= """"""
1280 _PROTO_DESCRIPTOR_NAME
= 'apphosting.IndexDocumentRequest'
1281 class IndexDocumentResponse(ProtocolBuffer
.ProtocolMessage
):
1283 def __init__(self
, contents
=None):
1286 if contents
is not None: self
.MergeFromString(contents
)
1288 def status_size(self
): return len(self
.status_
)
1289 def status_list(self
): return self
.status_
1291 def status(self
, i
):
1292 return self
.status_
[i
]
1294 def mutable_status(self
, i
):
1295 return self
.status_
[i
]
1297 def add_status(self
):
1299 self
.status_
.append(x
)
1302 def clear_status(self
):
1304 def doc_id_size(self
): return len(self
.doc_id_
)
1305 def doc_id_list(self
): return self
.doc_id_
1307 def doc_id(self
, i
):
1308 return self
.doc_id_
[i
]
1310 def set_doc_id(self
, i
, x
):
1313 def add_doc_id(self
, x
):
1314 self
.doc_id_
.append(x
)
1316 def clear_doc_id(self
):
1320 def MergeFrom(self
, x
):
1321 assert x
is not self
1322 for i
in xrange(x
.status_size()): self
.add_status().CopyFrom(x
.status(i
))
1323 for i
in xrange(x
.doc_id_size()): self
.add_doc_id(x
.doc_id(i
))
1325 def Equals(self
, x
):
1326 if x
is self
: return 1
1327 if len(self
.status_
) != len(x
.status_
): return 0
1328 for e1
, e2
in zip(self
.status_
, x
.status_
):
1329 if e1
!= e2
: return 0
1330 if len(self
.doc_id_
) != len(x
.doc_id_
): return 0
1331 for e1
, e2
in zip(self
.doc_id_
, x
.doc_id_
):
1332 if e1
!= e2
: return 0
1335 def IsInitialized(self
, debug_strs
=None):
1337 for p
in self
.status_
:
1338 if not p
.IsInitialized(debug_strs
): initialized
=0
1343 n
+= 1 * len(self
.status_
)
1344 for i
in xrange(len(self
.status_
)): n
+= self
.lengthString(self
.status_
[i
].ByteSize())
1345 n
+= 1 * len(self
.doc_id_
)
1346 for i
in xrange(len(self
.doc_id_
)): n
+= self
.lengthString(len(self
.doc_id_
[i
]))
1349 def ByteSizePartial(self
):
1351 n
+= 1 * len(self
.status_
)
1352 for i
in xrange(len(self
.status_
)): n
+= self
.lengthString(self
.status_
[i
].ByteSizePartial())
1353 n
+= 1 * len(self
.doc_id_
)
1354 for i
in xrange(len(self
.doc_id_
)): n
+= self
.lengthString(len(self
.doc_id_
[i
]))
1361 def OutputUnchecked(self
, out
):
1362 for i
in xrange(len(self
.status_
)):
1364 out
.putVarInt32(self
.status_
[i
].ByteSize())
1365 self
.status_
[i
].OutputUnchecked(out
)
1366 for i
in xrange(len(self
.doc_id_
)):
1368 out
.putPrefixedString(self
.doc_id_
[i
])
1370 def OutputPartial(self
, out
):
1371 for i
in xrange(len(self
.status_
)):
1373 out
.putVarInt32(self
.status_
[i
].ByteSizePartial())
1374 self
.status_
[i
].OutputPartial(out
)
1375 for i
in xrange(len(self
.doc_id_
)):
1377 out
.putPrefixedString(self
.doc_id_
[i
])
1379 def TryMerge(self
, d
):
1380 while d
.avail() > 0:
1381 tt
= d
.getVarInt32()
1383 length
= d
.getVarInt32()
1384 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1386 self
.add_status().TryMerge(tmp
)
1389 self
.add_doc_id(d
.getPrefixedString())
1393 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1397 def __str__(self
, prefix
="", printElemNumber
=0):
1400 for e
in self
.status_
:
1402 if printElemNumber
: elm
="(%d)" % cnt
1403 res
+=prefix
+("status%s <\n" % elm
)
1404 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
1408 for e
in self
.doc_id_
:
1410 if printElemNumber
: elm
="(%d)" % cnt
1411 res
+=prefix
+("doc_id%s: %s\n" % (elm
, self
.DebugFormatString(e
)))
1416 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1417 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1422 _TEXT
= _BuildTagLookupTable({
1428 _TYPES
= _BuildTagLookupTable({
1429 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1430 1: ProtocolBuffer
.Encoder
.STRING
,
1431 2: ProtocolBuffer
.Encoder
.STRING
,
1432 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1436 _STYLE_CONTENT_TYPE
= """"""
1437 _PROTO_DESCRIPTOR_NAME
= 'apphosting.IndexDocumentResponse'
1438 class DeleteDocumentParams(ProtocolBuffer
.ProtocolMessage
):
1441 def __init__(self
, contents
=None):
1443 self
.index_spec_
= IndexSpec()
1444 if contents
is not None: self
.MergeFromString(contents
)
1446 def doc_id_size(self
): return len(self
.doc_id_
)
1447 def doc_id_list(self
): return self
.doc_id_
1449 def doc_id(self
, i
):
1450 return self
.doc_id_
[i
]
1452 def set_doc_id(self
, i
, x
):
1455 def add_doc_id(self
, x
):
1456 self
.doc_id_
.append(x
)
1458 def clear_doc_id(self
):
1461 def index_spec(self
): return self
.index_spec_
1463 def mutable_index_spec(self
): self
.has_index_spec_
= 1; return self
.index_spec_
1465 def clear_index_spec(self
):self
.has_index_spec_
= 0; self
.index_spec_
.Clear()
1467 def has_index_spec(self
): return self
.has_index_spec_
1470 def MergeFrom(self
, x
):
1471 assert x
is not self
1472 for i
in xrange(x
.doc_id_size()): self
.add_doc_id(x
.doc_id(i
))
1473 if (x
.has_index_spec()): self
.mutable_index_spec().MergeFrom(x
.index_spec())
1475 def Equals(self
, x
):
1476 if x
is self
: return 1
1477 if len(self
.doc_id_
) != len(x
.doc_id_
): return 0
1478 for e1
, e2
in zip(self
.doc_id_
, x
.doc_id_
):
1479 if e1
!= e2
: return 0
1480 if self
.has_index_spec_
!= x
.has_index_spec_
: return 0
1481 if self
.has_index_spec_
and self
.index_spec_
!= x
.index_spec_
: return 0
1484 def IsInitialized(self
, debug_strs
=None):
1486 if (not self
.has_index_spec_
):
1488 if debug_strs
is not None:
1489 debug_strs
.append('Required field: index_spec not set.')
1490 elif not self
.index_spec_
.IsInitialized(debug_strs
): initialized
= 0
1495 n
+= 1 * len(self
.doc_id_
)
1496 for i
in xrange(len(self
.doc_id_
)): n
+= self
.lengthString(len(self
.doc_id_
[i
]))
1497 n
+= self
.lengthString(self
.index_spec_
.ByteSize())
1500 def ByteSizePartial(self
):
1502 n
+= 1 * len(self
.doc_id_
)
1503 for i
in xrange(len(self
.doc_id_
)): n
+= self
.lengthString(len(self
.doc_id_
[i
]))
1504 if (self
.has_index_spec_
):
1506 n
+= self
.lengthString(self
.index_spec_
.ByteSizePartial())
1511 self
.clear_index_spec()
1513 def OutputUnchecked(self
, out
):
1514 for i
in xrange(len(self
.doc_id_
)):
1516 out
.putPrefixedString(self
.doc_id_
[i
])
1518 out
.putVarInt32(self
.index_spec_
.ByteSize())
1519 self
.index_spec_
.OutputUnchecked(out
)
1521 def OutputPartial(self
, out
):
1522 for i
in xrange(len(self
.doc_id_
)):
1524 out
.putPrefixedString(self
.doc_id_
[i
])
1525 if (self
.has_index_spec_
):
1527 out
.putVarInt32(self
.index_spec_
.ByteSizePartial())
1528 self
.index_spec_
.OutputPartial(out
)
1530 def TryMerge(self
, d
):
1531 while d
.avail() > 0:
1532 tt
= d
.getVarInt32()
1534 self
.add_doc_id(d
.getPrefixedString())
1537 length
= d
.getVarInt32()
1538 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1540 self
.mutable_index_spec().TryMerge(tmp
)
1544 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1548 def __str__(self
, prefix
="", printElemNumber
=0):
1551 for e
in self
.doc_id_
:
1553 if printElemNumber
: elm
="(%d)" % cnt
1554 res
+=prefix
+("doc_id%s: %s\n" % (elm
, self
.DebugFormatString(e
)))
1556 if self
.has_index_spec_
:
1557 res
+=prefix
+"index_spec <\n"
1558 res
+=self
.index_spec_
.__str
__(prefix
+ " ", printElemNumber
)
1563 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1564 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1569 _TEXT
= _BuildTagLookupTable({
1575 _TYPES
= _BuildTagLookupTable({
1576 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1577 1: ProtocolBuffer
.Encoder
.STRING
,
1578 2: ProtocolBuffer
.Encoder
.STRING
,
1579 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1583 _STYLE_CONTENT_TYPE
= """"""
1584 _PROTO_DESCRIPTOR_NAME
= 'apphosting.DeleteDocumentParams'
1585 class DeleteDocumentRequest(ProtocolBuffer
.ProtocolMessage
):
1590 def __init__(self
, contents
=None):
1591 self
.params_
= DeleteDocumentParams()
1592 if contents
is not None: self
.MergeFromString(contents
)
1594 def params(self
): return self
.params_
1596 def mutable_params(self
): self
.has_params_
= 1; return self
.params_
1598 def clear_params(self
):self
.has_params_
= 0; self
.params_
.Clear()
1600 def has_params(self
): return self
.has_params_
1602 def app_id(self
): return self
.app_id_
1604 def set_app_id(self
, x
):
1605 self
.has_app_id_
= 1
1608 def clear_app_id(self
):
1609 if self
.has_app_id_
:
1610 self
.has_app_id_
= 0
1613 def has_app_id(self
): return self
.has_app_id_
1616 def MergeFrom(self
, x
):
1617 assert x
is not self
1618 if (x
.has_params()): self
.mutable_params().MergeFrom(x
.params())
1619 if (x
.has_app_id()): self
.set_app_id(x
.app_id())
1621 def Equals(self
, x
):
1622 if x
is self
: return 1
1623 if self
.has_params_
!= x
.has_params_
: return 0
1624 if self
.has_params_
and self
.params_
!= x
.params_
: return 0
1625 if self
.has_app_id_
!= x
.has_app_id_
: return 0
1626 if self
.has_app_id_
and self
.app_id_
!= x
.app_id_
: return 0
1629 def IsInitialized(self
, debug_strs
=None):
1631 if (not self
.has_params_
):
1633 if debug_strs
is not None:
1634 debug_strs
.append('Required field: params not set.')
1635 elif not self
.params_
.IsInitialized(debug_strs
): initialized
= 0
1640 n
+= self
.lengthString(self
.params_
.ByteSize())
1641 if (self
.has_app_id_
): n
+= 1 + self
.lengthString(len(self
.app_id_
))
1644 def ByteSizePartial(self
):
1646 if (self
.has_params_
):
1648 n
+= self
.lengthString(self
.params_
.ByteSizePartial())
1649 if (self
.has_app_id_
): n
+= 1 + self
.lengthString(len(self
.app_id_
))
1656 def OutputUnchecked(self
, out
):
1658 out
.putVarInt32(self
.params_
.ByteSize())
1659 self
.params_
.OutputUnchecked(out
)
1660 if (self
.has_app_id_
):
1662 out
.putPrefixedString(self
.app_id_
)
1664 def OutputPartial(self
, out
):
1665 if (self
.has_params_
):
1667 out
.putVarInt32(self
.params_
.ByteSizePartial())
1668 self
.params_
.OutputPartial(out
)
1669 if (self
.has_app_id_
):
1671 out
.putPrefixedString(self
.app_id_
)
1673 def TryMerge(self
, d
):
1674 while d
.avail() > 0:
1675 tt
= d
.getVarInt32()
1677 length
= d
.getVarInt32()
1678 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1680 self
.mutable_params().TryMerge(tmp
)
1683 self
.set_app_id(d
.getPrefixedString())
1687 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1691 def __str__(self
, prefix
="", printElemNumber
=0):
1693 if self
.has_params_
:
1694 res
+=prefix
+"params <\n"
1695 res
+=self
.params_
.__str
__(prefix
+ " ", printElemNumber
)
1697 if self
.has_app_id_
: res
+=prefix
+("app_id: %s\n" % self
.DebugFormatString(self
.app_id_
))
1701 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1702 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1707 _TEXT
= _BuildTagLookupTable({
1713 _TYPES
= _BuildTagLookupTable({
1714 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1715 1: ProtocolBuffer
.Encoder
.STRING
,
1716 3: ProtocolBuffer
.Encoder
.STRING
,
1717 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1721 _STYLE_CONTENT_TYPE
= """"""
1722 _PROTO_DESCRIPTOR_NAME
= 'apphosting.DeleteDocumentRequest'
1723 class DeleteDocumentResponse(ProtocolBuffer
.ProtocolMessage
):
1725 def __init__(self
, contents
=None):
1727 if contents
is not None: self
.MergeFromString(contents
)
1729 def status_size(self
): return len(self
.status_
)
1730 def status_list(self
): return self
.status_
1732 def status(self
, i
):
1733 return self
.status_
[i
]
1735 def mutable_status(self
, i
):
1736 return self
.status_
[i
]
1738 def add_status(self
):
1740 self
.status_
.append(x
)
1743 def clear_status(self
):
1746 def MergeFrom(self
, x
):
1747 assert x
is not self
1748 for i
in xrange(x
.status_size()): self
.add_status().CopyFrom(x
.status(i
))
1750 def Equals(self
, x
):
1751 if x
is self
: return 1
1752 if len(self
.status_
) != len(x
.status_
): return 0
1753 for e1
, e2
in zip(self
.status_
, x
.status_
):
1754 if e1
!= e2
: return 0
1757 def IsInitialized(self
, debug_strs
=None):
1759 for p
in self
.status_
:
1760 if not p
.IsInitialized(debug_strs
): initialized
=0
1765 n
+= 1 * len(self
.status_
)
1766 for i
in xrange(len(self
.status_
)): n
+= self
.lengthString(self
.status_
[i
].ByteSize())
1769 def ByteSizePartial(self
):
1771 n
+= 1 * len(self
.status_
)
1772 for i
in xrange(len(self
.status_
)): n
+= self
.lengthString(self
.status_
[i
].ByteSizePartial())
1778 def OutputUnchecked(self
, out
):
1779 for i
in xrange(len(self
.status_
)):
1781 out
.putVarInt32(self
.status_
[i
].ByteSize())
1782 self
.status_
[i
].OutputUnchecked(out
)
1784 def OutputPartial(self
, out
):
1785 for i
in xrange(len(self
.status_
)):
1787 out
.putVarInt32(self
.status_
[i
].ByteSizePartial())
1788 self
.status_
[i
].OutputPartial(out
)
1790 def TryMerge(self
, d
):
1791 while d
.avail() > 0:
1792 tt
= d
.getVarInt32()
1794 length
= d
.getVarInt32()
1795 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1797 self
.add_status().TryMerge(tmp
)
1801 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1805 def __str__(self
, prefix
="", printElemNumber
=0):
1808 for e
in self
.status_
:
1810 if printElemNumber
: elm
="(%d)" % cnt
1811 res
+=prefix
+("status%s <\n" % elm
)
1812 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
1818 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1819 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1823 _TEXT
= _BuildTagLookupTable({
1828 _TYPES
= _BuildTagLookupTable({
1829 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1830 1: ProtocolBuffer
.Encoder
.STRING
,
1831 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1835 _STYLE_CONTENT_TYPE
= """"""
1836 _PROTO_DESCRIPTOR_NAME
= 'apphosting.DeleteDocumentResponse'
1837 class ListDocumentsParams(ProtocolBuffer
.ProtocolMessage
):
1839 has_start_doc_id_
= 0
1841 has_include_start_doc_
= 0
1842 include_start_doc_
= 1
1848 def __init__(self
, contents
=None):
1849 self
.index_spec_
= IndexSpec()
1850 if contents
is not None: self
.MergeFromString(contents
)
1852 def index_spec(self
): return self
.index_spec_
1854 def mutable_index_spec(self
): self
.has_index_spec_
= 1; return self
.index_spec_
1856 def clear_index_spec(self
):self
.has_index_spec_
= 0; self
.index_spec_
.Clear()
1858 def has_index_spec(self
): return self
.has_index_spec_
1860 def start_doc_id(self
): return self
.start_doc_id_
1862 def set_start_doc_id(self
, x
):
1863 self
.has_start_doc_id_
= 1
1864 self
.start_doc_id_
= x
1866 def clear_start_doc_id(self
):
1867 if self
.has_start_doc_id_
:
1868 self
.has_start_doc_id_
= 0
1869 self
.start_doc_id_
= ""
1871 def has_start_doc_id(self
): return self
.has_start_doc_id_
1873 def include_start_doc(self
): return self
.include_start_doc_
1875 def set_include_start_doc(self
, x
):
1876 self
.has_include_start_doc_
= 1
1877 self
.include_start_doc_
= x
1879 def clear_include_start_doc(self
):
1880 if self
.has_include_start_doc_
:
1881 self
.has_include_start_doc_
= 0
1882 self
.include_start_doc_
= 1
1884 def has_include_start_doc(self
): return self
.has_include_start_doc_
1886 def limit(self
): return self
.limit_
1888 def set_limit(self
, x
):
1892 def clear_limit(self
):
1897 def has_limit(self
): return self
.has_limit_
1899 def keys_only(self
): return self
.keys_only_
1901 def set_keys_only(self
, x
):
1902 self
.has_keys_only_
= 1
1905 def clear_keys_only(self
):
1906 if self
.has_keys_only_
:
1907 self
.has_keys_only_
= 0
1910 def has_keys_only(self
): return self
.has_keys_only_
1913 def MergeFrom(self
, x
):
1914 assert x
is not self
1915 if (x
.has_index_spec()): self
.mutable_index_spec().MergeFrom(x
.index_spec())
1916 if (x
.has_start_doc_id()): self
.set_start_doc_id(x
.start_doc_id())
1917 if (x
.has_include_start_doc()): self
.set_include_start_doc(x
.include_start_doc())
1918 if (x
.has_limit()): self
.set_limit(x
.limit())
1919 if (x
.has_keys_only()): self
.set_keys_only(x
.keys_only())
1921 def Equals(self
, x
):
1922 if x
is self
: return 1
1923 if self
.has_index_spec_
!= x
.has_index_spec_
: return 0
1924 if self
.has_index_spec_
and self
.index_spec_
!= x
.index_spec_
: return 0
1925 if self
.has_start_doc_id_
!= x
.has_start_doc_id_
: return 0
1926 if self
.has_start_doc_id_
and self
.start_doc_id_
!= x
.start_doc_id_
: return 0
1927 if self
.has_include_start_doc_
!= x
.has_include_start_doc_
: return 0
1928 if self
.has_include_start_doc_
and self
.include_start_doc_
!= x
.include_start_doc_
: return 0
1929 if self
.has_limit_
!= x
.has_limit_
: return 0
1930 if self
.has_limit_
and self
.limit_
!= x
.limit_
: return 0
1931 if self
.has_keys_only_
!= x
.has_keys_only_
: return 0
1932 if self
.has_keys_only_
and self
.keys_only_
!= x
.keys_only_
: return 0
1935 def IsInitialized(self
, debug_strs
=None):
1937 if (not self
.has_index_spec_
):
1939 if debug_strs
is not None:
1940 debug_strs
.append('Required field: index_spec not set.')
1941 elif not self
.index_spec_
.IsInitialized(debug_strs
): initialized
= 0
1946 n
+= self
.lengthString(self
.index_spec_
.ByteSize())
1947 if (self
.has_start_doc_id_
): n
+= 1 + self
.lengthString(len(self
.start_doc_id_
))
1948 if (self
.has_include_start_doc_
): n
+= 2
1949 if (self
.has_limit_
): n
+= 1 + self
.lengthVarInt64(self
.limit_
)
1950 if (self
.has_keys_only_
): n
+= 2
1953 def ByteSizePartial(self
):
1955 if (self
.has_index_spec_
):
1957 n
+= self
.lengthString(self
.index_spec_
.ByteSizePartial())
1958 if (self
.has_start_doc_id_
): n
+= 1 + self
.lengthString(len(self
.start_doc_id_
))
1959 if (self
.has_include_start_doc_
): n
+= 2
1960 if (self
.has_limit_
): n
+= 1 + self
.lengthVarInt64(self
.limit_
)
1961 if (self
.has_keys_only_
): n
+= 2
1965 self
.clear_index_spec()
1966 self
.clear_start_doc_id()
1967 self
.clear_include_start_doc()
1969 self
.clear_keys_only()
1971 def OutputUnchecked(self
, out
):
1973 out
.putVarInt32(self
.index_spec_
.ByteSize())
1974 self
.index_spec_
.OutputUnchecked(out
)
1975 if (self
.has_start_doc_id_
):
1977 out
.putPrefixedString(self
.start_doc_id_
)
1978 if (self
.has_include_start_doc_
):
1980 out
.putBoolean(self
.include_start_doc_
)
1981 if (self
.has_limit_
):
1983 out
.putVarInt32(self
.limit_
)
1984 if (self
.has_keys_only_
):
1986 out
.putBoolean(self
.keys_only_
)
1988 def OutputPartial(self
, out
):
1989 if (self
.has_index_spec_
):
1991 out
.putVarInt32(self
.index_spec_
.ByteSizePartial())
1992 self
.index_spec_
.OutputPartial(out
)
1993 if (self
.has_start_doc_id_
):
1995 out
.putPrefixedString(self
.start_doc_id_
)
1996 if (self
.has_include_start_doc_
):
1998 out
.putBoolean(self
.include_start_doc_
)
1999 if (self
.has_limit_
):
2001 out
.putVarInt32(self
.limit_
)
2002 if (self
.has_keys_only_
):
2004 out
.putBoolean(self
.keys_only_
)
2006 def TryMerge(self
, d
):
2007 while d
.avail() > 0:
2008 tt
= d
.getVarInt32()
2010 length
= d
.getVarInt32()
2011 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2013 self
.mutable_index_spec().TryMerge(tmp
)
2016 self
.set_start_doc_id(d
.getPrefixedString())
2019 self
.set_include_start_doc(d
.getBoolean())
2022 self
.set_limit(d
.getVarInt32())
2025 self
.set_keys_only(d
.getBoolean())
2029 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2033 def __str__(self
, prefix
="", printElemNumber
=0):
2035 if self
.has_index_spec_
:
2036 res
+=prefix
+"index_spec <\n"
2037 res
+=self
.index_spec_
.__str
__(prefix
+ " ", printElemNumber
)
2039 if self
.has_start_doc_id_
: res
+=prefix
+("start_doc_id: %s\n" % self
.DebugFormatString(self
.start_doc_id_
))
2040 if self
.has_include_start_doc_
: res
+=prefix
+("include_start_doc: %s\n" % self
.DebugFormatBool(self
.include_start_doc_
))
2041 if self
.has_limit_
: res
+=prefix
+("limit: %s\n" % self
.DebugFormatInt32(self
.limit_
))
2042 if self
.has_keys_only_
: res
+=prefix
+("keys_only: %s\n" % self
.DebugFormatBool(self
.keys_only_
))
2046 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2047 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2051 kinclude_start_doc
= 3
2055 _TEXT
= _BuildTagLookupTable({
2059 3: "include_start_doc",
2064 _TYPES
= _BuildTagLookupTable({
2065 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2066 1: ProtocolBuffer
.Encoder
.STRING
,
2067 2: ProtocolBuffer
.Encoder
.STRING
,
2068 3: ProtocolBuffer
.Encoder
.NUMERIC
,
2069 4: ProtocolBuffer
.Encoder
.NUMERIC
,
2070 5: ProtocolBuffer
.Encoder
.NUMERIC
,
2071 }, 5, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2075 _STYLE_CONTENT_TYPE
= """"""
2076 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ListDocumentsParams'
2077 class ListDocumentsRequest(ProtocolBuffer
.ProtocolMessage
):
2082 def __init__(self
, contents
=None):
2083 self
.params_
= ListDocumentsParams()
2084 if contents
is not None: self
.MergeFromString(contents
)
2086 def params(self
): return self
.params_
2088 def mutable_params(self
): self
.has_params_
= 1; return self
.params_
2090 def clear_params(self
):self
.has_params_
= 0; self
.params_
.Clear()
2092 def has_params(self
): return self
.has_params_
2094 def app_id(self
): return self
.app_id_
2096 def set_app_id(self
, x
):
2097 self
.has_app_id_
= 1
2100 def clear_app_id(self
):
2101 if self
.has_app_id_
:
2102 self
.has_app_id_
= 0
2105 def has_app_id(self
): return self
.has_app_id_
2108 def MergeFrom(self
, x
):
2109 assert x
is not self
2110 if (x
.has_params()): self
.mutable_params().MergeFrom(x
.params())
2111 if (x
.has_app_id()): self
.set_app_id(x
.app_id())
2113 def Equals(self
, x
):
2114 if x
is self
: return 1
2115 if self
.has_params_
!= x
.has_params_
: return 0
2116 if self
.has_params_
and self
.params_
!= x
.params_
: return 0
2117 if self
.has_app_id_
!= x
.has_app_id_
: return 0
2118 if self
.has_app_id_
and self
.app_id_
!= x
.app_id_
: return 0
2121 def IsInitialized(self
, debug_strs
=None):
2123 if (not self
.has_params_
):
2125 if debug_strs
is not None:
2126 debug_strs
.append('Required field: params not set.')
2127 elif not self
.params_
.IsInitialized(debug_strs
): initialized
= 0
2132 n
+= self
.lengthString(self
.params_
.ByteSize())
2133 if (self
.has_app_id_
): n
+= 1 + self
.lengthString(len(self
.app_id_
))
2136 def ByteSizePartial(self
):
2138 if (self
.has_params_
):
2140 n
+= self
.lengthString(self
.params_
.ByteSizePartial())
2141 if (self
.has_app_id_
): n
+= 1 + self
.lengthString(len(self
.app_id_
))
2148 def OutputUnchecked(self
, out
):
2150 out
.putVarInt32(self
.params_
.ByteSize())
2151 self
.params_
.OutputUnchecked(out
)
2152 if (self
.has_app_id_
):
2154 out
.putPrefixedString(self
.app_id_
)
2156 def OutputPartial(self
, out
):
2157 if (self
.has_params_
):
2159 out
.putVarInt32(self
.params_
.ByteSizePartial())
2160 self
.params_
.OutputPartial(out
)
2161 if (self
.has_app_id_
):
2163 out
.putPrefixedString(self
.app_id_
)
2165 def TryMerge(self
, d
):
2166 while d
.avail() > 0:
2167 tt
= d
.getVarInt32()
2169 length
= d
.getVarInt32()
2170 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2172 self
.mutable_params().TryMerge(tmp
)
2175 self
.set_app_id(d
.getPrefixedString())
2179 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2183 def __str__(self
, prefix
="", printElemNumber
=0):
2185 if self
.has_params_
:
2186 res
+=prefix
+"params <\n"
2187 res
+=self
.params_
.__str
__(prefix
+ " ", printElemNumber
)
2189 if self
.has_app_id_
: res
+=prefix
+("app_id: %s\n" % self
.DebugFormatString(self
.app_id_
))
2193 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2194 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2199 _TEXT
= _BuildTagLookupTable({
2205 _TYPES
= _BuildTagLookupTable({
2206 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2207 1: ProtocolBuffer
.Encoder
.STRING
,
2208 2: ProtocolBuffer
.Encoder
.STRING
,
2209 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2213 _STYLE_CONTENT_TYPE
= """"""
2214 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ListDocumentsRequest'
2215 class ListDocumentsResponse(ProtocolBuffer
.ProtocolMessage
):
2218 def __init__(self
, contents
=None):
2219 self
.status_
= RequestStatus()
2221 if contents
is not None: self
.MergeFromString(contents
)
2223 def status(self
): return self
.status_
2225 def mutable_status(self
): self
.has_status_
= 1; return self
.status_
2227 def clear_status(self
):self
.has_status_
= 0; self
.status_
.Clear()
2229 def has_status(self
): return self
.has_status_
2231 def document_size(self
): return len(self
.document_
)
2232 def document_list(self
): return self
.document_
2234 def document(self
, i
):
2235 return self
.document_
[i
]
2237 def mutable_document(self
, i
):
2238 return self
.document_
[i
]
2240 def add_document(self
):
2242 self
.document_
.append(x
)
2245 def clear_document(self
):
2248 def MergeFrom(self
, x
):
2249 assert x
is not self
2250 if (x
.has_status()): self
.mutable_status().MergeFrom(x
.status())
2251 for i
in xrange(x
.document_size()): self
.add_document().CopyFrom(x
.document(i
))
2253 def Equals(self
, x
):
2254 if x
is self
: return 1
2255 if self
.has_status_
!= x
.has_status_
: return 0
2256 if self
.has_status_
and self
.status_
!= x
.status_
: return 0
2257 if len(self
.document_
) != len(x
.document_
): return 0
2258 for e1
, e2
in zip(self
.document_
, x
.document_
):
2259 if e1
!= e2
: return 0
2262 def IsInitialized(self
, debug_strs
=None):
2264 if (not self
.has_status_
):
2266 if debug_strs
is not None:
2267 debug_strs
.append('Required field: status not set.')
2268 elif not self
.status_
.IsInitialized(debug_strs
): initialized
= 0
2269 for p
in self
.document_
:
2270 if not p
.IsInitialized(debug_strs
): initialized
=0
2275 n
+= self
.lengthString(self
.status_
.ByteSize())
2276 n
+= 1 * len(self
.document_
)
2277 for i
in xrange(len(self
.document_
)): n
+= self
.lengthString(self
.document_
[i
].ByteSize())
2280 def ByteSizePartial(self
):
2282 if (self
.has_status_
):
2284 n
+= self
.lengthString(self
.status_
.ByteSizePartial())
2285 n
+= 1 * len(self
.document_
)
2286 for i
in xrange(len(self
.document_
)): n
+= self
.lengthString(self
.document_
[i
].ByteSizePartial())
2291 self
.clear_document()
2293 def OutputUnchecked(self
, out
):
2295 out
.putVarInt32(self
.status_
.ByteSize())
2296 self
.status_
.OutputUnchecked(out
)
2297 for i
in xrange(len(self
.document_
)):
2299 out
.putVarInt32(self
.document_
[i
].ByteSize())
2300 self
.document_
[i
].OutputUnchecked(out
)
2302 def OutputPartial(self
, out
):
2303 if (self
.has_status_
):
2305 out
.putVarInt32(self
.status_
.ByteSizePartial())
2306 self
.status_
.OutputPartial(out
)
2307 for i
in xrange(len(self
.document_
)):
2309 out
.putVarInt32(self
.document_
[i
].ByteSizePartial())
2310 self
.document_
[i
].OutputPartial(out
)
2312 def TryMerge(self
, d
):
2313 while d
.avail() > 0:
2314 tt
= d
.getVarInt32()
2316 length
= d
.getVarInt32()
2317 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2319 self
.mutable_status().TryMerge(tmp
)
2322 length
= d
.getVarInt32()
2323 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2325 self
.add_document().TryMerge(tmp
)
2329 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2333 def __str__(self
, prefix
="", printElemNumber
=0):
2335 if self
.has_status_
:
2336 res
+=prefix
+"status <\n"
2337 res
+=self
.status_
.__str
__(prefix
+ " ", printElemNumber
)
2340 for e
in self
.document_
:
2342 if printElemNumber
: elm
="(%d)" % cnt
2343 res
+=prefix
+("document%s <\n" % elm
)
2344 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2350 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2351 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2356 _TEXT
= _BuildTagLookupTable({
2362 _TYPES
= _BuildTagLookupTable({
2363 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2364 1: ProtocolBuffer
.Encoder
.STRING
,
2365 2: ProtocolBuffer
.Encoder
.STRING
,
2366 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2370 _STYLE_CONTENT_TYPE
= """"""
2371 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ListDocumentsResponse'
2372 class ListIndexesParams(ProtocolBuffer
.ProtocolMessage
):
2373 has_fetch_schema_
= 0
2379 has_start_index_name_
= 0
2380 start_index_name_
= ""
2381 has_include_start_index_
= 0
2382 include_start_index_
= 1
2383 has_index_name_prefix_
= 0
2384 index_name_prefix_
= ""
2390 def __init__(self
, contents
=None):
2391 if contents
is not None: self
.MergeFromString(contents
)
2393 def fetch_schema(self
): return self
.fetch_schema_
2395 def set_fetch_schema(self
, x
):
2396 self
.has_fetch_schema_
= 1
2397 self
.fetch_schema_
= x
2399 def clear_fetch_schema(self
):
2400 if self
.has_fetch_schema_
:
2401 self
.has_fetch_schema_
= 0
2402 self
.fetch_schema_
= 0
2404 def has_fetch_schema(self
): return self
.has_fetch_schema_
2406 def limit(self
): return self
.limit_
2408 def set_limit(self
, x
):
2412 def clear_limit(self
):
2417 def has_limit(self
): return self
.has_limit_
2419 def namespace(self
): return self
.namespace_
2421 def set_namespace(self
, x
):
2422 self
.has_namespace_
= 1
2425 def clear_namespace(self
):
2426 if self
.has_namespace_
:
2427 self
.has_namespace_
= 0
2428 self
.namespace_
= ""
2430 def has_namespace(self
): return self
.has_namespace_
2432 def start_index_name(self
): return self
.start_index_name_
2434 def set_start_index_name(self
, x
):
2435 self
.has_start_index_name_
= 1
2436 self
.start_index_name_
= x
2438 def clear_start_index_name(self
):
2439 if self
.has_start_index_name_
:
2440 self
.has_start_index_name_
= 0
2441 self
.start_index_name_
= ""
2443 def has_start_index_name(self
): return self
.has_start_index_name_
2445 def include_start_index(self
): return self
.include_start_index_
2447 def set_include_start_index(self
, x
):
2448 self
.has_include_start_index_
= 1
2449 self
.include_start_index_
= x
2451 def clear_include_start_index(self
):
2452 if self
.has_include_start_index_
:
2453 self
.has_include_start_index_
= 0
2454 self
.include_start_index_
= 1
2456 def has_include_start_index(self
): return self
.has_include_start_index_
2458 def index_name_prefix(self
): return self
.index_name_prefix_
2460 def set_index_name_prefix(self
, x
):
2461 self
.has_index_name_prefix_
= 1
2462 self
.index_name_prefix_
= x
2464 def clear_index_name_prefix(self
):
2465 if self
.has_index_name_prefix_
:
2466 self
.has_index_name_prefix_
= 0
2467 self
.index_name_prefix_
= ""
2469 def has_index_name_prefix(self
): return self
.has_index_name_prefix_
2471 def offset(self
): return self
.offset_
2473 def set_offset(self
, x
):
2474 self
.has_offset_
= 1
2477 def clear_offset(self
):
2478 if self
.has_offset_
:
2479 self
.has_offset_
= 0
2482 def has_offset(self
): return self
.has_offset_
2484 def source(self
): return self
.source_
2486 def set_source(self
, x
):
2487 self
.has_source_
= 1
2490 def clear_source(self
):
2491 if self
.has_source_
:
2492 self
.has_source_
= 0
2495 def has_source(self
): return self
.has_source_
2498 def MergeFrom(self
, x
):
2499 assert x
is not self
2500 if (x
.has_fetch_schema()): self
.set_fetch_schema(x
.fetch_schema())
2501 if (x
.has_limit()): self
.set_limit(x
.limit())
2502 if (x
.has_namespace()): self
.set_namespace(x
.namespace())
2503 if (x
.has_start_index_name()): self
.set_start_index_name(x
.start_index_name())
2504 if (x
.has_include_start_index()): self
.set_include_start_index(x
.include_start_index())
2505 if (x
.has_index_name_prefix()): self
.set_index_name_prefix(x
.index_name_prefix())
2506 if (x
.has_offset()): self
.set_offset(x
.offset())
2507 if (x
.has_source()): self
.set_source(x
.source())
2509 def Equals(self
, x
):
2510 if x
is self
: return 1
2511 if self
.has_fetch_schema_
!= x
.has_fetch_schema_
: return 0
2512 if self
.has_fetch_schema_
and self
.fetch_schema_
!= x
.fetch_schema_
: return 0
2513 if self
.has_limit_
!= x
.has_limit_
: return 0
2514 if self
.has_limit_
and self
.limit_
!= x
.limit_
: return 0
2515 if self
.has_namespace_
!= x
.has_namespace_
: return 0
2516 if self
.has_namespace_
and self
.namespace_
!= x
.namespace_
: return 0
2517 if self
.has_start_index_name_
!= x
.has_start_index_name_
: return 0
2518 if self
.has_start_index_name_
and self
.start_index_name_
!= x
.start_index_name_
: return 0
2519 if self
.has_include_start_index_
!= x
.has_include_start_index_
: return 0
2520 if self
.has_include_start_index_
and self
.include_start_index_
!= x
.include_start_index_
: return 0
2521 if self
.has_index_name_prefix_
!= x
.has_index_name_prefix_
: return 0
2522 if self
.has_index_name_prefix_
and self
.index_name_prefix_
!= x
.index_name_prefix_
: return 0
2523 if self
.has_offset_
!= x
.has_offset_
: return 0
2524 if self
.has_offset_
and self
.offset_
!= x
.offset_
: return 0
2525 if self
.has_source_
!= x
.has_source_
: return 0
2526 if self
.has_source_
and self
.source_
!= x
.source_
: return 0
2529 def IsInitialized(self
, debug_strs
=None):
2535 if (self
.has_fetch_schema_
): n
+= 2
2536 if (self
.has_limit_
): n
+= 1 + self
.lengthVarInt64(self
.limit_
)
2537 if (self
.has_namespace_
): n
+= 1 + self
.lengthString(len(self
.namespace_
))
2538 if (self
.has_start_index_name_
): n
+= 1 + self
.lengthString(len(self
.start_index_name_
))
2539 if (self
.has_include_start_index_
): n
+= 2
2540 if (self
.has_index_name_prefix_
): n
+= 1 + self
.lengthString(len(self
.index_name_prefix_
))
2541 if (self
.has_offset_
): n
+= 1 + self
.lengthVarInt64(self
.offset_
)
2542 if (self
.has_source_
): n
+= 1 + self
.lengthVarInt64(self
.source_
)
2545 def ByteSizePartial(self
):
2547 if (self
.has_fetch_schema_
): n
+= 2
2548 if (self
.has_limit_
): n
+= 1 + self
.lengthVarInt64(self
.limit_
)
2549 if (self
.has_namespace_
): n
+= 1 + self
.lengthString(len(self
.namespace_
))
2550 if (self
.has_start_index_name_
): n
+= 1 + self
.lengthString(len(self
.start_index_name_
))
2551 if (self
.has_include_start_index_
): n
+= 2
2552 if (self
.has_index_name_prefix_
): n
+= 1 + self
.lengthString(len(self
.index_name_prefix_
))
2553 if (self
.has_offset_
): n
+= 1 + self
.lengthVarInt64(self
.offset_
)
2554 if (self
.has_source_
): n
+= 1 + self
.lengthVarInt64(self
.source_
)
2558 self
.clear_fetch_schema()
2560 self
.clear_namespace()
2561 self
.clear_start_index_name()
2562 self
.clear_include_start_index()
2563 self
.clear_index_name_prefix()
2567 def OutputUnchecked(self
, out
):
2568 if (self
.has_fetch_schema_
):
2570 out
.putBoolean(self
.fetch_schema_
)
2571 if (self
.has_limit_
):
2573 out
.putVarInt32(self
.limit_
)
2574 if (self
.has_namespace_
):
2576 out
.putPrefixedString(self
.namespace_
)
2577 if (self
.has_start_index_name_
):
2579 out
.putPrefixedString(self
.start_index_name_
)
2580 if (self
.has_include_start_index_
):
2582 out
.putBoolean(self
.include_start_index_
)
2583 if (self
.has_index_name_prefix_
):
2585 out
.putPrefixedString(self
.index_name_prefix_
)
2586 if (self
.has_offset_
):
2588 out
.putVarInt32(self
.offset_
)
2589 if (self
.has_source_
):
2591 out
.putVarInt32(self
.source_
)
2593 def OutputPartial(self
, out
):
2594 if (self
.has_fetch_schema_
):
2596 out
.putBoolean(self
.fetch_schema_
)
2597 if (self
.has_limit_
):
2599 out
.putVarInt32(self
.limit_
)
2600 if (self
.has_namespace_
):
2602 out
.putPrefixedString(self
.namespace_
)
2603 if (self
.has_start_index_name_
):
2605 out
.putPrefixedString(self
.start_index_name_
)
2606 if (self
.has_include_start_index_
):
2608 out
.putBoolean(self
.include_start_index_
)
2609 if (self
.has_index_name_prefix_
):
2611 out
.putPrefixedString(self
.index_name_prefix_
)
2612 if (self
.has_offset_
):
2614 out
.putVarInt32(self
.offset_
)
2615 if (self
.has_source_
):
2617 out
.putVarInt32(self
.source_
)
2619 def TryMerge(self
, d
):
2620 while d
.avail() > 0:
2621 tt
= d
.getVarInt32()
2623 self
.set_fetch_schema(d
.getBoolean())
2626 self
.set_limit(d
.getVarInt32())
2629 self
.set_namespace(d
.getPrefixedString())
2632 self
.set_start_index_name(d
.getPrefixedString())
2635 self
.set_include_start_index(d
.getBoolean())
2638 self
.set_index_name_prefix(d
.getPrefixedString())
2641 self
.set_offset(d
.getVarInt32())
2644 self
.set_source(d
.getVarInt32())
2648 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2652 def __str__(self
, prefix
="", printElemNumber
=0):
2654 if self
.has_fetch_schema_
: res
+=prefix
+("fetch_schema: %s\n" % self
.DebugFormatBool(self
.fetch_schema_
))
2655 if self
.has_limit_
: res
+=prefix
+("limit: %s\n" % self
.DebugFormatInt32(self
.limit_
))
2656 if self
.has_namespace_
: res
+=prefix
+("namespace: %s\n" % self
.DebugFormatString(self
.namespace_
))
2657 if self
.has_start_index_name_
: res
+=prefix
+("start_index_name: %s\n" % self
.DebugFormatString(self
.start_index_name_
))
2658 if self
.has_include_start_index_
: res
+=prefix
+("include_start_index: %s\n" % self
.DebugFormatBool(self
.include_start_index_
))
2659 if self
.has_index_name_prefix_
: res
+=prefix
+("index_name_prefix: %s\n" % self
.DebugFormatString(self
.index_name_prefix_
))
2660 if self
.has_offset_
: res
+=prefix
+("offset: %s\n" % self
.DebugFormatInt32(self
.offset_
))
2661 if self
.has_source_
: res
+=prefix
+("source: %s\n" % self
.DebugFormatInt32(self
.source_
))
2665 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2666 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2671 kstart_index_name
= 4
2672 kinclude_start_index
= 5
2673 kindex_name_prefix
= 6
2677 _TEXT
= _BuildTagLookupTable({
2682 4: "start_index_name",
2683 5: "include_start_index",
2684 6: "index_name_prefix",
2689 _TYPES
= _BuildTagLookupTable({
2690 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2691 1: ProtocolBuffer
.Encoder
.NUMERIC
,
2692 2: ProtocolBuffer
.Encoder
.NUMERIC
,
2693 3: ProtocolBuffer
.Encoder
.STRING
,
2694 4: ProtocolBuffer
.Encoder
.STRING
,
2695 5: ProtocolBuffer
.Encoder
.NUMERIC
,
2696 6: ProtocolBuffer
.Encoder
.STRING
,
2697 7: ProtocolBuffer
.Encoder
.NUMERIC
,
2698 8: ProtocolBuffer
.Encoder
.NUMERIC
,
2699 }, 8, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2703 _STYLE_CONTENT_TYPE
= """"""
2704 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ListIndexesParams'
2705 class ListIndexesRequest(ProtocolBuffer
.ProtocolMessage
):
2710 def __init__(self
, contents
=None):
2711 self
.params_
= ListIndexesParams()
2712 if contents
is not None: self
.MergeFromString(contents
)
2714 def params(self
): return self
.params_
2716 def mutable_params(self
): self
.has_params_
= 1; return self
.params_
2718 def clear_params(self
):self
.has_params_
= 0; self
.params_
.Clear()
2720 def has_params(self
): return self
.has_params_
2722 def app_id(self
): return self
.app_id_
2724 def set_app_id(self
, x
):
2725 self
.has_app_id_
= 1
2728 def clear_app_id(self
):
2729 if self
.has_app_id_
:
2730 self
.has_app_id_
= 0
2733 def has_app_id(self
): return self
.has_app_id_
2736 def MergeFrom(self
, x
):
2737 assert x
is not self
2738 if (x
.has_params()): self
.mutable_params().MergeFrom(x
.params())
2739 if (x
.has_app_id()): self
.set_app_id(x
.app_id())
2741 def Equals(self
, x
):
2742 if x
is self
: return 1
2743 if self
.has_params_
!= x
.has_params_
: return 0
2744 if self
.has_params_
and self
.params_
!= x
.params_
: return 0
2745 if self
.has_app_id_
!= x
.has_app_id_
: return 0
2746 if self
.has_app_id_
and self
.app_id_
!= x
.app_id_
: return 0
2749 def IsInitialized(self
, debug_strs
=None):
2751 if (not self
.has_params_
):
2753 if debug_strs
is not None:
2754 debug_strs
.append('Required field: params not set.')
2755 elif not self
.params_
.IsInitialized(debug_strs
): initialized
= 0
2760 n
+= self
.lengthString(self
.params_
.ByteSize())
2761 if (self
.has_app_id_
): n
+= 1 + self
.lengthString(len(self
.app_id_
))
2764 def ByteSizePartial(self
):
2766 if (self
.has_params_
):
2768 n
+= self
.lengthString(self
.params_
.ByteSizePartial())
2769 if (self
.has_app_id_
): n
+= 1 + self
.lengthString(len(self
.app_id_
))
2776 def OutputUnchecked(self
, out
):
2778 out
.putVarInt32(self
.params_
.ByteSize())
2779 self
.params_
.OutputUnchecked(out
)
2780 if (self
.has_app_id_
):
2782 out
.putPrefixedString(self
.app_id_
)
2784 def OutputPartial(self
, out
):
2785 if (self
.has_params_
):
2787 out
.putVarInt32(self
.params_
.ByteSizePartial())
2788 self
.params_
.OutputPartial(out
)
2789 if (self
.has_app_id_
):
2791 out
.putPrefixedString(self
.app_id_
)
2793 def TryMerge(self
, d
):
2794 while d
.avail() > 0:
2795 tt
= d
.getVarInt32()
2797 length
= d
.getVarInt32()
2798 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2800 self
.mutable_params().TryMerge(tmp
)
2803 self
.set_app_id(d
.getPrefixedString())
2807 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2811 def __str__(self
, prefix
="", printElemNumber
=0):
2813 if self
.has_params_
:
2814 res
+=prefix
+"params <\n"
2815 res
+=self
.params_
.__str
__(prefix
+ " ", printElemNumber
)
2817 if self
.has_app_id_
: res
+=prefix
+("app_id: %s\n" % self
.DebugFormatString(self
.app_id_
))
2821 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2822 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2827 _TEXT
= _BuildTagLookupTable({
2833 _TYPES
= _BuildTagLookupTable({
2834 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2835 1: ProtocolBuffer
.Encoder
.STRING
,
2836 3: ProtocolBuffer
.Encoder
.STRING
,
2837 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2841 _STYLE_CONTENT_TYPE
= """"""
2842 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ListIndexesRequest'
2843 class ListIndexesResponse(ProtocolBuffer
.ProtocolMessage
):
2846 def __init__(self
, contents
=None):
2847 self
.status_
= RequestStatus()
2848 self
.index_metadata_
= []
2849 if contents
is not None: self
.MergeFromString(contents
)
2851 def status(self
): return self
.status_
2853 def mutable_status(self
): self
.has_status_
= 1; return self
.status_
2855 def clear_status(self
):self
.has_status_
= 0; self
.status_
.Clear()
2857 def has_status(self
): return self
.has_status_
2859 def index_metadata_size(self
): return len(self
.index_metadata_
)
2860 def index_metadata_list(self
): return self
.index_metadata_
2862 def index_metadata(self
, i
):
2863 return self
.index_metadata_
[i
]
2865 def mutable_index_metadata(self
, i
):
2866 return self
.index_metadata_
[i
]
2868 def add_index_metadata(self
):
2870 self
.index_metadata_
.append(x
)
2873 def clear_index_metadata(self
):
2874 self
.index_metadata_
= []
2876 def MergeFrom(self
, x
):
2877 assert x
is not self
2878 if (x
.has_status()): self
.mutable_status().MergeFrom(x
.status())
2879 for i
in xrange(x
.index_metadata_size()): self
.add_index_metadata().CopyFrom(x
.index_metadata(i
))
2881 def Equals(self
, x
):
2882 if x
is self
: return 1
2883 if self
.has_status_
!= x
.has_status_
: return 0
2884 if self
.has_status_
and self
.status_
!= x
.status_
: return 0
2885 if len(self
.index_metadata_
) != len(x
.index_metadata_
): return 0
2886 for e1
, e2
in zip(self
.index_metadata_
, x
.index_metadata_
):
2887 if e1
!= e2
: return 0
2890 def IsInitialized(self
, debug_strs
=None):
2892 if (not self
.has_status_
):
2894 if debug_strs
is not None:
2895 debug_strs
.append('Required field: status not set.')
2896 elif not self
.status_
.IsInitialized(debug_strs
): initialized
= 0
2897 for p
in self
.index_metadata_
:
2898 if not p
.IsInitialized(debug_strs
): initialized
=0
2903 n
+= self
.lengthString(self
.status_
.ByteSize())
2904 n
+= 1 * len(self
.index_metadata_
)
2905 for i
in xrange(len(self
.index_metadata_
)): n
+= self
.lengthString(self
.index_metadata_
[i
].ByteSize())
2908 def ByteSizePartial(self
):
2910 if (self
.has_status_
):
2912 n
+= self
.lengthString(self
.status_
.ByteSizePartial())
2913 n
+= 1 * len(self
.index_metadata_
)
2914 for i
in xrange(len(self
.index_metadata_
)): n
+= self
.lengthString(self
.index_metadata_
[i
].ByteSizePartial())
2919 self
.clear_index_metadata()
2921 def OutputUnchecked(self
, out
):
2923 out
.putVarInt32(self
.status_
.ByteSize())
2924 self
.status_
.OutputUnchecked(out
)
2925 for i
in xrange(len(self
.index_metadata_
)):
2927 out
.putVarInt32(self
.index_metadata_
[i
].ByteSize())
2928 self
.index_metadata_
[i
].OutputUnchecked(out
)
2930 def OutputPartial(self
, out
):
2931 if (self
.has_status_
):
2933 out
.putVarInt32(self
.status_
.ByteSizePartial())
2934 self
.status_
.OutputPartial(out
)
2935 for i
in xrange(len(self
.index_metadata_
)):
2937 out
.putVarInt32(self
.index_metadata_
[i
].ByteSizePartial())
2938 self
.index_metadata_
[i
].OutputPartial(out
)
2940 def TryMerge(self
, d
):
2941 while d
.avail() > 0:
2942 tt
= d
.getVarInt32()
2944 length
= d
.getVarInt32()
2945 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2947 self
.mutable_status().TryMerge(tmp
)
2950 length
= d
.getVarInt32()
2951 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2953 self
.add_index_metadata().TryMerge(tmp
)
2957 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2961 def __str__(self
, prefix
="", printElemNumber
=0):
2963 if self
.has_status_
:
2964 res
+=prefix
+"status <\n"
2965 res
+=self
.status_
.__str
__(prefix
+ " ", printElemNumber
)
2968 for e
in self
.index_metadata_
:
2970 if printElemNumber
: elm
="(%d)" % cnt
2971 res
+=prefix
+("index_metadata%s <\n" % elm
)
2972 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2978 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2979 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2984 _TEXT
= _BuildTagLookupTable({
2987 2: "index_metadata",
2990 _TYPES
= _BuildTagLookupTable({
2991 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2992 1: ProtocolBuffer
.Encoder
.STRING
,
2993 2: ProtocolBuffer
.Encoder
.STRING
,
2994 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2998 _STYLE_CONTENT_TYPE
= """"""
2999 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ListIndexesResponse'
3000 class DeleteSchemaParams(ProtocolBuffer
.ProtocolMessage
):
3004 def __init__(self
, contents
=None):
3005 self
.index_spec_
= []
3006 if contents
is not None: self
.MergeFromString(contents
)
3008 def source(self
): return self
.source_
3010 def set_source(self
, x
):
3011 self
.has_source_
= 1
3014 def clear_source(self
):
3015 if self
.has_source_
:
3016 self
.has_source_
= 0
3019 def has_source(self
): return self
.has_source_
3021 def index_spec_size(self
): return len(self
.index_spec_
)
3022 def index_spec_list(self
): return self
.index_spec_
3024 def index_spec(self
, i
):
3025 return self
.index_spec_
[i
]
3027 def mutable_index_spec(self
, i
):
3028 return self
.index_spec_
[i
]
3030 def add_index_spec(self
):
3032 self
.index_spec_
.append(x
)
3035 def clear_index_spec(self
):
3036 self
.index_spec_
= []
3038 def MergeFrom(self
, x
):
3039 assert x
is not self
3040 if (x
.has_source()): self
.set_source(x
.source())
3041 for i
in xrange(x
.index_spec_size()): self
.add_index_spec().CopyFrom(x
.index_spec(i
))
3043 def Equals(self
, x
):
3044 if x
is self
: return 1
3045 if self
.has_source_
!= x
.has_source_
: return 0
3046 if self
.has_source_
and self
.source_
!= x
.source_
: return 0
3047 if len(self
.index_spec_
) != len(x
.index_spec_
): return 0
3048 for e1
, e2
in zip(self
.index_spec_
, x
.index_spec_
):
3049 if e1
!= e2
: return 0
3052 def IsInitialized(self
, debug_strs
=None):
3054 for p
in self
.index_spec_
:
3055 if not p
.IsInitialized(debug_strs
): initialized
=0
3060 if (self
.has_source_
): n
+= 1 + self
.lengthVarInt64(self
.source_
)
3061 n
+= 1 * len(self
.index_spec_
)
3062 for i
in xrange(len(self
.index_spec_
)): n
+= self
.lengthString(self
.index_spec_
[i
].ByteSize())
3065 def ByteSizePartial(self
):
3067 if (self
.has_source_
): n
+= 1 + self
.lengthVarInt64(self
.source_
)
3068 n
+= 1 * len(self
.index_spec_
)
3069 for i
in xrange(len(self
.index_spec_
)): n
+= self
.lengthString(self
.index_spec_
[i
].ByteSizePartial())
3074 self
.clear_index_spec()
3076 def OutputUnchecked(self
, out
):
3077 if (self
.has_source_
):
3079 out
.putVarInt32(self
.source_
)
3080 for i
in xrange(len(self
.index_spec_
)):
3082 out
.putVarInt32(self
.index_spec_
[i
].ByteSize())
3083 self
.index_spec_
[i
].OutputUnchecked(out
)
3085 def OutputPartial(self
, out
):
3086 if (self
.has_source_
):
3088 out
.putVarInt32(self
.source_
)
3089 for i
in xrange(len(self
.index_spec_
)):
3091 out
.putVarInt32(self
.index_spec_
[i
].ByteSizePartial())
3092 self
.index_spec_
[i
].OutputPartial(out
)
3094 def TryMerge(self
, d
):
3095 while d
.avail() > 0:
3096 tt
= d
.getVarInt32()
3098 self
.set_source(d
.getVarInt32())
3101 length
= d
.getVarInt32()
3102 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3104 self
.add_index_spec().TryMerge(tmp
)
3108 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3112 def __str__(self
, prefix
="", printElemNumber
=0):
3114 if self
.has_source_
: res
+=prefix
+("source: %s\n" % self
.DebugFormatInt32(self
.source_
))
3116 for e
in self
.index_spec_
:
3118 if printElemNumber
: elm
="(%d)" % cnt
3119 res
+=prefix
+("index_spec%s <\n" % elm
)
3120 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
3126 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3127 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3132 _TEXT
= _BuildTagLookupTable({
3138 _TYPES
= _BuildTagLookupTable({
3139 0: ProtocolBuffer
.Encoder
.NUMERIC
,
3140 1: ProtocolBuffer
.Encoder
.NUMERIC
,
3141 2: ProtocolBuffer
.Encoder
.STRING
,
3142 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
3146 _STYLE_CONTENT_TYPE
= """"""
3147 _PROTO_DESCRIPTOR_NAME
= 'apphosting.DeleteSchemaParams'
3148 class DeleteSchemaRequest(ProtocolBuffer
.ProtocolMessage
):
3153 def __init__(self
, contents
=None):
3154 self
.params_
= DeleteSchemaParams()
3155 if contents
is not None: self
.MergeFromString(contents
)
3157 def params(self
): return self
.params_
3159 def mutable_params(self
): self
.has_params_
= 1; return self
.params_
3161 def clear_params(self
):self
.has_params_
= 0; self
.params_
.Clear()
3163 def has_params(self
): return self
.has_params_
3165 def app_id(self
): return self
.app_id_
3167 def set_app_id(self
, x
):
3168 self
.has_app_id_
= 1
3171 def clear_app_id(self
):
3172 if self
.has_app_id_
:
3173 self
.has_app_id_
= 0
3176 def has_app_id(self
): return self
.has_app_id_
3179 def MergeFrom(self
, x
):
3180 assert x
is not self
3181 if (x
.has_params()): self
.mutable_params().MergeFrom(x
.params())
3182 if (x
.has_app_id()): self
.set_app_id(x
.app_id())
3184 def Equals(self
, x
):
3185 if x
is self
: return 1
3186 if self
.has_params_
!= x
.has_params_
: return 0
3187 if self
.has_params_
and self
.params_
!= x
.params_
: return 0
3188 if self
.has_app_id_
!= x
.has_app_id_
: return 0
3189 if self
.has_app_id_
and self
.app_id_
!= x
.app_id_
: return 0
3192 def IsInitialized(self
, debug_strs
=None):
3194 if (not self
.has_params_
):
3196 if debug_strs
is not None:
3197 debug_strs
.append('Required field: params not set.')
3198 elif not self
.params_
.IsInitialized(debug_strs
): initialized
= 0
3203 n
+= self
.lengthString(self
.params_
.ByteSize())
3204 if (self
.has_app_id_
): n
+= 1 + self
.lengthString(len(self
.app_id_
))
3207 def ByteSizePartial(self
):
3209 if (self
.has_params_
):
3211 n
+= self
.lengthString(self
.params_
.ByteSizePartial())
3212 if (self
.has_app_id_
): n
+= 1 + self
.lengthString(len(self
.app_id_
))
3219 def OutputUnchecked(self
, out
):
3221 out
.putVarInt32(self
.params_
.ByteSize())
3222 self
.params_
.OutputUnchecked(out
)
3223 if (self
.has_app_id_
):
3225 out
.putPrefixedString(self
.app_id_
)
3227 def OutputPartial(self
, out
):
3228 if (self
.has_params_
):
3230 out
.putVarInt32(self
.params_
.ByteSizePartial())
3231 self
.params_
.OutputPartial(out
)
3232 if (self
.has_app_id_
):
3234 out
.putPrefixedString(self
.app_id_
)
3236 def TryMerge(self
, d
):
3237 while d
.avail() > 0:
3238 tt
= d
.getVarInt32()
3240 length
= d
.getVarInt32()
3241 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3243 self
.mutable_params().TryMerge(tmp
)
3246 self
.set_app_id(d
.getPrefixedString())
3250 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3254 def __str__(self
, prefix
="", printElemNumber
=0):
3256 if self
.has_params_
:
3257 res
+=prefix
+"params <\n"
3258 res
+=self
.params_
.__str
__(prefix
+ " ", printElemNumber
)
3260 if self
.has_app_id_
: res
+=prefix
+("app_id: %s\n" % self
.DebugFormatString(self
.app_id_
))
3264 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3265 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3270 _TEXT
= _BuildTagLookupTable({
3276 _TYPES
= _BuildTagLookupTable({
3277 0: ProtocolBuffer
.Encoder
.NUMERIC
,
3278 1: ProtocolBuffer
.Encoder
.STRING
,
3279 3: ProtocolBuffer
.Encoder
.STRING
,
3280 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
3284 _STYLE_CONTENT_TYPE
= """"""
3285 _PROTO_DESCRIPTOR_NAME
= 'apphosting.DeleteSchemaRequest'
3286 class DeleteSchemaResponse(ProtocolBuffer
.ProtocolMessage
):
3288 def __init__(self
, contents
=None):
3290 if contents
is not None: self
.MergeFromString(contents
)
3292 def status_size(self
): return len(self
.status_
)
3293 def status_list(self
): return self
.status_
3295 def status(self
, i
):
3296 return self
.status_
[i
]
3298 def mutable_status(self
, i
):
3299 return self
.status_
[i
]
3301 def add_status(self
):
3303 self
.status_
.append(x
)
3306 def clear_status(self
):
3309 def MergeFrom(self
, x
):
3310 assert x
is not self
3311 for i
in xrange(x
.status_size()): self
.add_status().CopyFrom(x
.status(i
))
3313 def Equals(self
, x
):
3314 if x
is self
: return 1
3315 if len(self
.status_
) != len(x
.status_
): return 0
3316 for e1
, e2
in zip(self
.status_
, x
.status_
):
3317 if e1
!= e2
: return 0
3320 def IsInitialized(self
, debug_strs
=None):
3322 for p
in self
.status_
:
3323 if not p
.IsInitialized(debug_strs
): initialized
=0
3328 n
+= 1 * len(self
.status_
)
3329 for i
in xrange(len(self
.status_
)): n
+= self
.lengthString(self
.status_
[i
].ByteSize())
3332 def ByteSizePartial(self
):
3334 n
+= 1 * len(self
.status_
)
3335 for i
in xrange(len(self
.status_
)): n
+= self
.lengthString(self
.status_
[i
].ByteSizePartial())
3341 def OutputUnchecked(self
, out
):
3342 for i
in xrange(len(self
.status_
)):
3344 out
.putVarInt32(self
.status_
[i
].ByteSize())
3345 self
.status_
[i
].OutputUnchecked(out
)
3347 def OutputPartial(self
, out
):
3348 for i
in xrange(len(self
.status_
)):
3350 out
.putVarInt32(self
.status_
[i
].ByteSizePartial())
3351 self
.status_
[i
].OutputPartial(out
)
3353 def TryMerge(self
, d
):
3354 while d
.avail() > 0:
3355 tt
= d
.getVarInt32()
3357 length
= d
.getVarInt32()
3358 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3360 self
.add_status().TryMerge(tmp
)
3364 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3368 def __str__(self
, prefix
="", printElemNumber
=0):
3371 for e
in self
.status_
:
3373 if printElemNumber
: elm
="(%d)" % cnt
3374 res
+=prefix
+("status%s <\n" % elm
)
3375 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
3381 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3382 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3386 _TEXT
= _BuildTagLookupTable({
3391 _TYPES
= _BuildTagLookupTable({
3392 0: ProtocolBuffer
.Encoder
.NUMERIC
,
3393 1: ProtocolBuffer
.Encoder
.STRING
,
3394 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
3398 _STYLE_CONTENT_TYPE
= """"""
3399 _PROTO_DESCRIPTOR_NAME
= 'apphosting.DeleteSchemaResponse'
3400 class SortSpec(ProtocolBuffer
.ProtocolMessage
):
3401 has_sort_expression_
= 0
3402 sort_expression_
= ""
3403 has_sort_descending_
= 0
3404 sort_descending_
= 1
3405 has_default_value_text_
= 0
3406 default_value_text_
= ""
3407 has_default_value_numeric_
= 0
3408 default_value_numeric_
= 0.0
3410 def __init__(self
, contents
=None):
3411 if contents
is not None: self
.MergeFromString(contents
)
3413 def sort_expression(self
): return self
.sort_expression_
3415 def set_sort_expression(self
, x
):
3416 self
.has_sort_expression_
= 1
3417 self
.sort_expression_
= x
3419 def clear_sort_expression(self
):
3420 if self
.has_sort_expression_
:
3421 self
.has_sort_expression_
= 0
3422 self
.sort_expression_
= ""
3424 def has_sort_expression(self
): return self
.has_sort_expression_
3426 def sort_descending(self
): return self
.sort_descending_
3428 def set_sort_descending(self
, x
):
3429 self
.has_sort_descending_
= 1
3430 self
.sort_descending_
= x
3432 def clear_sort_descending(self
):
3433 if self
.has_sort_descending_
:
3434 self
.has_sort_descending_
= 0
3435 self
.sort_descending_
= 1
3437 def has_sort_descending(self
): return self
.has_sort_descending_
3439 def default_value_text(self
): return self
.default_value_text_
3441 def set_default_value_text(self
, x
):
3442 self
.has_default_value_text_
= 1
3443 self
.default_value_text_
= x
3445 def clear_default_value_text(self
):
3446 if self
.has_default_value_text_
:
3447 self
.has_default_value_text_
= 0
3448 self
.default_value_text_
= ""
3450 def has_default_value_text(self
): return self
.has_default_value_text_
3452 def default_value_numeric(self
): return self
.default_value_numeric_
3454 def set_default_value_numeric(self
, x
):
3455 self
.has_default_value_numeric_
= 1
3456 self
.default_value_numeric_
= x
3458 def clear_default_value_numeric(self
):
3459 if self
.has_default_value_numeric_
:
3460 self
.has_default_value_numeric_
= 0
3461 self
.default_value_numeric_
= 0.0
3463 def has_default_value_numeric(self
): return self
.has_default_value_numeric_
3466 def MergeFrom(self
, x
):
3467 assert x
is not self
3468 if (x
.has_sort_expression()): self
.set_sort_expression(x
.sort_expression())
3469 if (x
.has_sort_descending()): self
.set_sort_descending(x
.sort_descending())
3470 if (x
.has_default_value_text()): self
.set_default_value_text(x
.default_value_text())
3471 if (x
.has_default_value_numeric()): self
.set_default_value_numeric(x
.default_value_numeric())
3473 def Equals(self
, x
):
3474 if x
is self
: return 1
3475 if self
.has_sort_expression_
!= x
.has_sort_expression_
: return 0
3476 if self
.has_sort_expression_
and self
.sort_expression_
!= x
.sort_expression_
: return 0
3477 if self
.has_sort_descending_
!= x
.has_sort_descending_
: return 0
3478 if self
.has_sort_descending_
and self
.sort_descending_
!= x
.sort_descending_
: return 0
3479 if self
.has_default_value_text_
!= x
.has_default_value_text_
: return 0
3480 if self
.has_default_value_text_
and self
.default_value_text_
!= x
.default_value_text_
: return 0
3481 if self
.has_default_value_numeric_
!= x
.has_default_value_numeric_
: return 0
3482 if self
.has_default_value_numeric_
and self
.default_value_numeric_
!= x
.default_value_numeric_
: return 0
3485 def IsInitialized(self
, debug_strs
=None):
3487 if (not self
.has_sort_expression_
):
3489 if debug_strs
is not None:
3490 debug_strs
.append('Required field: sort_expression not set.')
3495 n
+= self
.lengthString(len(self
.sort_expression_
))
3496 if (self
.has_sort_descending_
): n
+= 2
3497 if (self
.has_default_value_text_
): n
+= 1 + self
.lengthString(len(self
.default_value_text_
))
3498 if (self
.has_default_value_numeric_
): n
+= 9
3501 def ByteSizePartial(self
):
3503 if (self
.has_sort_expression_
):
3505 n
+= self
.lengthString(len(self
.sort_expression_
))
3506 if (self
.has_sort_descending_
): n
+= 2
3507 if (self
.has_default_value_text_
): n
+= 1 + self
.lengthString(len(self
.default_value_text_
))
3508 if (self
.has_default_value_numeric_
): n
+= 9
3512 self
.clear_sort_expression()
3513 self
.clear_sort_descending()
3514 self
.clear_default_value_text()
3515 self
.clear_default_value_numeric()
3517 def OutputUnchecked(self
, out
):
3519 out
.putPrefixedString(self
.sort_expression_
)
3520 if (self
.has_sort_descending_
):
3522 out
.putBoolean(self
.sort_descending_
)
3523 if (self
.has_default_value_text_
):
3525 out
.putPrefixedString(self
.default_value_text_
)
3526 if (self
.has_default_value_numeric_
):
3528 out
.putDouble(self
.default_value_numeric_
)
3530 def OutputPartial(self
, out
):
3531 if (self
.has_sort_expression_
):
3533 out
.putPrefixedString(self
.sort_expression_
)
3534 if (self
.has_sort_descending_
):
3536 out
.putBoolean(self
.sort_descending_
)
3537 if (self
.has_default_value_text_
):
3539 out
.putPrefixedString(self
.default_value_text_
)
3540 if (self
.has_default_value_numeric_
):
3542 out
.putDouble(self
.default_value_numeric_
)
3544 def TryMerge(self
, d
):
3545 while d
.avail() > 0:
3546 tt
= d
.getVarInt32()
3548 self
.set_sort_expression(d
.getPrefixedString())
3551 self
.set_sort_descending(d
.getBoolean())
3554 self
.set_default_value_text(d
.getPrefixedString())
3557 self
.set_default_value_numeric(d
.getDouble())
3561 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3565 def __str__(self
, prefix
="", printElemNumber
=0):
3567 if self
.has_sort_expression_
: res
+=prefix
+("sort_expression: %s\n" % self
.DebugFormatString(self
.sort_expression_
))
3568 if self
.has_sort_descending_
: res
+=prefix
+("sort_descending: %s\n" % self
.DebugFormatBool(self
.sort_descending_
))
3569 if self
.has_default_value_text_
: res
+=prefix
+("default_value_text: %s\n" % self
.DebugFormatString(self
.default_value_text_
))
3570 if self
.has_default_value_numeric_
: res
+=prefix
+("default_value_numeric: %s\n" % self
.DebugFormat(self
.default_value_numeric_
))
3574 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3575 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3577 ksort_expression
= 1
3578 ksort_descending
= 2
3579 kdefault_value_text
= 4
3580 kdefault_value_numeric
= 5
3582 _TEXT
= _BuildTagLookupTable({
3584 1: "sort_expression",
3585 2: "sort_descending",
3586 4: "default_value_text",
3587 5: "default_value_numeric",
3590 _TYPES
= _BuildTagLookupTable({
3591 0: ProtocolBuffer
.Encoder
.NUMERIC
,
3592 1: ProtocolBuffer
.Encoder
.STRING
,
3593 2: ProtocolBuffer
.Encoder
.NUMERIC
,
3594 4: ProtocolBuffer
.Encoder
.STRING
,
3595 5: ProtocolBuffer
.Encoder
.DOUBLE
,
3596 }, 5, ProtocolBuffer
.Encoder
.MAX_TYPE
)
3600 _STYLE_CONTENT_TYPE
= """"""
3601 _PROTO_DESCRIPTOR_NAME
= 'apphosting.SortSpec'
3602 class ScorerSpec(ProtocolBuffer
.ProtocolMessage
):
3605 RESCORING_MATCH_SCORER
= 0
3609 0: "RESCORING_MATCH_SCORER",
3613 def Scorer_Name(cls
, x
): return cls
._Scorer
_NAMES
.get(x
, "")
3614 Scorer_Name
= classmethod(Scorer_Name
)
3620 has_match_scorer_parameters_
= 0
3621 match_scorer_parameters_
= ""
3623 def __init__(self
, contents
=None):
3624 if contents
is not None: self
.MergeFromString(contents
)
3626 def scorer(self
): return self
.scorer_
3628 def set_scorer(self
, x
):
3629 self
.has_scorer_
= 1
3632 def clear_scorer(self
):
3633 if self
.has_scorer_
:
3634 self
.has_scorer_
= 0
3637 def has_scorer(self
): return self
.has_scorer_
3639 def limit(self
): return self
.limit_
3641 def set_limit(self
, x
):
3645 def clear_limit(self
):
3650 def has_limit(self
): return self
.has_limit_
3652 def match_scorer_parameters(self
): return self
.match_scorer_parameters_
3654 def set_match_scorer_parameters(self
, x
):
3655 self
.has_match_scorer_parameters_
= 1
3656 self
.match_scorer_parameters_
= x
3658 def clear_match_scorer_parameters(self
):
3659 if self
.has_match_scorer_parameters_
:
3660 self
.has_match_scorer_parameters_
= 0
3661 self
.match_scorer_parameters_
= ""
3663 def has_match_scorer_parameters(self
): return self
.has_match_scorer_parameters_
3666 def MergeFrom(self
, x
):
3667 assert x
is not self
3668 if (x
.has_scorer()): self
.set_scorer(x
.scorer())
3669 if (x
.has_limit()): self
.set_limit(x
.limit())
3670 if (x
.has_match_scorer_parameters()): self
.set_match_scorer_parameters(x
.match_scorer_parameters())
3672 def Equals(self
, x
):
3673 if x
is self
: return 1
3674 if self
.has_scorer_
!= x
.has_scorer_
: return 0
3675 if self
.has_scorer_
and self
.scorer_
!= x
.scorer_
: return 0
3676 if self
.has_limit_
!= x
.has_limit_
: return 0
3677 if self
.has_limit_
and self
.limit_
!= x
.limit_
: return 0
3678 if self
.has_match_scorer_parameters_
!= x
.has_match_scorer_parameters_
: return 0
3679 if self
.has_match_scorer_parameters_
and self
.match_scorer_parameters_
!= x
.match_scorer_parameters_
: return 0
3682 def IsInitialized(self
, debug_strs
=None):
3688 if (self
.has_scorer_
): n
+= 1 + self
.lengthVarInt64(self
.scorer_
)
3689 if (self
.has_limit_
): n
+= 1 + self
.lengthVarInt64(self
.limit_
)
3690 if (self
.has_match_scorer_parameters_
): n
+= 1 + self
.lengthString(len(self
.match_scorer_parameters_
))
3693 def ByteSizePartial(self
):
3695 if (self
.has_scorer_
): n
+= 1 + self
.lengthVarInt64(self
.scorer_
)
3696 if (self
.has_limit_
): n
+= 1 + self
.lengthVarInt64(self
.limit_
)
3697 if (self
.has_match_scorer_parameters_
): n
+= 1 + self
.lengthString(len(self
.match_scorer_parameters_
))
3703 self
.clear_match_scorer_parameters()
3705 def OutputUnchecked(self
, out
):
3706 if (self
.has_scorer_
):
3708 out
.putVarInt32(self
.scorer_
)
3709 if (self
.has_limit_
):
3711 out
.putVarInt32(self
.limit_
)
3712 if (self
.has_match_scorer_parameters_
):
3714 out
.putPrefixedString(self
.match_scorer_parameters_
)
3716 def OutputPartial(self
, out
):
3717 if (self
.has_scorer_
):
3719 out
.putVarInt32(self
.scorer_
)
3720 if (self
.has_limit_
):
3722 out
.putVarInt32(self
.limit_
)
3723 if (self
.has_match_scorer_parameters_
):
3725 out
.putPrefixedString(self
.match_scorer_parameters_
)
3727 def TryMerge(self
, d
):
3728 while d
.avail() > 0:
3729 tt
= d
.getVarInt32()
3731 self
.set_scorer(d
.getVarInt32())
3734 self
.set_limit(d
.getVarInt32())
3737 self
.set_match_scorer_parameters(d
.getPrefixedString())
3741 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3745 def __str__(self
, prefix
="", printElemNumber
=0):
3747 if self
.has_scorer_
: res
+=prefix
+("scorer: %s\n" % self
.DebugFormatInt32(self
.scorer_
))
3748 if self
.has_limit_
: res
+=prefix
+("limit: %s\n" % self
.DebugFormatInt32(self
.limit_
))
3749 if self
.has_match_scorer_parameters_
: res
+=prefix
+("match_scorer_parameters: %s\n" % self
.DebugFormatString(self
.match_scorer_parameters_
))
3753 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3754 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3758 kmatch_scorer_parameters
= 9
3760 _TEXT
= _BuildTagLookupTable({
3764 9: "match_scorer_parameters",
3767 _TYPES
= _BuildTagLookupTable({
3768 0: ProtocolBuffer
.Encoder
.NUMERIC
,
3769 1: ProtocolBuffer
.Encoder
.NUMERIC
,
3770 2: ProtocolBuffer
.Encoder
.NUMERIC
,
3771 9: ProtocolBuffer
.Encoder
.STRING
,
3772 }, 9, ProtocolBuffer
.Encoder
.MAX_TYPE
)
3776 _STYLE_CONTENT_TYPE
= """"""
3777 _PROTO_DESCRIPTOR_NAME
= 'apphosting.ScorerSpec'
3778 class FieldSpec_Expression(ProtocolBuffer
.ProtocolMessage
):
3784 def __init__(self
, contents
=None):
3785 if contents
is not None: self
.MergeFromString(contents
)
3787 def name(self
): return self
.name_
3789 def set_name(self
, x
):
3793 def clear_name(self
):
3798 def has_name(self
): return self
.has_name_
3800 def expression(self
): return self
.expression_
3802 def set_expression(self
, x
):
3803 self
.has_expression_
= 1
3804 self
.expression_
= x
3806 def clear_expression(self
):
3807 if self
.has_expression_
:
3808 self
.has_expression_
= 0
3809 self
.expression_
= ""
3811 def has_expression(self
): return self
.has_expression_
3814 def MergeFrom(self
, x
):
3815 assert x
is not self
3816 if (x
.has_name()): self
.set_name(x
.name())
3817 if (x
.has_expression()): self
.set_expression(x
.expression())
3819 def Equals(self
, x
):
3820 if x
is self
: return 1
3821 if self
.has_name_
!= x
.has_name_
: return 0
3822 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
3823 if self
.has_expression_
!= x
.has_expression_
: return 0
3824 if self
.has_expression_
and self
.expression_
!= x
.expression_
: return 0
3827 def IsInitialized(self
, debug_strs
=None):
3829 if (not self
.has_name_
):
3831 if debug_strs
is not None:
3832 debug_strs
.append('Required field: name not set.')
3833 if (not self
.has_expression_
):
3835 if debug_strs
is not None:
3836 debug_strs
.append('Required field: expression not set.')
3841 n
+= self
.lengthString(len(self
.name_
))
3842 n
+= self
.lengthString(len(self
.expression_
))
3845 def ByteSizePartial(self
):
3847 if (self
.has_name_
):
3849 n
+= self
.lengthString(len(self
.name_
))
3850 if (self
.has_expression_
):
3852 n
+= self
.lengthString(len(self
.expression_
))
3857 self
.clear_expression()
3859 def OutputUnchecked(self
, out
):
3861 out
.putPrefixedString(self
.name_
)
3863 out
.putPrefixedString(self
.expression_
)
3865 def OutputPartial(self
, out
):
3866 if (self
.has_name_
):
3868 out
.putPrefixedString(self
.name_
)
3869 if (self
.has_expression_
):
3871 out
.putPrefixedString(self
.expression_
)
3873 def TryMerge(self
, d
):
3875 tt
= d
.getVarInt32()
3878 self
.set_name(d
.getPrefixedString())
3881 self
.set_expression(d
.getPrefixedString())
3885 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3889 def __str__(self
, prefix
="", printElemNumber
=0):
3891 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
3892 if self
.has_expression_
: res
+=prefix
+("expression: %s\n" % self
.DebugFormatString(self
.expression_
))
3895 class FieldSpec(ProtocolBuffer
.ProtocolMessage
):
3897 def __init__(self
, contents
=None):
3899 self
.expression_
= []
3900 if contents
is not None: self
.MergeFromString(contents
)
3902 def name_size(self
): return len(self
.name_
)
3903 def name_list(self
): return self
.name_
3906 return self
.name_
[i
]
3908 def set_name(self
, i
, x
):
3911 def add_name(self
, x
):
3912 self
.name_
.append(x
)
3914 def clear_name(self
):
3917 def expression_size(self
): return len(self
.expression_
)
3918 def expression_list(self
): return self
.expression_
3920 def expression(self
, i
):
3921 return self
.expression_
[i
]
3923 def mutable_expression(self
, i
):
3924 return self
.expression_
[i
]
3926 def add_expression(self
):
3927 x
= FieldSpec_Expression()
3928 self
.expression_
.append(x
)
3931 def clear_expression(self
):
3932 self
.expression_
= []
3934 def MergeFrom(self
, x
):
3935 assert x
is not self
3936 for i
in xrange(x
.name_size()): self
.add_name(x
.name(i
))
3937 for i
in xrange(x
.expression_size()): self
.add_expression().CopyFrom(x
.expression(i
))
3939 def Equals(self
, x
):
3940 if x
is self
: return 1
3941 if len(self
.name_
) != len(x
.name_
): return 0
3942 for e1
, e2
in zip(self
.name_
, x
.name_
):
3943 if e1
!= e2
: return 0
3944 if len(self
.expression_
) != len(x
.expression_
): return 0
3945 for e1
, e2
in zip(self
.expression_
, x
.expression_
):
3946 if e1
!= e2
: return 0
3949 def IsInitialized(self
, debug_strs
=None):
3951 for p
in self
.expression_
:
3952 if not p
.IsInitialized(debug_strs
): initialized
=0
3957 n
+= 1 * len(self
.name_
)
3958 for i
in xrange(len(self
.name_
)): n
+= self
.lengthString(len(self
.name_
[i
]))
3959 n
+= 2 * len(self
.expression_
)
3960 for i
in xrange(len(self
.expression_
)): n
+= self
.expression_
[i
].ByteSize()
3963 def ByteSizePartial(self
):
3965 n
+= 1 * len(self
.name_
)
3966 for i
in xrange(len(self
.name_
)): n
+= self
.lengthString(len(self
.name_
[i
]))
3967 n
+= 2 * len(self
.expression_
)
3968 for i
in xrange(len(self
.expression_
)): n
+= self
.expression_
[i
].ByteSizePartial()
3973 self
.clear_expression()
3975 def OutputUnchecked(self
, out
):
3976 for i
in xrange(len(self
.name_
)):
3978 out
.putPrefixedString(self
.name_
[i
])
3979 for i
in xrange(len(self
.expression_
)):
3981 self
.expression_
[i
].OutputUnchecked(out
)
3984 def OutputPartial(self
, out
):
3985 for i
in xrange(len(self
.name_
)):
3987 out
.putPrefixedString(self
.name_
[i
])
3988 for i
in xrange(len(self
.expression_
)):
3990 self
.expression_
[i
].OutputPartial(out
)
3993 def TryMerge(self
, d
):
3994 while d
.avail() > 0:
3995 tt
= d
.getVarInt32()
3997 self
.add_name(d
.getPrefixedString())
4000 self
.add_expression().TryMerge(d
)
4004 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
4008 def __str__(self
, prefix
="", printElemNumber
=0):
4011 for e
in self
.name_
:
4013 if printElemNumber
: elm
="(%d)" % cnt
4014 res
+=prefix
+("name%s: %s\n" % (elm
, self
.DebugFormatString(e
)))
4017 for e
in self
.expression_
:
4019 if printElemNumber
: elm
="(%d)" % cnt
4020 res
+=prefix
+("Expression%s {\n" % elm
)
4021 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
4027 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
4028 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
4031 kExpressionGroup
= 2
4033 kExpressionexpression
= 4
4035 _TEXT
= _BuildTagLookupTable({
4043 _TYPES
= _BuildTagLookupTable({
4044 0: ProtocolBuffer
.Encoder
.NUMERIC
,
4045 1: ProtocolBuffer
.Encoder
.STRING
,
4046 2: ProtocolBuffer
.Encoder
.STARTGROUP
,
4047 3: ProtocolBuffer
.Encoder
.STRING
,
4048 4: ProtocolBuffer
.Encoder
.STRING
,
4049 }, 4, ProtocolBuffer
.Encoder
.MAX_TYPE
)
4053 _STYLE_CONTENT_TYPE
= """"""
4054 _PROTO_DESCRIPTOR_NAME
= 'apphosting.FieldSpec'
4055 class FacetRange(ProtocolBuffer
.ProtocolMessage
):
4063 def __init__(self
, contents
=None):
4064 if contents
is not None: self
.MergeFromString(contents
)
4066 def name(self
): return self
.name_
4068 def set_name(self
, x
):
4072 def clear_name(self
):
4077 def has_name(self
): return self
.has_name_
4079 def start(self
): return self
.start_
4081 def set_start(self
, x
):
4085 def clear_start(self
):
4090 def has_start(self
): return self
.has_start_
4092 def end(self
): return self
.end_
4094 def set_end(self
, x
):
4098 def clear_end(self
):
4103 def has_end(self
): return self
.has_end_
4106 def MergeFrom(self
, x
):
4107 assert x
is not self
4108 if (x
.has_name()): self
.set_name(x
.name())
4109 if (x
.has_start()): self
.set_start(x
.start())
4110 if (x
.has_end()): self
.set_end(x
.end())
4112 def Equals(self
, x
):
4113 if x
is self
: return 1
4114 if self
.has_name_
!= x
.has_name_
: return 0
4115 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
4116 if self
.has_start_
!= x
.has_start_
: return 0
4117 if self
.has_start_
and self
.start_
!= x
.start_
: return 0
4118 if self
.has_end_
!= x
.has_end_
: return 0
4119 if self
.has_end_
and self
.end_
!= x
.end_
: return 0
4122 def IsInitialized(self
, debug_strs
=None):
4128 if (self
.has_name_
): n
+= 1 + self
.lengthString(len(self
.name_
))
4129 if (self
.has_start_
): n
+= 1 + self
.lengthString(len(self
.start_
))
4130 if (self
.has_end_
): n
+= 1 + self
.lengthString(len(self
.end_
))
4133 def ByteSizePartial(self
):
4135 if (self
.has_name_
): n
+= 1 + self
.lengthString(len(self
.name_
))
4136 if (self
.has_start_
): n
+= 1 + self
.lengthString(len(self
.start_
))
4137 if (self
.has_end_
): n
+= 1 + self
.lengthString(len(self
.end_
))
4145 def OutputUnchecked(self
, out
):
4146 if (self
.has_name_
):
4148 out
.putPrefixedString(self
.name_
)
4149 if (self
.has_start_
):
4151 out
.putPrefixedString(self
.start_
)
4154 out
.putPrefixedString(self
.end_
)
4156 def OutputPartial(self
, out
):
4157 if (self
.has_name_
):
4159 out
.putPrefixedString(self
.name_
)
4160 if (self
.has_start_
):
4162 out
.putPrefixedString(self
.start_
)
4165 out
.putPrefixedString(self
.end_
)
4167 def TryMerge(self
, d
):
4168 while d
.avail() > 0:
4169 tt
= d
.getVarInt32()
4171 self
.set_name(d
.getPrefixedString())
4174 self
.set_start(d
.getPrefixedString())
4177 self
.set_end(d
.getPrefixedString())
4181 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
4185 def __str__(self
, prefix
="", printElemNumber
=0):
4187 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
4188 if self
.has_start_
: res
+=prefix
+("start: %s\n" % self
.DebugFormatString(self
.start_
))
4189 if self
.has_end_
: res
+=prefix
+("end: %s\n" % self
.DebugFormatString(self
.end_
))
4193 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
4194 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
4200 _TEXT
= _BuildTagLookupTable({
4207 _TYPES
= _BuildTagLookupTable({
4208 0: ProtocolBuffer
.Encoder
.NUMERIC
,
4209 1: ProtocolBuffer
.Encoder
.STRING
,
4210 2: ProtocolBuffer
.Encoder
.STRING
,
4211 3: ProtocolBuffer
.Encoder
.STRING
,
4212 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
4216 _STYLE_CONTENT_TYPE
= """"""
4217 _PROTO_DESCRIPTOR_NAME
= 'apphosting.FacetRange'
4218 class FacetRequestParam(ProtocolBuffer
.ProtocolMessage
):
4219 has_value_limit_
= 0
4222 def __init__(self
, contents
=None):
4224 self
.value_constraint_
= []
4225 if contents
is not None: self
.MergeFromString(contents
)
4227 def value_limit(self
): return self
.value_limit_
4229 def set_value_limit(self
, x
):
4230 self
.has_value_limit_
= 1
4231 self
.value_limit_
= x
4233 def clear_value_limit(self
):
4234 if self
.has_value_limit_
:
4235 self
.has_value_limit_
= 0
4236 self
.value_limit_
= 0
4238 def has_value_limit(self
): return self
.has_value_limit_
4240 def range_size(self
): return len(self
.range_
)
4241 def range_list(self
): return self
.range_
4244 return self
.range_
[i
]
4246 def mutable_range(self
, i
):
4247 return self
.range_
[i
]
4249 def add_range(self
):
4251 self
.range_
.append(x
)
4254 def clear_range(self
):
4256 def value_constraint_size(self
): return len(self
.value_constraint_
)
4257 def value_constraint_list(self
): return self
.value_constraint_
4259 def value_constraint(self
, i
):
4260 return self
.value_constraint_
[i
]
4262 def set_value_constraint(self
, i
, x
):
4263 self
.value_constraint_
[i
] = x
4265 def add_value_constraint(self
, x
):
4266 self
.value_constraint_
.append(x
)
4268 def clear_value_constraint(self
):
4269 self
.value_constraint_
= []
4272 def MergeFrom(self
, x
):
4273 assert x
is not self
4274 if (x
.has_value_limit()): self
.set_value_limit(x
.value_limit())
4275 for i
in xrange(x
.range_size()): self
.add_range().CopyFrom(x
.range(i
))
4276 for i
in xrange(x
.value_constraint_size()): self
.add_value_constraint(x
.value_constraint(i
))
4278 def Equals(self
, x
):
4279 if x
is self
: return 1
4280 if self
.has_value_limit_
!= x
.has_value_limit_
: return 0
4281 if self
.has_value_limit_
and self
.value_limit_
!= x
.value_limit_
: return 0
4282 if len(self
.range_
) != len(x
.range_
): return 0
4283 for e1
, e2
in zip(self
.range_
, x
.range_
):
4284 if e1
!= e2
: return 0
4285 if len(self
.value_constraint_
) != len(x
.value_constraint_
): return 0
4286 for e1
, e2
in zip(self
.value_constraint_
, x
.value_constraint_
):
4287 if e1
!= e2
: return 0
4290 def IsInitialized(self
, debug_strs
=None):
4292 for p
in self
.range_
:
4293 if not p
.IsInitialized(debug_strs
): initialized
=0
4298 if (self
.has_value_limit_
): n
+= 1 + self
.lengthVarInt64(self
.value_limit_
)
4299 n
+= 1 * len(self
.range_
)
4300 for i
in xrange(len(self
.range_
)): n
+= self
.lengthString(self
.range_
[i
].ByteSize())
4301 n
+= 1 * len(self
.value_constraint_
)
4302 for i
in xrange(len(self
.value_constraint_
)): n
+= self
.lengthString(len(self
.value_constraint_
[i
]))
4305 def ByteSizePartial(self
):
4307 if (self
.has_value_limit_
): n
+= 1 + self
.lengthVarInt64(self
.value_limit_
)
4308 n
+= 1 * len(self
.range_
)
4309 for i
in xrange(len(self
.range_
)): n
+= self
.lengthString(self
.range_
[i
].ByteSizePartial())
4310 n
+= 1 * len(self
.value_constraint_
)
4311 for i
in xrange(len(self
.value_constraint_
)): n
+= self
.lengthString(len(self
.value_constraint_
[i
]))
4315 self
.clear_value_limit()
4317 self
.clear_value_constraint()
4319 def OutputUnchecked(self
, out
):
4320 if (self
.has_value_limit_
):
4322 out
.putVarInt32(self
.value_limit_
)
4323 for i
in xrange(len(self
.range_
)):
4325 out
.putVarInt32(self
.range_
[i
].ByteSize())
4326 self
.range_
[i
].OutputUnchecked(out
)
4327 for i
in xrange(len(self
.value_constraint_
)):
4329 out
.putPrefixedString(self
.value_constraint_
[i
])
4331 def OutputPartial(self
, out
):
4332 if (self
.has_value_limit_
):
4334 out
.putVarInt32(self
.value_limit_
)
4335 for i
in xrange(len(self
.range_
)):
4337 out
.putVarInt32(self
.range_
[i
].ByteSizePartial())
4338 self
.range_
[i
].OutputPartial(out
)
4339 for i
in xrange(len(self
.value_constraint_
)):
4341 out
.putPrefixedString(self
.value_constraint_
[i
])
4343 def TryMerge(self
, d
):
4344 while d
.avail() > 0:
4345 tt
= d
.getVarInt32()
4347 self
.set_value_limit(d
.getVarInt32())
4350 length
= d
.getVarInt32()
4351 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4353 self
.add_range().TryMerge(tmp
)
4356 self
.add_value_constraint(d
.getPrefixedString())
4360 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
4364 def __str__(self
, prefix
="", printElemNumber
=0):
4366 if self
.has_value_limit_
: res
+=prefix
+("value_limit: %s\n" % self
.DebugFormatInt32(self
.value_limit_
))
4368 for e
in self
.range_
:
4370 if printElemNumber
: elm
="(%d)" % cnt
4371 res
+=prefix
+("range%s <\n" % elm
)
4372 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
4376 for e
in self
.value_constraint_
:
4378 if printElemNumber
: elm
="(%d)" % cnt
4379 res
+=prefix
+("value_constraint%s: %s\n" % (elm
, self
.DebugFormatString(e
)))
4384 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
4385 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
4389 kvalue_constraint
= 3
4391 _TEXT
= _BuildTagLookupTable({
4395 3: "value_constraint",
4398 _TYPES
= _BuildTagLookupTable({
4399 0: ProtocolBuffer
.Encoder
.NUMERIC
,
4400 1: ProtocolBuffer
.Encoder
.NUMERIC
,
4401 2: ProtocolBuffer
.Encoder
.STRING
,
4402 3: ProtocolBuffer
.Encoder
.STRING
,
4403 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
4407 _STYLE_CONTENT_TYPE
= """"""
4408 _PROTO_DESCRIPTOR_NAME
= 'apphosting.FacetRequestParam'
4409 class FacetAutoDetectParam(ProtocolBuffer
.ProtocolMessage
):
4410 has_value_limit_
= 0
4413 def __init__(self
, contents
=None):
4414 if contents
is not None: self
.MergeFromString(contents
)
4416 def value_limit(self
): return self
.value_limit_
4418 def set_value_limit(self
, x
):
4419 self
.has_value_limit_
= 1
4420 self
.value_limit_
= x
4422 def clear_value_limit(self
):
4423 if self
.has_value_limit_
:
4424 self
.has_value_limit_
= 0
4425 self
.value_limit_
= 10
4427 def has_value_limit(self
): return self
.has_value_limit_
4430 def MergeFrom(self
, x
):
4431 assert x
is not self
4432 if (x
.has_value_limit()): self
.set_value_limit(x
.value_limit())
4434 def Equals(self
, x
):
4435 if x
is self
: return 1
4436 if self
.has_value_limit_
!= x
.has_value_limit_
: return 0
4437 if self
.has_value_limit_
and self
.value_limit_
!= x
.value_limit_
: return 0
4440 def IsInitialized(self
, debug_strs
=None):
4446 if (self
.has_value_limit_
): n
+= 1 + self
.lengthVarInt64(self
.value_limit_
)
4449 def ByteSizePartial(self
):
4451 if (self
.has_value_limit_
): n
+= 1 + self
.lengthVarInt64(self
.value_limit_
)
4455 self
.clear_value_limit()
4457 def OutputUnchecked(self
, out
):
4458 if (self
.has_value_limit_
):
4460 out
.putVarInt32(self
.value_limit_
)
4462 def OutputPartial(self
, out
):
4463 if (self
.has_value_limit_
):
4465 out
.putVarInt32(self
.value_limit_
)
4467 def TryMerge(self
, d
):
4468 while d
.avail() > 0:
4469 tt
= d
.getVarInt32()
4471 self
.set_value_limit(d
.getVarInt32())
4475 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
4479 def __str__(self
, prefix
="", printElemNumber
=0):
4481 if self
.has_value_limit_
: res
+=prefix
+("value_limit: %s\n" % self
.DebugFormatInt32(self
.value_limit_
))
4485 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
4486 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
4490 _TEXT
= _BuildTagLookupTable({
4495 _TYPES
= _BuildTagLookupTable({
4496 0: ProtocolBuffer
.Encoder
.NUMERIC
,
4497 1: ProtocolBuffer
.Encoder
.NUMERIC
,
4498 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
4502 _STYLE_CONTENT_TYPE
= """"""
4503 _PROTO_DESCRIPTOR_NAME
= 'apphosting.FacetAutoDetectParam'
4504 class FacetRequest(ProtocolBuffer
.ProtocolMessage
):
4510 def __init__(self
, contents
=None):
4511 self
.lazy_init_lock_
= thread
.allocate_lock()
4512 if contents
is not None: self
.MergeFromString(contents
)
4514 def name(self
): return self
.name_
4516 def set_name(self
, x
):
4520 def clear_name(self
):
4525 def has_name(self
): return self
.has_name_
4528 if self
.params_
is None:
4529 self
.lazy_init_lock_
.acquire()
4531 if self
.params_
is None: self
.params_
= FacetRequestParam()
4533 self
.lazy_init_lock_
.release()
4536 def mutable_params(self
): self
.has_params_
= 1; return self
.params()
4538 def clear_params(self
):
4540 if self
.has_params_
:
4541 self
.has_params_
= 0;
4542 if self
.params_
is not None: self
.params_
.Clear()
4544 def has_params(self
): return self
.has_params_
4547 def MergeFrom(self
, x
):
4548 assert x
is not self
4549 if (x
.has_name()): self
.set_name(x
.name())
4550 if (x
.has_params()): self
.mutable_params().MergeFrom(x
.params())
4552 def Equals(self
, x
):
4553 if x
is self
: return 1
4554 if self
.has_name_
!= x
.has_name_
: return 0
4555 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
4556 if self
.has_params_
!= x
.has_params_
: return 0
4557 if self
.has_params_
and self
.params_
!= x
.params_
: return 0
4560 def IsInitialized(self
, debug_strs
=None):
4562 if (not self
.has_name_
):
4564 if debug_strs
is not None:
4565 debug_strs
.append('Required field: name not set.')
4566 if (self
.has_params_
and not self
.params_
.IsInitialized(debug_strs
)): initialized
= 0
4571 n
+= self
.lengthString(len(self
.name_
))
4572 if (self
.has_params_
): n
+= 1 + self
.lengthString(self
.params_
.ByteSize())
4575 def ByteSizePartial(self
):
4577 if (self
.has_name_
):
4579 n
+= self
.lengthString(len(self
.name_
))
4580 if (self
.has_params_
): n
+= 1 + self
.lengthString(self
.params_
.ByteSizePartial())
4587 def OutputUnchecked(self
, out
):
4589 out
.putPrefixedString(self
.name_
)
4590 if (self
.has_params_
):
4592 out
.putVarInt32(self
.params_
.ByteSize())
4593 self
.params_
.OutputUnchecked(out
)
4595 def OutputPartial(self
, out
):
4596 if (self
.has_name_
):
4598 out
.putPrefixedString(self
.name_
)
4599 if (self
.has_params_
):
4601 out
.putVarInt32(self
.params_
.ByteSizePartial())
4602 self
.params_
.OutputPartial(out
)
4604 def TryMerge(self
, d
):
4605 while d
.avail() > 0:
4606 tt
= d
.getVarInt32()
4608 self
.set_name(d
.getPrefixedString())
4611 length
= d
.getVarInt32()
4612 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4614 self
.mutable_params().TryMerge(tmp
)
4618 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
4622 def __str__(self
, prefix
="", printElemNumber
=0):
4624 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
4625 if self
.has_params_
:
4626 res
+=prefix
+"params <\n"
4627 res
+=self
.params_
.__str
__(prefix
+ " ", printElemNumber
)
4632 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
4633 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
4638 _TEXT
= _BuildTagLookupTable({
4644 _TYPES
= _BuildTagLookupTable({
4645 0: ProtocolBuffer
.Encoder
.NUMERIC
,
4646 1: ProtocolBuffer
.Encoder
.STRING
,
4647 2: ProtocolBuffer
.Encoder
.STRING
,
4648 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
4652 _STYLE_CONTENT_TYPE
= """"""
4653 _PROTO_DESCRIPTOR_NAME
= 'apphosting.FacetRequest'
4654 class FacetRefinement_Range(ProtocolBuffer
.ProtocolMessage
):
4660 def __init__(self
, contents
=None):
4661 if contents
is not None: self
.MergeFromString(contents
)
4663 def start(self
): return self
.start_
4665 def set_start(self
, x
):
4669 def clear_start(self
):
4674 def has_start(self
): return self
.has_start_
4676 def end(self
): return self
.end_
4678 def set_end(self
, x
):
4682 def clear_end(self
):
4687 def has_end(self
): return self
.has_end_
4690 def MergeFrom(self
, x
):
4691 assert x
is not self
4692 if (x
.has_start()): self
.set_start(x
.start())
4693 if (x
.has_end()): self
.set_end(x
.end())
4695 def Equals(self
, x
):
4696 if x
is self
: return 1
4697 if self
.has_start_
!= x
.has_start_
: return 0
4698 if self
.has_start_
and self
.start_
!= x
.start_
: return 0
4699 if self
.has_end_
!= x
.has_end_
: return 0
4700 if self
.has_end_
and self
.end_
!= x
.end_
: return 0
4703 def IsInitialized(self
, debug_strs
=None):
4709 if (self
.has_start_
): n
+= 1 + self
.lengthString(len(self
.start_
))
4710 if (self
.has_end_
): n
+= 1 + self
.lengthString(len(self
.end_
))
4713 def ByteSizePartial(self
):
4715 if (self
.has_start_
): n
+= 1 + self
.lengthString(len(self
.start_
))
4716 if (self
.has_end_
): n
+= 1 + self
.lengthString(len(self
.end_
))
4723 def OutputUnchecked(self
, out
):
4724 if (self
.has_start_
):
4726 out
.putPrefixedString(self
.start_
)
4729 out
.putPrefixedString(self
.end_
)
4731 def OutputPartial(self
, out
):
4732 if (self
.has_start_
):
4734 out
.putPrefixedString(self
.start_
)
4737 out
.putPrefixedString(self
.end_
)
4739 def TryMerge(self
, d
):
4740 while d
.avail() > 0:
4741 tt
= d
.getVarInt32()
4743 self
.set_start(d
.getPrefixedString())
4746 self
.set_end(d
.getPrefixedString())
4750 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
4754 def __str__(self
, prefix
="", printElemNumber
=0):
4756 if self
.has_start_
: res
+=prefix
+("start: %s\n" % self
.DebugFormatString(self
.start_
))
4757 if self
.has_end_
: res
+=prefix
+("end: %s\n" % self
.DebugFormatString(self
.end_
))
4761 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
4762 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
4767 _TEXT
= _BuildTagLookupTable({
4773 _TYPES
= _BuildTagLookupTable({
4774 0: ProtocolBuffer
.Encoder
.NUMERIC
,
4775 1: ProtocolBuffer
.Encoder
.STRING
,
4776 2: ProtocolBuffer
.Encoder
.STRING
,
4777 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
4781 _STYLE_CONTENT_TYPE
= """"""
4782 _PROTO_DESCRIPTOR_NAME
= 'apphosting.FacetRefinement_Range'
4783 class FacetRefinement(ProtocolBuffer
.ProtocolMessage
):
4791 def __init__(self
, contents
=None):
4792 self
.lazy_init_lock_
= thread
.allocate_lock()
4793 if contents
is not None: self
.MergeFromString(contents
)
4795 def name(self
): return self
.name_
4797 def set_name(self
, x
):
4801 def clear_name(self
):
4806 def has_name(self
): return self
.has_name_
4808 def value(self
): return self
.value_
4810 def set_value(self
, x
):
4814 def clear_value(self
):
4819 def has_value(self
): return self
.has_value_
4822 if self
.range_
is None:
4823 self
.lazy_init_lock_
.acquire()
4825 if self
.range_
is None: self
.range_
= FacetRefinement_Range()
4827 self
.lazy_init_lock_
.release()
4830 def mutable_range(self
): self
.has_range_
= 1; return self
.range()
4832 def clear_range(self
):
4835 self
.has_range_
= 0;
4836 if self
.range_
is not None: self
.range_
.Clear()
4838 def has_range(self
): return self
.has_range_
4841 def MergeFrom(self
, x
):
4842 assert x
is not self
4843 if (x
.has_name()): self
.set_name(x
.name())
4844 if (x
.has_value()): self
.set_value(x
.value())
4845 if (x
.has_range()): self
.mutable_range().MergeFrom(x
.range())
4847 def Equals(self
, x
):
4848 if x
is self
: return 1
4849 if self
.has_name_
!= x
.has_name_
: return 0
4850 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
4851 if self
.has_value_
!= x
.has_value_
: return 0
4852 if self
.has_value_
and self
.value_
!= x
.value_
: return 0
4853 if self
.has_range_
!= x
.has_range_
: return 0
4854 if self
.has_range_
and self
.range_
!= x
.range_
: return 0
4857 def IsInitialized(self
, debug_strs
=None):
4859 if (not self
.has_name_
):
4861 if debug_strs
is not None:
4862 debug_strs
.append('Required field: name not set.')
4863 if (self
.has_range_
and not self
.range_
.IsInitialized(debug_strs
)): initialized
= 0
4868 n
+= self
.lengthString(len(self
.name_
))
4869 if (self
.has_value_
): n
+= 1 + self
.lengthString(len(self
.value_
))
4870 if (self
.has_range_
): n
+= 1 + self
.lengthString(self
.range_
.ByteSize())
4873 def ByteSizePartial(self
):
4875 if (self
.has_name_
):
4877 n
+= self
.lengthString(len(self
.name_
))
4878 if (self
.has_value_
): n
+= 1 + self
.lengthString(len(self
.value_
))
4879 if (self
.has_range_
): n
+= 1 + self
.lengthString(self
.range_
.ByteSizePartial())
4887 def OutputUnchecked(self
, out
):
4889 out
.putPrefixedString(self
.name_
)
4890 if (self
.has_value_
):
4892 out
.putPrefixedString(self
.value_
)
4893 if (self
.has_range_
):
4895 out
.putVarInt32(self
.range_
.ByteSize())
4896 self
.range_
.OutputUnchecked(out
)
4898 def OutputPartial(self
, out
):
4899 if (self
.has_name_
):
4901 out
.putPrefixedString(self
.name_
)
4902 if (self
.has_value_
):
4904 out
.putPrefixedString(self
.value_
)
4905 if (self
.has_range_
):
4907 out
.putVarInt32(self
.range_
.ByteSizePartial())
4908 self
.range_
.OutputPartial(out
)
4910 def TryMerge(self
, d
):
4911 while d
.avail() > 0:
4912 tt
= d
.getVarInt32()
4914 self
.set_name(d
.getPrefixedString())
4917 self
.set_value(d
.getPrefixedString())
4920 length
= d
.getVarInt32()
4921 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4923 self
.mutable_range().TryMerge(tmp
)
4927 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
4931 def __str__(self
, prefix
="", printElemNumber
=0):
4933 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
4934 if self
.has_value_
: res
+=prefix
+("value: %s\n" % self
.DebugFormatString(self
.value_
))
4936 res
+=prefix
+"range <\n"
4937 res
+=self
.range_
.__str
__(prefix
+ " ", printElemNumber
)
4942 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
4943 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
4949 _TEXT
= _BuildTagLookupTable({
4956 _TYPES
= _BuildTagLookupTable({
4957 0: ProtocolBuffer
.Encoder
.NUMERIC
,
4958 1: ProtocolBuffer
.Encoder
.STRING
,
4959 2: ProtocolBuffer
.Encoder
.STRING
,
4960 3: ProtocolBuffer
.Encoder
.STRING
,
4961 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
4965 _STYLE_CONTENT_TYPE
= """"""
4966 _PROTO_DESCRIPTOR_NAME
= 'apphosting.FacetRefinement'
4967 class SearchParams(ProtocolBuffer
.ProtocolMessage
):
4974 _CursorType_NAMES
= {
4980 def CursorType_Name(cls
, x
): return cls
._CursorType
_NAMES
.get(x
, "")
4981 CursorType_Name
= classmethod(CursorType_Name
)
4988 _ParsingMode_NAMES
= {
4993 def ParsingMode_Name(cls
, x
): return cls
._ParsingMode
_NAMES
.get(x
, "")
4994 ParsingMode_Name
= classmethod(ParsingMode_Name
)
5003 has_cursor_type_
= 0
5007 has_matched_count_accuracy_
= 0
5008 matched_count_accuracy_
= 0
5009 has_scorer_spec_
= 0
5015 has_parsing_mode_
= 0
5017 has_auto_discover_facet_count_
= 0
5018 auto_discover_facet_count_
= 0
5019 has_facet_auto_detect_param_
= 0
5020 facet_auto_detect_param_
= None
5021 has_facet_depth_
= 0
5024 def __init__(self
, contents
=None):
5025 self
.index_spec_
= IndexSpec()
5026 self
.sort_spec_
= []
5027 self
.include_facet_
= []
5028 self
.facet_refinement_
= []
5029 self
.lazy_init_lock_
= thread
.allocate_lock()
5030 if contents
is not None: self
.MergeFromString(contents
)
5032 def index_spec(self
): return self
.index_spec_
5034 def mutable_index_spec(self
): self
.has_index_spec_
= 1; return self
.index_spec_
5036 def clear_index_spec(self
):self
.has_index_spec_
= 0; self
.index_spec_
.Clear()
5038 def has_index_spec(self
): return self
.has_index_spec_
5040 def query(self
): return self
.query_
5042 def set_query(self
, x
):
5046 def clear_query(self
):
5051 def has_query(self
): return self
.has_query_
5053 def cursor(self
): return self
.cursor_
5055 def set_cursor(self
, x
):
5056 self
.has_cursor_
= 1
5059 def clear_cursor(self
):
5060 if self
.has_cursor_
:
5061 self
.has_cursor_
= 0
5064 def has_cursor(self
): return self
.has_cursor_
5066 def offset(self
): return self
.offset_
5068 def set_offset(self
, x
):
5069 self
.has_offset_
= 1
5072 def clear_offset(self
):
5073 if self
.has_offset_
:
5074 self
.has_offset_
= 0
5077 def has_offset(self
): return self
.has_offset_
5079 def cursor_type(self
): return self
.cursor_type_
5081 def set_cursor_type(self
, x
):
5082 self
.has_cursor_type_
= 1
5083 self
.cursor_type_
= x
5085 def clear_cursor_type(self
):
5086 if self
.has_cursor_type_
:
5087 self
.has_cursor_type_
= 0
5088 self
.cursor_type_
= 0
5090 def has_cursor_type(self
): return self
.has_cursor_type_
5092 def limit(self
): return self
.limit_
5094 def set_limit(self
, x
):
5098 def clear_limit(self
):
5103 def has_limit(self
): return self
.has_limit_
5105 def matched_count_accuracy(self
): return self
.matched_count_accuracy_
5107 def set_matched_count_accuracy(self
, x
):
5108 self
.has_matched_count_accuracy_
= 1
5109 self
.matched_count_accuracy_
= x
5111 def clear_matched_count_accuracy(self
):
5112 if self
.has_matched_count_accuracy_
:
5113 self
.has_matched_count_accuracy_
= 0
5114 self
.matched_count_accuracy_
= 0
5116 def has_matched_count_accuracy(self
): return self
.has_matched_count_accuracy_
5118 def sort_spec_size(self
): return len(self
.sort_spec_
)
5119 def sort_spec_list(self
): return self
.sort_spec_
5121 def sort_spec(self
, i
):
5122 return self
.sort_spec_
[i
]
5124 def mutable_sort_spec(self
, i
):
5125 return self
.sort_spec_
[i
]
5127 def add_sort_spec(self
):
5129 self
.sort_spec_
.append(x
)
5132 def clear_sort_spec(self
):
5133 self
.sort_spec_
= []
5134 def scorer_spec(self
):
5135 if self
.scorer_spec_
is None:
5136 self
.lazy_init_lock_
.acquire()
5138 if self
.scorer_spec_
is None: self
.scorer_spec_
= ScorerSpec()
5140 self
.lazy_init_lock_
.release()
5141 return self
.scorer_spec_
5143 def mutable_scorer_spec(self
): self
.has_scorer_spec_
= 1; return self
.scorer_spec()
5145 def clear_scorer_spec(self
):
5147 if self
.has_scorer_spec_
:
5148 self
.has_scorer_spec_
= 0;
5149 if self
.scorer_spec_
is not None: self
.scorer_spec_
.Clear()
5151 def has_scorer_spec(self
): return self
.has_scorer_spec_
5153 def field_spec(self
):
5154 if self
.field_spec_
is None:
5155 self
.lazy_init_lock_
.acquire()
5157 if self
.field_spec_
is None: self
.field_spec_
= FieldSpec()
5159 self
.lazy_init_lock_
.release()
5160 return self
.field_spec_
5162 def mutable_field_spec(self
): self
.has_field_spec_
= 1; return self
.field_spec()
5164 def clear_field_spec(self
):
5166 if self
.has_field_spec_
:
5167 self
.has_field_spec_
= 0;
5168 if self
.field_spec_
is not None: self
.field_spec_
.Clear()
5170 def has_field_spec(self
): return self
.has_field_spec_
5172 def keys_only(self
): return self
.keys_only_
5174 def set_keys_only(self
, x
):
5175 self
.has_keys_only_
= 1
5178 def clear_keys_only(self
):
5179 if self
.has_keys_only_
:
5180 self
.has_keys_only_
= 0
5183 def has_keys_only(self
): return self
.has_keys_only_
5185 def parsing_mode(self
): return self
.parsing_mode_
5187 def set_parsing_mode(self
, x
):
5188 self
.has_parsing_mode_
= 1
5189 self
.parsing_mode_
= x
5191 def clear_parsing_mode(self
):
5192 if self
.has_parsing_mode_
:
5193 self
.has_parsing_mode_
= 0
5194 self
.parsing_mode_
= 0
5196 def has_parsing_mode(self
): return self
.has_parsing_mode_
5198 def auto_discover_facet_count(self
): return self
.auto_discover_facet_count_
5200 def set_auto_discover_facet_count(self
, x
):
5201 self
.has_auto_discover_facet_count_
= 1
5202 self
.auto_discover_facet_count_
= x
5204 def clear_auto_discover_facet_count(self
):
5205 if self
.has_auto_discover_facet_count_
:
5206 self
.has_auto_discover_facet_count_
= 0
5207 self
.auto_discover_facet_count_
= 0
5209 def has_auto_discover_facet_count(self
): return self
.has_auto_discover_facet_count_
5211 def include_facet_size(self
): return len(self
.include_facet_
)
5212 def include_facet_list(self
): return self
.include_facet_
5214 def include_facet(self
, i
):
5215 return self
.include_facet_
[i
]
5217 def mutable_include_facet(self
, i
):
5218 return self
.include_facet_
[i
]
5220 def add_include_facet(self
):
5222 self
.include_facet_
.append(x
)
5225 def clear_include_facet(self
):
5226 self
.include_facet_
= []
5227 def facet_refinement_size(self
): return len(self
.facet_refinement_
)
5228 def facet_refinement_list(self
): return self
.facet_refinement_
5230 def facet_refinement(self
, i
):
5231 return self
.facet_refinement_
[i
]
5233 def mutable_facet_refinement(self
, i
):
5234 return self
.facet_refinement_
[i
]
5236 def add_facet_refinement(self
):
5237 x
= FacetRefinement()
5238 self
.facet_refinement_
.append(x
)
5241 def clear_facet_refinement(self
):
5242 self
.facet_refinement_
= []
5243 def facet_auto_detect_param(self
):
5244 if self
.facet_auto_detect_param_
is None:
5245 self
.lazy_init_lock_
.acquire()
5247 if self
.facet_auto_detect_param_
is None: self
.facet_auto_detect_param_
= FacetAutoDetectParam()
5249 self
.lazy_init_lock_
.release()
5250 return self
.facet_auto_detect_param_
5252 def mutable_facet_auto_detect_param(self
): self
.has_facet_auto_detect_param_
= 1; return self
.facet_auto_detect_param()
5254 def clear_facet_auto_detect_param(self
):
5256 if self
.has_facet_auto_detect_param_
:
5257 self
.has_facet_auto_detect_param_
= 0;
5258 if self
.facet_auto_detect_param_
is not None: self
.facet_auto_detect_param_
.Clear()
5260 def has_facet_auto_detect_param(self
): return self
.has_facet_auto_detect_param_
5262 def facet_depth(self
): return self
.facet_depth_
5264 def set_facet_depth(self
, x
):
5265 self
.has_facet_depth_
= 1
5266 self
.facet_depth_
= x
5268 def clear_facet_depth(self
):
5269 if self
.has_facet_depth_
:
5270 self
.has_facet_depth_
= 0
5271 self
.facet_depth_
= 1000
5273 def has_facet_depth(self
): return self
.has_facet_depth_
5276 def MergeFrom(self
, x
):
5277 assert x
is not self
5278 if (x
.has_index_spec()): self
.mutable_index_spec().MergeFrom(x
.index_spec())
5279 if (x
.has_query()): self
.set_query(x
.query())
5280 if (x
.has_cursor()): self
.set_cursor(x
.cursor())
5281 if (x
.has_offset()): self
.set_offset(x
.offset())
5282 if (x
.has_cursor_type()): self
.set_cursor_type(x
.cursor_type())
5283 if (x
.has_limit()): self
.set_limit(x
.limit())
5284 if (x
.has_matched_count_accuracy()): self
.set_matched_count_accuracy(x
.matched_count_accuracy())
5285 for i
in xrange(x
.sort_spec_size()): self
.add_sort_spec().CopyFrom(x
.sort_spec(i
))
5286 if (x
.has_scorer_spec()): self
.mutable_scorer_spec().MergeFrom(x
.scorer_spec())
5287 if (x
.has_field_spec()): self
.mutable_field_spec().MergeFrom(x
.field_spec())
5288 if (x
.has_keys_only()): self
.set_keys_only(x
.keys_only())
5289 if (x
.has_parsing_mode()): self
.set_parsing_mode(x
.parsing_mode())
5290 if (x
.has_auto_discover_facet_count()): self
.set_auto_discover_facet_count(x
.auto_discover_facet_count())
5291 for i
in xrange(x
.include_facet_size()): self
.add_include_facet().CopyFrom(x
.include_facet(i
))
5292 for i
in xrange(x
.facet_refinement_size()): self
.add_facet_refinement().CopyFrom(x
.facet_refinement(i
))
5293 if (x
.has_facet_auto_detect_param()): self
.mutable_facet_auto_detect_param().MergeFrom(x
.facet_auto_detect_param())
5294 if (x
.has_facet_depth()): self
.set_facet_depth(x
.facet_depth())
5296 def Equals(self
, x
):
5297 if x
is self
: return 1
5298 if self
.has_index_spec_
!= x
.has_index_spec_
: return 0
5299 if self
.has_index_spec_
and self
.index_spec_
!= x
.index_spec_
: return 0
5300 if self
.has_query_
!= x
.has_query_
: return 0
5301 if self
.has_query_
and self
.query_
!= x
.query_
: return 0
5302 if self
.has_cursor_
!= x
.has_cursor_
: return 0
5303 if self
.has_cursor_
and self
.cursor_
!= x
.cursor_
: return 0
5304 if self
.has_offset_
!= x
.has_offset_
: return 0
5305 if self
.has_offset_
and self
.offset_
!= x
.offset_
: return 0
5306 if self
.has_cursor_type_
!= x
.has_cursor_type_
: return 0
5307 if self
.has_cursor_type_
and self
.cursor_type_
!= x
.cursor_type_
: return 0
5308 if self
.has_limit_
!= x
.has_limit_
: return 0
5309 if self
.has_limit_
and self
.limit_
!= x
.limit_
: return 0
5310 if self
.has_matched_count_accuracy_
!= x
.has_matched_count_accuracy_
: return 0
5311 if self
.has_matched_count_accuracy_
and self
.matched_count_accuracy_
!= x
.matched_count_accuracy_
: return 0
5312 if len(self
.sort_spec_
) != len(x
.sort_spec_
): return 0
5313 for e1
, e2
in zip(self
.sort_spec_
, x
.sort_spec_
):
5314 if e1
!= e2
: return 0
5315 if self
.has_scorer_spec_
!= x
.has_scorer_spec_
: return 0
5316 if self
.has_scorer_spec_
and self
.scorer_spec_
!= x
.scorer_spec_
: return 0
5317 if self
.has_field_spec_
!= x
.has_field_spec_
: return 0
5318 if self
.has_field_spec_
and self
.field_spec_
!= x
.field_spec_
: return 0
5319 if self
.has_keys_only_
!= x
.has_keys_only_
: return 0
5320 if self
.has_keys_only_
and self
.keys_only_
!= x
.keys_only_
: return 0
5321 if self
.has_parsing_mode_
!= x
.has_parsing_mode_
: return 0
5322 if self
.has_parsing_mode_
and self
.parsing_mode_
!= x
.parsing_mode_
: return 0
5323 if self
.has_auto_discover_facet_count_
!= x
.has_auto_discover_facet_count_
: return 0
5324 if self
.has_auto_discover_facet_count_
and self
.auto_discover_facet_count_
!= x
.auto_discover_facet_count_
: return 0
5325 if len(self
.include_facet_
) != len(x
.include_facet_
): return 0
5326 for e1
, e2
in zip(self
.include_facet_
, x
.include_facet_
):
5327 if e1
!= e2
: return 0
5328 if len(self
.facet_refinement_
) != len(x
.facet_refinement_
): return 0
5329 for e1
, e2
in zip(self
.facet_refinement_
, x
.facet_refinement_
):
5330 if e1
!= e2
: return 0
5331 if self
.has_facet_auto_detect_param_
!= x
.has_facet_auto_detect_param_
: return 0
5332 if self
.has_facet_auto_detect_param_
and self
.facet_auto_detect_param_
!= x
.facet_auto_detect_param_
: return 0
5333 if self
.has_facet_depth_
!= x
.has_facet_depth_
: return 0
5334 if self
.has_facet_depth_
and self
.facet_depth_
!= x
.facet_depth_
: return 0
5337 def IsInitialized(self
, debug_strs
=None):
5339 if (not self
.has_index_spec_
):
5341 if debug_strs
is not None:
5342 debug_strs
.append('Required field: index_spec not set.')
5343 elif not self
.index_spec_
.IsInitialized(debug_strs
): initialized
= 0
5344 if (not self
.has_query_
):
5346 if debug_strs
is not None:
5347 debug_strs
.append('Required field: query not set.')
5348 for p
in self
.sort_spec_
:
5349 if not p
.IsInitialized(debug_strs
): initialized
=0
5350 if (self
.has_scorer_spec_
and not self
.scorer_spec_
.IsInitialized(debug_strs
)): initialized
= 0
5351 if (self
.has_field_spec_
and not self
.field_spec_
.IsInitialized(debug_strs
)): initialized
= 0
5352 for p
in self
.include_facet_
:
5353 if not p
.IsInitialized(debug_strs
): initialized
=0
5354 for p
in self
.facet_refinement_
:
5355 if not p
.IsInitialized(debug_strs
): initialized
=0
5356 if (self
.has_facet_auto_detect_param_
and not self
.facet_auto_detect_param_
.IsInitialized(debug_strs
)): initialized
= 0
5361 n
+= self
.lengthString(self
.index_spec_
.ByteSize())
5362 n
+= self
.lengthString(len(self
.query_
))
5363 if (self
.has_cursor_
): n
+= 1 + self
.lengthString(len(self
.cursor_
))
5364 if (self
.has_offset_
): n
+= 1 + self
.lengthVarInt64(self
.offset_
)
5365 if (self
.has_cursor_type_
): n
+= 1 + self
.lengthVarInt64(self
.cursor_type_
)
5366 if (self
.has_limit_
): n
+= 1 + self
.lengthVarInt64(self
.limit_
)
5367 if (self
.has_matched_count_accuracy_
): n
+= 1 + self
.lengthVarInt64(self
.matched_count_accuracy_
)
5368 n
+= 1 * len(self
.sort_spec_
)
5369 for i
in xrange(len(self
.sort_spec_
)): n
+= self
.lengthString(self
.sort_spec_
[i
].ByteSize())
5370 if (self
.has_scorer_spec_
): n
+= 1 + self
.lengthString(self
.scorer_spec_
.ByteSize())
5371 if (self
.has_field_spec_
): n
+= 1 + self
.lengthString(self
.field_spec_
.ByteSize())
5372 if (self
.has_keys_only_
): n
+= 2
5373 if (self
.has_parsing_mode_
): n
+= 1 + self
.lengthVarInt64(self
.parsing_mode_
)
5374 if (self
.has_auto_discover_facet_count_
): n
+= 1 + self
.lengthVarInt64(self
.auto_discover_facet_count_
)
5375 n
+= 2 * len(self
.include_facet_
)
5376 for i
in xrange(len(self
.include_facet_
)): n
+= self
.lengthString(self
.include_facet_
[i
].ByteSize())
5377 n
+= 2 * len(self
.facet_refinement_
)
5378 for i
in xrange(len(self
.facet_refinement_
)): n
+= self
.lengthString(self
.facet_refinement_
[i
].ByteSize())
5379 if (self
.has_facet_auto_detect_param_
): n
+= 2 + self
.lengthString(self
.facet_auto_detect_param_
.ByteSize())
5380 if (self
.has_facet_depth_
): n
+= 2 + self
.lengthVarInt64(self
.facet_depth_
)
5383 def ByteSizePartial(self
):
5385 if (self
.has_index_spec_
):
5387 n
+= self
.lengthString(self
.index_spec_
.ByteSizePartial())
5388 if (self
.has_query_
):
5390 n
+= self
.lengthString(len(self
.query_
))
5391 if (self
.has_cursor_
): n
+= 1 + self
.lengthString(len(self
.cursor_
))
5392 if (self
.has_offset_
): n
+= 1 + self
.lengthVarInt64(self
.offset_
)
5393 if (self
.has_cursor_type_
): n
+= 1 + self
.lengthVarInt64(self
.cursor_type_
)
5394 if (self
.has_limit_
): n
+= 1 + self
.lengthVarInt64(self
.limit_
)
5395 if (self
.has_matched_count_accuracy_
): n
+= 1 + self
.lengthVarInt64(self
.matched_count_accuracy_
)
5396 n
+= 1 * len(self
.sort_spec_
)
5397 for i
in xrange(len(self
.sort_spec_
)): n
+= self
.lengthString(self
.sort_spec_
[i
].ByteSizePartial())
5398 if (self
.has_scorer_spec_
): n
+= 1 + self
.lengthString(self
.scorer_spec_
.ByteSizePartial())
5399 if (self
.has_field_spec_
): n
+= 1 + self
.lengthString(self
.field_spec_
.ByteSizePartial())
5400 if (self
.has_keys_only_
): n
+= 2
5401 if (self
.has_parsing_mode_
): n
+= 1 + self
.lengthVarInt64(self
.parsing_mode_
)
5402 if (self
.has_auto_discover_facet_count_
): n
+= 1 + self
.lengthVarInt64(self
.auto_discover_facet_count_
)
5403 n
+= 2 * len(self
.include_facet_
)
5404 for i
in xrange(len(self
.include_facet_
)): n
+= self
.lengthString(self
.include_facet_
[i
].ByteSizePartial())
5405 n
+= 2 * len(self
.facet_refinement_
)
5406 for i
in xrange(len(self
.facet_refinement_
)): n
+= self
.lengthString(self
.facet_refinement_
[i
].ByteSizePartial())
5407 if (self
.has_facet_auto_detect_param_
): n
+= 2 + self
.lengthString(self
.facet_auto_detect_param_
.ByteSizePartial())
5408 if (self
.has_facet_depth_
): n
+= 2 + self
.lengthVarInt64(self
.facet_depth_
)
5412 self
.clear_index_spec()
5416 self
.clear_cursor_type()
5418 self
.clear_matched_count_accuracy()
5419 self
.clear_sort_spec()
5420 self
.clear_scorer_spec()
5421 self
.clear_field_spec()
5422 self
.clear_keys_only()
5423 self
.clear_parsing_mode()
5424 self
.clear_auto_discover_facet_count()
5425 self
.clear_include_facet()
5426 self
.clear_facet_refinement()
5427 self
.clear_facet_auto_detect_param()
5428 self
.clear_facet_depth()
5430 def OutputUnchecked(self
, out
):
5432 out
.putVarInt32(self
.index_spec_
.ByteSize())
5433 self
.index_spec_
.OutputUnchecked(out
)
5435 out
.putPrefixedString(self
.query_
)
5436 if (self
.has_cursor_
):
5438 out
.putPrefixedString(self
.cursor_
)
5439 if (self
.has_cursor_type_
):
5441 out
.putVarInt32(self
.cursor_type_
)
5442 if (self
.has_limit_
):
5444 out
.putVarInt32(self
.limit_
)
5445 if (self
.has_matched_count_accuracy_
):
5447 out
.putVarInt32(self
.matched_count_accuracy_
)
5448 for i
in xrange(len(self
.sort_spec_
)):
5450 out
.putVarInt32(self
.sort_spec_
[i
].ByteSize())
5451 self
.sort_spec_
[i
].OutputUnchecked(out
)
5452 if (self
.has_scorer_spec_
):
5454 out
.putVarInt32(self
.scorer_spec_
.ByteSize())
5455 self
.scorer_spec_
.OutputUnchecked(out
)
5456 if (self
.has_field_spec_
):
5458 out
.putVarInt32(self
.field_spec_
.ByteSize())
5459 self
.field_spec_
.OutputUnchecked(out
)
5460 if (self
.has_offset_
):
5462 out
.putVarInt32(self
.offset_
)
5463 if (self
.has_keys_only_
):
5465 out
.putBoolean(self
.keys_only_
)
5466 if (self
.has_parsing_mode_
):
5467 out
.putVarInt32(104)
5468 out
.putVarInt32(self
.parsing_mode_
)
5469 if (self
.has_auto_discover_facet_count_
):
5470 out
.putVarInt32(120)
5471 out
.putVarInt32(self
.auto_discover_facet_count_
)
5472 for i
in xrange(len(self
.include_facet_
)):
5473 out
.putVarInt32(130)
5474 out
.putVarInt32(self
.include_facet_
[i
].ByteSize())
5475 self
.include_facet_
[i
].OutputUnchecked(out
)
5476 for i
in xrange(len(self
.facet_refinement_
)):
5477 out
.putVarInt32(138)
5478 out
.putVarInt32(self
.facet_refinement_
[i
].ByteSize())
5479 self
.facet_refinement_
[i
].OutputUnchecked(out
)
5480 if (self
.has_facet_auto_detect_param_
):
5481 out
.putVarInt32(146)
5482 out
.putVarInt32(self
.facet_auto_detect_param_
.ByteSize())
5483 self
.facet_auto_detect_param_
.OutputUnchecked(out
)
5484 if (self
.has_facet_depth_
):
5485 out
.putVarInt32(152)
5486 out
.putVarInt32(self
.facet_depth_
)
5488 def OutputPartial(self
, out
):
5489 if (self
.has_index_spec_
):
5491 out
.putVarInt32(self
.index_spec_
.ByteSizePartial())
5492 self
.index_spec_
.OutputPartial(out
)
5493 if (self
.has_query_
):
5495 out
.putPrefixedString(self
.query_
)
5496 if (self
.has_cursor_
):
5498 out
.putPrefixedString(self
.cursor_
)
5499 if (self
.has_cursor_type_
):
5501 out
.putVarInt32(self
.cursor_type_
)
5502 if (self
.has_limit_
):
5504 out
.putVarInt32(self
.limit_
)
5505 if (self
.has_matched_count_accuracy_
):
5507 out
.putVarInt32(self
.matched_count_accuracy_
)
5508 for i
in xrange(len(self
.sort_spec_
)):
5510 out
.putVarInt32(self
.sort_spec_
[i
].ByteSizePartial())
5511 self
.sort_spec_
[i
].OutputPartial(out
)
5512 if (self
.has_scorer_spec_
):
5514 out
.putVarInt32(self
.scorer_spec_
.ByteSizePartial())
5515 self
.scorer_spec_
.OutputPartial(out
)
5516 if (self
.has_field_spec_
):
5518 out
.putVarInt32(self
.field_spec_
.ByteSizePartial())
5519 self
.field_spec_
.OutputPartial(out
)
5520 if (self
.has_offset_
):
5522 out
.putVarInt32(self
.offset_
)
5523 if (self
.has_keys_only_
):
5525 out
.putBoolean(self
.keys_only_
)
5526 if (self
.has_parsing_mode_
):
5527 out
.putVarInt32(104)
5528 out
.putVarInt32(self
.parsing_mode_
)
5529 if (self
.has_auto_discover_facet_count_
):
5530 out
.putVarInt32(120)
5531 out
.putVarInt32(self
.auto_discover_facet_count_
)
5532 for i
in xrange(len(self
.include_facet_
)):
5533 out
.putVarInt32(130)
5534 out
.putVarInt32(self
.include_facet_
[i
].ByteSizePartial())
5535 self
.include_facet_
[i
].OutputPartial(out
)
5536 for i
in xrange(len(self
.facet_refinement_
)):
5537 out
.putVarInt32(138)
5538 out
.putVarInt32(self
.facet_refinement_
[i
].ByteSizePartial())
5539 self
.facet_refinement_
[i
].OutputPartial(out
)
5540 if (self
.has_facet_auto_detect_param_
):
5541 out
.putVarInt32(146)
5542 out
.putVarInt32(self
.facet_auto_detect_param_
.ByteSizePartial())
5543 self
.facet_auto_detect_param_
.OutputPartial(out
)
5544 if (self
.has_facet_depth_
):
5545 out
.putVarInt32(152)
5546 out
.putVarInt32(self
.facet_depth_
)
5548 def TryMerge(self
, d
):
5549 while d
.avail() > 0:
5550 tt
= d
.getVarInt32()
5552 length
= d
.getVarInt32()
5553 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5555 self
.mutable_index_spec().TryMerge(tmp
)
5558 self
.set_query(d
.getPrefixedString())
5561 self
.set_cursor(d
.getPrefixedString())
5564 self
.set_cursor_type(d
.getVarInt32())
5567 self
.set_limit(d
.getVarInt32())
5570 self
.set_matched_count_accuracy(d
.getVarInt32())
5573 length
= d
.getVarInt32()
5574 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5576 self
.add_sort_spec().TryMerge(tmp
)
5579 length
= d
.getVarInt32()
5580 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5582 self
.mutable_scorer_spec().TryMerge(tmp
)
5585 length
= d
.getVarInt32()
5586 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5588 self
.mutable_field_spec().TryMerge(tmp
)
5591 self
.set_offset(d
.getVarInt32())
5594 self
.set_keys_only(d
.getBoolean())
5597 self
.set_parsing_mode(d
.getVarInt32())
5600 self
.set_auto_discover_facet_count(d
.getVarInt32())
5603 length
= d
.getVarInt32()
5604 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5606 self
.add_include_facet().TryMerge(tmp
)
5609 length
= d
.getVarInt32()
5610 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5612 self
.add_facet_refinement().TryMerge(tmp
)
5615 length
= d
.getVarInt32()
5616 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5618 self
.mutable_facet_auto_detect_param().TryMerge(tmp
)
5621 self
.set_facet_depth(d
.getVarInt32())
5625 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
5629 def __str__(self
, prefix
="", printElemNumber
=0):
5631 if self
.has_index_spec_
:
5632 res
+=prefix
+"index_spec <\n"
5633 res
+=self
.index_spec_
.__str
__(prefix
+ " ", printElemNumber
)
5635 if self
.has_query_
: res
+=prefix
+("query: %s\n" % self
.DebugFormatString(self
.query_
))
5636 if self
.has_cursor_
: res
+=prefix
+("cursor: %s\n" % self
.DebugFormatString(self
.cursor_
))
5637 if self
.has_offset_
: res
+=prefix
+("offset: %s\n" % self
.DebugFormatInt32(self
.offset_
))
5638 if self
.has_cursor_type_
: res
+=prefix
+("cursor_type: %s\n" % self
.DebugFormatInt32(self
.cursor_type_
))
5639 if self
.has_limit_
: res
+=prefix
+("limit: %s\n" % self
.DebugFormatInt32(self
.limit_
))
5640 if self
.has_matched_count_accuracy_
: res
+=prefix
+("matched_count_accuracy: %s\n" % self
.DebugFormatInt32(self
.matched_count_accuracy_
))
5642 for e
in self
.sort_spec_
:
5644 if printElemNumber
: elm
="(%d)" % cnt
5645 res
+=prefix
+("sort_spec%s <\n" % elm
)
5646 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
5649 if self
.has_scorer_spec_
:
5650 res
+=prefix
+"scorer_spec <\n"
5651 res
+=self
.scorer_spec_
.__str
__(prefix
+ " ", printElemNumber
)
5653 if self
.has_field_spec_
:
5654 res
+=prefix
+"field_spec <\n"
5655 res
+=self
.field_spec_
.__str
__(prefix
+ " ", printElemNumber
)
5657 if self
.has_keys_only_
: res
+=prefix
+("keys_only: %s\n" % self
.DebugFormatBool(self
.keys_only_
))
5658 if self
.has_parsing_mode_
: res
+=prefix
+("parsing_mode: %s\n" % self
.DebugFormatInt32(self
.parsing_mode_
))
5659 if self
.has_auto_discover_facet_count_
: res
+=prefix
+("auto_discover_facet_count: %s\n" % self
.DebugFormatInt32(self
.auto_discover_facet_count_
))
5661 for e
in self
.include_facet_
:
5663 if printElemNumber
: elm
="(%d)" % cnt
5664 res
+=prefix
+("include_facet%s <\n" % elm
)
5665 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
5669 for e
in self
.facet_refinement_
:
5671 if printElemNumber
: elm
="(%d)" % cnt
5672 res
+=prefix
+("facet_refinement%s <\n" % elm
)
5673 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
5676 if self
.has_facet_auto_detect_param_
:
5677 res
+=prefix
+"facet_auto_detect_param <\n"
5678 res
+=self
.facet_auto_detect_param_
.__str
__(prefix
+ " ", printElemNumber
)
5680 if self
.has_facet_depth_
: res
+=prefix
+("facet_depth: %s\n" % self
.DebugFormatInt32(self
.facet_depth_
))
5684 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
5685 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
5693 kmatched_count_accuracy
= 7
5699 kauto_discover_facet_count
= 15
5701 kfacet_refinement
= 17
5702 kfacet_auto_detect_param
= 18
5705 _TEXT
= _BuildTagLookupTable({
5712 7: "matched_count_accuracy",
5719 15: "auto_discover_facet_count",
5720 16: "include_facet",
5721 17: "facet_refinement",
5722 18: "facet_auto_detect_param",
5726 _TYPES
= _BuildTagLookupTable({
5727 0: ProtocolBuffer
.Encoder
.NUMERIC
,
5728 1: ProtocolBuffer
.Encoder
.STRING
,
5729 2: ProtocolBuffer
.Encoder
.STRING
,
5730 4: ProtocolBuffer
.Encoder
.STRING
,
5731 5: ProtocolBuffer
.Encoder
.NUMERIC
,
5732 6: ProtocolBuffer
.Encoder
.NUMERIC
,
5733 7: ProtocolBuffer
.Encoder
.NUMERIC
,
5734 8: ProtocolBuffer
.Encoder
.STRING
,
5735 9: ProtocolBuffer
.Encoder
.STRING
,
5736 10: ProtocolBuffer
.Encoder
.STRING
,
5737 11: ProtocolBuffer
.Encoder
.NUMERIC
,
5738 12: ProtocolBuffer
.Encoder
.NUMERIC
,
5739 13: ProtocolBuffer
.Encoder
.NUMERIC
,
5740 15: ProtocolBuffer
.Encoder
.NUMERIC
,
5741 16: ProtocolBuffer
.Encoder
.STRING
,
5742 17: ProtocolBuffer
.Encoder
.STRING
,
5743 18: ProtocolBuffer
.Encoder
.STRING
,
5744 19: ProtocolBuffer
.Encoder
.NUMERIC
,
5745 }, 19, ProtocolBuffer
.Encoder
.MAX_TYPE
)
5749 _STYLE_CONTENT_TYPE
= """"""
5750 _PROTO_DESCRIPTOR_NAME
= 'apphosting.SearchParams'
5751 class SearchRequest(ProtocolBuffer
.ProtocolMessage
):
5756 def __init__(self
, contents
=None):
5757 self
.params_
= SearchParams()
5758 if contents
is not None: self
.MergeFromString(contents
)
5760 def params(self
): return self
.params_
5762 def mutable_params(self
): self
.has_params_
= 1; return self
.params_
5764 def clear_params(self
):self
.has_params_
= 0; self
.params_
.Clear()
5766 def has_params(self
): return self
.has_params_
5768 def app_id(self
): return self
.app_id_
5770 def set_app_id(self
, x
):
5771 self
.has_app_id_
= 1
5774 def clear_app_id(self
):
5775 if self
.has_app_id_
:
5776 self
.has_app_id_
= 0
5779 def has_app_id(self
): return self
.has_app_id_
5782 def MergeFrom(self
, x
):
5783 assert x
is not self
5784 if (x
.has_params()): self
.mutable_params().MergeFrom(x
.params())
5785 if (x
.has_app_id()): self
.set_app_id(x
.app_id())
5787 def Equals(self
, x
):
5788 if x
is self
: return 1
5789 if self
.has_params_
!= x
.has_params_
: return 0
5790 if self
.has_params_
and self
.params_
!= x
.params_
: return 0
5791 if self
.has_app_id_
!= x
.has_app_id_
: return 0
5792 if self
.has_app_id_
and self
.app_id_
!= x
.app_id_
: return 0
5795 def IsInitialized(self
, debug_strs
=None):
5797 if (not self
.has_params_
):
5799 if debug_strs
is not None:
5800 debug_strs
.append('Required field: params not set.')
5801 elif not self
.params_
.IsInitialized(debug_strs
): initialized
= 0
5806 n
+= self
.lengthString(self
.params_
.ByteSize())
5807 if (self
.has_app_id_
): n
+= 1 + self
.lengthString(len(self
.app_id_
))
5810 def ByteSizePartial(self
):
5812 if (self
.has_params_
):
5814 n
+= self
.lengthString(self
.params_
.ByteSizePartial())
5815 if (self
.has_app_id_
): n
+= 1 + self
.lengthString(len(self
.app_id_
))
5822 def OutputUnchecked(self
, out
):
5824 out
.putVarInt32(self
.params_
.ByteSize())
5825 self
.params_
.OutputUnchecked(out
)
5826 if (self
.has_app_id_
):
5828 out
.putPrefixedString(self
.app_id_
)
5830 def OutputPartial(self
, out
):
5831 if (self
.has_params_
):
5833 out
.putVarInt32(self
.params_
.ByteSizePartial())
5834 self
.params_
.OutputPartial(out
)
5835 if (self
.has_app_id_
):
5837 out
.putPrefixedString(self
.app_id_
)
5839 def TryMerge(self
, d
):
5840 while d
.avail() > 0:
5841 tt
= d
.getVarInt32()
5843 length
= d
.getVarInt32()
5844 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5846 self
.mutable_params().TryMerge(tmp
)
5849 self
.set_app_id(d
.getPrefixedString())
5853 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
5857 def __str__(self
, prefix
="", printElemNumber
=0):
5859 if self
.has_params_
:
5860 res
+=prefix
+"params <\n"
5861 res
+=self
.params_
.__str
__(prefix
+ " ", printElemNumber
)
5863 if self
.has_app_id_
: res
+=prefix
+("app_id: %s\n" % self
.DebugFormatString(self
.app_id_
))
5867 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
5868 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
5873 _TEXT
= _BuildTagLookupTable({
5879 _TYPES
= _BuildTagLookupTable({
5880 0: ProtocolBuffer
.Encoder
.NUMERIC
,
5881 1: ProtocolBuffer
.Encoder
.STRING
,
5882 3: ProtocolBuffer
.Encoder
.STRING
,
5883 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
5887 _STYLE_CONTENT_TYPE
= """"""
5888 _PROTO_DESCRIPTOR_NAME
= 'apphosting.SearchRequest'
5889 class FacetResultValue(ProtocolBuffer
.ProtocolMessage
):
5896 def __init__(self
, contents
=None):
5897 self
.refinement_
= FacetRefinement()
5898 if contents
is not None: self
.MergeFromString(contents
)
5900 def name(self
): return self
.name_
5902 def set_name(self
, x
):
5906 def clear_name(self
):
5911 def has_name(self
): return self
.has_name_
5913 def count(self
): return self
.count_
5915 def set_count(self
, x
):
5919 def clear_count(self
):
5924 def has_count(self
): return self
.has_count_
5926 def refinement(self
): return self
.refinement_
5928 def mutable_refinement(self
): self
.has_refinement_
= 1; return self
.refinement_
5930 def clear_refinement(self
):self
.has_refinement_
= 0; self
.refinement_
.Clear()
5932 def has_refinement(self
): return self
.has_refinement_
5935 def MergeFrom(self
, x
):
5936 assert x
is not self
5937 if (x
.has_name()): self
.set_name(x
.name())
5938 if (x
.has_count()): self
.set_count(x
.count())
5939 if (x
.has_refinement()): self
.mutable_refinement().MergeFrom(x
.refinement())
5941 def Equals(self
, x
):
5942 if x
is self
: return 1
5943 if self
.has_name_
!= x
.has_name_
: return 0
5944 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
5945 if self
.has_count_
!= x
.has_count_
: return 0
5946 if self
.has_count_
and self
.count_
!= x
.count_
: return 0
5947 if self
.has_refinement_
!= x
.has_refinement_
: return 0
5948 if self
.has_refinement_
and self
.refinement_
!= x
.refinement_
: return 0
5951 def IsInitialized(self
, debug_strs
=None):
5953 if (not self
.has_name_
):
5955 if debug_strs
is not None:
5956 debug_strs
.append('Required field: name not set.')
5957 if (not self
.has_count_
):
5959 if debug_strs
is not None:
5960 debug_strs
.append('Required field: count not set.')
5961 if (not self
.has_refinement_
):
5963 if debug_strs
is not None:
5964 debug_strs
.append('Required field: refinement not set.')
5965 elif not self
.refinement_
.IsInitialized(debug_strs
): initialized
= 0
5970 n
+= self
.lengthString(len(self
.name_
))
5971 n
+= self
.lengthVarInt64(self
.count_
)
5972 n
+= self
.lengthString(self
.refinement_
.ByteSize())
5975 def ByteSizePartial(self
):
5977 if (self
.has_name_
):
5979 n
+= self
.lengthString(len(self
.name_
))
5980 if (self
.has_count_
):
5982 n
+= self
.lengthVarInt64(self
.count_
)
5983 if (self
.has_refinement_
):
5985 n
+= self
.lengthString(self
.refinement_
.ByteSizePartial())
5991 self
.clear_refinement()
5993 def OutputUnchecked(self
, out
):
5995 out
.putPrefixedString(self
.name_
)
5997 out
.putVarInt32(self
.count_
)
5999 out
.putVarInt32(self
.refinement_
.ByteSize())
6000 self
.refinement_
.OutputUnchecked(out
)
6002 def OutputPartial(self
, out
):
6003 if (self
.has_name_
):
6005 out
.putPrefixedString(self
.name_
)
6006 if (self
.has_count_
):
6008 out
.putVarInt32(self
.count_
)
6009 if (self
.has_refinement_
):
6011 out
.putVarInt32(self
.refinement_
.ByteSizePartial())
6012 self
.refinement_
.OutputPartial(out
)
6014 def TryMerge(self
, d
):
6015 while d
.avail() > 0:
6016 tt
= d
.getVarInt32()
6018 self
.set_name(d
.getPrefixedString())
6021 self
.set_count(d
.getVarInt32())
6024 length
= d
.getVarInt32()
6025 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6027 self
.mutable_refinement().TryMerge(tmp
)
6031 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6035 def __str__(self
, prefix
="", printElemNumber
=0):
6037 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
6038 if self
.has_count_
: res
+=prefix
+("count: %s\n" % self
.DebugFormatInt32(self
.count_
))
6039 if self
.has_refinement_
:
6040 res
+=prefix
+"refinement <\n"
6041 res
+=self
.refinement_
.__str
__(prefix
+ " ", printElemNumber
)
6046 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6047 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6053 _TEXT
= _BuildTagLookupTable({
6060 _TYPES
= _BuildTagLookupTable({
6061 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6062 1: ProtocolBuffer
.Encoder
.STRING
,
6063 2: ProtocolBuffer
.Encoder
.NUMERIC
,
6064 3: ProtocolBuffer
.Encoder
.STRING
,
6065 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
6069 _STYLE_CONTENT_TYPE
= """"""
6070 _PROTO_DESCRIPTOR_NAME
= 'apphosting.FacetResultValue'
6071 class FacetResult(ProtocolBuffer
.ProtocolMessage
):
6075 def __init__(self
, contents
=None):
6077 if contents
is not None: self
.MergeFromString(contents
)
6079 def name(self
): return self
.name_
6081 def set_name(self
, x
):
6085 def clear_name(self
):
6090 def has_name(self
): return self
.has_name_
6092 def value_size(self
): return len(self
.value_
)
6093 def value_list(self
): return self
.value_
6096 return self
.value_
[i
]
6098 def mutable_value(self
, i
):
6099 return self
.value_
[i
]
6101 def add_value(self
):
6102 x
= FacetResultValue()
6103 self
.value_
.append(x
)
6106 def clear_value(self
):
6109 def MergeFrom(self
, x
):
6110 assert x
is not self
6111 if (x
.has_name()): self
.set_name(x
.name())
6112 for i
in xrange(x
.value_size()): self
.add_value().CopyFrom(x
.value(i
))
6114 def Equals(self
, x
):
6115 if x
is self
: return 1
6116 if self
.has_name_
!= x
.has_name_
: return 0
6117 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
6118 if len(self
.value_
) != len(x
.value_
): return 0
6119 for e1
, e2
in zip(self
.value_
, x
.value_
):
6120 if e1
!= e2
: return 0
6123 def IsInitialized(self
, debug_strs
=None):
6125 if (not self
.has_name_
):
6127 if debug_strs
is not None:
6128 debug_strs
.append('Required field: name not set.')
6129 for p
in self
.value_
:
6130 if not p
.IsInitialized(debug_strs
): initialized
=0
6135 n
+= self
.lengthString(len(self
.name_
))
6136 n
+= 1 * len(self
.value_
)
6137 for i
in xrange(len(self
.value_
)): n
+= self
.lengthString(self
.value_
[i
].ByteSize())
6140 def ByteSizePartial(self
):
6142 if (self
.has_name_
):
6144 n
+= self
.lengthString(len(self
.name_
))
6145 n
+= 1 * len(self
.value_
)
6146 for i
in xrange(len(self
.value_
)): n
+= self
.lengthString(self
.value_
[i
].ByteSizePartial())
6153 def OutputUnchecked(self
, out
):
6155 out
.putPrefixedString(self
.name_
)
6156 for i
in xrange(len(self
.value_
)):
6158 out
.putVarInt32(self
.value_
[i
].ByteSize())
6159 self
.value_
[i
].OutputUnchecked(out
)
6161 def OutputPartial(self
, out
):
6162 if (self
.has_name_
):
6164 out
.putPrefixedString(self
.name_
)
6165 for i
in xrange(len(self
.value_
)):
6167 out
.putVarInt32(self
.value_
[i
].ByteSizePartial())
6168 self
.value_
[i
].OutputPartial(out
)
6170 def TryMerge(self
, d
):
6171 while d
.avail() > 0:
6172 tt
= d
.getVarInt32()
6174 self
.set_name(d
.getPrefixedString())
6177 length
= d
.getVarInt32()
6178 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6180 self
.add_value().TryMerge(tmp
)
6184 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6188 def __str__(self
, prefix
="", printElemNumber
=0):
6190 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
6192 for e
in self
.value_
:
6194 if printElemNumber
: elm
="(%d)" % cnt
6195 res
+=prefix
+("value%s <\n" % elm
)
6196 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
6202 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6203 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6208 _TEXT
= _BuildTagLookupTable({
6214 _TYPES
= _BuildTagLookupTable({
6215 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6216 1: ProtocolBuffer
.Encoder
.STRING
,
6217 2: ProtocolBuffer
.Encoder
.STRING
,
6218 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
6222 _STYLE_CONTENT_TYPE
= """"""
6223 _PROTO_DESCRIPTOR_NAME
= 'apphosting.FacetResult'
6224 class SearchResult(ProtocolBuffer
.ProtocolMessage
):
6229 def __init__(self
, contents
=None):
6230 self
.document_
= Document()
6231 self
.expression_
= []
6233 if contents
is not None: self
.MergeFromString(contents
)
6235 def document(self
): return self
.document_
6237 def mutable_document(self
): self
.has_document_
= 1; return self
.document_
6239 def clear_document(self
):self
.has_document_
= 0; self
.document_
.Clear()
6241 def has_document(self
): return self
.has_document_
6243 def expression_size(self
): return len(self
.expression_
)
6244 def expression_list(self
): return self
.expression_
6246 def expression(self
, i
):
6247 return self
.expression_
[i
]
6249 def mutable_expression(self
, i
):
6250 return self
.expression_
[i
]
6252 def add_expression(self
):
6254 self
.expression_
.append(x
)
6257 def clear_expression(self
):
6258 self
.expression_
= []
6259 def score_size(self
): return len(self
.score_
)
6260 def score_list(self
): return self
.score_
6263 return self
.score_
[i
]
6265 def set_score(self
, i
, x
):
6268 def add_score(self
, x
):
6269 self
.score_
.append(x
)
6271 def clear_score(self
):
6274 def cursor(self
): return self
.cursor_
6276 def set_cursor(self
, x
):
6277 self
.has_cursor_
= 1
6280 def clear_cursor(self
):
6281 if self
.has_cursor_
:
6282 self
.has_cursor_
= 0
6285 def has_cursor(self
): return self
.has_cursor_
6288 def MergeFrom(self
, x
):
6289 assert x
is not self
6290 if (x
.has_document()): self
.mutable_document().MergeFrom(x
.document())
6291 for i
in xrange(x
.expression_size()): self
.add_expression().CopyFrom(x
.expression(i
))
6292 for i
in xrange(x
.score_size()): self
.add_score(x
.score(i
))
6293 if (x
.has_cursor()): self
.set_cursor(x
.cursor())
6295 def Equals(self
, x
):
6296 if x
is self
: return 1
6297 if self
.has_document_
!= x
.has_document_
: return 0
6298 if self
.has_document_
and self
.document_
!= x
.document_
: return 0
6299 if len(self
.expression_
) != len(x
.expression_
): return 0
6300 for e1
, e2
in zip(self
.expression_
, x
.expression_
):
6301 if e1
!= e2
: return 0
6302 if len(self
.score_
) != len(x
.score_
): return 0
6303 for e1
, e2
in zip(self
.score_
, x
.score_
):
6304 if e1
!= e2
: return 0
6305 if self
.has_cursor_
!= x
.has_cursor_
: return 0
6306 if self
.has_cursor_
and self
.cursor_
!= x
.cursor_
: return 0
6309 def IsInitialized(self
, debug_strs
=None):
6311 if (not self
.has_document_
):
6313 if debug_strs
is not None:
6314 debug_strs
.append('Required field: document not set.')
6315 elif not self
.document_
.IsInitialized(debug_strs
): initialized
= 0
6316 for p
in self
.expression_
:
6317 if not p
.IsInitialized(debug_strs
): initialized
=0
6322 n
+= self
.lengthString(self
.document_
.ByteSize())
6323 n
+= 1 * len(self
.expression_
)
6324 for i
in xrange(len(self
.expression_
)): n
+= self
.lengthString(self
.expression_
[i
].ByteSize())
6325 n
+= 9 * len(self
.score_
)
6326 if (self
.has_cursor_
): n
+= 1 + self
.lengthString(len(self
.cursor_
))
6329 def ByteSizePartial(self
):
6331 if (self
.has_document_
):
6333 n
+= self
.lengthString(self
.document_
.ByteSizePartial())
6334 n
+= 1 * len(self
.expression_
)
6335 for i
in xrange(len(self
.expression_
)): n
+= self
.lengthString(self
.expression_
[i
].ByteSizePartial())
6336 n
+= 9 * len(self
.score_
)
6337 if (self
.has_cursor_
): n
+= 1 + self
.lengthString(len(self
.cursor_
))
6341 self
.clear_document()
6342 self
.clear_expression()
6346 def OutputUnchecked(self
, out
):
6348 out
.putVarInt32(self
.document_
.ByteSize())
6349 self
.document_
.OutputUnchecked(out
)
6350 for i
in xrange(len(self
.score_
)):
6352 out
.putDouble(self
.score_
[i
])
6353 if (self
.has_cursor_
):
6355 out
.putPrefixedString(self
.cursor_
)
6356 for i
in xrange(len(self
.expression_
)):
6358 out
.putVarInt32(self
.expression_
[i
].ByteSize())
6359 self
.expression_
[i
].OutputUnchecked(out
)
6361 def OutputPartial(self
, out
):
6362 if (self
.has_document_
):
6364 out
.putVarInt32(self
.document_
.ByteSizePartial())
6365 self
.document_
.OutputPartial(out
)
6366 for i
in xrange(len(self
.score_
)):
6368 out
.putDouble(self
.score_
[i
])
6369 if (self
.has_cursor_
):
6371 out
.putPrefixedString(self
.cursor_
)
6372 for i
in xrange(len(self
.expression_
)):
6374 out
.putVarInt32(self
.expression_
[i
].ByteSizePartial())
6375 self
.expression_
[i
].OutputPartial(out
)
6377 def TryMerge(self
, d
):
6378 while d
.avail() > 0:
6379 tt
= d
.getVarInt32()
6381 length
= d
.getVarInt32()
6382 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6384 self
.mutable_document().TryMerge(tmp
)
6387 self
.add_score(d
.getDouble())
6390 self
.set_cursor(d
.getPrefixedString())
6393 length
= d
.getVarInt32()
6394 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6396 self
.add_expression().TryMerge(tmp
)
6400 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6404 def __str__(self
, prefix
="", printElemNumber
=0):
6406 if self
.has_document_
:
6407 res
+=prefix
+"document <\n"
6408 res
+=self
.document_
.__str
__(prefix
+ " ", printElemNumber
)
6411 for e
in self
.expression_
:
6413 if printElemNumber
: elm
="(%d)" % cnt
6414 res
+=prefix
+("expression%s <\n" % elm
)
6415 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
6419 for e
in self
.score_
:
6421 if printElemNumber
: elm
="(%d)" % cnt
6422 res
+=prefix
+("score%s: %s\n" % (elm
, self
.DebugFormat(e
)))
6424 if self
.has_cursor_
: res
+=prefix
+("cursor: %s\n" % self
.DebugFormatString(self
.cursor_
))
6428 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6429 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6436 _TEXT
= _BuildTagLookupTable({
6444 _TYPES
= _BuildTagLookupTable({
6445 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6446 1: ProtocolBuffer
.Encoder
.STRING
,
6447 2: ProtocolBuffer
.Encoder
.DOUBLE
,
6448 3: ProtocolBuffer
.Encoder
.STRING
,
6449 4: ProtocolBuffer
.Encoder
.STRING
,
6450 }, 4, ProtocolBuffer
.Encoder
.MAX_TYPE
)
6454 _STYLE_CONTENT_TYPE
= """"""
6455 _PROTO_DESCRIPTOR_NAME
= 'apphosting.SearchResult'
6456 class SearchResponse(_ExtendableProtocolMessage
):
6457 has_matched_count_
= 0
6463 def __init__(self
, contents
=None):
6464 if _extension_runtime
:
6465 self
._extension
_fields
= {}
6467 self
.status_
= RequestStatus()
6468 self
.facet_result_
= []
6469 if contents
is not None: self
.MergeFromString(contents
)
6471 def result_size(self
): return len(self
.result_
)
6472 def result_list(self
): return self
.result_
6474 def result(self
, i
):
6475 return self
.result_
[i
]
6477 def mutable_result(self
, i
):
6478 return self
.result_
[i
]
6480 def add_result(self
):
6482 self
.result_
.append(x
)
6485 def clear_result(self
):
6487 def matched_count(self
): return self
.matched_count_
6489 def set_matched_count(self
, x
):
6490 self
.has_matched_count_
= 1
6491 self
.matched_count_
= x
6493 def clear_matched_count(self
):
6494 if self
.has_matched_count_
:
6495 self
.has_matched_count_
= 0
6496 self
.matched_count_
= 0
6498 def has_matched_count(self
): return self
.has_matched_count_
6500 def status(self
): return self
.status_
6502 def mutable_status(self
): self
.has_status_
= 1; return self
.status_
6504 def clear_status(self
):self
.has_status_
= 0; self
.status_
.Clear()
6506 def has_status(self
): return self
.has_status_
6508 def cursor(self
): return self
.cursor_
6510 def set_cursor(self
, x
):
6511 self
.has_cursor_
= 1
6514 def clear_cursor(self
):
6515 if self
.has_cursor_
:
6516 self
.has_cursor_
= 0
6519 def has_cursor(self
): return self
.has_cursor_
6521 def facet_result_size(self
): return len(self
.facet_result_
)
6522 def facet_result_list(self
): return self
.facet_result_
6524 def facet_result(self
, i
):
6525 return self
.facet_result_
[i
]
6527 def mutable_facet_result(self
, i
):
6528 return self
.facet_result_
[i
]
6530 def add_facet_result(self
):
6532 self
.facet_result_
.append(x
)
6535 def clear_facet_result(self
):
6536 self
.facet_result_
= []
6538 def MergeFrom(self
, x
):
6539 assert x
is not self
6540 for i
in xrange(x
.result_size()): self
.add_result().CopyFrom(x
.result(i
))
6541 if (x
.has_matched_count()): self
.set_matched_count(x
.matched_count())
6542 if (x
.has_status()): self
.mutable_status().MergeFrom(x
.status())
6543 if (x
.has_cursor()): self
.set_cursor(x
.cursor())
6544 for i
in xrange(x
.facet_result_size()): self
.add_facet_result().CopyFrom(x
.facet_result(i
))
6545 if _extension_runtime
: self
._MergeExtensionFields
(x
)
6547 def Equals(self
, x
):
6548 if x
is self
: return 1
6549 if len(self
.result_
) != len(x
.result_
): return 0
6550 for e1
, e2
in zip(self
.result_
, x
.result_
):
6551 if e1
!= e2
: return 0
6552 if self
.has_matched_count_
!= x
.has_matched_count_
: return 0
6553 if self
.has_matched_count_
and self
.matched_count_
!= x
.matched_count_
: return 0
6554 if self
.has_status_
!= x
.has_status_
: return 0
6555 if self
.has_status_
and self
.status_
!= x
.status_
: return 0
6556 if self
.has_cursor_
!= x
.has_cursor_
: return 0
6557 if self
.has_cursor_
and self
.cursor_
!= x
.cursor_
: return 0
6558 if len(self
.facet_result_
) != len(x
.facet_result_
): return 0
6559 for e1
, e2
in zip(self
.facet_result_
, x
.facet_result_
):
6560 if e1
!= e2
: return 0
6561 if _extension_runtime
and not self
._ExtensionEquals
(x
): return 0
6564 def IsInitialized(self
, debug_strs
=None):
6566 for p
in self
.result_
:
6567 if not p
.IsInitialized(debug_strs
): initialized
=0
6568 if (not self
.has_matched_count_
):
6570 if debug_strs
is not None:
6571 debug_strs
.append('Required field: matched_count not set.')
6572 if (not self
.has_status_
):
6574 if debug_strs
is not None:
6575 debug_strs
.append('Required field: status not set.')
6576 elif not self
.status_
.IsInitialized(debug_strs
): initialized
= 0
6577 for p
in self
.facet_result_
:
6578 if not p
.IsInitialized(debug_strs
): initialized
=0
6583 n
+= 1 * len(self
.result_
)
6584 for i
in xrange(len(self
.result_
)): n
+= self
.lengthString(self
.result_
[i
].ByteSize())
6585 n
+= self
.lengthVarInt64(self
.matched_count_
)
6586 n
+= self
.lengthString(self
.status_
.ByteSize())
6587 if (self
.has_cursor_
): n
+= 1 + self
.lengthString(len(self
.cursor_
))
6588 n
+= 1 * len(self
.facet_result_
)
6589 for i
in xrange(len(self
.facet_result_
)): n
+= self
.lengthString(self
.facet_result_
[i
].ByteSize())
6590 if _extension_runtime
:
6591 n
+= self
._ExtensionByteSize
(False)
6594 def ByteSizePartial(self
):
6596 n
+= 1 * len(self
.result_
)
6597 for i
in xrange(len(self
.result_
)): n
+= self
.lengthString(self
.result_
[i
].ByteSizePartial())
6598 if (self
.has_matched_count_
):
6600 n
+= self
.lengthVarInt64(self
.matched_count_
)
6601 if (self
.has_status_
):
6603 n
+= self
.lengthString(self
.status_
.ByteSizePartial())
6604 if (self
.has_cursor_
): n
+= 1 + self
.lengthString(len(self
.cursor_
))
6605 n
+= 1 * len(self
.facet_result_
)
6606 for i
in xrange(len(self
.facet_result_
)): n
+= self
.lengthString(self
.facet_result_
[i
].ByteSizePartial())
6607 if _extension_runtime
:
6608 n
+= self
._ExtensionByteSize
(True)
6613 self
.clear_matched_count()
6616 self
.clear_facet_result()
6617 if _extension_runtime
: self
._extension
_fields
.clear()
6619 def OutputUnchecked(self
, out
):
6620 if _extension_runtime
:
6621 extensions
= self
._ListExtensions
()
6623 for i
in xrange(len(self
.result_
)):
6625 out
.putVarInt32(self
.result_
[i
].ByteSize())
6626 self
.result_
[i
].OutputUnchecked(out
)
6628 out
.putVarInt64(self
.matched_count_
)
6630 out
.putVarInt32(self
.status_
.ByteSize())
6631 self
.status_
.OutputUnchecked(out
)
6632 if (self
.has_cursor_
):
6634 out
.putPrefixedString(self
.cursor_
)
6635 for i
in xrange(len(self
.facet_result_
)):
6637 out
.putVarInt32(self
.facet_result_
[i
].ByteSize())
6638 self
.facet_result_
[i
].OutputUnchecked(out
)
6639 if _extension_runtime
:
6640 extension_index
= self
._OutputExtensionFields
(out
, False, extensions
, extension_index
, 10000)
6642 def OutputPartial(self
, out
):
6643 if _extension_runtime
:
6644 extensions
= self
._ListExtensions
()
6646 for i
in xrange(len(self
.result_
)):
6648 out
.putVarInt32(self
.result_
[i
].ByteSizePartial())
6649 self
.result_
[i
].OutputPartial(out
)
6650 if (self
.has_matched_count_
):
6652 out
.putVarInt64(self
.matched_count_
)
6653 if (self
.has_status_
):
6655 out
.putVarInt32(self
.status_
.ByteSizePartial())
6656 self
.status_
.OutputPartial(out
)
6657 if (self
.has_cursor_
):
6659 out
.putPrefixedString(self
.cursor_
)
6660 for i
in xrange(len(self
.facet_result_
)):
6662 out
.putVarInt32(self
.facet_result_
[i
].ByteSizePartial())
6663 self
.facet_result_
[i
].OutputPartial(out
)
6664 if _extension_runtime
:
6665 extension_index
= self
._OutputExtensionFields
(out
, True, extensions
, extension_index
, 10000)
6667 def TryMerge(self
, d
):
6668 while d
.avail() > 0:
6669 tt
= d
.getVarInt32()
6671 length
= d
.getVarInt32()
6672 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6674 self
.add_result().TryMerge(tmp
)
6677 self
.set_matched_count(d
.getVarInt64())
6680 length
= d
.getVarInt32()
6681 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6683 self
.mutable_status().TryMerge(tmp
)
6686 self
.set_cursor(d
.getPrefixedString())
6689 length
= d
.getVarInt32()
6690 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6692 self
.add_facet_result().TryMerge(tmp
)
6694 if _extension_runtime
:
6695 if (1000 <= tt
and tt
< 10000):
6696 self
._ParseOneExtensionField
(tt
, d
)
6700 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6704 def __str__(self
, prefix
="", printElemNumber
=0):
6707 for e
in self
.result_
:
6709 if printElemNumber
: elm
="(%d)" % cnt
6710 res
+=prefix
+("result%s <\n" % elm
)
6711 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
6714 if self
.has_matched_count_
: res
+=prefix
+("matched_count: %s\n" % self
.DebugFormatInt64(self
.matched_count_
))
6715 if self
.has_status_
:
6716 res
+=prefix
+"status <\n"
6717 res
+=self
.status_
.__str
__(prefix
+ " ", printElemNumber
)
6719 if self
.has_cursor_
: res
+=prefix
+("cursor: %s\n" % self
.DebugFormatString(self
.cursor_
))
6721 for e
in self
.facet_result_
:
6723 if printElemNumber
: elm
="(%d)" % cnt
6724 res
+=prefix
+("facet_result%s <\n" % elm
)
6725 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
6728 if _extension_runtime
:
6729 res
+=self
._ExtensionDebugString
(prefix
, printElemNumber
)
6732 if _extension_runtime
:
6733 _extensions_by_field_number
= {}
6735 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6736 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6744 _TEXT
= _BuildTagLookupTable({
6753 _TYPES
= _BuildTagLookupTable({
6754 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6755 1: ProtocolBuffer
.Encoder
.STRING
,
6756 2: ProtocolBuffer
.Encoder
.NUMERIC
,
6757 3: ProtocolBuffer
.Encoder
.STRING
,
6758 4: ProtocolBuffer
.Encoder
.STRING
,
6759 5: ProtocolBuffer
.Encoder
.STRING
,
6760 }, 5, ProtocolBuffer
.Encoder
.MAX_TYPE
)
6764 _STYLE_CONTENT_TYPE
= """"""
6765 _PROTO_DESCRIPTOR_NAME
= 'apphosting.SearchResponse'
6766 if _extension_runtime
:
6769 __all__
= ['SearchServiceError','RequestStatus','IndexSpec','IndexMetadata_Storage','IndexMetadata','IndexDocumentParams','IndexDocumentRequest','IndexDocumentResponse','DeleteDocumentParams','DeleteDocumentRequest','DeleteDocumentResponse','ListDocumentsParams','ListDocumentsRequest','ListDocumentsResponse','ListIndexesParams','ListIndexesRequest','ListIndexesResponse','DeleteSchemaParams','DeleteSchemaRequest','DeleteSchemaResponse','SortSpec','ScorerSpec','FieldSpec','FieldSpec_Expression','FacetRange','FacetRequestParam','FacetAutoDetectParam','FacetRequest','FacetRefinement_Range','FacetRefinement','SearchParams','SearchRequest','FacetResultValue','FacetResult','SearchResult','SearchResponse']