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.
18 from google
.net
.proto
import ProtocolBuffer
20 import dummy_thread
as thread
22 __pychecker__
= """maxreturns=0 maxbranches=0 no-callinit
23 unusednames=printElemNumber,debug_strs no-special"""
25 class PropertyValue_ReferenceValuePathElement(ProtocolBuffer
.ProtocolMessage
):
33 def __init__(self
, contents
=None):
34 if contents
is not None: self
.MergeFromString(contents
)
36 def type(self
): return self
.type_
38 def set_type(self
, x
):
47 def has_type(self
): return self
.has_type_
49 def id(self
): return self
.id_
60 def has_id(self
): return self
.has_id_
62 def name(self
): return self
.name_
64 def set_name(self
, x
):
73 def has_name(self
): return self
.has_name_
76 def MergeFrom(self
, x
):
78 if (x
.has_type()): self
.set_type(x
.type())
79 if (x
.has_id()): self
.set_id(x
.id())
80 if (x
.has_name()): self
.set_name(x
.name())
83 if x
is self
: return 1
84 if self
.has_type_
!= x
.has_type_
: return 0
85 if self
.has_type_
and self
.type_
!= x
.type_
: return 0
86 if self
.has_id_
!= x
.has_id_
: return 0
87 if self
.has_id_
and self
.id_
!= x
.id_
: return 0
88 if self
.has_name_
!= x
.has_name_
: return 0
89 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
92 def IsInitialized(self
, debug_strs
=None):
94 if (not self
.has_type_
):
96 if debug_strs
is not None:
97 debug_strs
.append('Required field: type not set.')
102 n
+= self
.lengthString(len(self
.type_
))
103 if (self
.has_id_
): n
+= 2 + self
.lengthVarInt64(self
.id_
)
104 if (self
.has_name_
): n
+= 2 + self
.lengthString(len(self
.name_
))
112 def OutputUnchecked(self
, out
):
114 out
.putPrefixedString(self
.type_
)
117 out
.putVarInt64(self
.id_
)
120 out
.putPrefixedString(self
.name_
)
122 def TryMerge(self
, d
):
127 self
.set_type(d
.getPrefixedString())
130 self
.set_id(d
.getVarInt64())
133 self
.set_name(d
.getPrefixedString())
135 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
139 def __str__(self
, prefix
="", printElemNumber
=0):
141 if self
.has_type_
: res
+=prefix
+("type: %s\n" % self
.DebugFormatString(self
.type_
))
142 if self
.has_id_
: res
+=prefix
+("id: %s\n" % self
.DebugFormatInt64(self
.id_
))
143 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
146 class PropertyValue_PointValue(ProtocolBuffer
.ProtocolMessage
):
152 def __init__(self
, contents
=None):
153 if contents
is not None: self
.MergeFromString(contents
)
155 def x(self
): return self
.x_
166 def has_x(self
): return self
.has_x_
168 def y(self
): return self
.y_
179 def has_y(self
): return self
.has_y_
182 def MergeFrom(self
, x
):
184 if (x
.has_x()): self
.set_x(x
.x())
185 if (x
.has_y()): self
.set_y(x
.y())
188 if x
is self
: return 1
189 if self
.has_x_
!= x
.has_x_
: return 0
190 if self
.has_x_
and self
.x_
!= x
.x_
: return 0
191 if self
.has_y_
!= x
.has_y_
: return 0
192 if self
.has_y_
and self
.y_
!= x
.y_
: return 0
195 def IsInitialized(self
, debug_strs
=None):
197 if (not self
.has_x_
):
199 if debug_strs
is not None:
200 debug_strs
.append('Required field: x not set.')
201 if (not self
.has_y_
):
203 if debug_strs
is not None:
204 debug_strs
.append('Required field: y not set.')
215 def OutputUnchecked(self
, out
):
217 out
.putDouble(self
.x_
)
219 out
.putDouble(self
.y_
)
221 def TryMerge(self
, d
):
226 self
.set_x(d
.getDouble())
229 self
.set_y(d
.getDouble())
231 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
235 def __str__(self
, prefix
="", printElemNumber
=0):
237 if self
.has_x_
: res
+=prefix
+("x: %s\n" % self
.DebugFormat(self
.x_
))
238 if self
.has_y_
: res
+=prefix
+("y: %s\n" % self
.DebugFormat(self
.y_
))
241 class PropertyValue_UserValue(ProtocolBuffer
.ProtocolMessage
):
250 has_obfuscated_gaiaid_
= 0
251 obfuscated_gaiaid_
= ""
253 def __init__(self
, contents
=None):
254 if contents
is not None: self
.MergeFromString(contents
)
256 def email(self
): return self
.email_
258 def set_email(self
, x
):
262 def clear_email(self
):
267 def has_email(self
): return self
.has_email_
269 def auth_domain(self
): return self
.auth_domain_
271 def set_auth_domain(self
, x
):
272 self
.has_auth_domain_
= 1
273 self
.auth_domain_
= x
275 def clear_auth_domain(self
):
276 if self
.has_auth_domain_
:
277 self
.has_auth_domain_
= 0
278 self
.auth_domain_
= ""
280 def has_auth_domain(self
): return self
.has_auth_domain_
282 def nickname(self
): return self
.nickname_
284 def set_nickname(self
, x
):
285 self
.has_nickname_
= 1
288 def clear_nickname(self
):
289 if self
.has_nickname_
:
290 self
.has_nickname_
= 0
293 def has_nickname(self
): return self
.has_nickname_
295 def gaiaid(self
): return self
.gaiaid_
297 def set_gaiaid(self
, x
):
301 def clear_gaiaid(self
):
306 def has_gaiaid(self
): return self
.has_gaiaid_
308 def obfuscated_gaiaid(self
): return self
.obfuscated_gaiaid_
310 def set_obfuscated_gaiaid(self
, x
):
311 self
.has_obfuscated_gaiaid_
= 1
312 self
.obfuscated_gaiaid_
= x
314 def clear_obfuscated_gaiaid(self
):
315 if self
.has_obfuscated_gaiaid_
:
316 self
.has_obfuscated_gaiaid_
= 0
317 self
.obfuscated_gaiaid_
= ""
319 def has_obfuscated_gaiaid(self
): return self
.has_obfuscated_gaiaid_
322 def MergeFrom(self
, x
):
324 if (x
.has_email()): self
.set_email(x
.email())
325 if (x
.has_auth_domain()): self
.set_auth_domain(x
.auth_domain())
326 if (x
.has_nickname()): self
.set_nickname(x
.nickname())
327 if (x
.has_gaiaid()): self
.set_gaiaid(x
.gaiaid())
328 if (x
.has_obfuscated_gaiaid()): self
.set_obfuscated_gaiaid(x
.obfuscated_gaiaid())
331 if x
is self
: return 1
332 if self
.has_email_
!= x
.has_email_
: return 0
333 if self
.has_email_
and self
.email_
!= x
.email_
: return 0
334 if self
.has_auth_domain_
!= x
.has_auth_domain_
: return 0
335 if self
.has_auth_domain_
and self
.auth_domain_
!= x
.auth_domain_
: return 0
336 if self
.has_nickname_
!= x
.has_nickname_
: return 0
337 if self
.has_nickname_
and self
.nickname_
!= x
.nickname_
: return 0
338 if self
.has_gaiaid_
!= x
.has_gaiaid_
: return 0
339 if self
.has_gaiaid_
and self
.gaiaid_
!= x
.gaiaid_
: return 0
340 if self
.has_obfuscated_gaiaid_
!= x
.has_obfuscated_gaiaid_
: return 0
341 if self
.has_obfuscated_gaiaid_
and self
.obfuscated_gaiaid_
!= x
.obfuscated_gaiaid_
: return 0
344 def IsInitialized(self
, debug_strs
=None):
346 if (not self
.has_email_
):
348 if debug_strs
is not None:
349 debug_strs
.append('Required field: email not set.')
350 if (not self
.has_auth_domain_
):
352 if debug_strs
is not None:
353 debug_strs
.append('Required field: auth_domain not set.')
354 if (not self
.has_gaiaid_
):
356 if debug_strs
is not None:
357 debug_strs
.append('Required field: gaiaid not set.')
362 n
+= self
.lengthString(len(self
.email_
))
363 n
+= self
.lengthString(len(self
.auth_domain_
))
364 if (self
.has_nickname_
): n
+= 1 + self
.lengthString(len(self
.nickname_
))
365 n
+= self
.lengthVarInt64(self
.gaiaid_
)
366 if (self
.has_obfuscated_gaiaid_
): n
+= 2 + self
.lengthString(len(self
.obfuscated_gaiaid_
))
371 self
.clear_auth_domain()
372 self
.clear_nickname()
374 self
.clear_obfuscated_gaiaid()
376 def OutputUnchecked(self
, out
):
378 out
.putPrefixedString(self
.email_
)
380 out
.putPrefixedString(self
.auth_domain_
)
381 if (self
.has_nickname_
):
383 out
.putPrefixedString(self
.nickname_
)
385 out
.putVarInt64(self
.gaiaid_
)
386 if (self
.has_obfuscated_gaiaid_
):
388 out
.putPrefixedString(self
.obfuscated_gaiaid_
)
390 def TryMerge(self
, d
):
395 self
.set_email(d
.getPrefixedString())
398 self
.set_auth_domain(d
.getPrefixedString())
401 self
.set_nickname(d
.getPrefixedString())
404 self
.set_gaiaid(d
.getVarInt64())
407 self
.set_obfuscated_gaiaid(d
.getPrefixedString())
409 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
413 def __str__(self
, prefix
="", printElemNumber
=0):
415 if self
.has_email_
: res
+=prefix
+("email: %s\n" % self
.DebugFormatString(self
.email_
))
416 if self
.has_auth_domain_
: res
+=prefix
+("auth_domain: %s\n" % self
.DebugFormatString(self
.auth_domain_
))
417 if self
.has_nickname_
: res
+=prefix
+("nickname: %s\n" % self
.DebugFormatString(self
.nickname_
))
418 if self
.has_gaiaid_
: res
+=prefix
+("gaiaid: %s\n" % self
.DebugFormatInt64(self
.gaiaid_
))
419 if self
.has_obfuscated_gaiaid_
: res
+=prefix
+("obfuscated_gaiaid: %s\n" % self
.DebugFormatString(self
.obfuscated_gaiaid_
))
422 class PropertyValue_ReferenceValue(ProtocolBuffer
.ProtocolMessage
):
426 def __init__(self
, contents
=None):
427 self
.pathelement_
= []
428 if contents
is not None: self
.MergeFromString(contents
)
430 def app(self
): return self
.app_
432 def set_app(self
, x
):
441 def has_app(self
): return self
.has_app_
443 def pathelement_size(self
): return len(self
.pathelement_
)
444 def pathelement_list(self
): return self
.pathelement_
446 def pathelement(self
, i
):
447 return self
.pathelement_
[i
]
449 def mutable_pathelement(self
, i
):
450 return self
.pathelement_
[i
]
452 def add_pathelement(self
):
453 x
= PropertyValue_ReferenceValuePathElement()
454 self
.pathelement_
.append(x
)
457 def clear_pathelement(self
):
458 self
.pathelement_
= []
460 def MergeFrom(self
, x
):
462 if (x
.has_app()): self
.set_app(x
.app())
463 for i
in xrange(x
.pathelement_size()): self
.add_pathelement().CopyFrom(x
.pathelement(i
))
466 if x
is self
: return 1
467 if self
.has_app_
!= x
.has_app_
: return 0
468 if self
.has_app_
and self
.app_
!= x
.app_
: return 0
469 if len(self
.pathelement_
) != len(x
.pathelement_
): return 0
470 for e1
, e2
in zip(self
.pathelement_
, x
.pathelement_
):
471 if e1
!= e2
: return 0
474 def IsInitialized(self
, debug_strs
=None):
476 if (not self
.has_app_
):
478 if debug_strs
is not None:
479 debug_strs
.append('Required field: app not set.')
480 for p
in self
.pathelement_
:
481 if not p
.IsInitialized(debug_strs
): initialized
=0
486 n
+= self
.lengthString(len(self
.app_
))
487 n
+= 2 * len(self
.pathelement_
)
488 for i
in xrange(len(self
.pathelement_
)): n
+= self
.pathelement_
[i
].ByteSize()
493 self
.clear_pathelement()
495 def OutputUnchecked(self
, out
):
497 out
.putPrefixedString(self
.app_
)
498 for i
in xrange(len(self
.pathelement_
)):
500 self
.pathelement_
[i
].OutputUnchecked(out
)
503 def TryMerge(self
, d
):
508 self
.set_app(d
.getPrefixedString())
511 self
.add_pathelement().TryMerge(d
)
513 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
517 def __str__(self
, prefix
="", printElemNumber
=0):
519 if self
.has_app_
: res
+=prefix
+("app: %s\n" % self
.DebugFormatString(self
.app_
))
521 for e
in self
.pathelement_
:
523 if printElemNumber
: elm
="(%d)" % cnt
524 res
+=prefix
+("PathElement%s {\n" % elm
)
525 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
530 class PropertyValue(ProtocolBuffer
.ProtocolMessage
):
533 has_booleanvalue_
= 0
543 has_referencevalue_
= 0
544 referencevalue_
= None
546 def __init__(self
, contents
=None):
547 self
.lazy_init_lock_
= thread
.allocate_lock()
548 if contents
is not None: self
.MergeFromString(contents
)
550 def int64value(self
): return self
.int64value_
552 def set_int64value(self
, x
):
553 self
.has_int64value_
= 1
556 def clear_int64value(self
):
557 if self
.has_int64value_
:
558 self
.has_int64value_
= 0
561 def has_int64value(self
): return self
.has_int64value_
563 def booleanvalue(self
): return self
.booleanvalue_
565 def set_booleanvalue(self
, x
):
566 self
.has_booleanvalue_
= 1
567 self
.booleanvalue_
= x
569 def clear_booleanvalue(self
):
570 if self
.has_booleanvalue_
:
571 self
.has_booleanvalue_
= 0
572 self
.booleanvalue_
= 0
574 def has_booleanvalue(self
): return self
.has_booleanvalue_
576 def stringvalue(self
): return self
.stringvalue_
578 def set_stringvalue(self
, x
):
579 self
.has_stringvalue_
= 1
580 self
.stringvalue_
= x
582 def clear_stringvalue(self
):
583 if self
.has_stringvalue_
:
584 self
.has_stringvalue_
= 0
585 self
.stringvalue_
= ""
587 def has_stringvalue(self
): return self
.has_stringvalue_
589 def doublevalue(self
): return self
.doublevalue_
591 def set_doublevalue(self
, x
):
592 self
.has_doublevalue_
= 1
593 self
.doublevalue_
= x
595 def clear_doublevalue(self
):
596 if self
.has_doublevalue_
:
597 self
.has_doublevalue_
= 0
598 self
.doublevalue_
= 0.0
600 def has_doublevalue(self
): return self
.has_doublevalue_
602 def pointvalue(self
):
603 if self
.pointvalue_
is None:
604 self
.lazy_init_lock_
.acquire()
606 if self
.pointvalue_
is None: self
.pointvalue_
= PropertyValue_PointValue()
608 self
.lazy_init_lock_
.release()
609 return self
.pointvalue_
611 def mutable_pointvalue(self
): self
.has_pointvalue_
= 1; return self
.pointvalue()
613 def clear_pointvalue(self
):
614 if self
.has_pointvalue_
:
615 self
.has_pointvalue_
= 0;
616 if self
.pointvalue_
is not None: self
.pointvalue_
.Clear()
618 def has_pointvalue(self
): return self
.has_pointvalue_
621 if self
.uservalue_
is None:
622 self
.lazy_init_lock_
.acquire()
624 if self
.uservalue_
is None: self
.uservalue_
= PropertyValue_UserValue()
626 self
.lazy_init_lock_
.release()
627 return self
.uservalue_
629 def mutable_uservalue(self
): self
.has_uservalue_
= 1; return self
.uservalue()
631 def clear_uservalue(self
):
632 if self
.has_uservalue_
:
633 self
.has_uservalue_
= 0;
634 if self
.uservalue_
is not None: self
.uservalue_
.Clear()
636 def has_uservalue(self
): return self
.has_uservalue_
638 def referencevalue(self
):
639 if self
.referencevalue_
is None:
640 self
.lazy_init_lock_
.acquire()
642 if self
.referencevalue_
is None: self
.referencevalue_
= PropertyValue_ReferenceValue()
644 self
.lazy_init_lock_
.release()
645 return self
.referencevalue_
647 def mutable_referencevalue(self
): self
.has_referencevalue_
= 1; return self
.referencevalue()
649 def clear_referencevalue(self
):
650 if self
.has_referencevalue_
:
651 self
.has_referencevalue_
= 0;
652 if self
.referencevalue_
is not None: self
.referencevalue_
.Clear()
654 def has_referencevalue(self
): return self
.has_referencevalue_
657 def MergeFrom(self
, x
):
659 if (x
.has_int64value()): self
.set_int64value(x
.int64value())
660 if (x
.has_booleanvalue()): self
.set_booleanvalue(x
.booleanvalue())
661 if (x
.has_stringvalue()): self
.set_stringvalue(x
.stringvalue())
662 if (x
.has_doublevalue()): self
.set_doublevalue(x
.doublevalue())
663 if (x
.has_pointvalue()): self
.mutable_pointvalue().MergeFrom(x
.pointvalue())
664 if (x
.has_uservalue()): self
.mutable_uservalue().MergeFrom(x
.uservalue())
665 if (x
.has_referencevalue()): self
.mutable_referencevalue().MergeFrom(x
.referencevalue())
668 if x
is self
: return 1
669 if self
.has_int64value_
!= x
.has_int64value_
: return 0
670 if self
.has_int64value_
and self
.int64value_
!= x
.int64value_
: return 0
671 if self
.has_booleanvalue_
!= x
.has_booleanvalue_
: return 0
672 if self
.has_booleanvalue_
and self
.booleanvalue_
!= x
.booleanvalue_
: return 0
673 if self
.has_stringvalue_
!= x
.has_stringvalue_
: return 0
674 if self
.has_stringvalue_
and self
.stringvalue_
!= x
.stringvalue_
: return 0
675 if self
.has_doublevalue_
!= x
.has_doublevalue_
: return 0
676 if self
.has_doublevalue_
and self
.doublevalue_
!= x
.doublevalue_
: return 0
677 if self
.has_pointvalue_
!= x
.has_pointvalue_
: return 0
678 if self
.has_pointvalue_
and self
.pointvalue_
!= x
.pointvalue_
: return 0
679 if self
.has_uservalue_
!= x
.has_uservalue_
: return 0
680 if self
.has_uservalue_
and self
.uservalue_
!= x
.uservalue_
: return 0
681 if self
.has_referencevalue_
!= x
.has_referencevalue_
: return 0
682 if self
.has_referencevalue_
and self
.referencevalue_
!= x
.referencevalue_
: return 0
685 def IsInitialized(self
, debug_strs
=None):
687 if (self
.has_pointvalue_
and not self
.pointvalue_
.IsInitialized(debug_strs
)): initialized
= 0
688 if (self
.has_uservalue_
and not self
.uservalue_
.IsInitialized(debug_strs
)): initialized
= 0
689 if (self
.has_referencevalue_
and not self
.referencevalue_
.IsInitialized(debug_strs
)): initialized
= 0
694 if (self
.has_int64value_
): n
+= 1 + self
.lengthVarInt64(self
.int64value_
)
695 if (self
.has_booleanvalue_
): n
+= 2
696 if (self
.has_stringvalue_
): n
+= 1 + self
.lengthString(len(self
.stringvalue_
))
697 if (self
.has_doublevalue_
): n
+= 9
698 if (self
.has_pointvalue_
): n
+= 2 + self
.pointvalue_
.ByteSize()
699 if (self
.has_uservalue_
): n
+= 2 + self
.uservalue_
.ByteSize()
700 if (self
.has_referencevalue_
): n
+= 2 + self
.referencevalue_
.ByteSize()
704 self
.clear_int64value()
705 self
.clear_booleanvalue()
706 self
.clear_stringvalue()
707 self
.clear_doublevalue()
708 self
.clear_pointvalue()
709 self
.clear_uservalue()
710 self
.clear_referencevalue()
712 def OutputUnchecked(self
, out
):
713 if (self
.has_int64value_
):
715 out
.putVarInt64(self
.int64value_
)
716 if (self
.has_booleanvalue_
):
718 out
.putBoolean(self
.booleanvalue_
)
719 if (self
.has_stringvalue_
):
721 out
.putPrefixedString(self
.stringvalue_
)
722 if (self
.has_doublevalue_
):
724 out
.putDouble(self
.doublevalue_
)
725 if (self
.has_pointvalue_
):
727 self
.pointvalue_
.OutputUnchecked(out
)
729 if (self
.has_uservalue_
):
731 self
.uservalue_
.OutputUnchecked(out
)
733 if (self
.has_referencevalue_
):
735 self
.referencevalue_
.OutputUnchecked(out
)
738 def TryMerge(self
, d
):
742 self
.set_int64value(d
.getVarInt64())
745 self
.set_booleanvalue(d
.getBoolean())
748 self
.set_stringvalue(d
.getPrefixedString())
751 self
.set_doublevalue(d
.getDouble())
754 self
.mutable_pointvalue().TryMerge(d
)
757 self
.mutable_uservalue().TryMerge(d
)
760 self
.mutable_referencevalue().TryMerge(d
)
762 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
766 def __str__(self
, prefix
="", printElemNumber
=0):
768 if self
.has_int64value_
: res
+=prefix
+("int64Value: %s\n" % self
.DebugFormatInt64(self
.int64value_
))
769 if self
.has_booleanvalue_
: res
+=prefix
+("booleanValue: %s\n" % self
.DebugFormatBool(self
.booleanvalue_
))
770 if self
.has_stringvalue_
: res
+=prefix
+("stringValue: %s\n" % self
.DebugFormatString(self
.stringvalue_
))
771 if self
.has_doublevalue_
: res
+=prefix
+("doubleValue: %s\n" % self
.DebugFormat(self
.doublevalue_
))
772 if self
.has_pointvalue_
:
773 res
+=prefix
+"PointValue {\n"
774 res
+=self
.pointvalue_
.__str
__(prefix
+ " ", printElemNumber
)
776 if self
.has_uservalue_
:
777 res
+=prefix
+"UserValue {\n"
778 res
+=self
.uservalue_
.__str
__(prefix
+ " ", printElemNumber
)
780 if self
.has_referencevalue_
:
781 res
+=prefix
+"ReferenceValue {\n"
782 res
+=self
.referencevalue_
.__str
__(prefix
+ " ", printElemNumber
)
795 kUserValueauth_domain
= 10
796 kUserValuenickname
= 11
797 kUserValuegaiaid
= 18
798 kUserValueobfuscated_gaiaid
= 19
799 kReferenceValueGroup
= 12
800 kReferenceValueapp
= 13
801 kReferenceValuePathElementGroup
= 14
802 kReferenceValuePathElementtype
= 15
803 kReferenceValuePathElementid
= 16
804 kReferenceValuePathElementname
= 17
830 ProtocolBuffer
.Encoder
.NUMERIC
,
831 ProtocolBuffer
.Encoder
.NUMERIC
,
833 ProtocolBuffer
.Encoder
.NUMERIC
,
835 ProtocolBuffer
.Encoder
.STRING
,
837 ProtocolBuffer
.Encoder
.DOUBLE
,
839 ProtocolBuffer
.Encoder
.STARTGROUP
,
841 ProtocolBuffer
.Encoder
.DOUBLE
,
843 ProtocolBuffer
.Encoder
.DOUBLE
,
845 ProtocolBuffer
.Encoder
.STARTGROUP
,
847 ProtocolBuffer
.Encoder
.STRING
,
849 ProtocolBuffer
.Encoder
.STRING
,
851 ProtocolBuffer
.Encoder
.STRING
,
853 ProtocolBuffer
.Encoder
.STARTGROUP
,
855 ProtocolBuffer
.Encoder
.STRING
,
857 ProtocolBuffer
.Encoder
.STARTGROUP
,
859 ProtocolBuffer
.Encoder
.STRING
,
861 ProtocolBuffer
.Encoder
.NUMERIC
,
863 ProtocolBuffer
.Encoder
.STRING
,
865 ProtocolBuffer
.Encoder
.NUMERIC
,
867 ProtocolBuffer
.Encoder
.STRING
,
872 _STYLE_CONTENT_TYPE
= """"""
873 class Property(ProtocolBuffer
.ProtocolMessage
):
889 GD_POSTALADDRESS
= 12
906 11: "GD_PHONENUMBER",
907 12: "GD_POSTALADDRESS",
911 def Meaning_Name(cls
, x
): return cls
._Meaning
_NAMES
.get(x
, "")
912 Meaning_Name
= classmethod(Meaning_Name
)
924 def __init__(self
, contents
=None):
925 self
.value_
= PropertyValue()
926 if contents
is not None: self
.MergeFromString(contents
)
928 def meaning(self
): return self
.meaning_
930 def set_meaning(self
, x
):
931 self
.has_meaning_
= 1
934 def clear_meaning(self
):
935 if self
.has_meaning_
:
936 self
.has_meaning_
= 0
939 def has_meaning(self
): return self
.has_meaning_
941 def meaning_uri(self
): return self
.meaning_uri_
943 def set_meaning_uri(self
, x
):
944 self
.has_meaning_uri_
= 1
945 self
.meaning_uri_
= x
947 def clear_meaning_uri(self
):
948 if self
.has_meaning_uri_
:
949 self
.has_meaning_uri_
= 0
950 self
.meaning_uri_
= ""
952 def has_meaning_uri(self
): return self
.has_meaning_uri_
954 def name(self
): return self
.name_
956 def set_name(self
, x
):
960 def clear_name(self
):
965 def has_name(self
): return self
.has_name_
967 def value(self
): return self
.value_
969 def mutable_value(self
): self
.has_value_
= 1; return self
.value_
971 def clear_value(self
):self
.has_value_
= 0; self
.value_
.Clear()
973 def has_value(self
): return self
.has_value_
975 def multiple(self
): return self
.multiple_
977 def set_multiple(self
, x
):
978 self
.has_multiple_
= 1
981 def clear_multiple(self
):
982 if self
.has_multiple_
:
983 self
.has_multiple_
= 0
986 def has_multiple(self
): return self
.has_multiple_
989 def MergeFrom(self
, x
):
991 if (x
.has_meaning()): self
.set_meaning(x
.meaning())
992 if (x
.has_meaning_uri()): self
.set_meaning_uri(x
.meaning_uri())
993 if (x
.has_name()): self
.set_name(x
.name())
994 if (x
.has_value()): self
.mutable_value().MergeFrom(x
.value())
995 if (x
.has_multiple()): self
.set_multiple(x
.multiple())
998 if x
is self
: return 1
999 if self
.has_meaning_
!= x
.has_meaning_
: return 0
1000 if self
.has_meaning_
and self
.meaning_
!= x
.meaning_
: return 0
1001 if self
.has_meaning_uri_
!= x
.has_meaning_uri_
: return 0
1002 if self
.has_meaning_uri_
and self
.meaning_uri_
!= x
.meaning_uri_
: return 0
1003 if self
.has_name_
!= x
.has_name_
: return 0
1004 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
1005 if self
.has_value_
!= x
.has_value_
: return 0
1006 if self
.has_value_
and self
.value_
!= x
.value_
: return 0
1007 if self
.has_multiple_
!= x
.has_multiple_
: return 0
1008 if self
.has_multiple_
and self
.multiple_
!= x
.multiple_
: return 0
1011 def IsInitialized(self
, debug_strs
=None):
1013 if (not self
.has_name_
):
1015 if debug_strs
is not None:
1016 debug_strs
.append('Required field: name not set.')
1017 if (not self
.has_value_
):
1019 if debug_strs
is not None:
1020 debug_strs
.append('Required field: value not set.')
1021 elif not self
.value_
.IsInitialized(debug_strs
): initialized
= 0
1022 if (not self
.has_multiple_
):
1024 if debug_strs
is not None:
1025 debug_strs
.append('Required field: multiple not set.')
1030 if (self
.has_meaning_
): n
+= 1 + self
.lengthVarInt64(self
.meaning_
)
1031 if (self
.has_meaning_uri_
): n
+= 1 + self
.lengthString(len(self
.meaning_uri_
))
1032 n
+= self
.lengthString(len(self
.name_
))
1033 n
+= self
.lengthString(self
.value_
.ByteSize())
1037 self
.clear_meaning()
1038 self
.clear_meaning_uri()
1041 self
.clear_multiple()
1043 def OutputUnchecked(self
, out
):
1044 if (self
.has_meaning_
):
1046 out
.putVarInt32(self
.meaning_
)
1047 if (self
.has_meaning_uri_
):
1049 out
.putPrefixedString(self
.meaning_uri_
)
1051 out
.putPrefixedString(self
.name_
)
1053 out
.putBoolean(self
.multiple_
)
1055 out
.putVarInt32(self
.value_
.ByteSize())
1056 self
.value_
.OutputUnchecked(out
)
1058 def TryMerge(self
, d
):
1059 while d
.avail() > 0:
1060 tt
= d
.getVarInt32()
1062 self
.set_meaning(d
.getVarInt32())
1065 self
.set_meaning_uri(d
.getPrefixedString())
1068 self
.set_name(d
.getPrefixedString())
1071 self
.set_multiple(d
.getBoolean())
1074 length
= d
.getVarInt32()
1075 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1077 self
.mutable_value().TryMerge(tmp
)
1079 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1083 def __str__(self
, prefix
="", printElemNumber
=0):
1085 if self
.has_meaning_
: res
+=prefix
+("meaning: %s\n" % self
.DebugFormatInt32(self
.meaning_
))
1086 if self
.has_meaning_uri_
: res
+=prefix
+("meaning_uri: %s\n" % self
.DebugFormatString(self
.meaning_uri_
))
1087 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
1089 res
+=prefix
+"value <\n"
1090 res
+=self
.value_
.__str
__(prefix
+ " ", printElemNumber
)
1092 if self
.has_multiple_
: res
+=prefix
+("multiple: %s\n" % self
.DebugFormatBool(self
.multiple_
))
1111 ProtocolBuffer
.Encoder
.NUMERIC
,
1112 ProtocolBuffer
.Encoder
.NUMERIC
,
1114 ProtocolBuffer
.Encoder
.STRING
,
1116 ProtocolBuffer
.Encoder
.STRING
,
1118 ProtocolBuffer
.Encoder
.NUMERIC
,
1120 ProtocolBuffer
.Encoder
.STRING
,
1125 _STYLE_CONTENT_TYPE
= """"""
1126 class Path_Element(ProtocolBuffer
.ProtocolMessage
):
1134 def __init__(self
, contents
=None):
1135 if contents
is not None: self
.MergeFromString(contents
)
1137 def type(self
): return self
.type_
1139 def set_type(self
, x
):
1143 def clear_type(self
):
1148 def has_type(self
): return self
.has_type_
1150 def id(self
): return self
.id_
1152 def set_id(self
, x
):
1161 def has_id(self
): return self
.has_id_
1163 def name(self
): return self
.name_
1165 def set_name(self
, x
):
1169 def clear_name(self
):
1174 def has_name(self
): return self
.has_name_
1177 def MergeFrom(self
, x
):
1178 assert x
is not self
1179 if (x
.has_type()): self
.set_type(x
.type())
1180 if (x
.has_id()): self
.set_id(x
.id())
1181 if (x
.has_name()): self
.set_name(x
.name())
1183 def Equals(self
, x
):
1184 if x
is self
: return 1
1185 if self
.has_type_
!= x
.has_type_
: return 0
1186 if self
.has_type_
and self
.type_
!= x
.type_
: return 0
1187 if self
.has_id_
!= x
.has_id_
: return 0
1188 if self
.has_id_
and self
.id_
!= x
.id_
: return 0
1189 if self
.has_name_
!= x
.has_name_
: return 0
1190 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
1193 def IsInitialized(self
, debug_strs
=None):
1195 if (not self
.has_type_
):
1197 if debug_strs
is not None:
1198 debug_strs
.append('Required field: type not set.')
1203 n
+= self
.lengthString(len(self
.type_
))
1204 if (self
.has_id_
): n
+= 1 + self
.lengthVarInt64(self
.id_
)
1205 if (self
.has_name_
): n
+= 1 + self
.lengthString(len(self
.name_
))
1213 def OutputUnchecked(self
, out
):
1215 out
.putPrefixedString(self
.type_
)
1218 out
.putVarInt64(self
.id_
)
1219 if (self
.has_name_
):
1221 out
.putPrefixedString(self
.name_
)
1223 def TryMerge(self
, d
):
1225 tt
= d
.getVarInt32()
1228 self
.set_type(d
.getPrefixedString())
1231 self
.set_id(d
.getVarInt64())
1234 self
.set_name(d
.getPrefixedString())
1236 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1240 def __str__(self
, prefix
="", printElemNumber
=0):
1242 if self
.has_type_
: res
+=prefix
+("type: %s\n" % self
.DebugFormatString(self
.type_
))
1243 if self
.has_id_
: res
+=prefix
+("id: %s\n" % self
.DebugFormatInt64(self
.id_
))
1244 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
1247 class Path(ProtocolBuffer
.ProtocolMessage
):
1249 def __init__(self
, contents
=None):
1251 if contents
is not None: self
.MergeFromString(contents
)
1253 def element_size(self
): return len(self
.element_
)
1254 def element_list(self
): return self
.element_
1256 def element(self
, i
):
1257 return self
.element_
[i
]
1259 def mutable_element(self
, i
):
1260 return self
.element_
[i
]
1262 def add_element(self
):
1264 self
.element_
.append(x
)
1267 def clear_element(self
):
1270 def MergeFrom(self
, x
):
1271 assert x
is not self
1272 for i
in xrange(x
.element_size()): self
.add_element().CopyFrom(x
.element(i
))
1274 def Equals(self
, x
):
1275 if x
is self
: return 1
1276 if len(self
.element_
) != len(x
.element_
): return 0
1277 for e1
, e2
in zip(self
.element_
, x
.element_
):
1278 if e1
!= e2
: return 0
1281 def IsInitialized(self
, debug_strs
=None):
1283 for p
in self
.element_
:
1284 if not p
.IsInitialized(debug_strs
): initialized
=0
1289 n
+= 2 * len(self
.element_
)
1290 for i
in xrange(len(self
.element_
)): n
+= self
.element_
[i
].ByteSize()
1294 self
.clear_element()
1296 def OutputUnchecked(self
, out
):
1297 for i
in xrange(len(self
.element_
)):
1299 self
.element_
[i
].OutputUnchecked(out
)
1302 def TryMerge(self
, d
):
1303 while d
.avail() > 0:
1304 tt
= d
.getVarInt32()
1306 self
.add_element().TryMerge(d
)
1308 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1312 def __str__(self
, prefix
="", printElemNumber
=0):
1315 for e
in self
.element_
:
1317 if printElemNumber
: elm
="(%d)" % cnt
1318 res
+=prefix
+("Element%s {\n" % elm
)
1319 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
1338 ProtocolBuffer
.Encoder
.NUMERIC
,
1339 ProtocolBuffer
.Encoder
.STARTGROUP
,
1341 ProtocolBuffer
.Encoder
.STRING
,
1343 ProtocolBuffer
.Encoder
.NUMERIC
,
1345 ProtocolBuffer
.Encoder
.STRING
,
1350 _STYLE_CONTENT_TYPE
= """"""
1351 class Reference(ProtocolBuffer
.ProtocolMessage
):
1356 def __init__(self
, contents
=None):
1358 if contents
is not None: self
.MergeFromString(contents
)
1360 def app(self
): return self
.app_
1362 def set_app(self
, x
):
1366 def clear_app(self
):
1371 def has_app(self
): return self
.has_app_
1373 def path(self
): return self
.path_
1375 def mutable_path(self
): self
.has_path_
= 1; return self
.path_
1377 def clear_path(self
):self
.has_path_
= 0; self
.path_
.Clear()
1379 def has_path(self
): return self
.has_path_
1382 def MergeFrom(self
, x
):
1383 assert x
is not self
1384 if (x
.has_app()): self
.set_app(x
.app())
1385 if (x
.has_path()): self
.mutable_path().MergeFrom(x
.path())
1387 def Equals(self
, x
):
1388 if x
is self
: return 1
1389 if self
.has_app_
!= x
.has_app_
: return 0
1390 if self
.has_app_
and self
.app_
!= x
.app_
: return 0
1391 if self
.has_path_
!= x
.has_path_
: return 0
1392 if self
.has_path_
and self
.path_
!= x
.path_
: return 0
1395 def IsInitialized(self
, debug_strs
=None):
1397 if (not self
.has_app_
):
1399 if debug_strs
is not None:
1400 debug_strs
.append('Required field: app not set.')
1401 if (not self
.has_path_
):
1403 if debug_strs
is not None:
1404 debug_strs
.append('Required field: path not set.')
1405 elif not self
.path_
.IsInitialized(debug_strs
): initialized
= 0
1410 n
+= self
.lengthString(len(self
.app_
))
1411 n
+= self
.lengthString(self
.path_
.ByteSize())
1418 def OutputUnchecked(self
, out
):
1419 out
.putVarInt32(106)
1420 out
.putPrefixedString(self
.app_
)
1421 out
.putVarInt32(114)
1422 out
.putVarInt32(self
.path_
.ByteSize())
1423 self
.path_
.OutputUnchecked(out
)
1425 def TryMerge(self
, d
):
1426 while d
.avail() > 0:
1427 tt
= d
.getVarInt32()
1429 self
.set_app(d
.getPrefixedString())
1432 length
= d
.getVarInt32()
1433 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1435 self
.mutable_path().TryMerge(tmp
)
1437 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1441 def __str__(self
, prefix
="", printElemNumber
=0):
1443 if self
.has_app_
: res
+=prefix
+("app: %s\n" % self
.DebugFormatString(self
.app_
))
1445 res
+=prefix
+"path <\n"
1446 res
+=self
.path_
.__str
__(prefix
+ " ", printElemNumber
)
1472 ProtocolBuffer
.Encoder
.NUMERIC
,
1473 ProtocolBuffer
.Encoder
.MAX_TYPE
,
1475 ProtocolBuffer
.Encoder
.MAX_TYPE
,
1477 ProtocolBuffer
.Encoder
.MAX_TYPE
,
1479 ProtocolBuffer
.Encoder
.MAX_TYPE
,
1481 ProtocolBuffer
.Encoder
.MAX_TYPE
,
1483 ProtocolBuffer
.Encoder
.MAX_TYPE
,
1485 ProtocolBuffer
.Encoder
.MAX_TYPE
,
1487 ProtocolBuffer
.Encoder
.MAX_TYPE
,
1489 ProtocolBuffer
.Encoder
.MAX_TYPE
,
1491 ProtocolBuffer
.Encoder
.MAX_TYPE
,
1493 ProtocolBuffer
.Encoder
.MAX_TYPE
,
1495 ProtocolBuffer
.Encoder
.MAX_TYPE
,
1497 ProtocolBuffer
.Encoder
.STRING
,
1499 ProtocolBuffer
.Encoder
.STRING
,
1504 _STYLE_CONTENT_TYPE
= """"""
1505 class User(ProtocolBuffer
.ProtocolMessage
):
1508 has_auth_domain_
= 0
1514 has_obfuscated_gaiaid_
= 0
1515 obfuscated_gaiaid_
= ""
1517 def __init__(self
, contents
=None):
1518 if contents
is not None: self
.MergeFromString(contents
)
1520 def email(self
): return self
.email_
1522 def set_email(self
, x
):
1526 def clear_email(self
):
1531 def has_email(self
): return self
.has_email_
1533 def auth_domain(self
): return self
.auth_domain_
1535 def set_auth_domain(self
, x
):
1536 self
.has_auth_domain_
= 1
1537 self
.auth_domain_
= x
1539 def clear_auth_domain(self
):
1540 if self
.has_auth_domain_
:
1541 self
.has_auth_domain_
= 0
1542 self
.auth_domain_
= ""
1544 def has_auth_domain(self
): return self
.has_auth_domain_
1546 def nickname(self
): return self
.nickname_
1548 def set_nickname(self
, x
):
1549 self
.has_nickname_
= 1
1552 def clear_nickname(self
):
1553 if self
.has_nickname_
:
1554 self
.has_nickname_
= 0
1557 def has_nickname(self
): return self
.has_nickname_
1559 def gaiaid(self
): return self
.gaiaid_
1561 def set_gaiaid(self
, x
):
1562 self
.has_gaiaid_
= 1
1565 def clear_gaiaid(self
):
1566 if self
.has_gaiaid_
:
1567 self
.has_gaiaid_
= 0
1570 def has_gaiaid(self
): return self
.has_gaiaid_
1572 def obfuscated_gaiaid(self
): return self
.obfuscated_gaiaid_
1574 def set_obfuscated_gaiaid(self
, x
):
1575 self
.has_obfuscated_gaiaid_
= 1
1576 self
.obfuscated_gaiaid_
= x
1578 def clear_obfuscated_gaiaid(self
):
1579 if self
.has_obfuscated_gaiaid_
:
1580 self
.has_obfuscated_gaiaid_
= 0
1581 self
.obfuscated_gaiaid_
= ""
1583 def has_obfuscated_gaiaid(self
): return self
.has_obfuscated_gaiaid_
1586 def MergeFrom(self
, x
):
1587 assert x
is not self
1588 if (x
.has_email()): self
.set_email(x
.email())
1589 if (x
.has_auth_domain()): self
.set_auth_domain(x
.auth_domain())
1590 if (x
.has_nickname()): self
.set_nickname(x
.nickname())
1591 if (x
.has_gaiaid()): self
.set_gaiaid(x
.gaiaid())
1592 if (x
.has_obfuscated_gaiaid()): self
.set_obfuscated_gaiaid(x
.obfuscated_gaiaid())
1594 def Equals(self
, x
):
1595 if x
is self
: return 1
1596 if self
.has_email_
!= x
.has_email_
: return 0
1597 if self
.has_email_
and self
.email_
!= x
.email_
: return 0
1598 if self
.has_auth_domain_
!= x
.has_auth_domain_
: return 0
1599 if self
.has_auth_domain_
and self
.auth_domain_
!= x
.auth_domain_
: return 0
1600 if self
.has_nickname_
!= x
.has_nickname_
: return 0
1601 if self
.has_nickname_
and self
.nickname_
!= x
.nickname_
: return 0
1602 if self
.has_gaiaid_
!= x
.has_gaiaid_
: return 0
1603 if self
.has_gaiaid_
and self
.gaiaid_
!= x
.gaiaid_
: return 0
1604 if self
.has_obfuscated_gaiaid_
!= x
.has_obfuscated_gaiaid_
: return 0
1605 if self
.has_obfuscated_gaiaid_
and self
.obfuscated_gaiaid_
!= x
.obfuscated_gaiaid_
: return 0
1608 def IsInitialized(self
, debug_strs
=None):
1610 if (not self
.has_email_
):
1612 if debug_strs
is not None:
1613 debug_strs
.append('Required field: email not set.')
1614 if (not self
.has_auth_domain_
):
1616 if debug_strs
is not None:
1617 debug_strs
.append('Required field: auth_domain not set.')
1618 if (not self
.has_gaiaid_
):
1620 if debug_strs
is not None:
1621 debug_strs
.append('Required field: gaiaid not set.')
1626 n
+= self
.lengthString(len(self
.email_
))
1627 n
+= self
.lengthString(len(self
.auth_domain_
))
1628 if (self
.has_nickname_
): n
+= 1 + self
.lengthString(len(self
.nickname_
))
1629 n
+= self
.lengthVarInt64(self
.gaiaid_
)
1630 if (self
.has_obfuscated_gaiaid_
): n
+= 1 + self
.lengthString(len(self
.obfuscated_gaiaid_
))
1635 self
.clear_auth_domain()
1636 self
.clear_nickname()
1638 self
.clear_obfuscated_gaiaid()
1640 def OutputUnchecked(self
, out
):
1642 out
.putPrefixedString(self
.email_
)
1644 out
.putPrefixedString(self
.auth_domain_
)
1645 if (self
.has_nickname_
):
1647 out
.putPrefixedString(self
.nickname_
)
1649 out
.putVarInt64(self
.gaiaid_
)
1650 if (self
.has_obfuscated_gaiaid_
):
1652 out
.putPrefixedString(self
.obfuscated_gaiaid_
)
1654 def TryMerge(self
, d
):
1655 while d
.avail() > 0:
1656 tt
= d
.getVarInt32()
1658 self
.set_email(d
.getPrefixedString())
1661 self
.set_auth_domain(d
.getPrefixedString())
1664 self
.set_nickname(d
.getPrefixedString())
1667 self
.set_gaiaid(d
.getVarInt64())
1670 self
.set_obfuscated_gaiaid(d
.getPrefixedString())
1672 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1676 def __str__(self
, prefix
="", printElemNumber
=0):
1678 if self
.has_email_
: res
+=prefix
+("email: %s\n" % self
.DebugFormatString(self
.email_
))
1679 if self
.has_auth_domain_
: res
+=prefix
+("auth_domain: %s\n" % self
.DebugFormatString(self
.auth_domain_
))
1680 if self
.has_nickname_
: res
+=prefix
+("nickname: %s\n" % self
.DebugFormatString(self
.nickname_
))
1681 if self
.has_gaiaid_
: res
+=prefix
+("gaiaid: %s\n" % self
.DebugFormatInt64(self
.gaiaid_
))
1682 if self
.has_obfuscated_gaiaid_
: res
+=prefix
+("obfuscated_gaiaid: %s\n" % self
.DebugFormatString(self
.obfuscated_gaiaid_
))
1689 kobfuscated_gaiaid
= 5
1697 "obfuscated_gaiaid",
1701 ProtocolBuffer
.Encoder
.NUMERIC
,
1702 ProtocolBuffer
.Encoder
.STRING
,
1704 ProtocolBuffer
.Encoder
.STRING
,
1706 ProtocolBuffer
.Encoder
.STRING
,
1708 ProtocolBuffer
.Encoder
.NUMERIC
,
1710 ProtocolBuffer
.Encoder
.STRING
,
1715 _STYLE_CONTENT_TYPE
= """"""
1716 class EntityProto(ProtocolBuffer
.ProtocolMessage
):
1728 def Kind_Name(cls
, x
): return cls
._Kind
_NAMES
.get(x
, "")
1729 Kind_Name
= classmethod(Kind_Name
)
1732 has_entity_group_
= 0
1740 def __init__(self
, contents
=None):
1741 self
.key_
= Reference()
1742 self
.entity_group_
= Path()
1744 self
.raw_property_
= []
1745 self
.lazy_init_lock_
= thread
.allocate_lock()
1746 if contents
is not None: self
.MergeFromString(contents
)
1748 def key(self
): return self
.key_
1750 def mutable_key(self
): self
.has_key_
= 1; return self
.key_
1752 def clear_key(self
):self
.has_key_
= 0; self
.key_
.Clear()
1754 def has_key(self
): return self
.has_key_
1756 def entity_group(self
): return self
.entity_group_
1758 def mutable_entity_group(self
): self
.has_entity_group_
= 1; return self
.entity_group_
1760 def clear_entity_group(self
):self
.has_entity_group_
= 0; self
.entity_group_
.Clear()
1762 def has_entity_group(self
): return self
.has_entity_group_
1765 if self
.owner_
is None:
1766 self
.lazy_init_lock_
.acquire()
1768 if self
.owner_
is None: self
.owner_
= User()
1770 self
.lazy_init_lock_
.release()
1773 def mutable_owner(self
): self
.has_owner_
= 1; return self
.owner()
1775 def clear_owner(self
):
1777 self
.has_owner_
= 0;
1778 if self
.owner_
is not None: self
.owner_
.Clear()
1780 def has_owner(self
): return self
.has_owner_
1782 def kind(self
): return self
.kind_
1784 def set_kind(self
, x
):
1788 def clear_kind(self
):
1793 def has_kind(self
): return self
.has_kind_
1795 def kind_uri(self
): return self
.kind_uri_
1797 def set_kind_uri(self
, x
):
1798 self
.has_kind_uri_
= 1
1801 def clear_kind_uri(self
):
1802 if self
.has_kind_uri_
:
1803 self
.has_kind_uri_
= 0
1806 def has_kind_uri(self
): return self
.has_kind_uri_
1808 def property_size(self
): return len(self
.property_
)
1809 def property_list(self
): return self
.property_
1811 def property(self
, i
):
1812 return self
.property_
[i
]
1814 def mutable_property(self
, i
):
1815 return self
.property_
[i
]
1817 def add_property(self
):
1819 self
.property_
.append(x
)
1822 def clear_property(self
):
1824 def raw_property_size(self
): return len(self
.raw_property_
)
1825 def raw_property_list(self
): return self
.raw_property_
1827 def raw_property(self
, i
):
1828 return self
.raw_property_
[i
]
1830 def mutable_raw_property(self
, i
):
1831 return self
.raw_property_
[i
]
1833 def add_raw_property(self
):
1835 self
.raw_property_
.append(x
)
1838 def clear_raw_property(self
):
1839 self
.raw_property_
= []
1841 def MergeFrom(self
, x
):
1842 assert x
is not self
1843 if (x
.has_key()): self
.mutable_key().MergeFrom(x
.key())
1844 if (x
.has_entity_group()): self
.mutable_entity_group().MergeFrom(x
.entity_group())
1845 if (x
.has_owner()): self
.mutable_owner().MergeFrom(x
.owner())
1846 if (x
.has_kind()): self
.set_kind(x
.kind())
1847 if (x
.has_kind_uri()): self
.set_kind_uri(x
.kind_uri())
1848 for i
in xrange(x
.property_size()): self
.add_property().CopyFrom(x
.property(i
))
1849 for i
in xrange(x
.raw_property_size()): self
.add_raw_property().CopyFrom(x
.raw_property(i
))
1851 def Equals(self
, x
):
1852 if x
is self
: return 1
1853 if self
.has_key_
!= x
.has_key_
: return 0
1854 if self
.has_key_
and self
.key_
!= x
.key_
: return 0
1855 if self
.has_entity_group_
!= x
.has_entity_group_
: return 0
1856 if self
.has_entity_group_
and self
.entity_group_
!= x
.entity_group_
: return 0
1857 if self
.has_owner_
!= x
.has_owner_
: return 0
1858 if self
.has_owner_
and self
.owner_
!= x
.owner_
: return 0
1859 if self
.has_kind_
!= x
.has_kind_
: return 0
1860 if self
.has_kind_
and self
.kind_
!= x
.kind_
: return 0
1861 if self
.has_kind_uri_
!= x
.has_kind_uri_
: return 0
1862 if self
.has_kind_uri_
and self
.kind_uri_
!= x
.kind_uri_
: return 0
1863 if len(self
.property_
) != len(x
.property_
): return 0
1864 for e1
, e2
in zip(self
.property_
, x
.property_
):
1865 if e1
!= e2
: return 0
1866 if len(self
.raw_property_
) != len(x
.raw_property_
): return 0
1867 for e1
, e2
in zip(self
.raw_property_
, x
.raw_property_
):
1868 if e1
!= e2
: return 0
1871 def IsInitialized(self
, debug_strs
=None):
1873 if (not self
.has_key_
):
1875 if debug_strs
is not None:
1876 debug_strs
.append('Required field: key not set.')
1877 elif not self
.key_
.IsInitialized(debug_strs
): initialized
= 0
1878 if (not self
.has_entity_group_
):
1880 if debug_strs
is not None:
1881 debug_strs
.append('Required field: entity_group not set.')
1882 elif not self
.entity_group_
.IsInitialized(debug_strs
): initialized
= 0
1883 if (self
.has_owner_
and not self
.owner_
.IsInitialized(debug_strs
)): initialized
= 0
1884 for p
in self
.property_
:
1885 if not p
.IsInitialized(debug_strs
): initialized
=0
1886 for p
in self
.raw_property_
:
1887 if not p
.IsInitialized(debug_strs
): initialized
=0
1892 n
+= self
.lengthString(self
.key_
.ByteSize())
1893 n
+= self
.lengthString(self
.entity_group_
.ByteSize())
1894 if (self
.has_owner_
): n
+= 2 + self
.lengthString(self
.owner_
.ByteSize())
1895 if (self
.has_kind_
): n
+= 1 + self
.lengthVarInt64(self
.kind_
)
1896 if (self
.has_kind_uri_
): n
+= 1 + self
.lengthString(len(self
.kind_uri_
))
1897 n
+= 1 * len(self
.property_
)
1898 for i
in xrange(len(self
.property_
)): n
+= self
.lengthString(self
.property_
[i
].ByteSize())
1899 n
+= 1 * len(self
.raw_property_
)
1900 for i
in xrange(len(self
.raw_property_
)): n
+= self
.lengthString(self
.raw_property_
[i
].ByteSize())
1905 self
.clear_entity_group()
1908 self
.clear_kind_uri()
1909 self
.clear_property()
1910 self
.clear_raw_property()
1912 def OutputUnchecked(self
, out
):
1913 if (self
.has_kind_
):
1915 out
.putVarInt32(self
.kind_
)
1916 if (self
.has_kind_uri_
):
1918 out
.putPrefixedString(self
.kind_uri_
)
1919 out
.putVarInt32(106)
1920 out
.putVarInt32(self
.key_
.ByteSize())
1921 self
.key_
.OutputUnchecked(out
)
1922 for i
in xrange(len(self
.property_
)):
1923 out
.putVarInt32(114)
1924 out
.putVarInt32(self
.property_
[i
].ByteSize())
1925 self
.property_
[i
].OutputUnchecked(out
)
1926 for i
in xrange(len(self
.raw_property_
)):
1927 out
.putVarInt32(122)
1928 out
.putVarInt32(self
.raw_property_
[i
].ByteSize())
1929 self
.raw_property_
[i
].OutputUnchecked(out
)
1930 out
.putVarInt32(130)
1931 out
.putVarInt32(self
.entity_group_
.ByteSize())
1932 self
.entity_group_
.OutputUnchecked(out
)
1933 if (self
.has_owner_
):
1934 out
.putVarInt32(138)
1935 out
.putVarInt32(self
.owner_
.ByteSize())
1936 self
.owner_
.OutputUnchecked(out
)
1938 def TryMerge(self
, d
):
1939 while d
.avail() > 0:
1940 tt
= d
.getVarInt32()
1942 self
.set_kind(d
.getVarInt32())
1945 self
.set_kind_uri(d
.getPrefixedString())
1948 length
= d
.getVarInt32()
1949 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1951 self
.mutable_key().TryMerge(tmp
)
1954 length
= d
.getVarInt32()
1955 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1957 self
.add_property().TryMerge(tmp
)
1960 length
= d
.getVarInt32()
1961 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1963 self
.add_raw_property().TryMerge(tmp
)
1966 length
= d
.getVarInt32()
1967 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1969 self
.mutable_entity_group().TryMerge(tmp
)
1972 length
= d
.getVarInt32()
1973 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1975 self
.mutable_owner().TryMerge(tmp
)
1977 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1981 def __str__(self
, prefix
="", printElemNumber
=0):
1984 res
+=prefix
+"key <\n"
1985 res
+=self
.key_
.__str
__(prefix
+ " ", printElemNumber
)
1987 if self
.has_entity_group_
:
1988 res
+=prefix
+"entity_group <\n"
1989 res
+=self
.entity_group_
.__str
__(prefix
+ " ", printElemNumber
)
1992 res
+=prefix
+"owner <\n"
1993 res
+=self
.owner_
.__str
__(prefix
+ " ", printElemNumber
)
1995 if self
.has_kind_
: res
+=prefix
+("kind: %s\n" % self
.DebugFormatInt32(self
.kind_
))
1996 if self
.has_kind_uri_
: res
+=prefix
+("kind_uri: %s\n" % self
.DebugFormatString(self
.kind_uri_
))
1998 for e
in self
.property_
:
2000 if printElemNumber
: elm
="(%d)" % cnt
2001 res
+=prefix
+("property%s <\n" % elm
)
2002 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2006 for e
in self
.raw_property_
:
2008 if printElemNumber
: elm
="(%d)" % cnt
2009 res
+=prefix
+("raw_property%s <\n" % elm
)
2010 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2045 ProtocolBuffer
.Encoder
.NUMERIC
,
2046 ProtocolBuffer
.Encoder
.MAX_TYPE
,
2048 ProtocolBuffer
.Encoder
.MAX_TYPE
,
2050 ProtocolBuffer
.Encoder
.MAX_TYPE
,
2052 ProtocolBuffer
.Encoder
.NUMERIC
,
2054 ProtocolBuffer
.Encoder
.STRING
,
2056 ProtocolBuffer
.Encoder
.MAX_TYPE
,
2058 ProtocolBuffer
.Encoder
.MAX_TYPE
,
2060 ProtocolBuffer
.Encoder
.MAX_TYPE
,
2062 ProtocolBuffer
.Encoder
.MAX_TYPE
,
2064 ProtocolBuffer
.Encoder
.MAX_TYPE
,
2066 ProtocolBuffer
.Encoder
.MAX_TYPE
,
2068 ProtocolBuffer
.Encoder
.MAX_TYPE
,
2070 ProtocolBuffer
.Encoder
.STRING
,
2072 ProtocolBuffer
.Encoder
.STRING
,
2074 ProtocolBuffer
.Encoder
.STRING
,
2076 ProtocolBuffer
.Encoder
.STRING
,
2078 ProtocolBuffer
.Encoder
.STRING
,
2083 _STYLE_CONTENT_TYPE
= """"""
2084 class CompositeProperty(ProtocolBuffer
.ProtocolMessage
):
2088 def __init__(self
, contents
=None):
2090 if contents
is not None: self
.MergeFromString(contents
)
2092 def index_id(self
): return self
.index_id_
2094 def set_index_id(self
, x
):
2095 self
.has_index_id_
= 1
2098 def clear_index_id(self
):
2099 if self
.has_index_id_
:
2100 self
.has_index_id_
= 0
2103 def has_index_id(self
): return self
.has_index_id_
2105 def value_size(self
): return len(self
.value_
)
2106 def value_list(self
): return self
.value_
2109 return self
.value_
[i
]
2111 def set_value(self
, i
, x
):
2114 def add_value(self
, x
):
2115 self
.value_
.append(x
)
2117 def clear_value(self
):
2121 def MergeFrom(self
, x
):
2122 assert x
is not self
2123 if (x
.has_index_id()): self
.set_index_id(x
.index_id())
2124 for i
in xrange(x
.value_size()): self
.add_value(x
.value(i
))
2126 def Equals(self
, x
):
2127 if x
is self
: return 1
2128 if self
.has_index_id_
!= x
.has_index_id_
: return 0
2129 if self
.has_index_id_
and self
.index_id_
!= x
.index_id_
: return 0
2130 if len(self
.value_
) != len(x
.value_
): return 0
2131 for e1
, e2
in zip(self
.value_
, x
.value_
):
2132 if e1
!= e2
: return 0
2135 def IsInitialized(self
, debug_strs
=None):
2137 if (not self
.has_index_id_
):
2139 if debug_strs
is not None:
2140 debug_strs
.append('Required field: index_id not set.')
2145 n
+= self
.lengthVarInt64(self
.index_id_
)
2146 n
+= 1 * len(self
.value_
)
2147 for i
in xrange(len(self
.value_
)): n
+= self
.lengthString(len(self
.value_
[i
]))
2151 self
.clear_index_id()
2154 def OutputUnchecked(self
, out
):
2156 out
.putVarInt64(self
.index_id_
)
2157 for i
in xrange(len(self
.value_
)):
2159 out
.putPrefixedString(self
.value_
[i
])
2161 def TryMerge(self
, d
):
2162 while d
.avail() > 0:
2163 tt
= d
.getVarInt32()
2165 self
.set_index_id(d
.getVarInt64())
2168 self
.add_value(d
.getPrefixedString())
2170 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2174 def __str__(self
, prefix
="", printElemNumber
=0):
2176 if self
.has_index_id_
: res
+=prefix
+("index_id: %s\n" % self
.DebugFormatInt64(self
.index_id_
))
2178 for e
in self
.value_
:
2180 if printElemNumber
: elm
="(%d)" % cnt
2181 res
+=prefix
+("value%s: %s\n" % (elm
, self
.DebugFormatString(e
)))
2195 ProtocolBuffer
.Encoder
.NUMERIC
,
2196 ProtocolBuffer
.Encoder
.NUMERIC
,
2198 ProtocolBuffer
.Encoder
.STRING
,
2203 _STYLE_CONTENT_TYPE
= """"""
2204 class Index_Property(ProtocolBuffer
.ProtocolMessage
):
2209 _Direction_NAMES
= {
2214 def Direction_Name(cls
, x
): return cls
._Direction
_NAMES
.get(x
, "")
2215 Direction_Name
= classmethod(Direction_Name
)
2222 def __init__(self
, contents
=None):
2223 if contents
is not None: self
.MergeFromString(contents
)
2225 def name(self
): return self
.name_
2227 def set_name(self
, x
):
2231 def clear_name(self
):
2236 def has_name(self
): return self
.has_name_
2238 def direction(self
): return self
.direction_
2240 def set_direction(self
, x
):
2241 self
.has_direction_
= 1
2244 def clear_direction(self
):
2245 if self
.has_direction_
:
2246 self
.has_direction_
= 0
2249 def has_direction(self
): return self
.has_direction_
2252 def MergeFrom(self
, x
):
2253 assert x
is not self
2254 if (x
.has_name()): self
.set_name(x
.name())
2255 if (x
.has_direction()): self
.set_direction(x
.direction())
2257 def Equals(self
, x
):
2258 if x
is self
: return 1
2259 if self
.has_name_
!= x
.has_name_
: return 0
2260 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
2261 if self
.has_direction_
!= x
.has_direction_
: return 0
2262 if self
.has_direction_
and self
.direction_
!= x
.direction_
: return 0
2265 def IsInitialized(self
, debug_strs
=None):
2267 if (not self
.has_name_
):
2269 if debug_strs
is not None:
2270 debug_strs
.append('Required field: name not set.')
2275 n
+= self
.lengthString(len(self
.name_
))
2276 if (self
.has_direction_
): n
+= 1 + self
.lengthVarInt64(self
.direction_
)
2281 self
.clear_direction()
2283 def OutputUnchecked(self
, out
):
2285 out
.putPrefixedString(self
.name_
)
2286 if (self
.has_direction_
):
2288 out
.putVarInt32(self
.direction_
)
2290 def TryMerge(self
, d
):
2292 tt
= d
.getVarInt32()
2295 self
.set_name(d
.getPrefixedString())
2298 self
.set_direction(d
.getVarInt32())
2300 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2304 def __str__(self
, prefix
="", printElemNumber
=0):
2306 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
2307 if self
.has_direction_
: res
+=prefix
+("direction: %s\n" % self
.DebugFormatInt32(self
.direction_
))
2310 class Index(ProtocolBuffer
.ProtocolMessage
):
2311 has_entity_type_
= 0
2316 def __init__(self
, contents
=None):
2318 if contents
is not None: self
.MergeFromString(contents
)
2320 def entity_type(self
): return self
.entity_type_
2322 def set_entity_type(self
, x
):
2323 self
.has_entity_type_
= 1
2324 self
.entity_type_
= x
2326 def clear_entity_type(self
):
2327 if self
.has_entity_type_
:
2328 self
.has_entity_type_
= 0
2329 self
.entity_type_
= ""
2331 def has_entity_type(self
): return self
.has_entity_type_
2333 def ancestor(self
): return self
.ancestor_
2335 def set_ancestor(self
, x
):
2336 self
.has_ancestor_
= 1
2339 def clear_ancestor(self
):
2340 if self
.has_ancestor_
:
2341 self
.has_ancestor_
= 0
2344 def has_ancestor(self
): return self
.has_ancestor_
2346 def property_size(self
): return len(self
.property_
)
2347 def property_list(self
): return self
.property_
2349 def property(self
, i
):
2350 return self
.property_
[i
]
2352 def mutable_property(self
, i
):
2353 return self
.property_
[i
]
2355 def add_property(self
):
2356 x
= Index_Property()
2357 self
.property_
.append(x
)
2360 def clear_property(self
):
2363 def MergeFrom(self
, x
):
2364 assert x
is not self
2365 if (x
.has_entity_type()): self
.set_entity_type(x
.entity_type())
2366 if (x
.has_ancestor()): self
.set_ancestor(x
.ancestor())
2367 for i
in xrange(x
.property_size()): self
.add_property().CopyFrom(x
.property(i
))
2369 def Equals(self
, x
):
2370 if x
is self
: return 1
2371 if self
.has_entity_type_
!= x
.has_entity_type_
: return 0
2372 if self
.has_entity_type_
and self
.entity_type_
!= x
.entity_type_
: return 0
2373 if self
.has_ancestor_
!= x
.has_ancestor_
: return 0
2374 if self
.has_ancestor_
and self
.ancestor_
!= x
.ancestor_
: return 0
2375 if len(self
.property_
) != len(x
.property_
): return 0
2376 for e1
, e2
in zip(self
.property_
, x
.property_
):
2377 if e1
!= e2
: return 0
2380 def IsInitialized(self
, debug_strs
=None):
2382 if (not self
.has_entity_type_
):
2384 if debug_strs
is not None:
2385 debug_strs
.append('Required field: entity_type not set.')
2386 if (not self
.has_ancestor_
):
2388 if debug_strs
is not None:
2389 debug_strs
.append('Required field: ancestor not set.')
2390 for p
in self
.property_
:
2391 if not p
.IsInitialized(debug_strs
): initialized
=0
2396 n
+= self
.lengthString(len(self
.entity_type_
))
2397 n
+= 2 * len(self
.property_
)
2398 for i
in xrange(len(self
.property_
)): n
+= self
.property_
[i
].ByteSize()
2402 self
.clear_entity_type()
2403 self
.clear_ancestor()
2404 self
.clear_property()
2406 def OutputUnchecked(self
, out
):
2408 out
.putPrefixedString(self
.entity_type_
)
2409 for i
in xrange(len(self
.property_
)):
2411 self
.property_
[i
].OutputUnchecked(out
)
2414 out
.putBoolean(self
.ancestor_
)
2416 def TryMerge(self
, d
):
2417 while d
.avail() > 0:
2418 tt
= d
.getVarInt32()
2420 self
.set_entity_type(d
.getPrefixedString())
2423 self
.add_property().TryMerge(d
)
2426 self
.set_ancestor(d
.getBoolean())
2428 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2432 def __str__(self
, prefix
="", printElemNumber
=0):
2434 if self
.has_entity_type_
: res
+=prefix
+("entity_type: %s\n" % self
.DebugFormatString(self
.entity_type_
))
2435 if self
.has_ancestor_
: res
+=prefix
+("ancestor: %s\n" % self
.DebugFormatBool(self
.ancestor_
))
2437 for e
in self
.property_
:
2439 if printElemNumber
: elm
="(%d)" % cnt
2440 res
+=prefix
+("Property%s {\n" % elm
)
2441 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2450 kPropertydirection
= 4
2462 ProtocolBuffer
.Encoder
.NUMERIC
,
2463 ProtocolBuffer
.Encoder
.STRING
,
2465 ProtocolBuffer
.Encoder
.STARTGROUP
,
2467 ProtocolBuffer
.Encoder
.STRING
,
2469 ProtocolBuffer
.Encoder
.NUMERIC
,
2471 ProtocolBuffer
.Encoder
.NUMERIC
,
2476 _STYLE_CONTENT_TYPE
= """"""
2477 class CompositeIndex(ProtocolBuffer
.ProtocolMessage
):
2491 def State_Name(cls
, x
): return cls
._State
_NAMES
.get(x
, "")
2492 State_Name
= classmethod(State_Name
)
2502 def __init__(self
, contents
=None):
2503 self
.definition_
= Index()
2504 if contents
is not None: self
.MergeFromString(contents
)
2506 def app_id(self
): return self
.app_id_
2508 def set_app_id(self
, x
):
2509 self
.has_app_id_
= 1
2512 def clear_app_id(self
):
2513 if self
.has_app_id_
:
2514 self
.has_app_id_
= 0
2517 def has_app_id(self
): return self
.has_app_id_
2519 def id(self
): return self
.id_
2521 def set_id(self
, x
):
2530 def has_id(self
): return self
.has_id_
2532 def definition(self
): return self
.definition_
2534 def mutable_definition(self
): self
.has_definition_
= 1; return self
.definition_
2536 def clear_definition(self
):self
.has_definition_
= 0; self
.definition_
.Clear()
2538 def has_definition(self
): return self
.has_definition_
2540 def state(self
): return self
.state_
2542 def set_state(self
, x
):
2546 def clear_state(self
):
2551 def has_state(self
): return self
.has_state_
2554 def MergeFrom(self
, x
):
2555 assert x
is not self
2556 if (x
.has_app_id()): self
.set_app_id(x
.app_id())
2557 if (x
.has_id()): self
.set_id(x
.id())
2558 if (x
.has_definition()): self
.mutable_definition().MergeFrom(x
.definition())
2559 if (x
.has_state()): self
.set_state(x
.state())
2561 def Equals(self
, x
):
2562 if x
is self
: return 1
2563 if self
.has_app_id_
!= x
.has_app_id_
: return 0
2564 if self
.has_app_id_
and self
.app_id_
!= x
.app_id_
: return 0
2565 if self
.has_id_
!= x
.has_id_
: return 0
2566 if self
.has_id_
and self
.id_
!= x
.id_
: return 0
2567 if self
.has_definition_
!= x
.has_definition_
: return 0
2568 if self
.has_definition_
and self
.definition_
!= x
.definition_
: return 0
2569 if self
.has_state_
!= x
.has_state_
: return 0
2570 if self
.has_state_
and self
.state_
!= x
.state_
: return 0
2573 def IsInitialized(self
, debug_strs
=None):
2575 if (not self
.has_app_id_
):
2577 if debug_strs
is not None:
2578 debug_strs
.append('Required field: app_id not set.')
2579 if (not self
.has_id_
):
2581 if debug_strs
is not None:
2582 debug_strs
.append('Required field: id not set.')
2583 if (not self
.has_definition_
):
2585 if debug_strs
is not None:
2586 debug_strs
.append('Required field: definition not set.')
2587 elif not self
.definition_
.IsInitialized(debug_strs
): initialized
= 0
2588 if (not self
.has_state_
):
2590 if debug_strs
is not None:
2591 debug_strs
.append('Required field: state not set.')
2596 n
+= self
.lengthString(len(self
.app_id_
))
2597 n
+= self
.lengthVarInt64(self
.id_
)
2598 n
+= self
.lengthString(self
.definition_
.ByteSize())
2599 n
+= self
.lengthVarInt64(self
.state_
)
2605 self
.clear_definition()
2608 def OutputUnchecked(self
, out
):
2610 out
.putPrefixedString(self
.app_id_
)
2612 out
.putVarInt64(self
.id_
)
2614 out
.putVarInt32(self
.definition_
.ByteSize())
2615 self
.definition_
.OutputUnchecked(out
)
2617 out
.putVarInt32(self
.state_
)
2619 def TryMerge(self
, d
):
2620 while d
.avail() > 0:
2621 tt
= d
.getVarInt32()
2623 self
.set_app_id(d
.getPrefixedString())
2626 self
.set_id(d
.getVarInt64())
2629 length
= d
.getVarInt32()
2630 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2632 self
.mutable_definition().TryMerge(tmp
)
2635 self
.set_state(d
.getVarInt32())
2637 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2641 def __str__(self
, prefix
="", printElemNumber
=0):
2643 if self
.has_app_id_
: res
+=prefix
+("app_id: %s\n" % self
.DebugFormatString(self
.app_id_
))
2644 if self
.has_id_
: res
+=prefix
+("id: %s\n" % self
.DebugFormatInt64(self
.id_
))
2645 if self
.has_definition_
:
2646 res
+=prefix
+"definition <\n"
2647 res
+=self
.definition_
.__str
__(prefix
+ " ", printElemNumber
)
2649 if self
.has_state_
: res
+=prefix
+("state: %s\n" % self
.DebugFormatInt32(self
.state_
))
2666 ProtocolBuffer
.Encoder
.NUMERIC
,
2667 ProtocolBuffer
.Encoder
.STRING
,
2669 ProtocolBuffer
.Encoder
.NUMERIC
,
2671 ProtocolBuffer
.Encoder
.STRING
,
2673 ProtocolBuffer
.Encoder
.NUMERIC
,
2678 _STYLE_CONTENT_TYPE
= """"""
2680 __all__
= ['PropertyValue','PropertyValue_ReferenceValuePathElement','PropertyValue_PointValue','PropertyValue_UserValue','PropertyValue_ReferenceValue','Property','Path','Path_Element','Reference','User','EntityProto','CompositeProperty','Index','Index_Property','CompositeIndex']