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
1026 if (self
.has_meaning_
): n
+= 1 + self
.lengthVarInt64(self
.meaning_
)
1027 if (self
.has_meaning_uri_
): n
+= 1 + self
.lengthString(len(self
.meaning_uri_
))
1028 n
+= self
.lengthString(len(self
.name_
))
1029 n
+= self
.lengthString(self
.value_
.ByteSize())
1030 if (self
.has_multiple_
): n
+= 2
1034 self
.clear_meaning()
1035 self
.clear_meaning_uri()
1038 self
.clear_multiple()
1040 def OutputUnchecked(self
, out
):
1041 if (self
.has_meaning_
):
1043 out
.putVarInt32(self
.meaning_
)
1044 if (self
.has_meaning_uri_
):
1046 out
.putPrefixedString(self
.meaning_uri_
)
1048 out
.putPrefixedString(self
.name_
)
1049 if (self
.has_multiple_
):
1051 out
.putBoolean(self
.multiple_
)
1053 out
.putVarInt32(self
.value_
.ByteSize())
1054 self
.value_
.OutputUnchecked(out
)
1056 def TryMerge(self
, d
):
1057 while d
.avail() > 0:
1058 tt
= d
.getVarInt32()
1060 self
.set_meaning(d
.getVarInt32())
1063 self
.set_meaning_uri(d
.getPrefixedString())
1066 self
.set_name(d
.getPrefixedString())
1069 self
.set_multiple(d
.getBoolean())
1072 length
= d
.getVarInt32()
1073 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1075 self
.mutable_value().TryMerge(tmp
)
1077 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1081 def __str__(self
, prefix
="", printElemNumber
=0):
1083 if self
.has_meaning_
: res
+=prefix
+("meaning: %s\n" % self
.DebugFormatInt32(self
.meaning_
))
1084 if self
.has_meaning_uri_
: res
+=prefix
+("meaning_uri: %s\n" % self
.DebugFormatString(self
.meaning_uri_
))
1085 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
1087 res
+=prefix
+"value <\n"
1088 res
+=self
.value_
.__str
__(prefix
+ " ", printElemNumber
)
1090 if self
.has_multiple_
: res
+=prefix
+("multiple: %s\n" % self
.DebugFormatBool(self
.multiple_
))
1109 ProtocolBuffer
.Encoder
.NUMERIC
,
1110 ProtocolBuffer
.Encoder
.NUMERIC
,
1112 ProtocolBuffer
.Encoder
.STRING
,
1114 ProtocolBuffer
.Encoder
.STRING
,
1116 ProtocolBuffer
.Encoder
.NUMERIC
,
1118 ProtocolBuffer
.Encoder
.STRING
,
1123 _STYLE_CONTENT_TYPE
= """"""
1124 class Path_Element(ProtocolBuffer
.ProtocolMessage
):
1132 def __init__(self
, contents
=None):
1133 if contents
is not None: self
.MergeFromString(contents
)
1135 def type(self
): return self
.type_
1137 def set_type(self
, x
):
1141 def clear_type(self
):
1146 def has_type(self
): return self
.has_type_
1148 def id(self
): return self
.id_
1150 def set_id(self
, x
):
1159 def has_id(self
): return self
.has_id_
1161 def name(self
): return self
.name_
1163 def set_name(self
, x
):
1167 def clear_name(self
):
1172 def has_name(self
): return self
.has_name_
1175 def MergeFrom(self
, x
):
1176 assert x
is not self
1177 if (x
.has_type()): self
.set_type(x
.type())
1178 if (x
.has_id()): self
.set_id(x
.id())
1179 if (x
.has_name()): self
.set_name(x
.name())
1181 def Equals(self
, x
):
1182 if x
is self
: return 1
1183 if self
.has_type_
!= x
.has_type_
: return 0
1184 if self
.has_type_
and self
.type_
!= x
.type_
: return 0
1185 if self
.has_id_
!= x
.has_id_
: return 0
1186 if self
.has_id_
and self
.id_
!= x
.id_
: return 0
1187 if self
.has_name_
!= x
.has_name_
: return 0
1188 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
1191 def IsInitialized(self
, debug_strs
=None):
1193 if (not self
.has_type_
):
1195 if debug_strs
is not None:
1196 debug_strs
.append('Required field: type not set.')
1201 n
+= self
.lengthString(len(self
.type_
))
1202 if (self
.has_id_
): n
+= 1 + self
.lengthVarInt64(self
.id_
)
1203 if (self
.has_name_
): n
+= 1 + self
.lengthString(len(self
.name_
))
1211 def OutputUnchecked(self
, out
):
1213 out
.putPrefixedString(self
.type_
)
1216 out
.putVarInt64(self
.id_
)
1217 if (self
.has_name_
):
1219 out
.putPrefixedString(self
.name_
)
1221 def TryMerge(self
, d
):
1223 tt
= d
.getVarInt32()
1226 self
.set_type(d
.getPrefixedString())
1229 self
.set_id(d
.getVarInt64())
1232 self
.set_name(d
.getPrefixedString())
1234 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1238 def __str__(self
, prefix
="", printElemNumber
=0):
1240 if self
.has_type_
: res
+=prefix
+("type: %s\n" % self
.DebugFormatString(self
.type_
))
1241 if self
.has_id_
: res
+=prefix
+("id: %s\n" % self
.DebugFormatInt64(self
.id_
))
1242 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
1245 class Path(ProtocolBuffer
.ProtocolMessage
):
1247 def __init__(self
, contents
=None):
1249 if contents
is not None: self
.MergeFromString(contents
)
1251 def element_size(self
): return len(self
.element_
)
1252 def element_list(self
): return self
.element_
1254 def element(self
, i
):
1255 return self
.element_
[i
]
1257 def mutable_element(self
, i
):
1258 return self
.element_
[i
]
1260 def add_element(self
):
1262 self
.element_
.append(x
)
1265 def clear_element(self
):
1268 def MergeFrom(self
, x
):
1269 assert x
is not self
1270 for i
in xrange(x
.element_size()): self
.add_element().CopyFrom(x
.element(i
))
1272 def Equals(self
, x
):
1273 if x
is self
: return 1
1274 if len(self
.element_
) != len(x
.element_
): return 0
1275 for e1
, e2
in zip(self
.element_
, x
.element_
):
1276 if e1
!= e2
: return 0
1279 def IsInitialized(self
, debug_strs
=None):
1281 for p
in self
.element_
:
1282 if not p
.IsInitialized(debug_strs
): initialized
=0
1287 n
+= 2 * len(self
.element_
)
1288 for i
in xrange(len(self
.element_
)): n
+= self
.element_
[i
].ByteSize()
1292 self
.clear_element()
1294 def OutputUnchecked(self
, out
):
1295 for i
in xrange(len(self
.element_
)):
1297 self
.element_
[i
].OutputUnchecked(out
)
1300 def TryMerge(self
, d
):
1301 while d
.avail() > 0:
1302 tt
= d
.getVarInt32()
1304 self
.add_element().TryMerge(d
)
1306 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1310 def __str__(self
, prefix
="", printElemNumber
=0):
1313 for e
in self
.element_
:
1315 if printElemNumber
: elm
="(%d)" % cnt
1316 res
+=prefix
+("Element%s {\n" % elm
)
1317 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
1336 ProtocolBuffer
.Encoder
.NUMERIC
,
1337 ProtocolBuffer
.Encoder
.STARTGROUP
,
1339 ProtocolBuffer
.Encoder
.STRING
,
1341 ProtocolBuffer
.Encoder
.NUMERIC
,
1343 ProtocolBuffer
.Encoder
.STRING
,
1348 _STYLE_CONTENT_TYPE
= """"""
1349 class Reference(ProtocolBuffer
.ProtocolMessage
):
1354 def __init__(self
, contents
=None):
1356 if contents
is not None: self
.MergeFromString(contents
)
1358 def app(self
): return self
.app_
1360 def set_app(self
, x
):
1364 def clear_app(self
):
1369 def has_app(self
): return self
.has_app_
1371 def path(self
): return self
.path_
1373 def mutable_path(self
): self
.has_path_
= 1; return self
.path_
1375 def clear_path(self
):self
.has_path_
= 0; self
.path_
.Clear()
1377 def has_path(self
): return self
.has_path_
1380 def MergeFrom(self
, x
):
1381 assert x
is not self
1382 if (x
.has_app()): self
.set_app(x
.app())
1383 if (x
.has_path()): self
.mutable_path().MergeFrom(x
.path())
1385 def Equals(self
, x
):
1386 if x
is self
: return 1
1387 if self
.has_app_
!= x
.has_app_
: return 0
1388 if self
.has_app_
and self
.app_
!= x
.app_
: return 0
1389 if self
.has_path_
!= x
.has_path_
: return 0
1390 if self
.has_path_
and self
.path_
!= x
.path_
: return 0
1393 def IsInitialized(self
, debug_strs
=None):
1395 if (not self
.has_app_
):
1397 if debug_strs
is not None:
1398 debug_strs
.append('Required field: app not set.')
1399 if (not self
.has_path_
):
1401 if debug_strs
is not None:
1402 debug_strs
.append('Required field: path not set.')
1403 elif not self
.path_
.IsInitialized(debug_strs
): initialized
= 0
1408 n
+= self
.lengthString(len(self
.app_
))
1409 n
+= self
.lengthString(self
.path_
.ByteSize())
1416 def OutputUnchecked(self
, out
):
1417 out
.putVarInt32(106)
1418 out
.putPrefixedString(self
.app_
)
1419 out
.putVarInt32(114)
1420 out
.putVarInt32(self
.path_
.ByteSize())
1421 self
.path_
.OutputUnchecked(out
)
1423 def TryMerge(self
, d
):
1424 while d
.avail() > 0:
1425 tt
= d
.getVarInt32()
1427 self
.set_app(d
.getPrefixedString())
1430 length
= d
.getVarInt32()
1431 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1433 self
.mutable_path().TryMerge(tmp
)
1435 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1439 def __str__(self
, prefix
="", printElemNumber
=0):
1441 if self
.has_app_
: res
+=prefix
+("app: %s\n" % self
.DebugFormatString(self
.app_
))
1443 res
+=prefix
+"path <\n"
1444 res
+=self
.path_
.__str
__(prefix
+ " ", printElemNumber
)
1470 ProtocolBuffer
.Encoder
.NUMERIC
,
1471 ProtocolBuffer
.Encoder
.MAX_TYPE
,
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
.STRING
,
1497 ProtocolBuffer
.Encoder
.STRING
,
1502 _STYLE_CONTENT_TYPE
= """"""
1503 class User(ProtocolBuffer
.ProtocolMessage
):
1506 has_auth_domain_
= 0
1512 has_obfuscated_gaiaid_
= 0
1513 obfuscated_gaiaid_
= ""
1515 def __init__(self
, contents
=None):
1516 if contents
is not None: self
.MergeFromString(contents
)
1518 def email(self
): return self
.email_
1520 def set_email(self
, x
):
1524 def clear_email(self
):
1529 def has_email(self
): return self
.has_email_
1531 def auth_domain(self
): return self
.auth_domain_
1533 def set_auth_domain(self
, x
):
1534 self
.has_auth_domain_
= 1
1535 self
.auth_domain_
= x
1537 def clear_auth_domain(self
):
1538 if self
.has_auth_domain_
:
1539 self
.has_auth_domain_
= 0
1540 self
.auth_domain_
= ""
1542 def has_auth_domain(self
): return self
.has_auth_domain_
1544 def nickname(self
): return self
.nickname_
1546 def set_nickname(self
, x
):
1547 self
.has_nickname_
= 1
1550 def clear_nickname(self
):
1551 if self
.has_nickname_
:
1552 self
.has_nickname_
= 0
1555 def has_nickname(self
): return self
.has_nickname_
1557 def gaiaid(self
): return self
.gaiaid_
1559 def set_gaiaid(self
, x
):
1560 self
.has_gaiaid_
= 1
1563 def clear_gaiaid(self
):
1564 if self
.has_gaiaid_
:
1565 self
.has_gaiaid_
= 0
1568 def has_gaiaid(self
): return self
.has_gaiaid_
1570 def obfuscated_gaiaid(self
): return self
.obfuscated_gaiaid_
1572 def set_obfuscated_gaiaid(self
, x
):
1573 self
.has_obfuscated_gaiaid_
= 1
1574 self
.obfuscated_gaiaid_
= x
1576 def clear_obfuscated_gaiaid(self
):
1577 if self
.has_obfuscated_gaiaid_
:
1578 self
.has_obfuscated_gaiaid_
= 0
1579 self
.obfuscated_gaiaid_
= ""
1581 def has_obfuscated_gaiaid(self
): return self
.has_obfuscated_gaiaid_
1584 def MergeFrom(self
, x
):
1585 assert x
is not self
1586 if (x
.has_email()): self
.set_email(x
.email())
1587 if (x
.has_auth_domain()): self
.set_auth_domain(x
.auth_domain())
1588 if (x
.has_nickname()): self
.set_nickname(x
.nickname())
1589 if (x
.has_gaiaid()): self
.set_gaiaid(x
.gaiaid())
1590 if (x
.has_obfuscated_gaiaid()): self
.set_obfuscated_gaiaid(x
.obfuscated_gaiaid())
1592 def Equals(self
, x
):
1593 if x
is self
: return 1
1594 if self
.has_email_
!= x
.has_email_
: return 0
1595 if self
.has_email_
and self
.email_
!= x
.email_
: return 0
1596 if self
.has_auth_domain_
!= x
.has_auth_domain_
: return 0
1597 if self
.has_auth_domain_
and self
.auth_domain_
!= x
.auth_domain_
: return 0
1598 if self
.has_nickname_
!= x
.has_nickname_
: return 0
1599 if self
.has_nickname_
and self
.nickname_
!= x
.nickname_
: return 0
1600 if self
.has_gaiaid_
!= x
.has_gaiaid_
: return 0
1601 if self
.has_gaiaid_
and self
.gaiaid_
!= x
.gaiaid_
: return 0
1602 if self
.has_obfuscated_gaiaid_
!= x
.has_obfuscated_gaiaid_
: return 0
1603 if self
.has_obfuscated_gaiaid_
and self
.obfuscated_gaiaid_
!= x
.obfuscated_gaiaid_
: return 0
1606 def IsInitialized(self
, debug_strs
=None):
1608 if (not self
.has_email_
):
1610 if debug_strs
is not None:
1611 debug_strs
.append('Required field: email not set.')
1612 if (not self
.has_auth_domain_
):
1614 if debug_strs
is not None:
1615 debug_strs
.append('Required field: auth_domain not set.')
1616 if (not self
.has_gaiaid_
):
1618 if debug_strs
is not None:
1619 debug_strs
.append('Required field: gaiaid not set.')
1624 n
+= self
.lengthString(len(self
.email_
))
1625 n
+= self
.lengthString(len(self
.auth_domain_
))
1626 if (self
.has_nickname_
): n
+= 1 + self
.lengthString(len(self
.nickname_
))
1627 n
+= self
.lengthVarInt64(self
.gaiaid_
)
1628 if (self
.has_obfuscated_gaiaid_
): n
+= 1 + self
.lengthString(len(self
.obfuscated_gaiaid_
))
1633 self
.clear_auth_domain()
1634 self
.clear_nickname()
1636 self
.clear_obfuscated_gaiaid()
1638 def OutputUnchecked(self
, out
):
1640 out
.putPrefixedString(self
.email_
)
1642 out
.putPrefixedString(self
.auth_domain_
)
1643 if (self
.has_nickname_
):
1645 out
.putPrefixedString(self
.nickname_
)
1647 out
.putVarInt64(self
.gaiaid_
)
1648 if (self
.has_obfuscated_gaiaid_
):
1650 out
.putPrefixedString(self
.obfuscated_gaiaid_
)
1652 def TryMerge(self
, d
):
1653 while d
.avail() > 0:
1654 tt
= d
.getVarInt32()
1656 self
.set_email(d
.getPrefixedString())
1659 self
.set_auth_domain(d
.getPrefixedString())
1662 self
.set_nickname(d
.getPrefixedString())
1665 self
.set_gaiaid(d
.getVarInt64())
1668 self
.set_obfuscated_gaiaid(d
.getPrefixedString())
1670 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1674 def __str__(self
, prefix
="", printElemNumber
=0):
1676 if self
.has_email_
: res
+=prefix
+("email: %s\n" % self
.DebugFormatString(self
.email_
))
1677 if self
.has_auth_domain_
: res
+=prefix
+("auth_domain: %s\n" % self
.DebugFormatString(self
.auth_domain_
))
1678 if self
.has_nickname_
: res
+=prefix
+("nickname: %s\n" % self
.DebugFormatString(self
.nickname_
))
1679 if self
.has_gaiaid_
: res
+=prefix
+("gaiaid: %s\n" % self
.DebugFormatInt64(self
.gaiaid_
))
1680 if self
.has_obfuscated_gaiaid_
: res
+=prefix
+("obfuscated_gaiaid: %s\n" % self
.DebugFormatString(self
.obfuscated_gaiaid_
))
1687 kobfuscated_gaiaid
= 5
1695 "obfuscated_gaiaid",
1699 ProtocolBuffer
.Encoder
.NUMERIC
,
1700 ProtocolBuffer
.Encoder
.STRING
,
1702 ProtocolBuffer
.Encoder
.STRING
,
1704 ProtocolBuffer
.Encoder
.STRING
,
1706 ProtocolBuffer
.Encoder
.NUMERIC
,
1708 ProtocolBuffer
.Encoder
.STRING
,
1713 _STYLE_CONTENT_TYPE
= """"""
1714 class EntityProto(ProtocolBuffer
.ProtocolMessage
):
1726 def Kind_Name(cls
, x
): return cls
._Kind
_NAMES
.get(x
, "")
1727 Kind_Name
= classmethod(Kind_Name
)
1730 has_entity_group_
= 0
1738 def __init__(self
, contents
=None):
1739 self
.key_
= Reference()
1740 self
.entity_group_
= Path()
1742 self
.raw_property_
= []
1743 self
.lazy_init_lock_
= thread
.allocate_lock()
1744 if contents
is not None: self
.MergeFromString(contents
)
1746 def key(self
): return self
.key_
1748 def mutable_key(self
): self
.has_key_
= 1; return self
.key_
1750 def clear_key(self
):self
.has_key_
= 0; self
.key_
.Clear()
1752 def has_key(self
): return self
.has_key_
1754 def entity_group(self
): return self
.entity_group_
1756 def mutable_entity_group(self
): self
.has_entity_group_
= 1; return self
.entity_group_
1758 def clear_entity_group(self
):self
.has_entity_group_
= 0; self
.entity_group_
.Clear()
1760 def has_entity_group(self
): return self
.has_entity_group_
1763 if self
.owner_
is None:
1764 self
.lazy_init_lock_
.acquire()
1766 if self
.owner_
is None: self
.owner_
= User()
1768 self
.lazy_init_lock_
.release()
1771 def mutable_owner(self
): self
.has_owner_
= 1; return self
.owner()
1773 def clear_owner(self
):
1775 self
.has_owner_
= 0;
1776 if self
.owner_
is not None: self
.owner_
.Clear()
1778 def has_owner(self
): return self
.has_owner_
1780 def kind(self
): return self
.kind_
1782 def set_kind(self
, x
):
1786 def clear_kind(self
):
1791 def has_kind(self
): return self
.has_kind_
1793 def kind_uri(self
): return self
.kind_uri_
1795 def set_kind_uri(self
, x
):
1796 self
.has_kind_uri_
= 1
1799 def clear_kind_uri(self
):
1800 if self
.has_kind_uri_
:
1801 self
.has_kind_uri_
= 0
1804 def has_kind_uri(self
): return self
.has_kind_uri_
1806 def property_size(self
): return len(self
.property_
)
1807 def property_list(self
): return self
.property_
1809 def property(self
, i
):
1810 return self
.property_
[i
]
1812 def mutable_property(self
, i
):
1813 return self
.property_
[i
]
1815 def add_property(self
):
1817 self
.property_
.append(x
)
1820 def clear_property(self
):
1822 def raw_property_size(self
): return len(self
.raw_property_
)
1823 def raw_property_list(self
): return self
.raw_property_
1825 def raw_property(self
, i
):
1826 return self
.raw_property_
[i
]
1828 def mutable_raw_property(self
, i
):
1829 return self
.raw_property_
[i
]
1831 def add_raw_property(self
):
1833 self
.raw_property_
.append(x
)
1836 def clear_raw_property(self
):
1837 self
.raw_property_
= []
1839 def MergeFrom(self
, x
):
1840 assert x
is not self
1841 if (x
.has_key()): self
.mutable_key().MergeFrom(x
.key())
1842 if (x
.has_entity_group()): self
.mutable_entity_group().MergeFrom(x
.entity_group())
1843 if (x
.has_owner()): self
.mutable_owner().MergeFrom(x
.owner())
1844 if (x
.has_kind()): self
.set_kind(x
.kind())
1845 if (x
.has_kind_uri()): self
.set_kind_uri(x
.kind_uri())
1846 for i
in xrange(x
.property_size()): self
.add_property().CopyFrom(x
.property(i
))
1847 for i
in xrange(x
.raw_property_size()): self
.add_raw_property().CopyFrom(x
.raw_property(i
))
1849 def Equals(self
, x
):
1850 if x
is self
: return 1
1851 if self
.has_key_
!= x
.has_key_
: return 0
1852 if self
.has_key_
and self
.key_
!= x
.key_
: return 0
1853 if self
.has_entity_group_
!= x
.has_entity_group_
: return 0
1854 if self
.has_entity_group_
and self
.entity_group_
!= x
.entity_group_
: return 0
1855 if self
.has_owner_
!= x
.has_owner_
: return 0
1856 if self
.has_owner_
and self
.owner_
!= x
.owner_
: return 0
1857 if self
.has_kind_
!= x
.has_kind_
: return 0
1858 if self
.has_kind_
and self
.kind_
!= x
.kind_
: return 0
1859 if self
.has_kind_uri_
!= x
.has_kind_uri_
: return 0
1860 if self
.has_kind_uri_
and self
.kind_uri_
!= x
.kind_uri_
: return 0
1861 if len(self
.property_
) != len(x
.property_
): return 0
1862 for e1
, e2
in zip(self
.property_
, x
.property_
):
1863 if e1
!= e2
: return 0
1864 if len(self
.raw_property_
) != len(x
.raw_property_
): return 0
1865 for e1
, e2
in zip(self
.raw_property_
, x
.raw_property_
):
1866 if e1
!= e2
: return 0
1869 def IsInitialized(self
, debug_strs
=None):
1871 if (not self
.has_key_
):
1873 if debug_strs
is not None:
1874 debug_strs
.append('Required field: key not set.')
1875 elif not self
.key_
.IsInitialized(debug_strs
): initialized
= 0
1876 if (not self
.has_entity_group_
):
1878 if debug_strs
is not None:
1879 debug_strs
.append('Required field: entity_group not set.')
1880 elif not self
.entity_group_
.IsInitialized(debug_strs
): initialized
= 0
1881 if (self
.has_owner_
and not self
.owner_
.IsInitialized(debug_strs
)): initialized
= 0
1882 for p
in self
.property_
:
1883 if not p
.IsInitialized(debug_strs
): initialized
=0
1884 for p
in self
.raw_property_
:
1885 if not p
.IsInitialized(debug_strs
): initialized
=0
1890 n
+= self
.lengthString(self
.key_
.ByteSize())
1891 n
+= self
.lengthString(self
.entity_group_
.ByteSize())
1892 if (self
.has_owner_
): n
+= 2 + self
.lengthString(self
.owner_
.ByteSize())
1893 if (self
.has_kind_
): n
+= 1 + self
.lengthVarInt64(self
.kind_
)
1894 if (self
.has_kind_uri_
): n
+= 1 + self
.lengthString(len(self
.kind_uri_
))
1895 n
+= 1 * len(self
.property_
)
1896 for i
in xrange(len(self
.property_
)): n
+= self
.lengthString(self
.property_
[i
].ByteSize())
1897 n
+= 1 * len(self
.raw_property_
)
1898 for i
in xrange(len(self
.raw_property_
)): n
+= self
.lengthString(self
.raw_property_
[i
].ByteSize())
1903 self
.clear_entity_group()
1906 self
.clear_kind_uri()
1907 self
.clear_property()
1908 self
.clear_raw_property()
1910 def OutputUnchecked(self
, out
):
1911 if (self
.has_kind_
):
1913 out
.putVarInt32(self
.kind_
)
1914 if (self
.has_kind_uri_
):
1916 out
.putPrefixedString(self
.kind_uri_
)
1917 out
.putVarInt32(106)
1918 out
.putVarInt32(self
.key_
.ByteSize())
1919 self
.key_
.OutputUnchecked(out
)
1920 for i
in xrange(len(self
.property_
)):
1921 out
.putVarInt32(114)
1922 out
.putVarInt32(self
.property_
[i
].ByteSize())
1923 self
.property_
[i
].OutputUnchecked(out
)
1924 for i
in xrange(len(self
.raw_property_
)):
1925 out
.putVarInt32(122)
1926 out
.putVarInt32(self
.raw_property_
[i
].ByteSize())
1927 self
.raw_property_
[i
].OutputUnchecked(out
)
1928 out
.putVarInt32(130)
1929 out
.putVarInt32(self
.entity_group_
.ByteSize())
1930 self
.entity_group_
.OutputUnchecked(out
)
1931 if (self
.has_owner_
):
1932 out
.putVarInt32(138)
1933 out
.putVarInt32(self
.owner_
.ByteSize())
1934 self
.owner_
.OutputUnchecked(out
)
1936 def TryMerge(self
, d
):
1937 while d
.avail() > 0:
1938 tt
= d
.getVarInt32()
1940 self
.set_kind(d
.getVarInt32())
1943 self
.set_kind_uri(d
.getPrefixedString())
1946 length
= d
.getVarInt32()
1947 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1949 self
.mutable_key().TryMerge(tmp
)
1952 length
= d
.getVarInt32()
1953 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1955 self
.add_property().TryMerge(tmp
)
1958 length
= d
.getVarInt32()
1959 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1961 self
.add_raw_property().TryMerge(tmp
)
1964 length
= d
.getVarInt32()
1965 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1967 self
.mutable_entity_group().TryMerge(tmp
)
1970 length
= d
.getVarInt32()
1971 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1973 self
.mutable_owner().TryMerge(tmp
)
1975 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1979 def __str__(self
, prefix
="", printElemNumber
=0):
1982 res
+=prefix
+"key <\n"
1983 res
+=self
.key_
.__str
__(prefix
+ " ", printElemNumber
)
1985 if self
.has_entity_group_
:
1986 res
+=prefix
+"entity_group <\n"
1987 res
+=self
.entity_group_
.__str
__(prefix
+ " ", printElemNumber
)
1990 res
+=prefix
+"owner <\n"
1991 res
+=self
.owner_
.__str
__(prefix
+ " ", printElemNumber
)
1993 if self
.has_kind_
: res
+=prefix
+("kind: %s\n" % self
.DebugFormatInt32(self
.kind_
))
1994 if self
.has_kind_uri_
: res
+=prefix
+("kind_uri: %s\n" % self
.DebugFormatString(self
.kind_uri_
))
1996 for e
in self
.property_
:
1998 if printElemNumber
: elm
="(%d)" % cnt
1999 res
+=prefix
+("property%s <\n" % elm
)
2000 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2004 for e
in self
.raw_property_
:
2006 if printElemNumber
: elm
="(%d)" % cnt
2007 res
+=prefix
+("raw_property%s <\n" % elm
)
2008 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2043 ProtocolBuffer
.Encoder
.NUMERIC
,
2044 ProtocolBuffer
.Encoder
.MAX_TYPE
,
2046 ProtocolBuffer
.Encoder
.MAX_TYPE
,
2048 ProtocolBuffer
.Encoder
.MAX_TYPE
,
2050 ProtocolBuffer
.Encoder
.NUMERIC
,
2052 ProtocolBuffer
.Encoder
.STRING
,
2054 ProtocolBuffer
.Encoder
.MAX_TYPE
,
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
.STRING
,
2070 ProtocolBuffer
.Encoder
.STRING
,
2072 ProtocolBuffer
.Encoder
.STRING
,
2074 ProtocolBuffer
.Encoder
.STRING
,
2076 ProtocolBuffer
.Encoder
.STRING
,
2081 _STYLE_CONTENT_TYPE
= """"""
2082 class CompositeProperty(ProtocolBuffer
.ProtocolMessage
):
2086 def __init__(self
, contents
=None):
2088 if contents
is not None: self
.MergeFromString(contents
)
2090 def index_id(self
): return self
.index_id_
2092 def set_index_id(self
, x
):
2093 self
.has_index_id_
= 1
2096 def clear_index_id(self
):
2097 if self
.has_index_id_
:
2098 self
.has_index_id_
= 0
2101 def has_index_id(self
): return self
.has_index_id_
2103 def value_size(self
): return len(self
.value_
)
2104 def value_list(self
): return self
.value_
2107 return self
.value_
[i
]
2109 def set_value(self
, i
, x
):
2112 def add_value(self
, x
):
2113 self
.value_
.append(x
)
2115 def clear_value(self
):
2119 def MergeFrom(self
, x
):
2120 assert x
is not self
2121 if (x
.has_index_id()): self
.set_index_id(x
.index_id())
2122 for i
in xrange(x
.value_size()): self
.add_value(x
.value(i
))
2124 def Equals(self
, x
):
2125 if x
is self
: return 1
2126 if self
.has_index_id_
!= x
.has_index_id_
: return 0
2127 if self
.has_index_id_
and self
.index_id_
!= x
.index_id_
: return 0
2128 if len(self
.value_
) != len(x
.value_
): return 0
2129 for e1
, e2
in zip(self
.value_
, x
.value_
):
2130 if e1
!= e2
: return 0
2133 def IsInitialized(self
, debug_strs
=None):
2135 if (not self
.has_index_id_
):
2137 if debug_strs
is not None:
2138 debug_strs
.append('Required field: index_id not set.')
2143 n
+= self
.lengthVarInt64(self
.index_id_
)
2144 n
+= 1 * len(self
.value_
)
2145 for i
in xrange(len(self
.value_
)): n
+= self
.lengthString(len(self
.value_
[i
]))
2149 self
.clear_index_id()
2152 def OutputUnchecked(self
, out
):
2154 out
.putVarInt64(self
.index_id_
)
2155 for i
in xrange(len(self
.value_
)):
2157 out
.putPrefixedString(self
.value_
[i
])
2159 def TryMerge(self
, d
):
2160 while d
.avail() > 0:
2161 tt
= d
.getVarInt32()
2163 self
.set_index_id(d
.getVarInt64())
2166 self
.add_value(d
.getPrefixedString())
2168 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2172 def __str__(self
, prefix
="", printElemNumber
=0):
2174 if self
.has_index_id_
: res
+=prefix
+("index_id: %s\n" % self
.DebugFormatInt64(self
.index_id_
))
2176 for e
in self
.value_
:
2178 if printElemNumber
: elm
="(%d)" % cnt
2179 res
+=prefix
+("value%s: %s\n" % (elm
, self
.DebugFormatString(e
)))
2193 ProtocolBuffer
.Encoder
.NUMERIC
,
2194 ProtocolBuffer
.Encoder
.NUMERIC
,
2196 ProtocolBuffer
.Encoder
.STRING
,
2201 _STYLE_CONTENT_TYPE
= """"""
2202 class Index_Property(ProtocolBuffer
.ProtocolMessage
):
2207 _Direction_NAMES
= {
2212 def Direction_Name(cls
, x
): return cls
._Direction
_NAMES
.get(x
, "")
2213 Direction_Name
= classmethod(Direction_Name
)
2220 def __init__(self
, contents
=None):
2221 if contents
is not None: self
.MergeFromString(contents
)
2223 def name(self
): return self
.name_
2225 def set_name(self
, x
):
2229 def clear_name(self
):
2234 def has_name(self
): return self
.has_name_
2236 def direction(self
): return self
.direction_
2238 def set_direction(self
, x
):
2239 self
.has_direction_
= 1
2242 def clear_direction(self
):
2243 if self
.has_direction_
:
2244 self
.has_direction_
= 0
2247 def has_direction(self
): return self
.has_direction_
2250 def MergeFrom(self
, x
):
2251 assert x
is not self
2252 if (x
.has_name()): self
.set_name(x
.name())
2253 if (x
.has_direction()): self
.set_direction(x
.direction())
2255 def Equals(self
, x
):
2256 if x
is self
: return 1
2257 if self
.has_name_
!= x
.has_name_
: return 0
2258 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
2259 if self
.has_direction_
!= x
.has_direction_
: return 0
2260 if self
.has_direction_
and self
.direction_
!= x
.direction_
: return 0
2263 def IsInitialized(self
, debug_strs
=None):
2265 if (not self
.has_name_
):
2267 if debug_strs
is not None:
2268 debug_strs
.append('Required field: name not set.')
2273 n
+= self
.lengthString(len(self
.name_
))
2274 if (self
.has_direction_
): n
+= 1 + self
.lengthVarInt64(self
.direction_
)
2279 self
.clear_direction()
2281 def OutputUnchecked(self
, out
):
2283 out
.putPrefixedString(self
.name_
)
2284 if (self
.has_direction_
):
2286 out
.putVarInt32(self
.direction_
)
2288 def TryMerge(self
, d
):
2290 tt
= d
.getVarInt32()
2293 self
.set_name(d
.getPrefixedString())
2296 self
.set_direction(d
.getVarInt32())
2298 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2302 def __str__(self
, prefix
="", printElemNumber
=0):
2304 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
2305 if self
.has_direction_
: res
+=prefix
+("direction: %s\n" % self
.DebugFormatInt32(self
.direction_
))
2308 class Index(ProtocolBuffer
.ProtocolMessage
):
2309 has_entity_type_
= 0
2314 def __init__(self
, contents
=None):
2316 if contents
is not None: self
.MergeFromString(contents
)
2318 def entity_type(self
): return self
.entity_type_
2320 def set_entity_type(self
, x
):
2321 self
.has_entity_type_
= 1
2322 self
.entity_type_
= x
2324 def clear_entity_type(self
):
2325 if self
.has_entity_type_
:
2326 self
.has_entity_type_
= 0
2327 self
.entity_type_
= ""
2329 def has_entity_type(self
): return self
.has_entity_type_
2331 def ancestor(self
): return self
.ancestor_
2333 def set_ancestor(self
, x
):
2334 self
.has_ancestor_
= 1
2337 def clear_ancestor(self
):
2338 if self
.has_ancestor_
:
2339 self
.has_ancestor_
= 0
2342 def has_ancestor(self
): return self
.has_ancestor_
2344 def property_size(self
): return len(self
.property_
)
2345 def property_list(self
): return self
.property_
2347 def property(self
, i
):
2348 return self
.property_
[i
]
2350 def mutable_property(self
, i
):
2351 return self
.property_
[i
]
2353 def add_property(self
):
2354 x
= Index_Property()
2355 self
.property_
.append(x
)
2358 def clear_property(self
):
2361 def MergeFrom(self
, x
):
2362 assert x
is not self
2363 if (x
.has_entity_type()): self
.set_entity_type(x
.entity_type())
2364 if (x
.has_ancestor()): self
.set_ancestor(x
.ancestor())
2365 for i
in xrange(x
.property_size()): self
.add_property().CopyFrom(x
.property(i
))
2367 def Equals(self
, x
):
2368 if x
is self
: return 1
2369 if self
.has_entity_type_
!= x
.has_entity_type_
: return 0
2370 if self
.has_entity_type_
and self
.entity_type_
!= x
.entity_type_
: return 0
2371 if self
.has_ancestor_
!= x
.has_ancestor_
: return 0
2372 if self
.has_ancestor_
and self
.ancestor_
!= x
.ancestor_
: return 0
2373 if len(self
.property_
) != len(x
.property_
): return 0
2374 for e1
, e2
in zip(self
.property_
, x
.property_
):
2375 if e1
!= e2
: return 0
2378 def IsInitialized(self
, debug_strs
=None):
2380 if (not self
.has_entity_type_
):
2382 if debug_strs
is not None:
2383 debug_strs
.append('Required field: entity_type not set.')
2384 if (not self
.has_ancestor_
):
2386 if debug_strs
is not None:
2387 debug_strs
.append('Required field: ancestor not set.')
2388 for p
in self
.property_
:
2389 if not p
.IsInitialized(debug_strs
): initialized
=0
2394 n
+= self
.lengthString(len(self
.entity_type_
))
2395 n
+= 2 * len(self
.property_
)
2396 for i
in xrange(len(self
.property_
)): n
+= self
.property_
[i
].ByteSize()
2400 self
.clear_entity_type()
2401 self
.clear_ancestor()
2402 self
.clear_property()
2404 def OutputUnchecked(self
, out
):
2406 out
.putPrefixedString(self
.entity_type_
)
2407 for i
in xrange(len(self
.property_
)):
2409 self
.property_
[i
].OutputUnchecked(out
)
2412 out
.putBoolean(self
.ancestor_
)
2414 def TryMerge(self
, d
):
2415 while d
.avail() > 0:
2416 tt
= d
.getVarInt32()
2418 self
.set_entity_type(d
.getPrefixedString())
2421 self
.add_property().TryMerge(d
)
2424 self
.set_ancestor(d
.getBoolean())
2426 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2430 def __str__(self
, prefix
="", printElemNumber
=0):
2432 if self
.has_entity_type_
: res
+=prefix
+("entity_type: %s\n" % self
.DebugFormatString(self
.entity_type_
))
2433 if self
.has_ancestor_
: res
+=prefix
+("ancestor: %s\n" % self
.DebugFormatBool(self
.ancestor_
))
2435 for e
in self
.property_
:
2437 if printElemNumber
: elm
="(%d)" % cnt
2438 res
+=prefix
+("Property%s {\n" % elm
)
2439 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2448 kPropertydirection
= 4
2460 ProtocolBuffer
.Encoder
.NUMERIC
,
2461 ProtocolBuffer
.Encoder
.STRING
,
2463 ProtocolBuffer
.Encoder
.STARTGROUP
,
2465 ProtocolBuffer
.Encoder
.STRING
,
2467 ProtocolBuffer
.Encoder
.NUMERIC
,
2469 ProtocolBuffer
.Encoder
.NUMERIC
,
2474 _STYLE_CONTENT_TYPE
= """"""
2475 class CompositeIndex(ProtocolBuffer
.ProtocolMessage
):
2489 def State_Name(cls
, x
): return cls
._State
_NAMES
.get(x
, "")
2490 State_Name
= classmethod(State_Name
)
2500 def __init__(self
, contents
=None):
2501 self
.definition_
= Index()
2502 if contents
is not None: self
.MergeFromString(contents
)
2504 def app_id(self
): return self
.app_id_
2506 def set_app_id(self
, x
):
2507 self
.has_app_id_
= 1
2510 def clear_app_id(self
):
2511 if self
.has_app_id_
:
2512 self
.has_app_id_
= 0
2515 def has_app_id(self
): return self
.has_app_id_
2517 def id(self
): return self
.id_
2519 def set_id(self
, x
):
2528 def has_id(self
): return self
.has_id_
2530 def definition(self
): return self
.definition_
2532 def mutable_definition(self
): self
.has_definition_
= 1; return self
.definition_
2534 def clear_definition(self
):self
.has_definition_
= 0; self
.definition_
.Clear()
2536 def has_definition(self
): return self
.has_definition_
2538 def state(self
): return self
.state_
2540 def set_state(self
, x
):
2544 def clear_state(self
):
2549 def has_state(self
): return self
.has_state_
2552 def MergeFrom(self
, x
):
2553 assert x
is not self
2554 if (x
.has_app_id()): self
.set_app_id(x
.app_id())
2555 if (x
.has_id()): self
.set_id(x
.id())
2556 if (x
.has_definition()): self
.mutable_definition().MergeFrom(x
.definition())
2557 if (x
.has_state()): self
.set_state(x
.state())
2559 def Equals(self
, x
):
2560 if x
is self
: return 1
2561 if self
.has_app_id_
!= x
.has_app_id_
: return 0
2562 if self
.has_app_id_
and self
.app_id_
!= x
.app_id_
: return 0
2563 if self
.has_id_
!= x
.has_id_
: return 0
2564 if self
.has_id_
and self
.id_
!= x
.id_
: return 0
2565 if self
.has_definition_
!= x
.has_definition_
: return 0
2566 if self
.has_definition_
and self
.definition_
!= x
.definition_
: return 0
2567 if self
.has_state_
!= x
.has_state_
: return 0
2568 if self
.has_state_
and self
.state_
!= x
.state_
: return 0
2571 def IsInitialized(self
, debug_strs
=None):
2573 if (not self
.has_app_id_
):
2575 if debug_strs
is not None:
2576 debug_strs
.append('Required field: app_id not set.')
2577 if (not self
.has_id_
):
2579 if debug_strs
is not None:
2580 debug_strs
.append('Required field: id not set.')
2581 if (not self
.has_definition_
):
2583 if debug_strs
is not None:
2584 debug_strs
.append('Required field: definition not set.')
2585 elif not self
.definition_
.IsInitialized(debug_strs
): initialized
= 0
2586 if (not self
.has_state_
):
2588 if debug_strs
is not None:
2589 debug_strs
.append('Required field: state not set.')
2594 n
+= self
.lengthString(len(self
.app_id_
))
2595 n
+= self
.lengthVarInt64(self
.id_
)
2596 n
+= self
.lengthString(self
.definition_
.ByteSize())
2597 n
+= self
.lengthVarInt64(self
.state_
)
2603 self
.clear_definition()
2606 def OutputUnchecked(self
, out
):
2608 out
.putPrefixedString(self
.app_id_
)
2610 out
.putVarInt64(self
.id_
)
2612 out
.putVarInt32(self
.definition_
.ByteSize())
2613 self
.definition_
.OutputUnchecked(out
)
2615 out
.putVarInt32(self
.state_
)
2617 def TryMerge(self
, d
):
2618 while d
.avail() > 0:
2619 tt
= d
.getVarInt32()
2621 self
.set_app_id(d
.getPrefixedString())
2624 self
.set_id(d
.getVarInt64())
2627 length
= d
.getVarInt32()
2628 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2630 self
.mutable_definition().TryMerge(tmp
)
2633 self
.set_state(d
.getVarInt32())
2635 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2639 def __str__(self
, prefix
="", printElemNumber
=0):
2641 if self
.has_app_id_
: res
+=prefix
+("app_id: %s\n" % self
.DebugFormatString(self
.app_id_
))
2642 if self
.has_id_
: res
+=prefix
+("id: %s\n" % self
.DebugFormatInt64(self
.id_
))
2643 if self
.has_definition_
:
2644 res
+=prefix
+"definition <\n"
2645 res
+=self
.definition_
.__str
__(prefix
+ " ", printElemNumber
)
2647 if self
.has_state_
: res
+=prefix
+("state: %s\n" % self
.DebugFormatInt32(self
.state_
))
2664 ProtocolBuffer
.Encoder
.NUMERIC
,
2665 ProtocolBuffer
.Encoder
.STRING
,
2667 ProtocolBuffer
.Encoder
.NUMERIC
,
2669 ProtocolBuffer
.Encoder
.STRING
,
2671 ProtocolBuffer
.Encoder
.NUMERIC
,
2676 _STYLE_CONTENT_TYPE
= """"""
2678 __all__
= ['PropertyValue','PropertyValue_ReferenceValuePathElement','PropertyValue_PointValue','PropertyValue_UserValue','PropertyValue_ReferenceValue','Property','Path','Path_Element','Reference','User','EntityProto','CompositeProperty','Index','Index_Property','CompositeIndex']