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
):
4511 def __init__(self
, contents
=None):
4512 self
.type_
= ContentType()
4513 self
.lazy_init_lock_
= thread
.allocate_lock()
4514 if contents
is not None: self
.MergeFromString(contents
)
4516 def name(self
): return self
.name_
4518 def set_name(self
, x
):
4522 def clear_name(self
):
4527 def has_name(self
): return self
.has_name_
4529 def type(self
): return self
.type_
4531 def mutable_type(self
): self
.has_type_
= 1; return self
.type_
4533 def clear_type(self
):self
.has_type_
= 0; self
.type_
.Clear()
4535 def has_type(self
): return self
.has_type_
4538 if self
.params_
is None:
4539 self
.lazy_init_lock_
.acquire()
4541 if self
.params_
is None: self
.params_
= FacetRequestParam()
4543 self
.lazy_init_lock_
.release()
4546 def mutable_params(self
): self
.has_params_
= 1; return self
.params()
4548 def clear_params(self
):
4550 if self
.has_params_
:
4551 self
.has_params_
= 0;
4552 if self
.params_
is not None: self
.params_
.Clear()
4554 def has_params(self
): return self
.has_params_
4557 def MergeFrom(self
, x
):
4558 assert x
is not self
4559 if (x
.has_name()): self
.set_name(x
.name())
4560 if (x
.has_type()): self
.mutable_type().MergeFrom(x
.type())
4561 if (x
.has_params()): self
.mutable_params().MergeFrom(x
.params())
4563 def Equals(self
, x
):
4564 if x
is self
: return 1
4565 if self
.has_name_
!= x
.has_name_
: return 0
4566 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
4567 if self
.has_type_
!= x
.has_type_
: return 0
4568 if self
.has_type_
and self
.type_
!= x
.type_
: return 0
4569 if self
.has_params_
!= x
.has_params_
: return 0
4570 if self
.has_params_
and self
.params_
!= x
.params_
: return 0
4573 def IsInitialized(self
, debug_strs
=None):
4575 if (not self
.has_name_
):
4577 if debug_strs
is not None:
4578 debug_strs
.append('Required field: name not set.')
4579 if (not self
.has_type_
):
4581 if debug_strs
is not None:
4582 debug_strs
.append('Required field: type not set.')
4583 elif not self
.type_
.IsInitialized(debug_strs
): initialized
= 0
4584 if (self
.has_params_
and not self
.params_
.IsInitialized(debug_strs
)): initialized
= 0
4589 n
+= self
.lengthString(len(self
.name_
))
4590 n
+= self
.lengthString(self
.type_
.ByteSize())
4591 if (self
.has_params_
): n
+= 1 + self
.lengthString(self
.params_
.ByteSize())
4594 def ByteSizePartial(self
):
4596 if (self
.has_name_
):
4598 n
+= self
.lengthString(len(self
.name_
))
4599 if (self
.has_type_
):
4601 n
+= self
.lengthString(self
.type_
.ByteSizePartial())
4602 if (self
.has_params_
): n
+= 1 + self
.lengthString(self
.params_
.ByteSizePartial())
4610 def OutputUnchecked(self
, out
):
4612 out
.putPrefixedString(self
.name_
)
4614 out
.putVarInt32(self
.type_
.ByteSize())
4615 self
.type_
.OutputUnchecked(out
)
4616 if (self
.has_params_
):
4618 out
.putVarInt32(self
.params_
.ByteSize())
4619 self
.params_
.OutputUnchecked(out
)
4621 def OutputPartial(self
, out
):
4622 if (self
.has_name_
):
4624 out
.putPrefixedString(self
.name_
)
4625 if (self
.has_type_
):
4627 out
.putVarInt32(self
.type_
.ByteSizePartial())
4628 self
.type_
.OutputPartial(out
)
4629 if (self
.has_params_
):
4631 out
.putVarInt32(self
.params_
.ByteSizePartial())
4632 self
.params_
.OutputPartial(out
)
4634 def TryMerge(self
, d
):
4635 while d
.avail() > 0:
4636 tt
= d
.getVarInt32()
4638 self
.set_name(d
.getPrefixedString())
4641 length
= d
.getVarInt32()
4642 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4644 self
.mutable_type().TryMerge(tmp
)
4647 length
= d
.getVarInt32()
4648 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4650 self
.mutable_params().TryMerge(tmp
)
4654 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
4658 def __str__(self
, prefix
="", printElemNumber
=0):
4660 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
4662 res
+=prefix
+"type <\n"
4663 res
+=self
.type_
.__str
__(prefix
+ " ", printElemNumber
)
4665 if self
.has_params_
:
4666 res
+=prefix
+"params <\n"
4667 res
+=self
.params_
.__str
__(prefix
+ " ", printElemNumber
)
4672 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
4673 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
4679 _TEXT
= _BuildTagLookupTable({
4686 _TYPES
= _BuildTagLookupTable({
4687 0: ProtocolBuffer
.Encoder
.NUMERIC
,
4688 1: ProtocolBuffer
.Encoder
.STRING
,
4689 2: ProtocolBuffer
.Encoder
.STRING
,
4690 3: ProtocolBuffer
.Encoder
.STRING
,
4691 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
4695 _STYLE_CONTENT_TYPE
= """"""
4696 _PROTO_DESCRIPTOR_NAME
= 'apphosting.FacetRequest'
4697 class FacetRefinement_Range(ProtocolBuffer
.ProtocolMessage
):
4703 def __init__(self
, contents
=None):
4704 if contents
is not None: self
.MergeFromString(contents
)
4706 def start(self
): return self
.start_
4708 def set_start(self
, x
):
4712 def clear_start(self
):
4717 def has_start(self
): return self
.has_start_
4719 def end(self
): return self
.end_
4721 def set_end(self
, x
):
4725 def clear_end(self
):
4730 def has_end(self
): return self
.has_end_
4733 def MergeFrom(self
, x
):
4734 assert x
is not self
4735 if (x
.has_start()): self
.set_start(x
.start())
4736 if (x
.has_end()): self
.set_end(x
.end())
4738 def Equals(self
, x
):
4739 if x
is self
: return 1
4740 if self
.has_start_
!= x
.has_start_
: return 0
4741 if self
.has_start_
and self
.start_
!= x
.start_
: return 0
4742 if self
.has_end_
!= x
.has_end_
: return 0
4743 if self
.has_end_
and self
.end_
!= x
.end_
: return 0
4746 def IsInitialized(self
, debug_strs
=None):
4752 if (self
.has_start_
): n
+= 1 + self
.lengthString(len(self
.start_
))
4753 if (self
.has_end_
): n
+= 1 + self
.lengthString(len(self
.end_
))
4756 def ByteSizePartial(self
):
4758 if (self
.has_start_
): n
+= 1 + self
.lengthString(len(self
.start_
))
4759 if (self
.has_end_
): n
+= 1 + self
.lengthString(len(self
.end_
))
4766 def OutputUnchecked(self
, out
):
4767 if (self
.has_start_
):
4769 out
.putPrefixedString(self
.start_
)
4772 out
.putPrefixedString(self
.end_
)
4774 def OutputPartial(self
, out
):
4775 if (self
.has_start_
):
4777 out
.putPrefixedString(self
.start_
)
4780 out
.putPrefixedString(self
.end_
)
4782 def TryMerge(self
, d
):
4783 while d
.avail() > 0:
4784 tt
= d
.getVarInt32()
4786 self
.set_start(d
.getPrefixedString())
4789 self
.set_end(d
.getPrefixedString())
4793 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
4797 def __str__(self
, prefix
="", printElemNumber
=0):
4799 if self
.has_start_
: res
+=prefix
+("start: %s\n" % self
.DebugFormatString(self
.start_
))
4800 if self
.has_end_
: res
+=prefix
+("end: %s\n" % self
.DebugFormatString(self
.end_
))
4804 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
4805 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
4810 _TEXT
= _BuildTagLookupTable({
4816 _TYPES
= _BuildTagLookupTable({
4817 0: ProtocolBuffer
.Encoder
.NUMERIC
,
4818 1: ProtocolBuffer
.Encoder
.STRING
,
4819 2: ProtocolBuffer
.Encoder
.STRING
,
4820 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
4824 _STYLE_CONTENT_TYPE
= """"""
4825 _PROTO_DESCRIPTOR_NAME
= 'apphosting.FacetRefinement_Range'
4826 class FacetRefinement(ProtocolBuffer
.ProtocolMessage
):
4835 def __init__(self
, contents
=None):
4836 self
.type_
= ContentType()
4837 self
.lazy_init_lock_
= thread
.allocate_lock()
4838 if contents
is not None: self
.MergeFromString(contents
)
4840 def name(self
): return self
.name_
4842 def set_name(self
, x
):
4846 def clear_name(self
):
4851 def has_name(self
): return self
.has_name_
4853 def type(self
): return self
.type_
4855 def mutable_type(self
): self
.has_type_
= 1; return self
.type_
4857 def clear_type(self
):self
.has_type_
= 0; self
.type_
.Clear()
4859 def has_type(self
): return self
.has_type_
4861 def value(self
): return self
.value_
4863 def set_value(self
, x
):
4867 def clear_value(self
):
4872 def has_value(self
): return self
.has_value_
4875 if self
.range_
is None:
4876 self
.lazy_init_lock_
.acquire()
4878 if self
.range_
is None: self
.range_
= FacetRefinement_Range()
4880 self
.lazy_init_lock_
.release()
4883 def mutable_range(self
): self
.has_range_
= 1; return self
.range()
4885 def clear_range(self
):
4888 self
.has_range_
= 0;
4889 if self
.range_
is not None: self
.range_
.Clear()
4891 def has_range(self
): return self
.has_range_
4894 def MergeFrom(self
, x
):
4895 assert x
is not self
4896 if (x
.has_name()): self
.set_name(x
.name())
4897 if (x
.has_type()): self
.mutable_type().MergeFrom(x
.type())
4898 if (x
.has_value()): self
.set_value(x
.value())
4899 if (x
.has_range()): self
.mutable_range().MergeFrom(x
.range())
4901 def Equals(self
, x
):
4902 if x
is self
: return 1
4903 if self
.has_name_
!= x
.has_name_
: return 0
4904 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
4905 if self
.has_type_
!= x
.has_type_
: return 0
4906 if self
.has_type_
and self
.type_
!= x
.type_
: return 0
4907 if self
.has_value_
!= x
.has_value_
: return 0
4908 if self
.has_value_
and self
.value_
!= x
.value_
: return 0
4909 if self
.has_range_
!= x
.has_range_
: return 0
4910 if self
.has_range_
and self
.range_
!= x
.range_
: return 0
4913 def IsInitialized(self
, debug_strs
=None):
4915 if (not self
.has_name_
):
4917 if debug_strs
is not None:
4918 debug_strs
.append('Required field: name not set.')
4919 if (not self
.has_type_
):
4921 if debug_strs
is not None:
4922 debug_strs
.append('Required field: type not set.')
4923 elif not self
.type_
.IsInitialized(debug_strs
): initialized
= 0
4924 if (self
.has_range_
and not self
.range_
.IsInitialized(debug_strs
)): initialized
= 0
4929 n
+= self
.lengthString(len(self
.name_
))
4930 n
+= self
.lengthString(self
.type_
.ByteSize())
4931 if (self
.has_value_
): n
+= 1 + self
.lengthString(len(self
.value_
))
4932 if (self
.has_range_
): n
+= 1 + self
.lengthString(self
.range_
.ByteSize())
4935 def ByteSizePartial(self
):
4937 if (self
.has_name_
):
4939 n
+= self
.lengthString(len(self
.name_
))
4940 if (self
.has_type_
):
4942 n
+= self
.lengthString(self
.type_
.ByteSizePartial())
4943 if (self
.has_value_
): n
+= 1 + self
.lengthString(len(self
.value_
))
4944 if (self
.has_range_
): n
+= 1 + self
.lengthString(self
.range_
.ByteSizePartial())
4953 def OutputUnchecked(self
, out
):
4955 out
.putPrefixedString(self
.name_
)
4957 out
.putVarInt32(self
.type_
.ByteSize())
4958 self
.type_
.OutputUnchecked(out
)
4959 if (self
.has_value_
):
4961 out
.putPrefixedString(self
.value_
)
4962 if (self
.has_range_
):
4964 out
.putVarInt32(self
.range_
.ByteSize())
4965 self
.range_
.OutputUnchecked(out
)
4967 def OutputPartial(self
, out
):
4968 if (self
.has_name_
):
4970 out
.putPrefixedString(self
.name_
)
4971 if (self
.has_type_
):
4973 out
.putVarInt32(self
.type_
.ByteSizePartial())
4974 self
.type_
.OutputPartial(out
)
4975 if (self
.has_value_
):
4977 out
.putPrefixedString(self
.value_
)
4978 if (self
.has_range_
):
4980 out
.putVarInt32(self
.range_
.ByteSizePartial())
4981 self
.range_
.OutputPartial(out
)
4983 def TryMerge(self
, d
):
4984 while d
.avail() > 0:
4985 tt
= d
.getVarInt32()
4987 self
.set_name(d
.getPrefixedString())
4990 length
= d
.getVarInt32()
4991 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
4993 self
.mutable_type().TryMerge(tmp
)
4996 self
.set_value(d
.getPrefixedString())
4999 length
= d
.getVarInt32()
5000 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5002 self
.mutable_range().TryMerge(tmp
)
5006 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
5010 def __str__(self
, prefix
="", printElemNumber
=0):
5012 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
5014 res
+=prefix
+"type <\n"
5015 res
+=self
.type_
.__str
__(prefix
+ " ", printElemNumber
)
5017 if self
.has_value_
: res
+=prefix
+("value: %s\n" % self
.DebugFormatString(self
.value_
))
5019 res
+=prefix
+"range <\n"
5020 res
+=self
.range_
.__str
__(prefix
+ " ", printElemNumber
)
5025 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
5026 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
5033 _TEXT
= _BuildTagLookupTable({
5041 _TYPES
= _BuildTagLookupTable({
5042 0: ProtocolBuffer
.Encoder
.NUMERIC
,
5043 1: ProtocolBuffer
.Encoder
.STRING
,
5044 2: ProtocolBuffer
.Encoder
.STRING
,
5045 3: ProtocolBuffer
.Encoder
.STRING
,
5046 4: ProtocolBuffer
.Encoder
.STRING
,
5047 }, 4, ProtocolBuffer
.Encoder
.MAX_TYPE
)
5051 _STYLE_CONTENT_TYPE
= """"""
5052 _PROTO_DESCRIPTOR_NAME
= 'apphosting.FacetRefinement'
5053 class SearchParams(ProtocolBuffer
.ProtocolMessage
):
5060 _CursorType_NAMES
= {
5066 def CursorType_Name(cls
, x
): return cls
._CursorType
_NAMES
.get(x
, "")
5067 CursorType_Name
= classmethod(CursorType_Name
)
5074 _ParsingMode_NAMES
= {
5079 def ParsingMode_Name(cls
, x
): return cls
._ParsingMode
_NAMES
.get(x
, "")
5080 ParsingMode_Name
= classmethod(ParsingMode_Name
)
5089 has_cursor_type_
= 0
5093 has_matched_count_accuracy_
= 0
5094 matched_count_accuracy_
= 0
5095 has_scorer_spec_
= 0
5101 has_parsing_mode_
= 0
5103 has_auto_discover_facet_count_
= 0
5104 auto_discover_facet_count_
= 0
5105 has_facet_auto_detect_param_
= 0
5106 facet_auto_detect_param_
= None
5107 has_facet_depth_
= 0
5110 def __init__(self
, contents
=None):
5111 self
.index_spec_
= IndexSpec()
5112 self
.sort_spec_
= []
5113 self
.include_facet_
= []
5114 self
.facet_refinement_
= []
5115 self
.lazy_init_lock_
= thread
.allocate_lock()
5116 if contents
is not None: self
.MergeFromString(contents
)
5118 def index_spec(self
): return self
.index_spec_
5120 def mutable_index_spec(self
): self
.has_index_spec_
= 1; return self
.index_spec_
5122 def clear_index_spec(self
):self
.has_index_spec_
= 0; self
.index_spec_
.Clear()
5124 def has_index_spec(self
): return self
.has_index_spec_
5126 def query(self
): return self
.query_
5128 def set_query(self
, x
):
5132 def clear_query(self
):
5137 def has_query(self
): return self
.has_query_
5139 def cursor(self
): return self
.cursor_
5141 def set_cursor(self
, x
):
5142 self
.has_cursor_
= 1
5145 def clear_cursor(self
):
5146 if self
.has_cursor_
:
5147 self
.has_cursor_
= 0
5150 def has_cursor(self
): return self
.has_cursor_
5152 def offset(self
): return self
.offset_
5154 def set_offset(self
, x
):
5155 self
.has_offset_
= 1
5158 def clear_offset(self
):
5159 if self
.has_offset_
:
5160 self
.has_offset_
= 0
5163 def has_offset(self
): return self
.has_offset_
5165 def cursor_type(self
): return self
.cursor_type_
5167 def set_cursor_type(self
, x
):
5168 self
.has_cursor_type_
= 1
5169 self
.cursor_type_
= x
5171 def clear_cursor_type(self
):
5172 if self
.has_cursor_type_
:
5173 self
.has_cursor_type_
= 0
5174 self
.cursor_type_
= 0
5176 def has_cursor_type(self
): return self
.has_cursor_type_
5178 def limit(self
): return self
.limit_
5180 def set_limit(self
, x
):
5184 def clear_limit(self
):
5189 def has_limit(self
): return self
.has_limit_
5191 def matched_count_accuracy(self
): return self
.matched_count_accuracy_
5193 def set_matched_count_accuracy(self
, x
):
5194 self
.has_matched_count_accuracy_
= 1
5195 self
.matched_count_accuracy_
= x
5197 def clear_matched_count_accuracy(self
):
5198 if self
.has_matched_count_accuracy_
:
5199 self
.has_matched_count_accuracy_
= 0
5200 self
.matched_count_accuracy_
= 0
5202 def has_matched_count_accuracy(self
): return self
.has_matched_count_accuracy_
5204 def sort_spec_size(self
): return len(self
.sort_spec_
)
5205 def sort_spec_list(self
): return self
.sort_spec_
5207 def sort_spec(self
, i
):
5208 return self
.sort_spec_
[i
]
5210 def mutable_sort_spec(self
, i
):
5211 return self
.sort_spec_
[i
]
5213 def add_sort_spec(self
):
5215 self
.sort_spec_
.append(x
)
5218 def clear_sort_spec(self
):
5219 self
.sort_spec_
= []
5220 def scorer_spec(self
):
5221 if self
.scorer_spec_
is None:
5222 self
.lazy_init_lock_
.acquire()
5224 if self
.scorer_spec_
is None: self
.scorer_spec_
= ScorerSpec()
5226 self
.lazy_init_lock_
.release()
5227 return self
.scorer_spec_
5229 def mutable_scorer_spec(self
): self
.has_scorer_spec_
= 1; return self
.scorer_spec()
5231 def clear_scorer_spec(self
):
5233 if self
.has_scorer_spec_
:
5234 self
.has_scorer_spec_
= 0;
5235 if self
.scorer_spec_
is not None: self
.scorer_spec_
.Clear()
5237 def has_scorer_spec(self
): return self
.has_scorer_spec_
5239 def field_spec(self
):
5240 if self
.field_spec_
is None:
5241 self
.lazy_init_lock_
.acquire()
5243 if self
.field_spec_
is None: self
.field_spec_
= FieldSpec()
5245 self
.lazy_init_lock_
.release()
5246 return self
.field_spec_
5248 def mutable_field_spec(self
): self
.has_field_spec_
= 1; return self
.field_spec()
5250 def clear_field_spec(self
):
5252 if self
.has_field_spec_
:
5253 self
.has_field_spec_
= 0;
5254 if self
.field_spec_
is not None: self
.field_spec_
.Clear()
5256 def has_field_spec(self
): return self
.has_field_spec_
5258 def keys_only(self
): return self
.keys_only_
5260 def set_keys_only(self
, x
):
5261 self
.has_keys_only_
= 1
5264 def clear_keys_only(self
):
5265 if self
.has_keys_only_
:
5266 self
.has_keys_only_
= 0
5269 def has_keys_only(self
): return self
.has_keys_only_
5271 def parsing_mode(self
): return self
.parsing_mode_
5273 def set_parsing_mode(self
, x
):
5274 self
.has_parsing_mode_
= 1
5275 self
.parsing_mode_
= x
5277 def clear_parsing_mode(self
):
5278 if self
.has_parsing_mode_
:
5279 self
.has_parsing_mode_
= 0
5280 self
.parsing_mode_
= 0
5282 def has_parsing_mode(self
): return self
.has_parsing_mode_
5284 def auto_discover_facet_count(self
): return self
.auto_discover_facet_count_
5286 def set_auto_discover_facet_count(self
, x
):
5287 self
.has_auto_discover_facet_count_
= 1
5288 self
.auto_discover_facet_count_
= x
5290 def clear_auto_discover_facet_count(self
):
5291 if self
.has_auto_discover_facet_count_
:
5292 self
.has_auto_discover_facet_count_
= 0
5293 self
.auto_discover_facet_count_
= 0
5295 def has_auto_discover_facet_count(self
): return self
.has_auto_discover_facet_count_
5297 def include_facet_size(self
): return len(self
.include_facet_
)
5298 def include_facet_list(self
): return self
.include_facet_
5300 def include_facet(self
, i
):
5301 return self
.include_facet_
[i
]
5303 def mutable_include_facet(self
, i
):
5304 return self
.include_facet_
[i
]
5306 def add_include_facet(self
):
5308 self
.include_facet_
.append(x
)
5311 def clear_include_facet(self
):
5312 self
.include_facet_
= []
5313 def facet_refinement_size(self
): return len(self
.facet_refinement_
)
5314 def facet_refinement_list(self
): return self
.facet_refinement_
5316 def facet_refinement(self
, i
):
5317 return self
.facet_refinement_
[i
]
5319 def mutable_facet_refinement(self
, i
):
5320 return self
.facet_refinement_
[i
]
5322 def add_facet_refinement(self
):
5323 x
= FacetRefinement()
5324 self
.facet_refinement_
.append(x
)
5327 def clear_facet_refinement(self
):
5328 self
.facet_refinement_
= []
5329 def facet_auto_detect_param(self
):
5330 if self
.facet_auto_detect_param_
is None:
5331 self
.lazy_init_lock_
.acquire()
5333 if self
.facet_auto_detect_param_
is None: self
.facet_auto_detect_param_
= FacetAutoDetectParam()
5335 self
.lazy_init_lock_
.release()
5336 return self
.facet_auto_detect_param_
5338 def mutable_facet_auto_detect_param(self
): self
.has_facet_auto_detect_param_
= 1; return self
.facet_auto_detect_param()
5340 def clear_facet_auto_detect_param(self
):
5342 if self
.has_facet_auto_detect_param_
:
5343 self
.has_facet_auto_detect_param_
= 0;
5344 if self
.facet_auto_detect_param_
is not None: self
.facet_auto_detect_param_
.Clear()
5346 def has_facet_auto_detect_param(self
): return self
.has_facet_auto_detect_param_
5348 def facet_depth(self
): return self
.facet_depth_
5350 def set_facet_depth(self
, x
):
5351 self
.has_facet_depth_
= 1
5352 self
.facet_depth_
= x
5354 def clear_facet_depth(self
):
5355 if self
.has_facet_depth_
:
5356 self
.has_facet_depth_
= 0
5357 self
.facet_depth_
= 1000
5359 def has_facet_depth(self
): return self
.has_facet_depth_
5362 def MergeFrom(self
, x
):
5363 assert x
is not self
5364 if (x
.has_index_spec()): self
.mutable_index_spec().MergeFrom(x
.index_spec())
5365 if (x
.has_query()): self
.set_query(x
.query())
5366 if (x
.has_cursor()): self
.set_cursor(x
.cursor())
5367 if (x
.has_offset()): self
.set_offset(x
.offset())
5368 if (x
.has_cursor_type()): self
.set_cursor_type(x
.cursor_type())
5369 if (x
.has_limit()): self
.set_limit(x
.limit())
5370 if (x
.has_matched_count_accuracy()): self
.set_matched_count_accuracy(x
.matched_count_accuracy())
5371 for i
in xrange(x
.sort_spec_size()): self
.add_sort_spec().CopyFrom(x
.sort_spec(i
))
5372 if (x
.has_scorer_spec()): self
.mutable_scorer_spec().MergeFrom(x
.scorer_spec())
5373 if (x
.has_field_spec()): self
.mutable_field_spec().MergeFrom(x
.field_spec())
5374 if (x
.has_keys_only()): self
.set_keys_only(x
.keys_only())
5375 if (x
.has_parsing_mode()): self
.set_parsing_mode(x
.parsing_mode())
5376 if (x
.has_auto_discover_facet_count()): self
.set_auto_discover_facet_count(x
.auto_discover_facet_count())
5377 for i
in xrange(x
.include_facet_size()): self
.add_include_facet().CopyFrom(x
.include_facet(i
))
5378 for i
in xrange(x
.facet_refinement_size()): self
.add_facet_refinement().CopyFrom(x
.facet_refinement(i
))
5379 if (x
.has_facet_auto_detect_param()): self
.mutable_facet_auto_detect_param().MergeFrom(x
.facet_auto_detect_param())
5380 if (x
.has_facet_depth()): self
.set_facet_depth(x
.facet_depth())
5382 def Equals(self
, x
):
5383 if x
is self
: return 1
5384 if self
.has_index_spec_
!= x
.has_index_spec_
: return 0
5385 if self
.has_index_spec_
and self
.index_spec_
!= x
.index_spec_
: return 0
5386 if self
.has_query_
!= x
.has_query_
: return 0
5387 if self
.has_query_
and self
.query_
!= x
.query_
: return 0
5388 if self
.has_cursor_
!= x
.has_cursor_
: return 0
5389 if self
.has_cursor_
and self
.cursor_
!= x
.cursor_
: return 0
5390 if self
.has_offset_
!= x
.has_offset_
: return 0
5391 if self
.has_offset_
and self
.offset_
!= x
.offset_
: return 0
5392 if self
.has_cursor_type_
!= x
.has_cursor_type_
: return 0
5393 if self
.has_cursor_type_
and self
.cursor_type_
!= x
.cursor_type_
: return 0
5394 if self
.has_limit_
!= x
.has_limit_
: return 0
5395 if self
.has_limit_
and self
.limit_
!= x
.limit_
: return 0
5396 if self
.has_matched_count_accuracy_
!= x
.has_matched_count_accuracy_
: return 0
5397 if self
.has_matched_count_accuracy_
and self
.matched_count_accuracy_
!= x
.matched_count_accuracy_
: return 0
5398 if len(self
.sort_spec_
) != len(x
.sort_spec_
): return 0
5399 for e1
, e2
in zip(self
.sort_spec_
, x
.sort_spec_
):
5400 if e1
!= e2
: return 0
5401 if self
.has_scorer_spec_
!= x
.has_scorer_spec_
: return 0
5402 if self
.has_scorer_spec_
and self
.scorer_spec_
!= x
.scorer_spec_
: return 0
5403 if self
.has_field_spec_
!= x
.has_field_spec_
: return 0
5404 if self
.has_field_spec_
and self
.field_spec_
!= x
.field_spec_
: return 0
5405 if self
.has_keys_only_
!= x
.has_keys_only_
: return 0
5406 if self
.has_keys_only_
and self
.keys_only_
!= x
.keys_only_
: return 0
5407 if self
.has_parsing_mode_
!= x
.has_parsing_mode_
: return 0
5408 if self
.has_parsing_mode_
and self
.parsing_mode_
!= x
.parsing_mode_
: return 0
5409 if self
.has_auto_discover_facet_count_
!= x
.has_auto_discover_facet_count_
: return 0
5410 if self
.has_auto_discover_facet_count_
and self
.auto_discover_facet_count_
!= x
.auto_discover_facet_count_
: return 0
5411 if len(self
.include_facet_
) != len(x
.include_facet_
): return 0
5412 for e1
, e2
in zip(self
.include_facet_
, x
.include_facet_
):
5413 if e1
!= e2
: return 0
5414 if len(self
.facet_refinement_
) != len(x
.facet_refinement_
): return 0
5415 for e1
, e2
in zip(self
.facet_refinement_
, x
.facet_refinement_
):
5416 if e1
!= e2
: return 0
5417 if self
.has_facet_auto_detect_param_
!= x
.has_facet_auto_detect_param_
: return 0
5418 if self
.has_facet_auto_detect_param_
and self
.facet_auto_detect_param_
!= x
.facet_auto_detect_param_
: return 0
5419 if self
.has_facet_depth_
!= x
.has_facet_depth_
: return 0
5420 if self
.has_facet_depth_
and self
.facet_depth_
!= x
.facet_depth_
: return 0
5423 def IsInitialized(self
, debug_strs
=None):
5425 if (not self
.has_index_spec_
):
5427 if debug_strs
is not None:
5428 debug_strs
.append('Required field: index_spec not set.')
5429 elif not self
.index_spec_
.IsInitialized(debug_strs
): initialized
= 0
5430 if (not self
.has_query_
):
5432 if debug_strs
is not None:
5433 debug_strs
.append('Required field: query not set.')
5434 for p
in self
.sort_spec_
:
5435 if not p
.IsInitialized(debug_strs
): initialized
=0
5436 if (self
.has_scorer_spec_
and not self
.scorer_spec_
.IsInitialized(debug_strs
)): initialized
= 0
5437 if (self
.has_field_spec_
and not self
.field_spec_
.IsInitialized(debug_strs
)): initialized
= 0
5438 for p
in self
.include_facet_
:
5439 if not p
.IsInitialized(debug_strs
): initialized
=0
5440 for p
in self
.facet_refinement_
:
5441 if not p
.IsInitialized(debug_strs
): initialized
=0
5442 if (self
.has_facet_auto_detect_param_
and not self
.facet_auto_detect_param_
.IsInitialized(debug_strs
)): initialized
= 0
5447 n
+= self
.lengthString(self
.index_spec_
.ByteSize())
5448 n
+= self
.lengthString(len(self
.query_
))
5449 if (self
.has_cursor_
): n
+= 1 + self
.lengthString(len(self
.cursor_
))
5450 if (self
.has_offset_
): n
+= 1 + self
.lengthVarInt64(self
.offset_
)
5451 if (self
.has_cursor_type_
): n
+= 1 + self
.lengthVarInt64(self
.cursor_type_
)
5452 if (self
.has_limit_
): n
+= 1 + self
.lengthVarInt64(self
.limit_
)
5453 if (self
.has_matched_count_accuracy_
): n
+= 1 + self
.lengthVarInt64(self
.matched_count_accuracy_
)
5454 n
+= 1 * len(self
.sort_spec_
)
5455 for i
in xrange(len(self
.sort_spec_
)): n
+= self
.lengthString(self
.sort_spec_
[i
].ByteSize())
5456 if (self
.has_scorer_spec_
): n
+= 1 + self
.lengthString(self
.scorer_spec_
.ByteSize())
5457 if (self
.has_field_spec_
): n
+= 1 + self
.lengthString(self
.field_spec_
.ByteSize())
5458 if (self
.has_keys_only_
): n
+= 2
5459 if (self
.has_parsing_mode_
): n
+= 1 + self
.lengthVarInt64(self
.parsing_mode_
)
5460 if (self
.has_auto_discover_facet_count_
): n
+= 1 + self
.lengthVarInt64(self
.auto_discover_facet_count_
)
5461 n
+= 2 * len(self
.include_facet_
)
5462 for i
in xrange(len(self
.include_facet_
)): n
+= self
.lengthString(self
.include_facet_
[i
].ByteSize())
5463 n
+= 2 * len(self
.facet_refinement_
)
5464 for i
in xrange(len(self
.facet_refinement_
)): n
+= self
.lengthString(self
.facet_refinement_
[i
].ByteSize())
5465 if (self
.has_facet_auto_detect_param_
): n
+= 2 + self
.lengthString(self
.facet_auto_detect_param_
.ByteSize())
5466 if (self
.has_facet_depth_
): n
+= 2 + self
.lengthVarInt64(self
.facet_depth_
)
5469 def ByteSizePartial(self
):
5471 if (self
.has_index_spec_
):
5473 n
+= self
.lengthString(self
.index_spec_
.ByteSizePartial())
5474 if (self
.has_query_
):
5476 n
+= self
.lengthString(len(self
.query_
))
5477 if (self
.has_cursor_
): n
+= 1 + self
.lengthString(len(self
.cursor_
))
5478 if (self
.has_offset_
): n
+= 1 + self
.lengthVarInt64(self
.offset_
)
5479 if (self
.has_cursor_type_
): n
+= 1 + self
.lengthVarInt64(self
.cursor_type_
)
5480 if (self
.has_limit_
): n
+= 1 + self
.lengthVarInt64(self
.limit_
)
5481 if (self
.has_matched_count_accuracy_
): n
+= 1 + self
.lengthVarInt64(self
.matched_count_accuracy_
)
5482 n
+= 1 * len(self
.sort_spec_
)
5483 for i
in xrange(len(self
.sort_spec_
)): n
+= self
.lengthString(self
.sort_spec_
[i
].ByteSizePartial())
5484 if (self
.has_scorer_spec_
): n
+= 1 + self
.lengthString(self
.scorer_spec_
.ByteSizePartial())
5485 if (self
.has_field_spec_
): n
+= 1 + self
.lengthString(self
.field_spec_
.ByteSizePartial())
5486 if (self
.has_keys_only_
): n
+= 2
5487 if (self
.has_parsing_mode_
): n
+= 1 + self
.lengthVarInt64(self
.parsing_mode_
)
5488 if (self
.has_auto_discover_facet_count_
): n
+= 1 + self
.lengthVarInt64(self
.auto_discover_facet_count_
)
5489 n
+= 2 * len(self
.include_facet_
)
5490 for i
in xrange(len(self
.include_facet_
)): n
+= self
.lengthString(self
.include_facet_
[i
].ByteSizePartial())
5491 n
+= 2 * len(self
.facet_refinement_
)
5492 for i
in xrange(len(self
.facet_refinement_
)): n
+= self
.lengthString(self
.facet_refinement_
[i
].ByteSizePartial())
5493 if (self
.has_facet_auto_detect_param_
): n
+= 2 + self
.lengthString(self
.facet_auto_detect_param_
.ByteSizePartial())
5494 if (self
.has_facet_depth_
): n
+= 2 + self
.lengthVarInt64(self
.facet_depth_
)
5498 self
.clear_index_spec()
5502 self
.clear_cursor_type()
5504 self
.clear_matched_count_accuracy()
5505 self
.clear_sort_spec()
5506 self
.clear_scorer_spec()
5507 self
.clear_field_spec()
5508 self
.clear_keys_only()
5509 self
.clear_parsing_mode()
5510 self
.clear_auto_discover_facet_count()
5511 self
.clear_include_facet()
5512 self
.clear_facet_refinement()
5513 self
.clear_facet_auto_detect_param()
5514 self
.clear_facet_depth()
5516 def OutputUnchecked(self
, out
):
5518 out
.putVarInt32(self
.index_spec_
.ByteSize())
5519 self
.index_spec_
.OutputUnchecked(out
)
5521 out
.putPrefixedString(self
.query_
)
5522 if (self
.has_cursor_
):
5524 out
.putPrefixedString(self
.cursor_
)
5525 if (self
.has_cursor_type_
):
5527 out
.putVarInt32(self
.cursor_type_
)
5528 if (self
.has_limit_
):
5530 out
.putVarInt32(self
.limit_
)
5531 if (self
.has_matched_count_accuracy_
):
5533 out
.putVarInt32(self
.matched_count_accuracy_
)
5534 for i
in xrange(len(self
.sort_spec_
)):
5536 out
.putVarInt32(self
.sort_spec_
[i
].ByteSize())
5537 self
.sort_spec_
[i
].OutputUnchecked(out
)
5538 if (self
.has_scorer_spec_
):
5540 out
.putVarInt32(self
.scorer_spec_
.ByteSize())
5541 self
.scorer_spec_
.OutputUnchecked(out
)
5542 if (self
.has_field_spec_
):
5544 out
.putVarInt32(self
.field_spec_
.ByteSize())
5545 self
.field_spec_
.OutputUnchecked(out
)
5546 if (self
.has_offset_
):
5548 out
.putVarInt32(self
.offset_
)
5549 if (self
.has_keys_only_
):
5551 out
.putBoolean(self
.keys_only_
)
5552 if (self
.has_parsing_mode_
):
5553 out
.putVarInt32(104)
5554 out
.putVarInt32(self
.parsing_mode_
)
5555 if (self
.has_auto_discover_facet_count_
):
5556 out
.putVarInt32(120)
5557 out
.putVarInt32(self
.auto_discover_facet_count_
)
5558 for i
in xrange(len(self
.include_facet_
)):
5559 out
.putVarInt32(130)
5560 out
.putVarInt32(self
.include_facet_
[i
].ByteSize())
5561 self
.include_facet_
[i
].OutputUnchecked(out
)
5562 for i
in xrange(len(self
.facet_refinement_
)):
5563 out
.putVarInt32(138)
5564 out
.putVarInt32(self
.facet_refinement_
[i
].ByteSize())
5565 self
.facet_refinement_
[i
].OutputUnchecked(out
)
5566 if (self
.has_facet_auto_detect_param_
):
5567 out
.putVarInt32(146)
5568 out
.putVarInt32(self
.facet_auto_detect_param_
.ByteSize())
5569 self
.facet_auto_detect_param_
.OutputUnchecked(out
)
5570 if (self
.has_facet_depth_
):
5571 out
.putVarInt32(152)
5572 out
.putVarInt32(self
.facet_depth_
)
5574 def OutputPartial(self
, out
):
5575 if (self
.has_index_spec_
):
5577 out
.putVarInt32(self
.index_spec_
.ByteSizePartial())
5578 self
.index_spec_
.OutputPartial(out
)
5579 if (self
.has_query_
):
5581 out
.putPrefixedString(self
.query_
)
5582 if (self
.has_cursor_
):
5584 out
.putPrefixedString(self
.cursor_
)
5585 if (self
.has_cursor_type_
):
5587 out
.putVarInt32(self
.cursor_type_
)
5588 if (self
.has_limit_
):
5590 out
.putVarInt32(self
.limit_
)
5591 if (self
.has_matched_count_accuracy_
):
5593 out
.putVarInt32(self
.matched_count_accuracy_
)
5594 for i
in xrange(len(self
.sort_spec_
)):
5596 out
.putVarInt32(self
.sort_spec_
[i
].ByteSizePartial())
5597 self
.sort_spec_
[i
].OutputPartial(out
)
5598 if (self
.has_scorer_spec_
):
5600 out
.putVarInt32(self
.scorer_spec_
.ByteSizePartial())
5601 self
.scorer_spec_
.OutputPartial(out
)
5602 if (self
.has_field_spec_
):
5604 out
.putVarInt32(self
.field_spec_
.ByteSizePartial())
5605 self
.field_spec_
.OutputPartial(out
)
5606 if (self
.has_offset_
):
5608 out
.putVarInt32(self
.offset_
)
5609 if (self
.has_keys_only_
):
5611 out
.putBoolean(self
.keys_only_
)
5612 if (self
.has_parsing_mode_
):
5613 out
.putVarInt32(104)
5614 out
.putVarInt32(self
.parsing_mode_
)
5615 if (self
.has_auto_discover_facet_count_
):
5616 out
.putVarInt32(120)
5617 out
.putVarInt32(self
.auto_discover_facet_count_
)
5618 for i
in xrange(len(self
.include_facet_
)):
5619 out
.putVarInt32(130)
5620 out
.putVarInt32(self
.include_facet_
[i
].ByteSizePartial())
5621 self
.include_facet_
[i
].OutputPartial(out
)
5622 for i
in xrange(len(self
.facet_refinement_
)):
5623 out
.putVarInt32(138)
5624 out
.putVarInt32(self
.facet_refinement_
[i
].ByteSizePartial())
5625 self
.facet_refinement_
[i
].OutputPartial(out
)
5626 if (self
.has_facet_auto_detect_param_
):
5627 out
.putVarInt32(146)
5628 out
.putVarInt32(self
.facet_auto_detect_param_
.ByteSizePartial())
5629 self
.facet_auto_detect_param_
.OutputPartial(out
)
5630 if (self
.has_facet_depth_
):
5631 out
.putVarInt32(152)
5632 out
.putVarInt32(self
.facet_depth_
)
5634 def TryMerge(self
, d
):
5635 while d
.avail() > 0:
5636 tt
= d
.getVarInt32()
5638 length
= d
.getVarInt32()
5639 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5641 self
.mutable_index_spec().TryMerge(tmp
)
5644 self
.set_query(d
.getPrefixedString())
5647 self
.set_cursor(d
.getPrefixedString())
5650 self
.set_cursor_type(d
.getVarInt32())
5653 self
.set_limit(d
.getVarInt32())
5656 self
.set_matched_count_accuracy(d
.getVarInt32())
5659 length
= d
.getVarInt32()
5660 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5662 self
.add_sort_spec().TryMerge(tmp
)
5665 length
= d
.getVarInt32()
5666 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5668 self
.mutable_scorer_spec().TryMerge(tmp
)
5671 length
= d
.getVarInt32()
5672 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5674 self
.mutable_field_spec().TryMerge(tmp
)
5677 self
.set_offset(d
.getVarInt32())
5680 self
.set_keys_only(d
.getBoolean())
5683 self
.set_parsing_mode(d
.getVarInt32())
5686 self
.set_auto_discover_facet_count(d
.getVarInt32())
5689 length
= d
.getVarInt32()
5690 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5692 self
.add_include_facet().TryMerge(tmp
)
5695 length
= d
.getVarInt32()
5696 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5698 self
.add_facet_refinement().TryMerge(tmp
)
5701 length
= d
.getVarInt32()
5702 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5704 self
.mutable_facet_auto_detect_param().TryMerge(tmp
)
5707 self
.set_facet_depth(d
.getVarInt32())
5711 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
5715 def __str__(self
, prefix
="", printElemNumber
=0):
5717 if self
.has_index_spec_
:
5718 res
+=prefix
+"index_spec <\n"
5719 res
+=self
.index_spec_
.__str
__(prefix
+ " ", printElemNumber
)
5721 if self
.has_query_
: res
+=prefix
+("query: %s\n" % self
.DebugFormatString(self
.query_
))
5722 if self
.has_cursor_
: res
+=prefix
+("cursor: %s\n" % self
.DebugFormatString(self
.cursor_
))
5723 if self
.has_offset_
: res
+=prefix
+("offset: %s\n" % self
.DebugFormatInt32(self
.offset_
))
5724 if self
.has_cursor_type_
: res
+=prefix
+("cursor_type: %s\n" % self
.DebugFormatInt32(self
.cursor_type_
))
5725 if self
.has_limit_
: res
+=prefix
+("limit: %s\n" % self
.DebugFormatInt32(self
.limit_
))
5726 if self
.has_matched_count_accuracy_
: res
+=prefix
+("matched_count_accuracy: %s\n" % self
.DebugFormatInt32(self
.matched_count_accuracy_
))
5728 for e
in self
.sort_spec_
:
5730 if printElemNumber
: elm
="(%d)" % cnt
5731 res
+=prefix
+("sort_spec%s <\n" % elm
)
5732 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
5735 if self
.has_scorer_spec_
:
5736 res
+=prefix
+"scorer_spec <\n"
5737 res
+=self
.scorer_spec_
.__str
__(prefix
+ " ", printElemNumber
)
5739 if self
.has_field_spec_
:
5740 res
+=prefix
+"field_spec <\n"
5741 res
+=self
.field_spec_
.__str
__(prefix
+ " ", printElemNumber
)
5743 if self
.has_keys_only_
: res
+=prefix
+("keys_only: %s\n" % self
.DebugFormatBool(self
.keys_only_
))
5744 if self
.has_parsing_mode_
: res
+=prefix
+("parsing_mode: %s\n" % self
.DebugFormatInt32(self
.parsing_mode_
))
5745 if self
.has_auto_discover_facet_count_
: res
+=prefix
+("auto_discover_facet_count: %s\n" % self
.DebugFormatInt32(self
.auto_discover_facet_count_
))
5747 for e
in self
.include_facet_
:
5749 if printElemNumber
: elm
="(%d)" % cnt
5750 res
+=prefix
+("include_facet%s <\n" % elm
)
5751 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
5755 for e
in self
.facet_refinement_
:
5757 if printElemNumber
: elm
="(%d)" % cnt
5758 res
+=prefix
+("facet_refinement%s <\n" % elm
)
5759 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
5762 if self
.has_facet_auto_detect_param_
:
5763 res
+=prefix
+"facet_auto_detect_param <\n"
5764 res
+=self
.facet_auto_detect_param_
.__str
__(prefix
+ " ", printElemNumber
)
5766 if self
.has_facet_depth_
: res
+=prefix
+("facet_depth: %s\n" % self
.DebugFormatInt32(self
.facet_depth_
))
5770 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
5771 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
5779 kmatched_count_accuracy
= 7
5785 kauto_discover_facet_count
= 15
5787 kfacet_refinement
= 17
5788 kfacet_auto_detect_param
= 18
5791 _TEXT
= _BuildTagLookupTable({
5798 7: "matched_count_accuracy",
5805 15: "auto_discover_facet_count",
5806 16: "include_facet",
5807 17: "facet_refinement",
5808 18: "facet_auto_detect_param",
5812 _TYPES
= _BuildTagLookupTable({
5813 0: ProtocolBuffer
.Encoder
.NUMERIC
,
5814 1: ProtocolBuffer
.Encoder
.STRING
,
5815 2: ProtocolBuffer
.Encoder
.STRING
,
5816 4: ProtocolBuffer
.Encoder
.STRING
,
5817 5: ProtocolBuffer
.Encoder
.NUMERIC
,
5818 6: ProtocolBuffer
.Encoder
.NUMERIC
,
5819 7: ProtocolBuffer
.Encoder
.NUMERIC
,
5820 8: ProtocolBuffer
.Encoder
.STRING
,
5821 9: ProtocolBuffer
.Encoder
.STRING
,
5822 10: ProtocolBuffer
.Encoder
.STRING
,
5823 11: ProtocolBuffer
.Encoder
.NUMERIC
,
5824 12: ProtocolBuffer
.Encoder
.NUMERIC
,
5825 13: ProtocolBuffer
.Encoder
.NUMERIC
,
5826 15: ProtocolBuffer
.Encoder
.NUMERIC
,
5827 16: ProtocolBuffer
.Encoder
.STRING
,
5828 17: ProtocolBuffer
.Encoder
.STRING
,
5829 18: ProtocolBuffer
.Encoder
.STRING
,
5830 19: ProtocolBuffer
.Encoder
.NUMERIC
,
5831 }, 19, ProtocolBuffer
.Encoder
.MAX_TYPE
)
5835 _STYLE_CONTENT_TYPE
= """"""
5836 _PROTO_DESCRIPTOR_NAME
= 'apphosting.SearchParams'
5837 class SearchRequest(ProtocolBuffer
.ProtocolMessage
):
5842 def __init__(self
, contents
=None):
5843 self
.params_
= SearchParams()
5844 if contents
is not None: self
.MergeFromString(contents
)
5846 def params(self
): return self
.params_
5848 def mutable_params(self
): self
.has_params_
= 1; return self
.params_
5850 def clear_params(self
):self
.has_params_
= 0; self
.params_
.Clear()
5852 def has_params(self
): return self
.has_params_
5854 def app_id(self
): return self
.app_id_
5856 def set_app_id(self
, x
):
5857 self
.has_app_id_
= 1
5860 def clear_app_id(self
):
5861 if self
.has_app_id_
:
5862 self
.has_app_id_
= 0
5865 def has_app_id(self
): return self
.has_app_id_
5868 def MergeFrom(self
, x
):
5869 assert x
is not self
5870 if (x
.has_params()): self
.mutable_params().MergeFrom(x
.params())
5871 if (x
.has_app_id()): self
.set_app_id(x
.app_id())
5873 def Equals(self
, x
):
5874 if x
is self
: return 1
5875 if self
.has_params_
!= x
.has_params_
: return 0
5876 if self
.has_params_
and self
.params_
!= x
.params_
: return 0
5877 if self
.has_app_id_
!= x
.has_app_id_
: return 0
5878 if self
.has_app_id_
and self
.app_id_
!= x
.app_id_
: return 0
5881 def IsInitialized(self
, debug_strs
=None):
5883 if (not self
.has_params_
):
5885 if debug_strs
is not None:
5886 debug_strs
.append('Required field: params not set.')
5887 elif not self
.params_
.IsInitialized(debug_strs
): initialized
= 0
5892 n
+= self
.lengthString(self
.params_
.ByteSize())
5893 if (self
.has_app_id_
): n
+= 1 + self
.lengthString(len(self
.app_id_
))
5896 def ByteSizePartial(self
):
5898 if (self
.has_params_
):
5900 n
+= self
.lengthString(self
.params_
.ByteSizePartial())
5901 if (self
.has_app_id_
): n
+= 1 + self
.lengthString(len(self
.app_id_
))
5908 def OutputUnchecked(self
, out
):
5910 out
.putVarInt32(self
.params_
.ByteSize())
5911 self
.params_
.OutputUnchecked(out
)
5912 if (self
.has_app_id_
):
5914 out
.putPrefixedString(self
.app_id_
)
5916 def OutputPartial(self
, out
):
5917 if (self
.has_params_
):
5919 out
.putVarInt32(self
.params_
.ByteSizePartial())
5920 self
.params_
.OutputPartial(out
)
5921 if (self
.has_app_id_
):
5923 out
.putPrefixedString(self
.app_id_
)
5925 def TryMerge(self
, d
):
5926 while d
.avail() > 0:
5927 tt
= d
.getVarInt32()
5929 length
= d
.getVarInt32()
5930 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
5932 self
.mutable_params().TryMerge(tmp
)
5935 self
.set_app_id(d
.getPrefixedString())
5939 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
5943 def __str__(self
, prefix
="", printElemNumber
=0):
5945 if self
.has_params_
:
5946 res
+=prefix
+"params <\n"
5947 res
+=self
.params_
.__str
__(prefix
+ " ", printElemNumber
)
5949 if self
.has_app_id_
: res
+=prefix
+("app_id: %s\n" % self
.DebugFormatString(self
.app_id_
))
5953 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
5954 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
5959 _TEXT
= _BuildTagLookupTable({
5965 _TYPES
= _BuildTagLookupTable({
5966 0: ProtocolBuffer
.Encoder
.NUMERIC
,
5967 1: ProtocolBuffer
.Encoder
.STRING
,
5968 3: ProtocolBuffer
.Encoder
.STRING
,
5969 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
5973 _STYLE_CONTENT_TYPE
= """"""
5974 _PROTO_DESCRIPTOR_NAME
= 'apphosting.SearchRequest'
5975 class FacetResultValue(ProtocolBuffer
.ProtocolMessage
):
5981 def __init__(self
, contents
=None):
5982 if contents
is not None: self
.MergeFromString(contents
)
5984 def name(self
): return self
.name_
5986 def set_name(self
, x
):
5990 def clear_name(self
):
5995 def has_name(self
): return self
.has_name_
5997 def count(self
): return self
.count_
5999 def set_count(self
, x
):
6003 def clear_count(self
):
6008 def has_count(self
): return self
.has_count_
6011 def MergeFrom(self
, x
):
6012 assert x
is not self
6013 if (x
.has_name()): self
.set_name(x
.name())
6014 if (x
.has_count()): self
.set_count(x
.count())
6016 def Equals(self
, x
):
6017 if x
is self
: return 1
6018 if self
.has_name_
!= x
.has_name_
: return 0
6019 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
6020 if self
.has_count_
!= x
.has_count_
: return 0
6021 if self
.has_count_
and self
.count_
!= x
.count_
: return 0
6024 def IsInitialized(self
, debug_strs
=None):
6026 if (not self
.has_name_
):
6028 if debug_strs
is not None:
6029 debug_strs
.append('Required field: name not set.')
6030 if (not self
.has_count_
):
6032 if debug_strs
is not None:
6033 debug_strs
.append('Required field: count not set.')
6038 n
+= self
.lengthString(len(self
.name_
))
6039 n
+= self
.lengthVarInt64(self
.count_
)
6042 def ByteSizePartial(self
):
6044 if (self
.has_name_
):
6046 n
+= self
.lengthString(len(self
.name_
))
6047 if (self
.has_count_
):
6049 n
+= self
.lengthVarInt64(self
.count_
)
6056 def OutputUnchecked(self
, out
):
6058 out
.putPrefixedString(self
.name_
)
6060 out
.putVarInt32(self
.count_
)
6062 def OutputPartial(self
, out
):
6063 if (self
.has_name_
):
6065 out
.putPrefixedString(self
.name_
)
6066 if (self
.has_count_
):
6068 out
.putVarInt32(self
.count_
)
6070 def TryMerge(self
, d
):
6071 while d
.avail() > 0:
6072 tt
= d
.getVarInt32()
6074 self
.set_name(d
.getPrefixedString())
6077 self
.set_count(d
.getVarInt32())
6081 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6085 def __str__(self
, prefix
="", printElemNumber
=0):
6087 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
6088 if self
.has_count_
: res
+=prefix
+("count: %s\n" % self
.DebugFormatInt32(self
.count_
))
6092 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6093 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6098 _TEXT
= _BuildTagLookupTable({
6104 _TYPES
= _BuildTagLookupTable({
6105 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6106 1: ProtocolBuffer
.Encoder
.STRING
,
6107 2: ProtocolBuffer
.Encoder
.NUMERIC
,
6108 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
6112 _STYLE_CONTENT_TYPE
= """"""
6113 _PROTO_DESCRIPTOR_NAME
= 'apphosting.FacetResultValue'
6114 class FacetResult(ProtocolBuffer
.ProtocolMessage
):
6119 def __init__(self
, contents
=None):
6120 self
.type_
= ContentType()
6122 if contents
is not None: self
.MergeFromString(contents
)
6124 def name(self
): return self
.name_
6126 def set_name(self
, x
):
6130 def clear_name(self
):
6135 def has_name(self
): return self
.has_name_
6137 def type(self
): return self
.type_
6139 def mutable_type(self
): self
.has_type_
= 1; return self
.type_
6141 def clear_type(self
):self
.has_type_
= 0; self
.type_
.Clear()
6143 def has_type(self
): return self
.has_type_
6145 def value_size(self
): return len(self
.value_
)
6146 def value_list(self
): return self
.value_
6149 return self
.value_
[i
]
6151 def mutable_value(self
, i
):
6152 return self
.value_
[i
]
6154 def add_value(self
):
6155 x
= FacetResultValue()
6156 self
.value_
.append(x
)
6159 def clear_value(self
):
6162 def MergeFrom(self
, x
):
6163 assert x
is not self
6164 if (x
.has_name()): self
.set_name(x
.name())
6165 if (x
.has_type()): self
.mutable_type().MergeFrom(x
.type())
6166 for i
in xrange(x
.value_size()): self
.add_value().CopyFrom(x
.value(i
))
6168 def Equals(self
, x
):
6169 if x
is self
: return 1
6170 if self
.has_name_
!= x
.has_name_
: return 0
6171 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
6172 if self
.has_type_
!= x
.has_type_
: return 0
6173 if self
.has_type_
and self
.type_
!= x
.type_
: return 0
6174 if len(self
.value_
) != len(x
.value_
): return 0
6175 for e1
, e2
in zip(self
.value_
, x
.value_
):
6176 if e1
!= e2
: return 0
6179 def IsInitialized(self
, debug_strs
=None):
6181 if (not self
.has_name_
):
6183 if debug_strs
is not None:
6184 debug_strs
.append('Required field: name not set.')
6185 if (not self
.has_type_
):
6187 if debug_strs
is not None:
6188 debug_strs
.append('Required field: type not set.')
6189 elif not self
.type_
.IsInitialized(debug_strs
): initialized
= 0
6190 for p
in self
.value_
:
6191 if not p
.IsInitialized(debug_strs
): initialized
=0
6196 n
+= self
.lengthString(len(self
.name_
))
6197 n
+= self
.lengthString(self
.type_
.ByteSize())
6198 n
+= 1 * len(self
.value_
)
6199 for i
in xrange(len(self
.value_
)): n
+= self
.lengthString(self
.value_
[i
].ByteSize())
6202 def ByteSizePartial(self
):
6204 if (self
.has_name_
):
6206 n
+= self
.lengthString(len(self
.name_
))
6207 if (self
.has_type_
):
6209 n
+= self
.lengthString(self
.type_
.ByteSizePartial())
6210 n
+= 1 * len(self
.value_
)
6211 for i
in xrange(len(self
.value_
)): n
+= self
.lengthString(self
.value_
[i
].ByteSizePartial())
6219 def OutputUnchecked(self
, out
):
6221 out
.putPrefixedString(self
.name_
)
6223 out
.putVarInt32(self
.type_
.ByteSize())
6224 self
.type_
.OutputUnchecked(out
)
6225 for i
in xrange(len(self
.value_
)):
6227 out
.putVarInt32(self
.value_
[i
].ByteSize())
6228 self
.value_
[i
].OutputUnchecked(out
)
6230 def OutputPartial(self
, out
):
6231 if (self
.has_name_
):
6233 out
.putPrefixedString(self
.name_
)
6234 if (self
.has_type_
):
6236 out
.putVarInt32(self
.type_
.ByteSizePartial())
6237 self
.type_
.OutputPartial(out
)
6238 for i
in xrange(len(self
.value_
)):
6240 out
.putVarInt32(self
.value_
[i
].ByteSizePartial())
6241 self
.value_
[i
].OutputPartial(out
)
6243 def TryMerge(self
, d
):
6244 while d
.avail() > 0:
6245 tt
= d
.getVarInt32()
6247 self
.set_name(d
.getPrefixedString())
6250 length
= d
.getVarInt32()
6251 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6253 self
.mutable_type().TryMerge(tmp
)
6256 length
= d
.getVarInt32()
6257 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6259 self
.add_value().TryMerge(tmp
)
6263 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6267 def __str__(self
, prefix
="", printElemNumber
=0):
6269 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
6271 res
+=prefix
+"type <\n"
6272 res
+=self
.type_
.__str
__(prefix
+ " ", printElemNumber
)
6275 for e
in self
.value_
:
6277 if printElemNumber
: elm
="(%d)" % cnt
6278 res
+=prefix
+("value%s <\n" % elm
)
6279 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
6285 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6286 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6292 _TEXT
= _BuildTagLookupTable({
6299 _TYPES
= _BuildTagLookupTable({
6300 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6301 1: ProtocolBuffer
.Encoder
.STRING
,
6302 2: ProtocolBuffer
.Encoder
.STRING
,
6303 3: ProtocolBuffer
.Encoder
.STRING
,
6304 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
6308 _STYLE_CONTENT_TYPE
= """"""
6309 _PROTO_DESCRIPTOR_NAME
= 'apphosting.FacetResult'
6310 class SearchResult(ProtocolBuffer
.ProtocolMessage
):
6315 def __init__(self
, contents
=None):
6316 self
.document_
= Document()
6317 self
.expression_
= []
6319 if contents
is not None: self
.MergeFromString(contents
)
6321 def document(self
): return self
.document_
6323 def mutable_document(self
): self
.has_document_
= 1; return self
.document_
6325 def clear_document(self
):self
.has_document_
= 0; self
.document_
.Clear()
6327 def has_document(self
): return self
.has_document_
6329 def expression_size(self
): return len(self
.expression_
)
6330 def expression_list(self
): return self
.expression_
6332 def expression(self
, i
):
6333 return self
.expression_
[i
]
6335 def mutable_expression(self
, i
):
6336 return self
.expression_
[i
]
6338 def add_expression(self
):
6340 self
.expression_
.append(x
)
6343 def clear_expression(self
):
6344 self
.expression_
= []
6345 def score_size(self
): return len(self
.score_
)
6346 def score_list(self
): return self
.score_
6349 return self
.score_
[i
]
6351 def set_score(self
, i
, x
):
6354 def add_score(self
, x
):
6355 self
.score_
.append(x
)
6357 def clear_score(self
):
6360 def cursor(self
): return self
.cursor_
6362 def set_cursor(self
, x
):
6363 self
.has_cursor_
= 1
6366 def clear_cursor(self
):
6367 if self
.has_cursor_
:
6368 self
.has_cursor_
= 0
6371 def has_cursor(self
): return self
.has_cursor_
6374 def MergeFrom(self
, x
):
6375 assert x
is not self
6376 if (x
.has_document()): self
.mutable_document().MergeFrom(x
.document())
6377 for i
in xrange(x
.expression_size()): self
.add_expression().CopyFrom(x
.expression(i
))
6378 for i
in xrange(x
.score_size()): self
.add_score(x
.score(i
))
6379 if (x
.has_cursor()): self
.set_cursor(x
.cursor())
6381 def Equals(self
, x
):
6382 if x
is self
: return 1
6383 if self
.has_document_
!= x
.has_document_
: return 0
6384 if self
.has_document_
and self
.document_
!= x
.document_
: return 0
6385 if len(self
.expression_
) != len(x
.expression_
): return 0
6386 for e1
, e2
in zip(self
.expression_
, x
.expression_
):
6387 if e1
!= e2
: return 0
6388 if len(self
.score_
) != len(x
.score_
): return 0
6389 for e1
, e2
in zip(self
.score_
, x
.score_
):
6390 if e1
!= e2
: return 0
6391 if self
.has_cursor_
!= x
.has_cursor_
: return 0
6392 if self
.has_cursor_
and self
.cursor_
!= x
.cursor_
: return 0
6395 def IsInitialized(self
, debug_strs
=None):
6397 if (not self
.has_document_
):
6399 if debug_strs
is not None:
6400 debug_strs
.append('Required field: document not set.')
6401 elif not self
.document_
.IsInitialized(debug_strs
): initialized
= 0
6402 for p
in self
.expression_
:
6403 if not p
.IsInitialized(debug_strs
): initialized
=0
6408 n
+= self
.lengthString(self
.document_
.ByteSize())
6409 n
+= 1 * len(self
.expression_
)
6410 for i
in xrange(len(self
.expression_
)): n
+= self
.lengthString(self
.expression_
[i
].ByteSize())
6411 n
+= 9 * len(self
.score_
)
6412 if (self
.has_cursor_
): n
+= 1 + self
.lengthString(len(self
.cursor_
))
6415 def ByteSizePartial(self
):
6417 if (self
.has_document_
):
6419 n
+= self
.lengthString(self
.document_
.ByteSizePartial())
6420 n
+= 1 * len(self
.expression_
)
6421 for i
in xrange(len(self
.expression_
)): n
+= self
.lengthString(self
.expression_
[i
].ByteSizePartial())
6422 n
+= 9 * len(self
.score_
)
6423 if (self
.has_cursor_
): n
+= 1 + self
.lengthString(len(self
.cursor_
))
6427 self
.clear_document()
6428 self
.clear_expression()
6432 def OutputUnchecked(self
, out
):
6434 out
.putVarInt32(self
.document_
.ByteSize())
6435 self
.document_
.OutputUnchecked(out
)
6436 for i
in xrange(len(self
.score_
)):
6438 out
.putDouble(self
.score_
[i
])
6439 if (self
.has_cursor_
):
6441 out
.putPrefixedString(self
.cursor_
)
6442 for i
in xrange(len(self
.expression_
)):
6444 out
.putVarInt32(self
.expression_
[i
].ByteSize())
6445 self
.expression_
[i
].OutputUnchecked(out
)
6447 def OutputPartial(self
, out
):
6448 if (self
.has_document_
):
6450 out
.putVarInt32(self
.document_
.ByteSizePartial())
6451 self
.document_
.OutputPartial(out
)
6452 for i
in xrange(len(self
.score_
)):
6454 out
.putDouble(self
.score_
[i
])
6455 if (self
.has_cursor_
):
6457 out
.putPrefixedString(self
.cursor_
)
6458 for i
in xrange(len(self
.expression_
)):
6460 out
.putVarInt32(self
.expression_
[i
].ByteSizePartial())
6461 self
.expression_
[i
].OutputPartial(out
)
6463 def TryMerge(self
, d
):
6464 while d
.avail() > 0:
6465 tt
= d
.getVarInt32()
6467 length
= d
.getVarInt32()
6468 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6470 self
.mutable_document().TryMerge(tmp
)
6473 self
.add_score(d
.getDouble())
6476 self
.set_cursor(d
.getPrefixedString())
6479 length
= d
.getVarInt32()
6480 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6482 self
.add_expression().TryMerge(tmp
)
6486 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6490 def __str__(self
, prefix
="", printElemNumber
=0):
6492 if self
.has_document_
:
6493 res
+=prefix
+"document <\n"
6494 res
+=self
.document_
.__str
__(prefix
+ " ", printElemNumber
)
6497 for e
in self
.expression_
:
6499 if printElemNumber
: elm
="(%d)" % cnt
6500 res
+=prefix
+("expression%s <\n" % elm
)
6501 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
6505 for e
in self
.score_
:
6507 if printElemNumber
: elm
="(%d)" % cnt
6508 res
+=prefix
+("score%s: %s\n" % (elm
, self
.DebugFormat(e
)))
6510 if self
.has_cursor_
: res
+=prefix
+("cursor: %s\n" % self
.DebugFormatString(self
.cursor_
))
6514 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6515 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6522 _TEXT
= _BuildTagLookupTable({
6530 _TYPES
= _BuildTagLookupTable({
6531 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6532 1: ProtocolBuffer
.Encoder
.STRING
,
6533 2: ProtocolBuffer
.Encoder
.DOUBLE
,
6534 3: ProtocolBuffer
.Encoder
.STRING
,
6535 4: ProtocolBuffer
.Encoder
.STRING
,
6536 }, 4, ProtocolBuffer
.Encoder
.MAX_TYPE
)
6540 _STYLE_CONTENT_TYPE
= """"""
6541 _PROTO_DESCRIPTOR_NAME
= 'apphosting.SearchResult'
6542 class SearchResponse(_ExtendableProtocolMessage
):
6543 has_matched_count_
= 0
6549 def __init__(self
, contents
=None):
6550 if _extension_runtime
:
6551 self
._extension
_fields
= {}
6553 self
.status_
= RequestStatus()
6554 self
.facet_result_
= []
6555 if contents
is not None: self
.MergeFromString(contents
)
6557 def result_size(self
): return len(self
.result_
)
6558 def result_list(self
): return self
.result_
6560 def result(self
, i
):
6561 return self
.result_
[i
]
6563 def mutable_result(self
, i
):
6564 return self
.result_
[i
]
6566 def add_result(self
):
6568 self
.result_
.append(x
)
6571 def clear_result(self
):
6573 def matched_count(self
): return self
.matched_count_
6575 def set_matched_count(self
, x
):
6576 self
.has_matched_count_
= 1
6577 self
.matched_count_
= x
6579 def clear_matched_count(self
):
6580 if self
.has_matched_count_
:
6581 self
.has_matched_count_
= 0
6582 self
.matched_count_
= 0
6584 def has_matched_count(self
): return self
.has_matched_count_
6586 def status(self
): return self
.status_
6588 def mutable_status(self
): self
.has_status_
= 1; return self
.status_
6590 def clear_status(self
):self
.has_status_
= 0; self
.status_
.Clear()
6592 def has_status(self
): return self
.has_status_
6594 def cursor(self
): return self
.cursor_
6596 def set_cursor(self
, x
):
6597 self
.has_cursor_
= 1
6600 def clear_cursor(self
):
6601 if self
.has_cursor_
:
6602 self
.has_cursor_
= 0
6605 def has_cursor(self
): return self
.has_cursor_
6607 def facet_result_size(self
): return len(self
.facet_result_
)
6608 def facet_result_list(self
): return self
.facet_result_
6610 def facet_result(self
, i
):
6611 return self
.facet_result_
[i
]
6613 def mutable_facet_result(self
, i
):
6614 return self
.facet_result_
[i
]
6616 def add_facet_result(self
):
6618 self
.facet_result_
.append(x
)
6621 def clear_facet_result(self
):
6622 self
.facet_result_
= []
6624 def MergeFrom(self
, x
):
6625 assert x
is not self
6626 for i
in xrange(x
.result_size()): self
.add_result().CopyFrom(x
.result(i
))
6627 if (x
.has_matched_count()): self
.set_matched_count(x
.matched_count())
6628 if (x
.has_status()): self
.mutable_status().MergeFrom(x
.status())
6629 if (x
.has_cursor()): self
.set_cursor(x
.cursor())
6630 for i
in xrange(x
.facet_result_size()): self
.add_facet_result().CopyFrom(x
.facet_result(i
))
6631 if _extension_runtime
: self
._MergeExtensionFields
(x
)
6633 def Equals(self
, x
):
6634 if x
is self
: return 1
6635 if len(self
.result_
) != len(x
.result_
): return 0
6636 for e1
, e2
in zip(self
.result_
, x
.result_
):
6637 if e1
!= e2
: return 0
6638 if self
.has_matched_count_
!= x
.has_matched_count_
: return 0
6639 if self
.has_matched_count_
and self
.matched_count_
!= x
.matched_count_
: return 0
6640 if self
.has_status_
!= x
.has_status_
: return 0
6641 if self
.has_status_
and self
.status_
!= x
.status_
: return 0
6642 if self
.has_cursor_
!= x
.has_cursor_
: return 0
6643 if self
.has_cursor_
and self
.cursor_
!= x
.cursor_
: return 0
6644 if len(self
.facet_result_
) != len(x
.facet_result_
): return 0
6645 for e1
, e2
in zip(self
.facet_result_
, x
.facet_result_
):
6646 if e1
!= e2
: return 0
6647 if _extension_runtime
and not self
._ExtensionEquals
(x
): return 0
6650 def IsInitialized(self
, debug_strs
=None):
6652 for p
in self
.result_
:
6653 if not p
.IsInitialized(debug_strs
): initialized
=0
6654 if (not self
.has_matched_count_
):
6656 if debug_strs
is not None:
6657 debug_strs
.append('Required field: matched_count not set.')
6658 if (not self
.has_status_
):
6660 if debug_strs
is not None:
6661 debug_strs
.append('Required field: status not set.')
6662 elif not self
.status_
.IsInitialized(debug_strs
): initialized
= 0
6663 for p
in self
.facet_result_
:
6664 if not p
.IsInitialized(debug_strs
): initialized
=0
6669 n
+= 1 * len(self
.result_
)
6670 for i
in xrange(len(self
.result_
)): n
+= self
.lengthString(self
.result_
[i
].ByteSize())
6671 n
+= self
.lengthVarInt64(self
.matched_count_
)
6672 n
+= self
.lengthString(self
.status_
.ByteSize())
6673 if (self
.has_cursor_
): n
+= 1 + self
.lengthString(len(self
.cursor_
))
6674 n
+= 1 * len(self
.facet_result_
)
6675 for i
in xrange(len(self
.facet_result_
)): n
+= self
.lengthString(self
.facet_result_
[i
].ByteSize())
6676 if _extension_runtime
:
6677 n
+= self
._ExtensionByteSize
(False)
6680 def ByteSizePartial(self
):
6682 n
+= 1 * len(self
.result_
)
6683 for i
in xrange(len(self
.result_
)): n
+= self
.lengthString(self
.result_
[i
].ByteSizePartial())
6684 if (self
.has_matched_count_
):
6686 n
+= self
.lengthVarInt64(self
.matched_count_
)
6687 if (self
.has_status_
):
6689 n
+= self
.lengthString(self
.status_
.ByteSizePartial())
6690 if (self
.has_cursor_
): n
+= 1 + self
.lengthString(len(self
.cursor_
))
6691 n
+= 1 * len(self
.facet_result_
)
6692 for i
in xrange(len(self
.facet_result_
)): n
+= self
.lengthString(self
.facet_result_
[i
].ByteSizePartial())
6693 if _extension_runtime
:
6694 n
+= self
._ExtensionByteSize
(True)
6699 self
.clear_matched_count()
6702 self
.clear_facet_result()
6703 if _extension_runtime
: self
._extension
_fields
.clear()
6705 def OutputUnchecked(self
, out
):
6706 if _extension_runtime
:
6707 extensions
= self
._ListExtensions
()
6709 for i
in xrange(len(self
.result_
)):
6711 out
.putVarInt32(self
.result_
[i
].ByteSize())
6712 self
.result_
[i
].OutputUnchecked(out
)
6714 out
.putVarInt64(self
.matched_count_
)
6716 out
.putVarInt32(self
.status_
.ByteSize())
6717 self
.status_
.OutputUnchecked(out
)
6718 if (self
.has_cursor_
):
6720 out
.putPrefixedString(self
.cursor_
)
6721 for i
in xrange(len(self
.facet_result_
)):
6723 out
.putVarInt32(self
.facet_result_
[i
].ByteSize())
6724 self
.facet_result_
[i
].OutputUnchecked(out
)
6725 if _extension_runtime
:
6726 extension_index
= self
._OutputExtensionFields
(out
, False, extensions
, extension_index
, 10000)
6728 def OutputPartial(self
, out
):
6729 if _extension_runtime
:
6730 extensions
= self
._ListExtensions
()
6732 for i
in xrange(len(self
.result_
)):
6734 out
.putVarInt32(self
.result_
[i
].ByteSizePartial())
6735 self
.result_
[i
].OutputPartial(out
)
6736 if (self
.has_matched_count_
):
6738 out
.putVarInt64(self
.matched_count_
)
6739 if (self
.has_status_
):
6741 out
.putVarInt32(self
.status_
.ByteSizePartial())
6742 self
.status_
.OutputPartial(out
)
6743 if (self
.has_cursor_
):
6745 out
.putPrefixedString(self
.cursor_
)
6746 for i
in xrange(len(self
.facet_result_
)):
6748 out
.putVarInt32(self
.facet_result_
[i
].ByteSizePartial())
6749 self
.facet_result_
[i
].OutputPartial(out
)
6750 if _extension_runtime
:
6751 extension_index
= self
._OutputExtensionFields
(out
, True, extensions
, extension_index
, 10000)
6753 def TryMerge(self
, d
):
6754 while d
.avail() > 0:
6755 tt
= d
.getVarInt32()
6757 length
= d
.getVarInt32()
6758 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6760 self
.add_result().TryMerge(tmp
)
6763 self
.set_matched_count(d
.getVarInt64())
6766 length
= d
.getVarInt32()
6767 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6769 self
.mutable_status().TryMerge(tmp
)
6772 self
.set_cursor(d
.getPrefixedString())
6775 length
= d
.getVarInt32()
6776 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
6778 self
.add_facet_result().TryMerge(tmp
)
6780 if _extension_runtime
:
6781 if (1000 <= tt
and tt
< 10000):
6782 self
._ParseOneExtensionField
(tt
, d
)
6786 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
6790 def __str__(self
, prefix
="", printElemNumber
=0):
6793 for e
in self
.result_
:
6795 if printElemNumber
: elm
="(%d)" % cnt
6796 res
+=prefix
+("result%s <\n" % elm
)
6797 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
6800 if self
.has_matched_count_
: res
+=prefix
+("matched_count: %s\n" % self
.DebugFormatInt64(self
.matched_count_
))
6801 if self
.has_status_
:
6802 res
+=prefix
+"status <\n"
6803 res
+=self
.status_
.__str
__(prefix
+ " ", printElemNumber
)
6805 if self
.has_cursor_
: res
+=prefix
+("cursor: %s\n" % self
.DebugFormatString(self
.cursor_
))
6807 for e
in self
.facet_result_
:
6809 if printElemNumber
: elm
="(%d)" % cnt
6810 res
+=prefix
+("facet_result%s <\n" % elm
)
6811 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
6814 if _extension_runtime
:
6815 res
+=self
._ExtensionDebugString
(prefix
, printElemNumber
)
6818 if _extension_runtime
:
6819 _extensions_by_field_number
= {}
6821 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
6822 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
6830 _TEXT
= _BuildTagLookupTable({
6839 _TYPES
= _BuildTagLookupTable({
6840 0: ProtocolBuffer
.Encoder
.NUMERIC
,
6841 1: ProtocolBuffer
.Encoder
.STRING
,
6842 2: ProtocolBuffer
.Encoder
.NUMERIC
,
6843 3: ProtocolBuffer
.Encoder
.STRING
,
6844 4: ProtocolBuffer
.Encoder
.STRING
,
6845 5: ProtocolBuffer
.Encoder
.STRING
,
6846 }, 5, ProtocolBuffer
.Encoder
.MAX_TYPE
)
6850 _STYLE_CONTENT_TYPE
= """"""
6851 _PROTO_DESCRIPTOR_NAME
= 'apphosting.SearchResponse'
6852 if _extension_runtime
:
6855 __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']