3 # Copyright 2007 Google Inc.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
20 from google
.net
.proto
import ProtocolBuffer
22 import dummy_thread
as thread
24 __pychecker__
= """maxreturns=0 maxbranches=0 no-callinit
25 unusednames=printElemNumber,debug_strs no-special"""
27 if hasattr(ProtocolBuffer
, 'ExtendableProtocolMessage'):
28 _extension_runtime
= True
29 _ExtendableProtocolMessage
= ProtocolBuffer
.ExtendableProtocolMessage
31 _extension_runtime
= False
32 _ExtendableProtocolMessage
= ProtocolBuffer
.ProtocolMessage
34 class PropertyValue_ReferenceValuePathElement(ProtocolBuffer
.ProtocolMessage
):
42 def __init__(self
, contents
=None):
43 if contents
is not None: self
.MergeFromString(contents
)
45 def type(self
): return self
.type_
47 def set_type(self
, x
):
56 def has_type(self
): return self
.has_type_
58 def id(self
): return self
.id_
69 def has_id(self
): return self
.has_id_
71 def name(self
): return self
.name_
73 def set_name(self
, x
):
82 def has_name(self
): return self
.has_name_
85 def MergeFrom(self
, x
):
87 if (x
.has_type()): self
.set_type(x
.type())
88 if (x
.has_id()): self
.set_id(x
.id())
89 if (x
.has_name()): self
.set_name(x
.name())
92 if x
is self
: return 1
93 if self
.has_type_
!= x
.has_type_
: return 0
94 if self
.has_type_
and self
.type_
!= x
.type_
: return 0
95 if self
.has_id_
!= x
.has_id_
: return 0
96 if self
.has_id_
and self
.id_
!= x
.id_
: return 0
97 if self
.has_name_
!= x
.has_name_
: return 0
98 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
101 def IsInitialized(self
, debug_strs
=None):
103 if (not self
.has_type_
):
105 if debug_strs
is not None:
106 debug_strs
.append('Required field: type not set.')
111 n
+= self
.lengthString(len(self
.type_
))
112 if (self
.has_id_
): n
+= 2 + self
.lengthVarInt64(self
.id_
)
113 if (self
.has_name_
): n
+= 2 + self
.lengthString(len(self
.name_
))
116 def ByteSizePartial(self
):
120 n
+= self
.lengthString(len(self
.type_
))
121 if (self
.has_id_
): n
+= 2 + self
.lengthVarInt64(self
.id_
)
122 if (self
.has_name_
): n
+= 2 + self
.lengthString(len(self
.name_
))
130 def OutputUnchecked(self
, out
):
132 out
.putPrefixedString(self
.type_
)
135 out
.putVarInt64(self
.id_
)
138 out
.putPrefixedString(self
.name_
)
140 def OutputPartial(self
, out
):
143 out
.putPrefixedString(self
.type_
)
146 out
.putVarInt64(self
.id_
)
149 out
.putPrefixedString(self
.name_
)
151 def TryMerge(self
, d
):
156 self
.set_type(d
.getPrefixedString())
159 self
.set_id(d
.getVarInt64())
162 self
.set_name(d
.getPrefixedString())
166 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
170 def __str__(self
, prefix
="", printElemNumber
=0):
172 if self
.has_type_
: res
+=prefix
+("type: %s\n" % self
.DebugFormatString(self
.type_
))
173 if self
.has_id_
: res
+=prefix
+("id: %s\n" % self
.DebugFormatInt64(self
.id_
))
174 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
177 class PropertyValue_PointValue(ProtocolBuffer
.ProtocolMessage
):
183 def __init__(self
, contents
=None):
184 if contents
is not None: self
.MergeFromString(contents
)
186 def x(self
): return self
.x_
197 def has_x(self
): return self
.has_x_
199 def y(self
): return self
.y_
210 def has_y(self
): return self
.has_y_
213 def MergeFrom(self
, x
):
215 if (x
.has_x()): self
.set_x(x
.x())
216 if (x
.has_y()): self
.set_y(x
.y())
219 if x
is self
: return 1
220 if self
.has_x_
!= x
.has_x_
: return 0
221 if self
.has_x_
and self
.x_
!= x
.x_
: return 0
222 if self
.has_y_
!= x
.has_y_
: return 0
223 if self
.has_y_
and self
.y_
!= x
.y_
: return 0
226 def IsInitialized(self
, debug_strs
=None):
228 if (not self
.has_x_
):
230 if debug_strs
is not None:
231 debug_strs
.append('Required field: x not set.')
232 if (not self
.has_y_
):
234 if debug_strs
is not None:
235 debug_strs
.append('Required field: y not set.')
242 def ByteSizePartial(self
):
254 def OutputUnchecked(self
, out
):
256 out
.putDouble(self
.x_
)
258 out
.putDouble(self
.y_
)
260 def OutputPartial(self
, out
):
263 out
.putDouble(self
.x_
)
266 out
.putDouble(self
.y_
)
268 def TryMerge(self
, d
):
273 self
.set_x(d
.getDouble())
276 self
.set_y(d
.getDouble())
280 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
284 def __str__(self
, prefix
="", printElemNumber
=0):
286 if self
.has_x_
: res
+=prefix
+("x: %s\n" % self
.DebugFormat(self
.x_
))
287 if self
.has_y_
: res
+=prefix
+("y: %s\n" % self
.DebugFormat(self
.y_
))
290 class PropertyValue_UserValue(ProtocolBuffer
.ProtocolMessage
):
299 has_obfuscated_gaiaid_
= 0
300 obfuscated_gaiaid_
= ""
301 has_federated_identity_
= 0
302 federated_identity_
= ""
303 has_federated_provider_
= 0
304 federated_provider_
= ""
306 def __init__(self
, contents
=None):
307 if contents
is not None: self
.MergeFromString(contents
)
309 def email(self
): return self
.email_
311 def set_email(self
, x
):
315 def clear_email(self
):
320 def has_email(self
): return self
.has_email_
322 def auth_domain(self
): return self
.auth_domain_
324 def set_auth_domain(self
, x
):
325 self
.has_auth_domain_
= 1
326 self
.auth_domain_
= x
328 def clear_auth_domain(self
):
329 if self
.has_auth_domain_
:
330 self
.has_auth_domain_
= 0
331 self
.auth_domain_
= ""
333 def has_auth_domain(self
): return self
.has_auth_domain_
335 def nickname(self
): return self
.nickname_
337 def set_nickname(self
, x
):
338 self
.has_nickname_
= 1
341 def clear_nickname(self
):
342 if self
.has_nickname_
:
343 self
.has_nickname_
= 0
346 def has_nickname(self
): return self
.has_nickname_
348 def gaiaid(self
): return self
.gaiaid_
350 def set_gaiaid(self
, x
):
354 def clear_gaiaid(self
):
359 def has_gaiaid(self
): return self
.has_gaiaid_
361 def obfuscated_gaiaid(self
): return self
.obfuscated_gaiaid_
363 def set_obfuscated_gaiaid(self
, x
):
364 self
.has_obfuscated_gaiaid_
= 1
365 self
.obfuscated_gaiaid_
= x
367 def clear_obfuscated_gaiaid(self
):
368 if self
.has_obfuscated_gaiaid_
:
369 self
.has_obfuscated_gaiaid_
= 0
370 self
.obfuscated_gaiaid_
= ""
372 def has_obfuscated_gaiaid(self
): return self
.has_obfuscated_gaiaid_
374 def federated_identity(self
): return self
.federated_identity_
376 def set_federated_identity(self
, x
):
377 self
.has_federated_identity_
= 1
378 self
.federated_identity_
= x
380 def clear_federated_identity(self
):
381 if self
.has_federated_identity_
:
382 self
.has_federated_identity_
= 0
383 self
.federated_identity_
= ""
385 def has_federated_identity(self
): return self
.has_federated_identity_
387 def federated_provider(self
): return self
.federated_provider_
389 def set_federated_provider(self
, x
):
390 self
.has_federated_provider_
= 1
391 self
.federated_provider_
= x
393 def clear_federated_provider(self
):
394 if self
.has_federated_provider_
:
395 self
.has_federated_provider_
= 0
396 self
.federated_provider_
= ""
398 def has_federated_provider(self
): return self
.has_federated_provider_
401 def MergeFrom(self
, x
):
403 if (x
.has_email()): self
.set_email(x
.email())
404 if (x
.has_auth_domain()): self
.set_auth_domain(x
.auth_domain())
405 if (x
.has_nickname()): self
.set_nickname(x
.nickname())
406 if (x
.has_gaiaid()): self
.set_gaiaid(x
.gaiaid())
407 if (x
.has_obfuscated_gaiaid()): self
.set_obfuscated_gaiaid(x
.obfuscated_gaiaid())
408 if (x
.has_federated_identity()): self
.set_federated_identity(x
.federated_identity())
409 if (x
.has_federated_provider()): self
.set_federated_provider(x
.federated_provider())
412 if x
is self
: return 1
413 if self
.has_email_
!= x
.has_email_
: return 0
414 if self
.has_email_
and self
.email_
!= x
.email_
: return 0
415 if self
.has_auth_domain_
!= x
.has_auth_domain_
: return 0
416 if self
.has_auth_domain_
and self
.auth_domain_
!= x
.auth_domain_
: return 0
417 if self
.has_nickname_
!= x
.has_nickname_
: return 0
418 if self
.has_nickname_
and self
.nickname_
!= x
.nickname_
: return 0
419 if self
.has_gaiaid_
!= x
.has_gaiaid_
: return 0
420 if self
.has_gaiaid_
and self
.gaiaid_
!= x
.gaiaid_
: return 0
421 if self
.has_obfuscated_gaiaid_
!= x
.has_obfuscated_gaiaid_
: return 0
422 if self
.has_obfuscated_gaiaid_
and self
.obfuscated_gaiaid_
!= x
.obfuscated_gaiaid_
: return 0
423 if self
.has_federated_identity_
!= x
.has_federated_identity_
: return 0
424 if self
.has_federated_identity_
and self
.federated_identity_
!= x
.federated_identity_
: return 0
425 if self
.has_federated_provider_
!= x
.has_federated_provider_
: return 0
426 if self
.has_federated_provider_
and self
.federated_provider_
!= x
.federated_provider_
: return 0
429 def IsInitialized(self
, debug_strs
=None):
431 if (not self
.has_email_
):
433 if debug_strs
is not None:
434 debug_strs
.append('Required field: email not set.')
435 if (not self
.has_auth_domain_
):
437 if debug_strs
is not None:
438 debug_strs
.append('Required field: auth_domain not set.')
439 if (not self
.has_gaiaid_
):
441 if debug_strs
is not None:
442 debug_strs
.append('Required field: gaiaid not set.')
447 n
+= self
.lengthString(len(self
.email_
))
448 n
+= self
.lengthString(len(self
.auth_domain_
))
449 if (self
.has_nickname_
): n
+= 1 + self
.lengthString(len(self
.nickname_
))
450 n
+= self
.lengthVarInt64(self
.gaiaid_
)
451 if (self
.has_obfuscated_gaiaid_
): n
+= 2 + self
.lengthString(len(self
.obfuscated_gaiaid_
))
452 if (self
.has_federated_identity_
): n
+= 2 + self
.lengthString(len(self
.federated_identity_
))
453 if (self
.has_federated_provider_
): n
+= 2 + self
.lengthString(len(self
.federated_provider_
))
456 def ByteSizePartial(self
):
458 if (self
.has_email_
):
460 n
+= self
.lengthString(len(self
.email_
))
461 if (self
.has_auth_domain_
):
463 n
+= self
.lengthString(len(self
.auth_domain_
))
464 if (self
.has_nickname_
): n
+= 1 + self
.lengthString(len(self
.nickname_
))
465 if (self
.has_gaiaid_
):
467 n
+= self
.lengthVarInt64(self
.gaiaid_
)
468 if (self
.has_obfuscated_gaiaid_
): n
+= 2 + self
.lengthString(len(self
.obfuscated_gaiaid_
))
469 if (self
.has_federated_identity_
): n
+= 2 + self
.lengthString(len(self
.federated_identity_
))
470 if (self
.has_federated_provider_
): n
+= 2 + self
.lengthString(len(self
.federated_provider_
))
475 self
.clear_auth_domain()
476 self
.clear_nickname()
478 self
.clear_obfuscated_gaiaid()
479 self
.clear_federated_identity()
480 self
.clear_federated_provider()
482 def OutputUnchecked(self
, out
):
484 out
.putPrefixedString(self
.email_
)
486 out
.putPrefixedString(self
.auth_domain_
)
487 if (self
.has_nickname_
):
489 out
.putPrefixedString(self
.nickname_
)
491 out
.putVarInt64(self
.gaiaid_
)
492 if (self
.has_obfuscated_gaiaid_
):
494 out
.putPrefixedString(self
.obfuscated_gaiaid_
)
495 if (self
.has_federated_identity_
):
497 out
.putPrefixedString(self
.federated_identity_
)
498 if (self
.has_federated_provider_
):
500 out
.putPrefixedString(self
.federated_provider_
)
502 def OutputPartial(self
, out
):
503 if (self
.has_email_
):
505 out
.putPrefixedString(self
.email_
)
506 if (self
.has_auth_domain_
):
508 out
.putPrefixedString(self
.auth_domain_
)
509 if (self
.has_nickname_
):
511 out
.putPrefixedString(self
.nickname_
)
512 if (self
.has_gaiaid_
):
514 out
.putVarInt64(self
.gaiaid_
)
515 if (self
.has_obfuscated_gaiaid_
):
517 out
.putPrefixedString(self
.obfuscated_gaiaid_
)
518 if (self
.has_federated_identity_
):
520 out
.putPrefixedString(self
.federated_identity_
)
521 if (self
.has_federated_provider_
):
523 out
.putPrefixedString(self
.federated_provider_
)
525 def TryMerge(self
, d
):
530 self
.set_email(d
.getPrefixedString())
533 self
.set_auth_domain(d
.getPrefixedString())
536 self
.set_nickname(d
.getPrefixedString())
539 self
.set_gaiaid(d
.getVarInt64())
542 self
.set_obfuscated_gaiaid(d
.getPrefixedString())
545 self
.set_federated_identity(d
.getPrefixedString())
548 self
.set_federated_provider(d
.getPrefixedString())
552 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
556 def __str__(self
, prefix
="", printElemNumber
=0):
558 if self
.has_email_
: res
+=prefix
+("email: %s\n" % self
.DebugFormatString(self
.email_
))
559 if self
.has_auth_domain_
: res
+=prefix
+("auth_domain: %s\n" % self
.DebugFormatString(self
.auth_domain_
))
560 if self
.has_nickname_
: res
+=prefix
+("nickname: %s\n" % self
.DebugFormatString(self
.nickname_
))
561 if self
.has_gaiaid_
: res
+=prefix
+("gaiaid: %s\n" % self
.DebugFormatInt64(self
.gaiaid_
))
562 if self
.has_obfuscated_gaiaid_
: res
+=prefix
+("obfuscated_gaiaid: %s\n" % self
.DebugFormatString(self
.obfuscated_gaiaid_
))
563 if self
.has_federated_identity_
: res
+=prefix
+("federated_identity: %s\n" % self
.DebugFormatString(self
.federated_identity_
))
564 if self
.has_federated_provider_
: res
+=prefix
+("federated_provider: %s\n" % self
.DebugFormatString(self
.federated_provider_
))
567 class PropertyValue_ReferenceValue(ProtocolBuffer
.ProtocolMessage
):
573 def __init__(self
, contents
=None):
574 self
.pathelement_
= []
575 if contents
is not None: self
.MergeFromString(contents
)
577 def app(self
): return self
.app_
579 def set_app(self
, x
):
588 def has_app(self
): return self
.has_app_
590 def name_space(self
): return self
.name_space_
592 def set_name_space(self
, x
):
593 self
.has_name_space_
= 1
596 def clear_name_space(self
):
597 if self
.has_name_space_
:
598 self
.has_name_space_
= 0
599 self
.name_space_
= ""
601 def has_name_space(self
): return self
.has_name_space_
603 def pathelement_size(self
): return len(self
.pathelement_
)
604 def pathelement_list(self
): return self
.pathelement_
606 def pathelement(self
, i
):
607 return self
.pathelement_
[i
]
609 def mutable_pathelement(self
, i
):
610 return self
.pathelement_
[i
]
612 def add_pathelement(self
):
613 x
= PropertyValue_ReferenceValuePathElement()
614 self
.pathelement_
.append(x
)
617 def clear_pathelement(self
):
618 self
.pathelement_
= []
620 def MergeFrom(self
, x
):
622 if (x
.has_app()): self
.set_app(x
.app())
623 if (x
.has_name_space()): self
.set_name_space(x
.name_space())
624 for i
in xrange(x
.pathelement_size()): self
.add_pathelement().CopyFrom(x
.pathelement(i
))
627 if x
is self
: return 1
628 if self
.has_app_
!= x
.has_app_
: return 0
629 if self
.has_app_
and self
.app_
!= x
.app_
: return 0
630 if self
.has_name_space_
!= x
.has_name_space_
: return 0
631 if self
.has_name_space_
and self
.name_space_
!= x
.name_space_
: return 0
632 if len(self
.pathelement_
) != len(x
.pathelement_
): return 0
633 for e1
, e2
in zip(self
.pathelement_
, x
.pathelement_
):
634 if e1
!= e2
: return 0
637 def IsInitialized(self
, debug_strs
=None):
639 if (not self
.has_app_
):
641 if debug_strs
is not None:
642 debug_strs
.append('Required field: app not set.')
643 for p
in self
.pathelement_
:
644 if not p
.IsInitialized(debug_strs
): initialized
=0
649 n
+= self
.lengthString(len(self
.app_
))
650 if (self
.has_name_space_
): n
+= 2 + self
.lengthString(len(self
.name_space_
))
651 n
+= 2 * len(self
.pathelement_
)
652 for i
in xrange(len(self
.pathelement_
)): n
+= self
.pathelement_
[i
].ByteSize()
655 def ByteSizePartial(self
):
659 n
+= self
.lengthString(len(self
.app_
))
660 if (self
.has_name_space_
): n
+= 2 + self
.lengthString(len(self
.name_space_
))
661 n
+= 2 * len(self
.pathelement_
)
662 for i
in xrange(len(self
.pathelement_
)): n
+= self
.pathelement_
[i
].ByteSizePartial()
667 self
.clear_name_space()
668 self
.clear_pathelement()
670 def OutputUnchecked(self
, out
):
672 out
.putPrefixedString(self
.app_
)
673 for i
in xrange(len(self
.pathelement_
)):
675 self
.pathelement_
[i
].OutputUnchecked(out
)
677 if (self
.has_name_space_
):
679 out
.putPrefixedString(self
.name_space_
)
681 def OutputPartial(self
, out
):
684 out
.putPrefixedString(self
.app_
)
685 for i
in xrange(len(self
.pathelement_
)):
687 self
.pathelement_
[i
].OutputPartial(out
)
689 if (self
.has_name_space_
):
691 out
.putPrefixedString(self
.name_space_
)
693 def TryMerge(self
, d
):
698 self
.set_app(d
.getPrefixedString())
701 self
.add_pathelement().TryMerge(d
)
704 self
.set_name_space(d
.getPrefixedString())
708 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
712 def __str__(self
, prefix
="", printElemNumber
=0):
714 if self
.has_app_
: res
+=prefix
+("app: %s\n" % self
.DebugFormatString(self
.app_
))
715 if self
.has_name_space_
: res
+=prefix
+("name_space: %s\n" % self
.DebugFormatString(self
.name_space_
))
717 for e
in self
.pathelement_
:
719 if printElemNumber
: elm
="(%d)" % cnt
720 res
+=prefix
+("PathElement%s {\n" % elm
)
721 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
726 class PropertyValue(ProtocolBuffer
.ProtocolMessage
):
729 has_booleanvalue_
= 0
739 has_referencevalue_
= 0
740 referencevalue_
= None
742 def __init__(self
, contents
=None):
743 self
.lazy_init_lock_
= thread
.allocate_lock()
744 if contents
is not None: self
.MergeFromString(contents
)
746 def int64value(self
): return self
.int64value_
748 def set_int64value(self
, x
):
749 self
.has_int64value_
= 1
752 def clear_int64value(self
):
753 if self
.has_int64value_
:
754 self
.has_int64value_
= 0
757 def has_int64value(self
): return self
.has_int64value_
759 def booleanvalue(self
): return self
.booleanvalue_
761 def set_booleanvalue(self
, x
):
762 self
.has_booleanvalue_
= 1
763 self
.booleanvalue_
= x
765 def clear_booleanvalue(self
):
766 if self
.has_booleanvalue_
:
767 self
.has_booleanvalue_
= 0
768 self
.booleanvalue_
= 0
770 def has_booleanvalue(self
): return self
.has_booleanvalue_
772 def stringvalue(self
): return self
.stringvalue_
774 def set_stringvalue(self
, x
):
775 self
.has_stringvalue_
= 1
776 self
.stringvalue_
= x
778 def clear_stringvalue(self
):
779 if self
.has_stringvalue_
:
780 self
.has_stringvalue_
= 0
781 self
.stringvalue_
= ""
783 def has_stringvalue(self
): return self
.has_stringvalue_
785 def doublevalue(self
): return self
.doublevalue_
787 def set_doublevalue(self
, x
):
788 self
.has_doublevalue_
= 1
789 self
.doublevalue_
= x
791 def clear_doublevalue(self
):
792 if self
.has_doublevalue_
:
793 self
.has_doublevalue_
= 0
794 self
.doublevalue_
= 0.0
796 def has_doublevalue(self
): return self
.has_doublevalue_
798 def pointvalue(self
):
799 if self
.pointvalue_
is None:
800 self
.lazy_init_lock_
.acquire()
802 if self
.pointvalue_
is None: self
.pointvalue_
= PropertyValue_PointValue()
804 self
.lazy_init_lock_
.release()
805 return self
.pointvalue_
807 def mutable_pointvalue(self
): self
.has_pointvalue_
= 1; return self
.pointvalue()
809 def clear_pointvalue(self
):
811 if self
.has_pointvalue_
:
812 self
.has_pointvalue_
= 0;
813 if self
.pointvalue_
is not None: self
.pointvalue_
.Clear()
815 def has_pointvalue(self
): return self
.has_pointvalue_
818 if self
.uservalue_
is None:
819 self
.lazy_init_lock_
.acquire()
821 if self
.uservalue_
is None: self
.uservalue_
= PropertyValue_UserValue()
823 self
.lazy_init_lock_
.release()
824 return self
.uservalue_
826 def mutable_uservalue(self
): self
.has_uservalue_
= 1; return self
.uservalue()
828 def clear_uservalue(self
):
830 if self
.has_uservalue_
:
831 self
.has_uservalue_
= 0;
832 if self
.uservalue_
is not None: self
.uservalue_
.Clear()
834 def has_uservalue(self
): return self
.has_uservalue_
836 def referencevalue(self
):
837 if self
.referencevalue_
is None:
838 self
.lazy_init_lock_
.acquire()
840 if self
.referencevalue_
is None: self
.referencevalue_
= PropertyValue_ReferenceValue()
842 self
.lazy_init_lock_
.release()
843 return self
.referencevalue_
845 def mutable_referencevalue(self
): self
.has_referencevalue_
= 1; return self
.referencevalue()
847 def clear_referencevalue(self
):
849 if self
.has_referencevalue_
:
850 self
.has_referencevalue_
= 0;
851 if self
.referencevalue_
is not None: self
.referencevalue_
.Clear()
853 def has_referencevalue(self
): return self
.has_referencevalue_
856 def MergeFrom(self
, x
):
858 if (x
.has_int64value()): self
.set_int64value(x
.int64value())
859 if (x
.has_booleanvalue()): self
.set_booleanvalue(x
.booleanvalue())
860 if (x
.has_stringvalue()): self
.set_stringvalue(x
.stringvalue())
861 if (x
.has_doublevalue()): self
.set_doublevalue(x
.doublevalue())
862 if (x
.has_pointvalue()): self
.mutable_pointvalue().MergeFrom(x
.pointvalue())
863 if (x
.has_uservalue()): self
.mutable_uservalue().MergeFrom(x
.uservalue())
864 if (x
.has_referencevalue()): self
.mutable_referencevalue().MergeFrom(x
.referencevalue())
867 if x
is self
: return 1
868 if self
.has_int64value_
!= x
.has_int64value_
: return 0
869 if self
.has_int64value_
and self
.int64value_
!= x
.int64value_
: return 0
870 if self
.has_booleanvalue_
!= x
.has_booleanvalue_
: return 0
871 if self
.has_booleanvalue_
and self
.booleanvalue_
!= x
.booleanvalue_
: return 0
872 if self
.has_stringvalue_
!= x
.has_stringvalue_
: return 0
873 if self
.has_stringvalue_
and self
.stringvalue_
!= x
.stringvalue_
: return 0
874 if self
.has_doublevalue_
!= x
.has_doublevalue_
: return 0
875 if self
.has_doublevalue_
and self
.doublevalue_
!= x
.doublevalue_
: return 0
876 if self
.has_pointvalue_
!= x
.has_pointvalue_
: return 0
877 if self
.has_pointvalue_
and self
.pointvalue_
!= x
.pointvalue_
: return 0
878 if self
.has_uservalue_
!= x
.has_uservalue_
: return 0
879 if self
.has_uservalue_
and self
.uservalue_
!= x
.uservalue_
: return 0
880 if self
.has_referencevalue_
!= x
.has_referencevalue_
: return 0
881 if self
.has_referencevalue_
and self
.referencevalue_
!= x
.referencevalue_
: return 0
884 def IsInitialized(self
, debug_strs
=None):
886 if (self
.has_pointvalue_
and not self
.pointvalue_
.IsInitialized(debug_strs
)): initialized
= 0
887 if (self
.has_uservalue_
and not self
.uservalue_
.IsInitialized(debug_strs
)): initialized
= 0
888 if (self
.has_referencevalue_
and not self
.referencevalue_
.IsInitialized(debug_strs
)): initialized
= 0
893 if (self
.has_int64value_
): n
+= 1 + self
.lengthVarInt64(self
.int64value_
)
894 if (self
.has_booleanvalue_
): n
+= 2
895 if (self
.has_stringvalue_
): n
+= 1 + self
.lengthString(len(self
.stringvalue_
))
896 if (self
.has_doublevalue_
): n
+= 9
897 if (self
.has_pointvalue_
): n
+= 2 + self
.pointvalue_
.ByteSize()
898 if (self
.has_uservalue_
): n
+= 2 + self
.uservalue_
.ByteSize()
899 if (self
.has_referencevalue_
): n
+= 2 + self
.referencevalue_
.ByteSize()
902 def ByteSizePartial(self
):
904 if (self
.has_int64value_
): n
+= 1 + self
.lengthVarInt64(self
.int64value_
)
905 if (self
.has_booleanvalue_
): n
+= 2
906 if (self
.has_stringvalue_
): n
+= 1 + self
.lengthString(len(self
.stringvalue_
))
907 if (self
.has_doublevalue_
): n
+= 9
908 if (self
.has_pointvalue_
): n
+= 2 + self
.pointvalue_
.ByteSizePartial()
909 if (self
.has_uservalue_
): n
+= 2 + self
.uservalue_
.ByteSizePartial()
910 if (self
.has_referencevalue_
): n
+= 2 + self
.referencevalue_
.ByteSizePartial()
914 self
.clear_int64value()
915 self
.clear_booleanvalue()
916 self
.clear_stringvalue()
917 self
.clear_doublevalue()
918 self
.clear_pointvalue()
919 self
.clear_uservalue()
920 self
.clear_referencevalue()
922 def OutputUnchecked(self
, out
):
923 if (self
.has_int64value_
):
925 out
.putVarInt64(self
.int64value_
)
926 if (self
.has_booleanvalue_
):
928 out
.putBoolean(self
.booleanvalue_
)
929 if (self
.has_stringvalue_
):
931 out
.putPrefixedString(self
.stringvalue_
)
932 if (self
.has_doublevalue_
):
934 out
.putDouble(self
.doublevalue_
)
935 if (self
.has_pointvalue_
):
937 self
.pointvalue_
.OutputUnchecked(out
)
939 if (self
.has_uservalue_
):
941 self
.uservalue_
.OutputUnchecked(out
)
943 if (self
.has_referencevalue_
):
945 self
.referencevalue_
.OutputUnchecked(out
)
948 def OutputPartial(self
, out
):
949 if (self
.has_int64value_
):
951 out
.putVarInt64(self
.int64value_
)
952 if (self
.has_booleanvalue_
):
954 out
.putBoolean(self
.booleanvalue_
)
955 if (self
.has_stringvalue_
):
957 out
.putPrefixedString(self
.stringvalue_
)
958 if (self
.has_doublevalue_
):
960 out
.putDouble(self
.doublevalue_
)
961 if (self
.has_pointvalue_
):
963 self
.pointvalue_
.OutputPartial(out
)
965 if (self
.has_uservalue_
):
967 self
.uservalue_
.OutputPartial(out
)
969 if (self
.has_referencevalue_
):
971 self
.referencevalue_
.OutputPartial(out
)
974 def TryMerge(self
, d
):
978 self
.set_int64value(d
.getVarInt64())
981 self
.set_booleanvalue(d
.getBoolean())
984 self
.set_stringvalue(d
.getPrefixedString())
987 self
.set_doublevalue(d
.getDouble())
990 self
.mutable_pointvalue().TryMerge(d
)
993 self
.mutable_uservalue().TryMerge(d
)
996 self
.mutable_referencevalue().TryMerge(d
)
1000 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1004 def __str__(self
, prefix
="", printElemNumber
=0):
1006 if self
.has_int64value_
: res
+=prefix
+("int64Value: %s\n" % self
.DebugFormatInt64(self
.int64value_
))
1007 if self
.has_booleanvalue_
: res
+=prefix
+("booleanValue: %s\n" % self
.DebugFormatBool(self
.booleanvalue_
))
1008 if self
.has_stringvalue_
: res
+=prefix
+("stringValue: %s\n" % self
.DebugFormatString(self
.stringvalue_
))
1009 if self
.has_doublevalue_
: res
+=prefix
+("doubleValue: %s\n" % self
.DebugFormat(self
.doublevalue_
))
1010 if self
.has_pointvalue_
:
1011 res
+=prefix
+"PointValue {\n"
1012 res
+=self
.pointvalue_
.__str
__(prefix
+ " ", printElemNumber
)
1014 if self
.has_uservalue_
:
1015 res
+=prefix
+"UserValue {\n"
1016 res
+=self
.uservalue_
.__str
__(prefix
+ " ", printElemNumber
)
1018 if self
.has_referencevalue_
:
1019 res
+=prefix
+"ReferenceValue {\n"
1020 res
+=self
.referencevalue_
.__str
__(prefix
+ " ", printElemNumber
)
1025 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1026 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1032 kPointValueGroup
= 5
1037 kUserValueauth_domain
= 10
1038 kUserValuenickname
= 11
1039 kUserValuegaiaid
= 18
1040 kUserValueobfuscated_gaiaid
= 19
1041 kUserValuefederated_identity
= 21
1042 kUserValuefederated_provider
= 22
1043 kReferenceValueGroup
= 12
1044 kReferenceValueapp
= 13
1045 kReferenceValuename_space
= 20
1046 kReferenceValuePathElementGroup
= 14
1047 kReferenceValuePathElementtype
= 15
1048 kReferenceValuePathElementid
= 16
1049 kReferenceValuePathElementname
= 17
1051 _TEXT
= _BuildTagLookupTable({
1064 12: "ReferenceValue",
1071 19: "obfuscated_gaiaid",
1073 21: "federated_identity",
1074 22: "federated_provider",
1077 _TYPES
= _BuildTagLookupTable({
1078 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1079 1: ProtocolBuffer
.Encoder
.NUMERIC
,
1080 2: ProtocolBuffer
.Encoder
.NUMERIC
,
1081 3: ProtocolBuffer
.Encoder
.STRING
,
1082 4: ProtocolBuffer
.Encoder
.DOUBLE
,
1083 5: ProtocolBuffer
.Encoder
.STARTGROUP
,
1084 6: ProtocolBuffer
.Encoder
.DOUBLE
,
1085 7: ProtocolBuffer
.Encoder
.DOUBLE
,
1086 8: ProtocolBuffer
.Encoder
.STARTGROUP
,
1087 9: ProtocolBuffer
.Encoder
.STRING
,
1088 10: ProtocolBuffer
.Encoder
.STRING
,
1089 11: ProtocolBuffer
.Encoder
.STRING
,
1090 12: ProtocolBuffer
.Encoder
.STARTGROUP
,
1091 13: ProtocolBuffer
.Encoder
.STRING
,
1092 14: ProtocolBuffer
.Encoder
.STARTGROUP
,
1093 15: ProtocolBuffer
.Encoder
.STRING
,
1094 16: ProtocolBuffer
.Encoder
.NUMERIC
,
1095 17: ProtocolBuffer
.Encoder
.STRING
,
1096 18: ProtocolBuffer
.Encoder
.NUMERIC
,
1097 19: ProtocolBuffer
.Encoder
.STRING
,
1098 20: ProtocolBuffer
.Encoder
.STRING
,
1099 21: ProtocolBuffer
.Encoder
.STRING
,
1100 22: ProtocolBuffer
.Encoder
.STRING
,
1101 }, 22, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1105 _STYLE_CONTENT_TYPE
= """"""
1106 _PROTO_DESCRIPTOR_NAME
= 'storage_onestore_v3.PropertyValue'
1107 class Property(ProtocolBuffer
.ProtocolMessage
):
1125 GD_POSTALADDRESS
= 12
1146 11: "GD_PHONENUMBER",
1147 12: "GD_POSTALADDRESS",
1154 def Meaning_Name(cls
, x
): return cls
._Meaning
_NAMES
.get(x
, "")
1155 Meaning_Name
= classmethod(Meaning_Name
)
1162 _FtsTokenizationOption_NAMES
= {
1167 def FtsTokenizationOption_Name(cls
, x
): return cls
._FtsTokenizationOption
_NAMES
.get(x
, "")
1168 FtsTokenizationOption_Name
= classmethod(FtsTokenizationOption_Name
)
1172 has_meaning_uri_
= 0
1181 has_fts_tokenization_option_
= 0
1182 fts_tokenization_option_
= 0
1186 def __init__(self
, contents
=None):
1187 self
.value_
= PropertyValue()
1188 if contents
is not None: self
.MergeFromString(contents
)
1190 def meaning(self
): return self
.meaning_
1192 def set_meaning(self
, x
):
1193 self
.has_meaning_
= 1
1196 def clear_meaning(self
):
1197 if self
.has_meaning_
:
1198 self
.has_meaning_
= 0
1201 def has_meaning(self
): return self
.has_meaning_
1203 def meaning_uri(self
): return self
.meaning_uri_
1205 def set_meaning_uri(self
, x
):
1206 self
.has_meaning_uri_
= 1
1207 self
.meaning_uri_
= x
1209 def clear_meaning_uri(self
):
1210 if self
.has_meaning_uri_
:
1211 self
.has_meaning_uri_
= 0
1212 self
.meaning_uri_
= ""
1214 def has_meaning_uri(self
): return self
.has_meaning_uri_
1216 def name(self
): return self
.name_
1218 def set_name(self
, x
):
1222 def clear_name(self
):
1227 def has_name(self
): return self
.has_name_
1229 def value(self
): return self
.value_
1231 def mutable_value(self
): self
.has_value_
= 1; return self
.value_
1233 def clear_value(self
):self
.has_value_
= 0; self
.value_
.Clear()
1235 def has_value(self
): return self
.has_value_
1237 def multiple(self
): return self
.multiple_
1239 def set_multiple(self
, x
):
1240 self
.has_multiple_
= 1
1243 def clear_multiple(self
):
1244 if self
.has_multiple_
:
1245 self
.has_multiple_
= 0
1248 def has_multiple(self
): return self
.has_multiple_
1250 def searchable(self
): return self
.searchable_
1252 def set_searchable(self
, x
):
1253 self
.has_searchable_
= 1
1254 self
.searchable_
= x
1256 def clear_searchable(self
):
1257 if self
.has_searchable_
:
1258 self
.has_searchable_
= 0
1259 self
.searchable_
= 0
1261 def has_searchable(self
): return self
.has_searchable_
1263 def fts_tokenization_option(self
): return self
.fts_tokenization_option_
1265 def set_fts_tokenization_option(self
, x
):
1266 self
.has_fts_tokenization_option_
= 1
1267 self
.fts_tokenization_option_
= x
1269 def clear_fts_tokenization_option(self
):
1270 if self
.has_fts_tokenization_option_
:
1271 self
.has_fts_tokenization_option_
= 0
1272 self
.fts_tokenization_option_
= 0
1274 def has_fts_tokenization_option(self
): return self
.has_fts_tokenization_option_
1276 def locale(self
): return self
.locale_
1278 def set_locale(self
, x
):
1279 self
.has_locale_
= 1
1282 def clear_locale(self
):
1283 if self
.has_locale_
:
1284 self
.has_locale_
= 0
1287 def has_locale(self
): return self
.has_locale_
1290 def MergeFrom(self
, x
):
1291 assert x
is not self
1292 if (x
.has_meaning()): self
.set_meaning(x
.meaning())
1293 if (x
.has_meaning_uri()): self
.set_meaning_uri(x
.meaning_uri())
1294 if (x
.has_name()): self
.set_name(x
.name())
1295 if (x
.has_value()): self
.mutable_value().MergeFrom(x
.value())
1296 if (x
.has_multiple()): self
.set_multiple(x
.multiple())
1297 if (x
.has_searchable()): self
.set_searchable(x
.searchable())
1298 if (x
.has_fts_tokenization_option()): self
.set_fts_tokenization_option(x
.fts_tokenization_option())
1299 if (x
.has_locale()): self
.set_locale(x
.locale())
1301 def Equals(self
, x
):
1302 if x
is self
: return 1
1303 if self
.has_meaning_
!= x
.has_meaning_
: return 0
1304 if self
.has_meaning_
and self
.meaning_
!= x
.meaning_
: return 0
1305 if self
.has_meaning_uri_
!= x
.has_meaning_uri_
: return 0
1306 if self
.has_meaning_uri_
and self
.meaning_uri_
!= x
.meaning_uri_
: return 0
1307 if self
.has_name_
!= x
.has_name_
: return 0
1308 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
1309 if self
.has_value_
!= x
.has_value_
: return 0
1310 if self
.has_value_
and self
.value_
!= x
.value_
: return 0
1311 if self
.has_multiple_
!= x
.has_multiple_
: return 0
1312 if self
.has_multiple_
and self
.multiple_
!= x
.multiple_
: return 0
1313 if self
.has_searchable_
!= x
.has_searchable_
: return 0
1314 if self
.has_searchable_
and self
.searchable_
!= x
.searchable_
: return 0
1315 if self
.has_fts_tokenization_option_
!= x
.has_fts_tokenization_option_
: return 0
1316 if self
.has_fts_tokenization_option_
and self
.fts_tokenization_option_
!= x
.fts_tokenization_option_
: return 0
1317 if self
.has_locale_
!= x
.has_locale_
: return 0
1318 if self
.has_locale_
and self
.locale_
!= x
.locale_
: return 0
1321 def IsInitialized(self
, debug_strs
=None):
1323 if (not self
.has_name_
):
1325 if debug_strs
is not None:
1326 debug_strs
.append('Required field: name not set.')
1327 if (not self
.has_value_
):
1329 if debug_strs
is not None:
1330 debug_strs
.append('Required field: value not set.')
1331 elif not self
.value_
.IsInitialized(debug_strs
): initialized
= 0
1332 if (not self
.has_multiple_
):
1334 if debug_strs
is not None:
1335 debug_strs
.append('Required field: multiple not set.')
1340 if (self
.has_meaning_
): n
+= 1 + self
.lengthVarInt64(self
.meaning_
)
1341 if (self
.has_meaning_uri_
): n
+= 1 + self
.lengthString(len(self
.meaning_uri_
))
1342 n
+= self
.lengthString(len(self
.name_
))
1343 n
+= self
.lengthString(self
.value_
.ByteSize())
1344 if (self
.has_searchable_
): n
+= 2
1345 if (self
.has_fts_tokenization_option_
): n
+= 1 + self
.lengthVarInt64(self
.fts_tokenization_option_
)
1346 if (self
.has_locale_
): n
+= 1 + self
.lengthString(len(self
.locale_
))
1349 def ByteSizePartial(self
):
1351 if (self
.has_meaning_
): n
+= 1 + self
.lengthVarInt64(self
.meaning_
)
1352 if (self
.has_meaning_uri_
): n
+= 1 + self
.lengthString(len(self
.meaning_uri_
))
1353 if (self
.has_name_
):
1355 n
+= self
.lengthString(len(self
.name_
))
1356 if (self
.has_value_
):
1358 n
+= self
.lengthString(self
.value_
.ByteSizePartial())
1359 if (self
.has_multiple_
):
1361 if (self
.has_searchable_
): n
+= 2
1362 if (self
.has_fts_tokenization_option_
): n
+= 1 + self
.lengthVarInt64(self
.fts_tokenization_option_
)
1363 if (self
.has_locale_
): n
+= 1 + self
.lengthString(len(self
.locale_
))
1367 self
.clear_meaning()
1368 self
.clear_meaning_uri()
1371 self
.clear_multiple()
1372 self
.clear_searchable()
1373 self
.clear_fts_tokenization_option()
1376 def OutputUnchecked(self
, out
):
1377 if (self
.has_meaning_
):
1379 out
.putVarInt32(self
.meaning_
)
1380 if (self
.has_meaning_uri_
):
1382 out
.putPrefixedString(self
.meaning_uri_
)
1384 out
.putPrefixedString(self
.name_
)
1386 out
.putBoolean(self
.multiple_
)
1388 out
.putVarInt32(self
.value_
.ByteSize())
1389 self
.value_
.OutputUnchecked(out
)
1390 if (self
.has_searchable_
):
1392 out
.putBoolean(self
.searchable_
)
1393 if (self
.has_fts_tokenization_option_
):
1395 out
.putVarInt32(self
.fts_tokenization_option_
)
1396 if (self
.has_locale_
):
1398 out
.putPrefixedString(self
.locale_
)
1400 def OutputPartial(self
, out
):
1401 if (self
.has_meaning_
):
1403 out
.putVarInt32(self
.meaning_
)
1404 if (self
.has_meaning_uri_
):
1406 out
.putPrefixedString(self
.meaning_uri_
)
1407 if (self
.has_name_
):
1409 out
.putPrefixedString(self
.name_
)
1410 if (self
.has_multiple_
):
1412 out
.putBoolean(self
.multiple_
)
1413 if (self
.has_value_
):
1415 out
.putVarInt32(self
.value_
.ByteSizePartial())
1416 self
.value_
.OutputPartial(out
)
1417 if (self
.has_searchable_
):
1419 out
.putBoolean(self
.searchable_
)
1420 if (self
.has_fts_tokenization_option_
):
1422 out
.putVarInt32(self
.fts_tokenization_option_
)
1423 if (self
.has_locale_
):
1425 out
.putPrefixedString(self
.locale_
)
1427 def TryMerge(self
, d
):
1428 while d
.avail() > 0:
1429 tt
= d
.getVarInt32()
1431 self
.set_meaning(d
.getVarInt32())
1434 self
.set_meaning_uri(d
.getPrefixedString())
1437 self
.set_name(d
.getPrefixedString())
1440 self
.set_multiple(d
.getBoolean())
1443 length
= d
.getVarInt32()
1444 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1446 self
.mutable_value().TryMerge(tmp
)
1449 self
.set_searchable(d
.getBoolean())
1452 self
.set_fts_tokenization_option(d
.getVarInt32())
1455 self
.set_locale(d
.getPrefixedString())
1459 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1463 def __str__(self
, prefix
="", printElemNumber
=0):
1465 if self
.has_meaning_
: res
+=prefix
+("meaning: %s\n" % self
.DebugFormatInt32(self
.meaning_
))
1466 if self
.has_meaning_uri_
: res
+=prefix
+("meaning_uri: %s\n" % self
.DebugFormatString(self
.meaning_uri_
))
1467 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
1469 res
+=prefix
+"value <\n"
1470 res
+=self
.value_
.__str
__(prefix
+ " ", printElemNumber
)
1472 if self
.has_multiple_
: res
+=prefix
+("multiple: %s\n" % self
.DebugFormatBool(self
.multiple_
))
1473 if self
.has_searchable_
: res
+=prefix
+("searchable: %s\n" % self
.DebugFormatBool(self
.searchable_
))
1474 if self
.has_fts_tokenization_option_
: res
+=prefix
+("fts_tokenization_option: %s\n" % self
.DebugFormatInt32(self
.fts_tokenization_option_
))
1475 if self
.has_locale_
: res
+=prefix
+("locale: %s\n" % self
.DebugFormatString(self
.locale_
))
1479 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1480 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1488 kfts_tokenization_option
= 8
1491 _TEXT
= _BuildTagLookupTable({
1499 8: "fts_tokenization_option",
1503 _TYPES
= _BuildTagLookupTable({
1504 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1505 1: ProtocolBuffer
.Encoder
.NUMERIC
,
1506 2: ProtocolBuffer
.Encoder
.STRING
,
1507 3: ProtocolBuffer
.Encoder
.STRING
,
1508 4: ProtocolBuffer
.Encoder
.NUMERIC
,
1509 5: ProtocolBuffer
.Encoder
.STRING
,
1510 6: ProtocolBuffer
.Encoder
.NUMERIC
,
1511 8: ProtocolBuffer
.Encoder
.NUMERIC
,
1512 9: ProtocolBuffer
.Encoder
.STRING
,
1513 }, 9, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1517 _STYLE_CONTENT_TYPE
= """"""
1518 _PROTO_DESCRIPTOR_NAME
= 'storage_onestore_v3.Property'
1519 class Path_Element(ProtocolBuffer
.ProtocolMessage
):
1527 def __init__(self
, contents
=None):
1528 if contents
is not None: self
.MergeFromString(contents
)
1530 def type(self
): return self
.type_
1532 def set_type(self
, x
):
1536 def clear_type(self
):
1541 def has_type(self
): return self
.has_type_
1543 def id(self
): return self
.id_
1545 def set_id(self
, x
):
1554 def has_id(self
): return self
.has_id_
1556 def name(self
): return self
.name_
1558 def set_name(self
, x
):
1562 def clear_name(self
):
1567 def has_name(self
): return self
.has_name_
1570 def MergeFrom(self
, x
):
1571 assert x
is not self
1572 if (x
.has_type()): self
.set_type(x
.type())
1573 if (x
.has_id()): self
.set_id(x
.id())
1574 if (x
.has_name()): self
.set_name(x
.name())
1576 def Equals(self
, x
):
1577 if x
is self
: return 1
1578 if self
.has_type_
!= x
.has_type_
: return 0
1579 if self
.has_type_
and self
.type_
!= x
.type_
: return 0
1580 if self
.has_id_
!= x
.has_id_
: return 0
1581 if self
.has_id_
and self
.id_
!= x
.id_
: return 0
1582 if self
.has_name_
!= x
.has_name_
: return 0
1583 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
1586 def IsInitialized(self
, debug_strs
=None):
1588 if (not self
.has_type_
):
1590 if debug_strs
is not None:
1591 debug_strs
.append('Required field: type not set.')
1596 n
+= self
.lengthString(len(self
.type_
))
1597 if (self
.has_id_
): n
+= 1 + self
.lengthVarInt64(self
.id_
)
1598 if (self
.has_name_
): n
+= 1 + self
.lengthString(len(self
.name_
))
1601 def ByteSizePartial(self
):
1603 if (self
.has_type_
):
1605 n
+= self
.lengthString(len(self
.type_
))
1606 if (self
.has_id_
): n
+= 1 + self
.lengthVarInt64(self
.id_
)
1607 if (self
.has_name_
): n
+= 1 + self
.lengthString(len(self
.name_
))
1615 def OutputUnchecked(self
, out
):
1617 out
.putPrefixedString(self
.type_
)
1620 out
.putVarInt64(self
.id_
)
1621 if (self
.has_name_
):
1623 out
.putPrefixedString(self
.name_
)
1625 def OutputPartial(self
, out
):
1626 if (self
.has_type_
):
1628 out
.putPrefixedString(self
.type_
)
1631 out
.putVarInt64(self
.id_
)
1632 if (self
.has_name_
):
1634 out
.putPrefixedString(self
.name_
)
1636 def TryMerge(self
, d
):
1638 tt
= d
.getVarInt32()
1641 self
.set_type(d
.getPrefixedString())
1644 self
.set_id(d
.getVarInt64())
1647 self
.set_name(d
.getPrefixedString())
1651 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1655 def __str__(self
, prefix
="", printElemNumber
=0):
1657 if self
.has_type_
: res
+=prefix
+("type: %s\n" % self
.DebugFormatString(self
.type_
))
1658 if self
.has_id_
: res
+=prefix
+("id: %s\n" % self
.DebugFormatInt64(self
.id_
))
1659 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
1662 class Path(ProtocolBuffer
.ProtocolMessage
):
1664 def __init__(self
, contents
=None):
1666 if contents
is not None: self
.MergeFromString(contents
)
1668 def element_size(self
): return len(self
.element_
)
1669 def element_list(self
): return self
.element_
1671 def element(self
, i
):
1672 return self
.element_
[i
]
1674 def mutable_element(self
, i
):
1675 return self
.element_
[i
]
1677 def add_element(self
):
1679 self
.element_
.append(x
)
1682 def clear_element(self
):
1685 def MergeFrom(self
, x
):
1686 assert x
is not self
1687 for i
in xrange(x
.element_size()): self
.add_element().CopyFrom(x
.element(i
))
1689 def Equals(self
, x
):
1690 if x
is self
: return 1
1691 if len(self
.element_
) != len(x
.element_
): return 0
1692 for e1
, e2
in zip(self
.element_
, x
.element_
):
1693 if e1
!= e2
: return 0
1696 def IsInitialized(self
, debug_strs
=None):
1698 for p
in self
.element_
:
1699 if not p
.IsInitialized(debug_strs
): initialized
=0
1704 n
+= 2 * len(self
.element_
)
1705 for i
in xrange(len(self
.element_
)): n
+= self
.element_
[i
].ByteSize()
1708 def ByteSizePartial(self
):
1710 n
+= 2 * len(self
.element_
)
1711 for i
in xrange(len(self
.element_
)): n
+= self
.element_
[i
].ByteSizePartial()
1715 self
.clear_element()
1717 def OutputUnchecked(self
, out
):
1718 for i
in xrange(len(self
.element_
)):
1720 self
.element_
[i
].OutputUnchecked(out
)
1723 def OutputPartial(self
, out
):
1724 for i
in xrange(len(self
.element_
)):
1726 self
.element_
[i
].OutputPartial(out
)
1729 def TryMerge(self
, d
):
1730 while d
.avail() > 0:
1731 tt
= d
.getVarInt32()
1733 self
.add_element().TryMerge(d
)
1737 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1741 def __str__(self
, prefix
="", printElemNumber
=0):
1744 for e
in self
.element_
:
1746 if printElemNumber
: elm
="(%d)" % cnt
1747 res
+=prefix
+("Element%s {\n" % elm
)
1748 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
1754 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1755 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1762 _TEXT
= _BuildTagLookupTable({
1770 _TYPES
= _BuildTagLookupTable({
1771 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1772 1: ProtocolBuffer
.Encoder
.STARTGROUP
,
1773 2: ProtocolBuffer
.Encoder
.STRING
,
1774 3: ProtocolBuffer
.Encoder
.NUMERIC
,
1775 4: ProtocolBuffer
.Encoder
.STRING
,
1776 }, 4, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1780 _STYLE_CONTENT_TYPE
= """"""
1781 _PROTO_DESCRIPTOR_NAME
= 'storage_onestore_v3.Path'
1782 class Reference(ProtocolBuffer
.ProtocolMessage
):
1789 def __init__(self
, contents
=None):
1791 if contents
is not None: self
.MergeFromString(contents
)
1793 def app(self
): return self
.app_
1795 def set_app(self
, x
):
1799 def clear_app(self
):
1804 def has_app(self
): return self
.has_app_
1806 def name_space(self
): return self
.name_space_
1808 def set_name_space(self
, x
):
1809 self
.has_name_space_
= 1
1810 self
.name_space_
= x
1812 def clear_name_space(self
):
1813 if self
.has_name_space_
:
1814 self
.has_name_space_
= 0
1815 self
.name_space_
= ""
1817 def has_name_space(self
): return self
.has_name_space_
1819 def path(self
): return self
.path_
1821 def mutable_path(self
): self
.has_path_
= 1; return self
.path_
1823 def clear_path(self
):self
.has_path_
= 0; self
.path_
.Clear()
1825 def has_path(self
): return self
.has_path_
1828 def MergeFrom(self
, x
):
1829 assert x
is not self
1830 if (x
.has_app()): self
.set_app(x
.app())
1831 if (x
.has_name_space()): self
.set_name_space(x
.name_space())
1832 if (x
.has_path()): self
.mutable_path().MergeFrom(x
.path())
1834 def Equals(self
, x
):
1835 if x
is self
: return 1
1836 if self
.has_app_
!= x
.has_app_
: return 0
1837 if self
.has_app_
and self
.app_
!= x
.app_
: return 0
1838 if self
.has_name_space_
!= x
.has_name_space_
: return 0
1839 if self
.has_name_space_
and self
.name_space_
!= x
.name_space_
: return 0
1840 if self
.has_path_
!= x
.has_path_
: return 0
1841 if self
.has_path_
and self
.path_
!= x
.path_
: return 0
1844 def IsInitialized(self
, debug_strs
=None):
1846 if (not self
.has_app_
):
1848 if debug_strs
is not None:
1849 debug_strs
.append('Required field: app not set.')
1850 if (not self
.has_path_
):
1852 if debug_strs
is not None:
1853 debug_strs
.append('Required field: path not set.')
1854 elif not self
.path_
.IsInitialized(debug_strs
): initialized
= 0
1859 n
+= self
.lengthString(len(self
.app_
))
1860 if (self
.has_name_space_
): n
+= 2 + self
.lengthString(len(self
.name_space_
))
1861 n
+= self
.lengthString(self
.path_
.ByteSize())
1864 def ByteSizePartial(self
):
1868 n
+= self
.lengthString(len(self
.app_
))
1869 if (self
.has_name_space_
): n
+= 2 + self
.lengthString(len(self
.name_space_
))
1870 if (self
.has_path_
):
1872 n
+= self
.lengthString(self
.path_
.ByteSizePartial())
1877 self
.clear_name_space()
1880 def OutputUnchecked(self
, out
):
1881 out
.putVarInt32(106)
1882 out
.putPrefixedString(self
.app_
)
1883 out
.putVarInt32(114)
1884 out
.putVarInt32(self
.path_
.ByteSize())
1885 self
.path_
.OutputUnchecked(out
)
1886 if (self
.has_name_space_
):
1887 out
.putVarInt32(162)
1888 out
.putPrefixedString(self
.name_space_
)
1890 def OutputPartial(self
, out
):
1892 out
.putVarInt32(106)
1893 out
.putPrefixedString(self
.app_
)
1894 if (self
.has_path_
):
1895 out
.putVarInt32(114)
1896 out
.putVarInt32(self
.path_
.ByteSizePartial())
1897 self
.path_
.OutputPartial(out
)
1898 if (self
.has_name_space_
):
1899 out
.putVarInt32(162)
1900 out
.putPrefixedString(self
.name_space_
)
1902 def TryMerge(self
, d
):
1903 while d
.avail() > 0:
1904 tt
= d
.getVarInt32()
1906 self
.set_app(d
.getPrefixedString())
1909 length
= d
.getVarInt32()
1910 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
1912 self
.mutable_path().TryMerge(tmp
)
1915 self
.set_name_space(d
.getPrefixedString())
1919 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1923 def __str__(self
, prefix
="", printElemNumber
=0):
1925 if self
.has_app_
: res
+=prefix
+("app: %s\n" % self
.DebugFormatString(self
.app_
))
1926 if self
.has_name_space_
: res
+=prefix
+("name_space: %s\n" % self
.DebugFormatString(self
.name_space_
))
1928 res
+=prefix
+"path <\n"
1929 res
+=self
.path_
.__str
__(prefix
+ " ", printElemNumber
)
1934 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1935 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1941 _TEXT
= _BuildTagLookupTable({
1948 _TYPES
= _BuildTagLookupTable({
1949 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1950 13: ProtocolBuffer
.Encoder
.STRING
,
1951 14: ProtocolBuffer
.Encoder
.STRING
,
1952 20: ProtocolBuffer
.Encoder
.STRING
,
1953 }, 20, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1957 _STYLE_CONTENT_TYPE
= """"""
1958 _PROTO_DESCRIPTOR_NAME
= 'storage_onestore_v3.Reference'
1959 class User(ProtocolBuffer
.ProtocolMessage
):
1962 has_auth_domain_
= 0
1968 has_obfuscated_gaiaid_
= 0
1969 obfuscated_gaiaid_
= ""
1970 has_federated_identity_
= 0
1971 federated_identity_
= ""
1972 has_federated_provider_
= 0
1973 federated_provider_
= ""
1975 def __init__(self
, contents
=None):
1976 if contents
is not None: self
.MergeFromString(contents
)
1978 def email(self
): return self
.email_
1980 def set_email(self
, x
):
1984 def clear_email(self
):
1989 def has_email(self
): return self
.has_email_
1991 def auth_domain(self
): return self
.auth_domain_
1993 def set_auth_domain(self
, x
):
1994 self
.has_auth_domain_
= 1
1995 self
.auth_domain_
= x
1997 def clear_auth_domain(self
):
1998 if self
.has_auth_domain_
:
1999 self
.has_auth_domain_
= 0
2000 self
.auth_domain_
= ""
2002 def has_auth_domain(self
): return self
.has_auth_domain_
2004 def nickname(self
): return self
.nickname_
2006 def set_nickname(self
, x
):
2007 self
.has_nickname_
= 1
2010 def clear_nickname(self
):
2011 if self
.has_nickname_
:
2012 self
.has_nickname_
= 0
2015 def has_nickname(self
): return self
.has_nickname_
2017 def gaiaid(self
): return self
.gaiaid_
2019 def set_gaiaid(self
, x
):
2020 self
.has_gaiaid_
= 1
2023 def clear_gaiaid(self
):
2024 if self
.has_gaiaid_
:
2025 self
.has_gaiaid_
= 0
2028 def has_gaiaid(self
): return self
.has_gaiaid_
2030 def obfuscated_gaiaid(self
): return self
.obfuscated_gaiaid_
2032 def set_obfuscated_gaiaid(self
, x
):
2033 self
.has_obfuscated_gaiaid_
= 1
2034 self
.obfuscated_gaiaid_
= x
2036 def clear_obfuscated_gaiaid(self
):
2037 if self
.has_obfuscated_gaiaid_
:
2038 self
.has_obfuscated_gaiaid_
= 0
2039 self
.obfuscated_gaiaid_
= ""
2041 def has_obfuscated_gaiaid(self
): return self
.has_obfuscated_gaiaid_
2043 def federated_identity(self
): return self
.federated_identity_
2045 def set_federated_identity(self
, x
):
2046 self
.has_federated_identity_
= 1
2047 self
.federated_identity_
= x
2049 def clear_federated_identity(self
):
2050 if self
.has_federated_identity_
:
2051 self
.has_federated_identity_
= 0
2052 self
.federated_identity_
= ""
2054 def has_federated_identity(self
): return self
.has_federated_identity_
2056 def federated_provider(self
): return self
.federated_provider_
2058 def set_federated_provider(self
, x
):
2059 self
.has_federated_provider_
= 1
2060 self
.federated_provider_
= x
2062 def clear_federated_provider(self
):
2063 if self
.has_federated_provider_
:
2064 self
.has_federated_provider_
= 0
2065 self
.federated_provider_
= ""
2067 def has_federated_provider(self
): return self
.has_federated_provider_
2070 def MergeFrom(self
, x
):
2071 assert x
is not self
2072 if (x
.has_email()): self
.set_email(x
.email())
2073 if (x
.has_auth_domain()): self
.set_auth_domain(x
.auth_domain())
2074 if (x
.has_nickname()): self
.set_nickname(x
.nickname())
2075 if (x
.has_gaiaid()): self
.set_gaiaid(x
.gaiaid())
2076 if (x
.has_obfuscated_gaiaid()): self
.set_obfuscated_gaiaid(x
.obfuscated_gaiaid())
2077 if (x
.has_federated_identity()): self
.set_federated_identity(x
.federated_identity())
2078 if (x
.has_federated_provider()): self
.set_federated_provider(x
.federated_provider())
2080 def Equals(self
, x
):
2081 if x
is self
: return 1
2082 if self
.has_email_
!= x
.has_email_
: return 0
2083 if self
.has_email_
and self
.email_
!= x
.email_
: return 0
2084 if self
.has_auth_domain_
!= x
.has_auth_domain_
: return 0
2085 if self
.has_auth_domain_
and self
.auth_domain_
!= x
.auth_domain_
: return 0
2086 if self
.has_nickname_
!= x
.has_nickname_
: return 0
2087 if self
.has_nickname_
and self
.nickname_
!= x
.nickname_
: return 0
2088 if self
.has_gaiaid_
!= x
.has_gaiaid_
: return 0
2089 if self
.has_gaiaid_
and self
.gaiaid_
!= x
.gaiaid_
: return 0
2090 if self
.has_obfuscated_gaiaid_
!= x
.has_obfuscated_gaiaid_
: return 0
2091 if self
.has_obfuscated_gaiaid_
and self
.obfuscated_gaiaid_
!= x
.obfuscated_gaiaid_
: return 0
2092 if self
.has_federated_identity_
!= x
.has_federated_identity_
: return 0
2093 if self
.has_federated_identity_
and self
.federated_identity_
!= x
.federated_identity_
: return 0
2094 if self
.has_federated_provider_
!= x
.has_federated_provider_
: return 0
2095 if self
.has_federated_provider_
and self
.federated_provider_
!= x
.federated_provider_
: return 0
2098 def IsInitialized(self
, debug_strs
=None):
2100 if (not self
.has_email_
):
2102 if debug_strs
is not None:
2103 debug_strs
.append('Required field: email not set.')
2104 if (not self
.has_auth_domain_
):
2106 if debug_strs
is not None:
2107 debug_strs
.append('Required field: auth_domain not set.')
2108 if (not self
.has_gaiaid_
):
2110 if debug_strs
is not None:
2111 debug_strs
.append('Required field: gaiaid not set.')
2116 n
+= self
.lengthString(len(self
.email_
))
2117 n
+= self
.lengthString(len(self
.auth_domain_
))
2118 if (self
.has_nickname_
): n
+= 1 + self
.lengthString(len(self
.nickname_
))
2119 n
+= self
.lengthVarInt64(self
.gaiaid_
)
2120 if (self
.has_obfuscated_gaiaid_
): n
+= 1 + self
.lengthString(len(self
.obfuscated_gaiaid_
))
2121 if (self
.has_federated_identity_
): n
+= 1 + self
.lengthString(len(self
.federated_identity_
))
2122 if (self
.has_federated_provider_
): n
+= 1 + self
.lengthString(len(self
.federated_provider_
))
2125 def ByteSizePartial(self
):
2127 if (self
.has_email_
):
2129 n
+= self
.lengthString(len(self
.email_
))
2130 if (self
.has_auth_domain_
):
2132 n
+= self
.lengthString(len(self
.auth_domain_
))
2133 if (self
.has_nickname_
): n
+= 1 + self
.lengthString(len(self
.nickname_
))
2134 if (self
.has_gaiaid_
):
2136 n
+= self
.lengthVarInt64(self
.gaiaid_
)
2137 if (self
.has_obfuscated_gaiaid_
): n
+= 1 + self
.lengthString(len(self
.obfuscated_gaiaid_
))
2138 if (self
.has_federated_identity_
): n
+= 1 + self
.lengthString(len(self
.federated_identity_
))
2139 if (self
.has_federated_provider_
): n
+= 1 + self
.lengthString(len(self
.federated_provider_
))
2144 self
.clear_auth_domain()
2145 self
.clear_nickname()
2147 self
.clear_obfuscated_gaiaid()
2148 self
.clear_federated_identity()
2149 self
.clear_federated_provider()
2151 def OutputUnchecked(self
, out
):
2153 out
.putPrefixedString(self
.email_
)
2155 out
.putPrefixedString(self
.auth_domain_
)
2156 if (self
.has_nickname_
):
2158 out
.putPrefixedString(self
.nickname_
)
2160 out
.putVarInt64(self
.gaiaid_
)
2161 if (self
.has_obfuscated_gaiaid_
):
2163 out
.putPrefixedString(self
.obfuscated_gaiaid_
)
2164 if (self
.has_federated_identity_
):
2166 out
.putPrefixedString(self
.federated_identity_
)
2167 if (self
.has_federated_provider_
):
2169 out
.putPrefixedString(self
.federated_provider_
)
2171 def OutputPartial(self
, out
):
2172 if (self
.has_email_
):
2174 out
.putPrefixedString(self
.email_
)
2175 if (self
.has_auth_domain_
):
2177 out
.putPrefixedString(self
.auth_domain_
)
2178 if (self
.has_nickname_
):
2180 out
.putPrefixedString(self
.nickname_
)
2181 if (self
.has_gaiaid_
):
2183 out
.putVarInt64(self
.gaiaid_
)
2184 if (self
.has_obfuscated_gaiaid_
):
2186 out
.putPrefixedString(self
.obfuscated_gaiaid_
)
2187 if (self
.has_federated_identity_
):
2189 out
.putPrefixedString(self
.federated_identity_
)
2190 if (self
.has_federated_provider_
):
2192 out
.putPrefixedString(self
.federated_provider_
)
2194 def TryMerge(self
, d
):
2195 while d
.avail() > 0:
2196 tt
= d
.getVarInt32()
2198 self
.set_email(d
.getPrefixedString())
2201 self
.set_auth_domain(d
.getPrefixedString())
2204 self
.set_nickname(d
.getPrefixedString())
2207 self
.set_gaiaid(d
.getVarInt64())
2210 self
.set_obfuscated_gaiaid(d
.getPrefixedString())
2213 self
.set_federated_identity(d
.getPrefixedString())
2216 self
.set_federated_provider(d
.getPrefixedString())
2220 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2224 def __str__(self
, prefix
="", printElemNumber
=0):
2226 if self
.has_email_
: res
+=prefix
+("email: %s\n" % self
.DebugFormatString(self
.email_
))
2227 if self
.has_auth_domain_
: res
+=prefix
+("auth_domain: %s\n" % self
.DebugFormatString(self
.auth_domain_
))
2228 if self
.has_nickname_
: res
+=prefix
+("nickname: %s\n" % self
.DebugFormatString(self
.nickname_
))
2229 if self
.has_gaiaid_
: res
+=prefix
+("gaiaid: %s\n" % self
.DebugFormatInt64(self
.gaiaid_
))
2230 if self
.has_obfuscated_gaiaid_
: res
+=prefix
+("obfuscated_gaiaid: %s\n" % self
.DebugFormatString(self
.obfuscated_gaiaid_
))
2231 if self
.has_federated_identity_
: res
+=prefix
+("federated_identity: %s\n" % self
.DebugFormatString(self
.federated_identity_
))
2232 if self
.has_federated_provider_
: res
+=prefix
+("federated_provider: %s\n" % self
.DebugFormatString(self
.federated_provider_
))
2236 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2237 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2243 kobfuscated_gaiaid
= 5
2244 kfederated_identity
= 6
2245 kfederated_provider
= 7
2247 _TEXT
= _BuildTagLookupTable({
2253 5: "obfuscated_gaiaid",
2254 6: "federated_identity",
2255 7: "federated_provider",
2258 _TYPES
= _BuildTagLookupTable({
2259 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2260 1: ProtocolBuffer
.Encoder
.STRING
,
2261 2: ProtocolBuffer
.Encoder
.STRING
,
2262 3: ProtocolBuffer
.Encoder
.STRING
,
2263 4: ProtocolBuffer
.Encoder
.NUMERIC
,
2264 5: ProtocolBuffer
.Encoder
.STRING
,
2265 6: ProtocolBuffer
.Encoder
.STRING
,
2266 7: ProtocolBuffer
.Encoder
.STRING
,
2267 }, 7, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2271 _STYLE_CONTENT_TYPE
= """"""
2272 _PROTO_DESCRIPTOR_NAME
= 'storage_onestore_v3.User'
2273 class EntityProto(ProtocolBuffer
.ProtocolMessage
):
2286 def Kind_Name(cls
, x
): return cls
._Kind
_NAMES
.get(x
, "")
2287 Kind_Name
= classmethod(Kind_Name
)
2290 has_entity_group_
= 0
2300 def __init__(self
, contents
=None):
2301 self
.key_
= Reference()
2302 self
.entity_group_
= Path()
2304 self
.raw_property_
= []
2305 self
.lazy_init_lock_
= thread
.allocate_lock()
2306 if contents
is not None: self
.MergeFromString(contents
)
2308 def key(self
): return self
.key_
2310 def mutable_key(self
): self
.has_key_
= 1; return self
.key_
2312 def clear_key(self
):self
.has_key_
= 0; self
.key_
.Clear()
2314 def has_key(self
): return self
.has_key_
2316 def entity_group(self
): return self
.entity_group_
2318 def mutable_entity_group(self
): self
.has_entity_group_
= 1; return self
.entity_group_
2320 def clear_entity_group(self
):self
.has_entity_group_
= 0; self
.entity_group_
.Clear()
2322 def has_entity_group(self
): return self
.has_entity_group_
2325 if self
.owner_
is None:
2326 self
.lazy_init_lock_
.acquire()
2328 if self
.owner_
is None: self
.owner_
= User()
2330 self
.lazy_init_lock_
.release()
2333 def mutable_owner(self
): self
.has_owner_
= 1; return self
.owner()
2335 def clear_owner(self
):
2338 self
.has_owner_
= 0;
2339 if self
.owner_
is not None: self
.owner_
.Clear()
2341 def has_owner(self
): return self
.has_owner_
2343 def kind(self
): return self
.kind_
2345 def set_kind(self
, x
):
2349 def clear_kind(self
):
2354 def has_kind(self
): return self
.has_kind_
2356 def kind_uri(self
): return self
.kind_uri_
2358 def set_kind_uri(self
, x
):
2359 self
.has_kind_uri_
= 1
2362 def clear_kind_uri(self
):
2363 if self
.has_kind_uri_
:
2364 self
.has_kind_uri_
= 0
2367 def has_kind_uri(self
): return self
.has_kind_uri_
2369 def property_size(self
): return len(self
.property_
)
2370 def property_list(self
): return self
.property_
2372 def property(self
, i
):
2373 return self
.property_
[i
]
2375 def mutable_property(self
, i
):
2376 return self
.property_
[i
]
2378 def add_property(self
):
2380 self
.property_
.append(x
)
2383 def clear_property(self
):
2385 def raw_property_size(self
): return len(self
.raw_property_
)
2386 def raw_property_list(self
): return self
.raw_property_
2388 def raw_property(self
, i
):
2389 return self
.raw_property_
[i
]
2391 def mutable_raw_property(self
, i
):
2392 return self
.raw_property_
[i
]
2394 def add_raw_property(self
):
2396 self
.raw_property_
.append(x
)
2399 def clear_raw_property(self
):
2400 self
.raw_property_
= []
2401 def rank(self
): return self
.rank_
2403 def set_rank(self
, x
):
2407 def clear_rank(self
):
2412 def has_rank(self
): return self
.has_rank_
2415 def MergeFrom(self
, x
):
2416 assert x
is not self
2417 if (x
.has_key()): self
.mutable_key().MergeFrom(x
.key())
2418 if (x
.has_entity_group()): self
.mutable_entity_group().MergeFrom(x
.entity_group())
2419 if (x
.has_owner()): self
.mutable_owner().MergeFrom(x
.owner())
2420 if (x
.has_kind()): self
.set_kind(x
.kind())
2421 if (x
.has_kind_uri()): self
.set_kind_uri(x
.kind_uri())
2422 for i
in xrange(x
.property_size()): self
.add_property().CopyFrom(x
.property(i
))
2423 for i
in xrange(x
.raw_property_size()): self
.add_raw_property().CopyFrom(x
.raw_property(i
))
2424 if (x
.has_rank()): self
.set_rank(x
.rank())
2426 def Equals(self
, x
):
2427 if x
is self
: return 1
2428 if self
.has_key_
!= x
.has_key_
: return 0
2429 if self
.has_key_
and self
.key_
!= x
.key_
: return 0
2430 if self
.has_entity_group_
!= x
.has_entity_group_
: return 0
2431 if self
.has_entity_group_
and self
.entity_group_
!= x
.entity_group_
: return 0
2432 if self
.has_owner_
!= x
.has_owner_
: return 0
2433 if self
.has_owner_
and self
.owner_
!= x
.owner_
: return 0
2434 if self
.has_kind_
!= x
.has_kind_
: return 0
2435 if self
.has_kind_
and self
.kind_
!= x
.kind_
: return 0
2436 if self
.has_kind_uri_
!= x
.has_kind_uri_
: return 0
2437 if self
.has_kind_uri_
and self
.kind_uri_
!= x
.kind_uri_
: return 0
2438 if len(self
.property_
) != len(x
.property_
): return 0
2439 for e1
, e2
in zip(self
.property_
, x
.property_
):
2440 if e1
!= e2
: return 0
2441 if len(self
.raw_property_
) != len(x
.raw_property_
): return 0
2442 for e1
, e2
in zip(self
.raw_property_
, x
.raw_property_
):
2443 if e1
!= e2
: return 0
2444 if self
.has_rank_
!= x
.has_rank_
: return 0
2445 if self
.has_rank_
and self
.rank_
!= x
.rank_
: return 0
2448 def IsInitialized(self
, debug_strs
=None):
2450 if (not self
.has_key_
):
2452 if debug_strs
is not None:
2453 debug_strs
.append('Required field: key not set.')
2454 elif not self
.key_
.IsInitialized(debug_strs
): initialized
= 0
2455 if (not self
.has_entity_group_
):
2457 if debug_strs
is not None:
2458 debug_strs
.append('Required field: entity_group not set.')
2459 elif not self
.entity_group_
.IsInitialized(debug_strs
): initialized
= 0
2460 if (self
.has_owner_
and not self
.owner_
.IsInitialized(debug_strs
)): initialized
= 0
2461 for p
in self
.property_
:
2462 if not p
.IsInitialized(debug_strs
): initialized
=0
2463 for p
in self
.raw_property_
:
2464 if not p
.IsInitialized(debug_strs
): initialized
=0
2469 n
+= self
.lengthString(self
.key_
.ByteSize())
2470 n
+= self
.lengthString(self
.entity_group_
.ByteSize())
2471 if (self
.has_owner_
): n
+= 2 + self
.lengthString(self
.owner_
.ByteSize())
2472 if (self
.has_kind_
): n
+= 1 + self
.lengthVarInt64(self
.kind_
)
2473 if (self
.has_kind_uri_
): n
+= 1 + self
.lengthString(len(self
.kind_uri_
))
2474 n
+= 1 * len(self
.property_
)
2475 for i
in xrange(len(self
.property_
)): n
+= self
.lengthString(self
.property_
[i
].ByteSize())
2476 n
+= 1 * len(self
.raw_property_
)
2477 for i
in xrange(len(self
.raw_property_
)): n
+= self
.lengthString(self
.raw_property_
[i
].ByteSize())
2478 if (self
.has_rank_
): n
+= 2 + self
.lengthVarInt64(self
.rank_
)
2481 def ByteSizePartial(self
):
2485 n
+= self
.lengthString(self
.key_
.ByteSizePartial())
2486 if (self
.has_entity_group_
):
2488 n
+= self
.lengthString(self
.entity_group_
.ByteSizePartial())
2489 if (self
.has_owner_
): n
+= 2 + self
.lengthString(self
.owner_
.ByteSizePartial())
2490 if (self
.has_kind_
): n
+= 1 + self
.lengthVarInt64(self
.kind_
)
2491 if (self
.has_kind_uri_
): n
+= 1 + self
.lengthString(len(self
.kind_uri_
))
2492 n
+= 1 * len(self
.property_
)
2493 for i
in xrange(len(self
.property_
)): n
+= self
.lengthString(self
.property_
[i
].ByteSizePartial())
2494 n
+= 1 * len(self
.raw_property_
)
2495 for i
in xrange(len(self
.raw_property_
)): n
+= self
.lengthString(self
.raw_property_
[i
].ByteSizePartial())
2496 if (self
.has_rank_
): n
+= 2 + self
.lengthVarInt64(self
.rank_
)
2501 self
.clear_entity_group()
2504 self
.clear_kind_uri()
2505 self
.clear_property()
2506 self
.clear_raw_property()
2509 def OutputUnchecked(self
, out
):
2510 if (self
.has_kind_
):
2512 out
.putVarInt32(self
.kind_
)
2513 if (self
.has_kind_uri_
):
2515 out
.putPrefixedString(self
.kind_uri_
)
2516 out
.putVarInt32(106)
2517 out
.putVarInt32(self
.key_
.ByteSize())
2518 self
.key_
.OutputUnchecked(out
)
2519 for i
in xrange(len(self
.property_
)):
2520 out
.putVarInt32(114)
2521 out
.putVarInt32(self
.property_
[i
].ByteSize())
2522 self
.property_
[i
].OutputUnchecked(out
)
2523 for i
in xrange(len(self
.raw_property_
)):
2524 out
.putVarInt32(122)
2525 out
.putVarInt32(self
.raw_property_
[i
].ByteSize())
2526 self
.raw_property_
[i
].OutputUnchecked(out
)
2527 out
.putVarInt32(130)
2528 out
.putVarInt32(self
.entity_group_
.ByteSize())
2529 self
.entity_group_
.OutputUnchecked(out
)
2530 if (self
.has_owner_
):
2531 out
.putVarInt32(138)
2532 out
.putVarInt32(self
.owner_
.ByteSize())
2533 self
.owner_
.OutputUnchecked(out
)
2534 if (self
.has_rank_
):
2535 out
.putVarInt32(144)
2536 out
.putVarInt32(self
.rank_
)
2538 def OutputPartial(self
, out
):
2539 if (self
.has_kind_
):
2541 out
.putVarInt32(self
.kind_
)
2542 if (self
.has_kind_uri_
):
2544 out
.putPrefixedString(self
.kind_uri_
)
2546 out
.putVarInt32(106)
2547 out
.putVarInt32(self
.key_
.ByteSizePartial())
2548 self
.key_
.OutputPartial(out
)
2549 for i
in xrange(len(self
.property_
)):
2550 out
.putVarInt32(114)
2551 out
.putVarInt32(self
.property_
[i
].ByteSizePartial())
2552 self
.property_
[i
].OutputPartial(out
)
2553 for i
in xrange(len(self
.raw_property_
)):
2554 out
.putVarInt32(122)
2555 out
.putVarInt32(self
.raw_property_
[i
].ByteSizePartial())
2556 self
.raw_property_
[i
].OutputPartial(out
)
2557 if (self
.has_entity_group_
):
2558 out
.putVarInt32(130)
2559 out
.putVarInt32(self
.entity_group_
.ByteSizePartial())
2560 self
.entity_group_
.OutputPartial(out
)
2561 if (self
.has_owner_
):
2562 out
.putVarInt32(138)
2563 out
.putVarInt32(self
.owner_
.ByteSizePartial())
2564 self
.owner_
.OutputPartial(out
)
2565 if (self
.has_rank_
):
2566 out
.putVarInt32(144)
2567 out
.putVarInt32(self
.rank_
)
2569 def TryMerge(self
, d
):
2570 while d
.avail() > 0:
2571 tt
= d
.getVarInt32()
2573 self
.set_kind(d
.getVarInt32())
2576 self
.set_kind_uri(d
.getPrefixedString())
2579 length
= d
.getVarInt32()
2580 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2582 self
.mutable_key().TryMerge(tmp
)
2585 length
= d
.getVarInt32()
2586 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2588 self
.add_property().TryMerge(tmp
)
2591 length
= d
.getVarInt32()
2592 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2594 self
.add_raw_property().TryMerge(tmp
)
2597 length
= d
.getVarInt32()
2598 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2600 self
.mutable_entity_group().TryMerge(tmp
)
2603 length
= d
.getVarInt32()
2604 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
2606 self
.mutable_owner().TryMerge(tmp
)
2609 self
.set_rank(d
.getVarInt32())
2613 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2617 def __str__(self
, prefix
="", printElemNumber
=0):
2620 res
+=prefix
+"key <\n"
2621 res
+=self
.key_
.__str
__(prefix
+ " ", printElemNumber
)
2623 if self
.has_entity_group_
:
2624 res
+=prefix
+"entity_group <\n"
2625 res
+=self
.entity_group_
.__str
__(prefix
+ " ", printElemNumber
)
2628 res
+=prefix
+"owner <\n"
2629 res
+=self
.owner_
.__str
__(prefix
+ " ", printElemNumber
)
2631 if self
.has_kind_
: res
+=prefix
+("kind: %s\n" % self
.DebugFormatInt32(self
.kind_
))
2632 if self
.has_kind_uri_
: res
+=prefix
+("kind_uri: %s\n" % self
.DebugFormatString(self
.kind_uri_
))
2634 for e
in self
.property_
:
2636 if printElemNumber
: elm
="(%d)" % cnt
2637 res
+=prefix
+("property%s <\n" % elm
)
2638 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2642 for e
in self
.raw_property_
:
2644 if printElemNumber
: elm
="(%d)" % cnt
2645 res
+=prefix
+("raw_property%s <\n" % elm
)
2646 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
2649 if self
.has_rank_
: res
+=prefix
+("rank: %s\n" % self
.DebugFormatInt32(self
.rank_
))
2653 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2654 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2665 _TEXT
= _BuildTagLookupTable({
2677 _TYPES
= _BuildTagLookupTable({
2678 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2679 4: ProtocolBuffer
.Encoder
.NUMERIC
,
2680 5: ProtocolBuffer
.Encoder
.STRING
,
2681 13: ProtocolBuffer
.Encoder
.STRING
,
2682 14: ProtocolBuffer
.Encoder
.STRING
,
2683 15: ProtocolBuffer
.Encoder
.STRING
,
2684 16: ProtocolBuffer
.Encoder
.STRING
,
2685 17: ProtocolBuffer
.Encoder
.STRING
,
2686 18: ProtocolBuffer
.Encoder
.NUMERIC
,
2687 }, 18, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2691 _STYLE_CONTENT_TYPE
= """"""
2692 _PROTO_DESCRIPTOR_NAME
= 'storage_onestore_v3.EntityProto'
2693 class CompositeProperty(ProtocolBuffer
.ProtocolMessage
):
2697 def __init__(self
, contents
=None):
2699 if contents
is not None: self
.MergeFromString(contents
)
2701 def index_id(self
): return self
.index_id_
2703 def set_index_id(self
, x
):
2704 self
.has_index_id_
= 1
2707 def clear_index_id(self
):
2708 if self
.has_index_id_
:
2709 self
.has_index_id_
= 0
2712 def has_index_id(self
): return self
.has_index_id_
2714 def value_size(self
): return len(self
.value_
)
2715 def value_list(self
): return self
.value_
2718 return self
.value_
[i
]
2720 def set_value(self
, i
, x
):
2723 def add_value(self
, x
):
2724 self
.value_
.append(x
)
2726 def clear_value(self
):
2730 def MergeFrom(self
, x
):
2731 assert x
is not self
2732 if (x
.has_index_id()): self
.set_index_id(x
.index_id())
2733 for i
in xrange(x
.value_size()): self
.add_value(x
.value(i
))
2735 def Equals(self
, x
):
2736 if x
is self
: return 1
2737 if self
.has_index_id_
!= x
.has_index_id_
: return 0
2738 if self
.has_index_id_
and self
.index_id_
!= x
.index_id_
: return 0
2739 if len(self
.value_
) != len(x
.value_
): return 0
2740 for e1
, e2
in zip(self
.value_
, x
.value_
):
2741 if e1
!= e2
: return 0
2744 def IsInitialized(self
, debug_strs
=None):
2746 if (not self
.has_index_id_
):
2748 if debug_strs
is not None:
2749 debug_strs
.append('Required field: index_id not set.')
2754 n
+= self
.lengthVarInt64(self
.index_id_
)
2755 n
+= 1 * len(self
.value_
)
2756 for i
in xrange(len(self
.value_
)): n
+= self
.lengthString(len(self
.value_
[i
]))
2759 def ByteSizePartial(self
):
2761 if (self
.has_index_id_
):
2763 n
+= self
.lengthVarInt64(self
.index_id_
)
2764 n
+= 1 * len(self
.value_
)
2765 for i
in xrange(len(self
.value_
)): n
+= self
.lengthString(len(self
.value_
[i
]))
2769 self
.clear_index_id()
2772 def OutputUnchecked(self
, out
):
2774 out
.putVarInt64(self
.index_id_
)
2775 for i
in xrange(len(self
.value_
)):
2777 out
.putPrefixedString(self
.value_
[i
])
2779 def OutputPartial(self
, out
):
2780 if (self
.has_index_id_
):
2782 out
.putVarInt64(self
.index_id_
)
2783 for i
in xrange(len(self
.value_
)):
2785 out
.putPrefixedString(self
.value_
[i
])
2787 def TryMerge(self
, d
):
2788 while d
.avail() > 0:
2789 tt
= d
.getVarInt32()
2791 self
.set_index_id(d
.getVarInt64())
2794 self
.add_value(d
.getPrefixedString())
2798 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2802 def __str__(self
, prefix
="", printElemNumber
=0):
2804 if self
.has_index_id_
: res
+=prefix
+("index_id: %s\n" % self
.DebugFormatInt64(self
.index_id_
))
2806 for e
in self
.value_
:
2808 if printElemNumber
: elm
="(%d)" % cnt
2809 res
+=prefix
+("value%s: %s\n" % (elm
, self
.DebugFormatString(e
)))
2814 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
2815 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
2820 _TEXT
= _BuildTagLookupTable({
2826 _TYPES
= _BuildTagLookupTable({
2827 0: ProtocolBuffer
.Encoder
.NUMERIC
,
2828 1: ProtocolBuffer
.Encoder
.NUMERIC
,
2829 2: ProtocolBuffer
.Encoder
.STRING
,
2830 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
2834 _STYLE_CONTENT_TYPE
= """"""
2835 _PROTO_DESCRIPTOR_NAME
= 'storage_onestore_v3.CompositeProperty'
2836 class Index_Property(ProtocolBuffer
.ProtocolMessage
):
2842 _Direction_NAMES
= {
2847 def Direction_Name(cls
, x
): return cls
._Direction
_NAMES
.get(x
, "")
2848 Direction_Name
= classmethod(Direction_Name
)
2855 def __init__(self
, contents
=None):
2856 if contents
is not None: self
.MergeFromString(contents
)
2858 def name(self
): return self
.name_
2860 def set_name(self
, x
):
2864 def clear_name(self
):
2869 def has_name(self
): return self
.has_name_
2871 def direction(self
): return self
.direction_
2873 def set_direction(self
, x
):
2874 self
.has_direction_
= 1
2877 def clear_direction(self
):
2878 if self
.has_direction_
:
2879 self
.has_direction_
= 0
2882 def has_direction(self
): return self
.has_direction_
2885 def MergeFrom(self
, x
):
2886 assert x
is not self
2887 if (x
.has_name()): self
.set_name(x
.name())
2888 if (x
.has_direction()): self
.set_direction(x
.direction())
2890 def Equals(self
, x
):
2891 if x
is self
: return 1
2892 if self
.has_name_
!= x
.has_name_
: return 0
2893 if self
.has_name_
and self
.name_
!= x
.name_
: return 0
2894 if self
.has_direction_
!= x
.has_direction_
: return 0
2895 if self
.has_direction_
and self
.direction_
!= x
.direction_
: return 0
2898 def IsInitialized(self
, debug_strs
=None):
2900 if (not self
.has_name_
):
2902 if debug_strs
is not None:
2903 debug_strs
.append('Required field: name not set.')
2908 n
+= self
.lengthString(len(self
.name_
))
2909 if (self
.has_direction_
): n
+= 1 + self
.lengthVarInt64(self
.direction_
)
2912 def ByteSizePartial(self
):
2914 if (self
.has_name_
):
2916 n
+= self
.lengthString(len(self
.name_
))
2917 if (self
.has_direction_
): n
+= 1 + self
.lengthVarInt64(self
.direction_
)
2922 self
.clear_direction()
2924 def OutputUnchecked(self
, out
):
2926 out
.putPrefixedString(self
.name_
)
2927 if (self
.has_direction_
):
2929 out
.putVarInt32(self
.direction_
)
2931 def OutputPartial(self
, out
):
2932 if (self
.has_name_
):
2934 out
.putPrefixedString(self
.name_
)
2935 if (self
.has_direction_
):
2937 out
.putVarInt32(self
.direction_
)
2939 def TryMerge(self
, d
):
2941 tt
= d
.getVarInt32()
2944 self
.set_name(d
.getPrefixedString())
2947 self
.set_direction(d
.getVarInt32())
2951 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
2955 def __str__(self
, prefix
="", printElemNumber
=0):
2957 if self
.has_name_
: res
+=prefix
+("name: %s\n" % self
.DebugFormatString(self
.name_
))
2958 if self
.has_direction_
: res
+=prefix
+("direction: %s\n" % self
.DebugFormatInt32(self
.direction_
))
2961 class Index(ProtocolBuffer
.ProtocolMessage
):
2962 has_entity_type_
= 0
2967 def __init__(self
, contents
=None):
2969 if contents
is not None: self
.MergeFromString(contents
)
2971 def entity_type(self
): return self
.entity_type_
2973 def set_entity_type(self
, x
):
2974 self
.has_entity_type_
= 1
2975 self
.entity_type_
= x
2977 def clear_entity_type(self
):
2978 if self
.has_entity_type_
:
2979 self
.has_entity_type_
= 0
2980 self
.entity_type_
= ""
2982 def has_entity_type(self
): return self
.has_entity_type_
2984 def ancestor(self
): return self
.ancestor_
2986 def set_ancestor(self
, x
):
2987 self
.has_ancestor_
= 1
2990 def clear_ancestor(self
):
2991 if self
.has_ancestor_
:
2992 self
.has_ancestor_
= 0
2995 def has_ancestor(self
): return self
.has_ancestor_
2997 def property_size(self
): return len(self
.property_
)
2998 def property_list(self
): return self
.property_
3000 def property(self
, i
):
3001 return self
.property_
[i
]
3003 def mutable_property(self
, i
):
3004 return self
.property_
[i
]
3006 def add_property(self
):
3007 x
= Index_Property()
3008 self
.property_
.append(x
)
3011 def clear_property(self
):
3014 def MergeFrom(self
, x
):
3015 assert x
is not self
3016 if (x
.has_entity_type()): self
.set_entity_type(x
.entity_type())
3017 if (x
.has_ancestor()): self
.set_ancestor(x
.ancestor())
3018 for i
in xrange(x
.property_size()): self
.add_property().CopyFrom(x
.property(i
))
3020 def Equals(self
, x
):
3021 if x
is self
: return 1
3022 if self
.has_entity_type_
!= x
.has_entity_type_
: return 0
3023 if self
.has_entity_type_
and self
.entity_type_
!= x
.entity_type_
: return 0
3024 if self
.has_ancestor_
!= x
.has_ancestor_
: return 0
3025 if self
.has_ancestor_
and self
.ancestor_
!= x
.ancestor_
: return 0
3026 if len(self
.property_
) != len(x
.property_
): return 0
3027 for e1
, e2
in zip(self
.property_
, x
.property_
):
3028 if e1
!= e2
: return 0
3031 def IsInitialized(self
, debug_strs
=None):
3033 if (not self
.has_entity_type_
):
3035 if debug_strs
is not None:
3036 debug_strs
.append('Required field: entity_type not set.')
3037 if (not self
.has_ancestor_
):
3039 if debug_strs
is not None:
3040 debug_strs
.append('Required field: ancestor not set.')
3041 for p
in self
.property_
:
3042 if not p
.IsInitialized(debug_strs
): initialized
=0
3047 n
+= self
.lengthString(len(self
.entity_type_
))
3048 n
+= 2 * len(self
.property_
)
3049 for i
in xrange(len(self
.property_
)): n
+= self
.property_
[i
].ByteSize()
3052 def ByteSizePartial(self
):
3054 if (self
.has_entity_type_
):
3056 n
+= self
.lengthString(len(self
.entity_type_
))
3057 if (self
.has_ancestor_
):
3059 n
+= 2 * len(self
.property_
)
3060 for i
in xrange(len(self
.property_
)): n
+= self
.property_
[i
].ByteSizePartial()
3064 self
.clear_entity_type()
3065 self
.clear_ancestor()
3066 self
.clear_property()
3068 def OutputUnchecked(self
, out
):
3070 out
.putPrefixedString(self
.entity_type_
)
3071 for i
in xrange(len(self
.property_
)):
3073 self
.property_
[i
].OutputUnchecked(out
)
3076 out
.putBoolean(self
.ancestor_
)
3078 def OutputPartial(self
, out
):
3079 if (self
.has_entity_type_
):
3081 out
.putPrefixedString(self
.entity_type_
)
3082 for i
in xrange(len(self
.property_
)):
3084 self
.property_
[i
].OutputPartial(out
)
3086 if (self
.has_ancestor_
):
3088 out
.putBoolean(self
.ancestor_
)
3090 def TryMerge(self
, d
):
3091 while d
.avail() > 0:
3092 tt
= d
.getVarInt32()
3094 self
.set_entity_type(d
.getPrefixedString())
3097 self
.add_property().TryMerge(d
)
3100 self
.set_ancestor(d
.getBoolean())
3104 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3108 def __str__(self
, prefix
="", printElemNumber
=0):
3110 if self
.has_entity_type_
: res
+=prefix
+("entity_type: %s\n" % self
.DebugFormatString(self
.entity_type_
))
3111 if self
.has_ancestor_
: res
+=prefix
+("ancestor: %s\n" % self
.DebugFormatBool(self
.ancestor_
))
3113 for e
in self
.property_
:
3115 if printElemNumber
: elm
="(%d)" % cnt
3116 res
+=prefix
+("Property%s {\n" % elm
)
3117 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
3123 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3124 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3130 kPropertydirection
= 4
3132 _TEXT
= _BuildTagLookupTable({
3141 _TYPES
= _BuildTagLookupTable({
3142 0: ProtocolBuffer
.Encoder
.NUMERIC
,
3143 1: ProtocolBuffer
.Encoder
.STRING
,
3144 2: ProtocolBuffer
.Encoder
.STARTGROUP
,
3145 3: ProtocolBuffer
.Encoder
.STRING
,
3146 4: ProtocolBuffer
.Encoder
.NUMERIC
,
3147 5: ProtocolBuffer
.Encoder
.NUMERIC
,
3148 }, 5, ProtocolBuffer
.Encoder
.MAX_TYPE
)
3152 _STYLE_CONTENT_TYPE
= """"""
3153 _PROTO_DESCRIPTOR_NAME
= 'storage_onestore_v3.Index'
3154 class CompositeIndex(ProtocolBuffer
.ProtocolMessage
):
3169 def State_Name(cls
, x
): return cls
._State
_NAMES
.get(x
, "")
3170 State_Name
= classmethod(State_Name
)
3179 has_only_use_if_required_
= 0
3180 only_use_if_required_
= 0
3182 def __init__(self
, contents
=None):
3183 self
.definition_
= Index()
3184 if contents
is not None: self
.MergeFromString(contents
)
3186 def app_id(self
): return self
.app_id_
3188 def set_app_id(self
, x
):
3189 self
.has_app_id_
= 1
3192 def clear_app_id(self
):
3193 if self
.has_app_id_
:
3194 self
.has_app_id_
= 0
3197 def has_app_id(self
): return self
.has_app_id_
3199 def id(self
): return self
.id_
3201 def set_id(self
, x
):
3210 def has_id(self
): return self
.has_id_
3212 def definition(self
): return self
.definition_
3214 def mutable_definition(self
): self
.has_definition_
= 1; return self
.definition_
3216 def clear_definition(self
):self
.has_definition_
= 0; self
.definition_
.Clear()
3218 def has_definition(self
): return self
.has_definition_
3220 def state(self
): return self
.state_
3222 def set_state(self
, x
):
3226 def clear_state(self
):
3231 def has_state(self
): return self
.has_state_
3233 def only_use_if_required(self
): return self
.only_use_if_required_
3235 def set_only_use_if_required(self
, x
):
3236 self
.has_only_use_if_required_
= 1
3237 self
.only_use_if_required_
= x
3239 def clear_only_use_if_required(self
):
3240 if self
.has_only_use_if_required_
:
3241 self
.has_only_use_if_required_
= 0
3242 self
.only_use_if_required_
= 0
3244 def has_only_use_if_required(self
): return self
.has_only_use_if_required_
3247 def MergeFrom(self
, x
):
3248 assert x
is not self
3249 if (x
.has_app_id()): self
.set_app_id(x
.app_id())
3250 if (x
.has_id()): self
.set_id(x
.id())
3251 if (x
.has_definition()): self
.mutable_definition().MergeFrom(x
.definition())
3252 if (x
.has_state()): self
.set_state(x
.state())
3253 if (x
.has_only_use_if_required()): self
.set_only_use_if_required(x
.only_use_if_required())
3255 def Equals(self
, x
):
3256 if x
is self
: return 1
3257 if self
.has_app_id_
!= x
.has_app_id_
: return 0
3258 if self
.has_app_id_
and self
.app_id_
!= x
.app_id_
: return 0
3259 if self
.has_id_
!= x
.has_id_
: return 0
3260 if self
.has_id_
and self
.id_
!= x
.id_
: return 0
3261 if self
.has_definition_
!= x
.has_definition_
: return 0
3262 if self
.has_definition_
and self
.definition_
!= x
.definition_
: return 0
3263 if self
.has_state_
!= x
.has_state_
: return 0
3264 if self
.has_state_
and self
.state_
!= x
.state_
: return 0
3265 if self
.has_only_use_if_required_
!= x
.has_only_use_if_required_
: return 0
3266 if self
.has_only_use_if_required_
and self
.only_use_if_required_
!= x
.only_use_if_required_
: return 0
3269 def IsInitialized(self
, debug_strs
=None):
3271 if (not self
.has_app_id_
):
3273 if debug_strs
is not None:
3274 debug_strs
.append('Required field: app_id not set.')
3275 if (not self
.has_id_
):
3277 if debug_strs
is not None:
3278 debug_strs
.append('Required field: id not set.')
3279 if (not self
.has_definition_
):
3281 if debug_strs
is not None:
3282 debug_strs
.append('Required field: definition not set.')
3283 elif not self
.definition_
.IsInitialized(debug_strs
): initialized
= 0
3284 if (not self
.has_state_
):
3286 if debug_strs
is not None:
3287 debug_strs
.append('Required field: state not set.')
3292 n
+= self
.lengthString(len(self
.app_id_
))
3293 n
+= self
.lengthVarInt64(self
.id_
)
3294 n
+= self
.lengthString(self
.definition_
.ByteSize())
3295 n
+= self
.lengthVarInt64(self
.state_
)
3296 if (self
.has_only_use_if_required_
): n
+= 2
3299 def ByteSizePartial(self
):
3301 if (self
.has_app_id_
):
3303 n
+= self
.lengthString(len(self
.app_id_
))
3306 n
+= self
.lengthVarInt64(self
.id_
)
3307 if (self
.has_definition_
):
3309 n
+= self
.lengthString(self
.definition_
.ByteSizePartial())
3310 if (self
.has_state_
):
3312 n
+= self
.lengthVarInt64(self
.state_
)
3313 if (self
.has_only_use_if_required_
): n
+= 2
3319 self
.clear_definition()
3321 self
.clear_only_use_if_required()
3323 def OutputUnchecked(self
, out
):
3325 out
.putPrefixedString(self
.app_id_
)
3327 out
.putVarInt64(self
.id_
)
3329 out
.putVarInt32(self
.definition_
.ByteSize())
3330 self
.definition_
.OutputUnchecked(out
)
3332 out
.putVarInt32(self
.state_
)
3333 if (self
.has_only_use_if_required_
):
3335 out
.putBoolean(self
.only_use_if_required_
)
3337 def OutputPartial(self
, out
):
3338 if (self
.has_app_id_
):
3340 out
.putPrefixedString(self
.app_id_
)
3343 out
.putVarInt64(self
.id_
)
3344 if (self
.has_definition_
):
3346 out
.putVarInt32(self
.definition_
.ByteSizePartial())
3347 self
.definition_
.OutputPartial(out
)
3348 if (self
.has_state_
):
3350 out
.putVarInt32(self
.state_
)
3351 if (self
.has_only_use_if_required_
):
3353 out
.putBoolean(self
.only_use_if_required_
)
3355 def TryMerge(self
, d
):
3356 while d
.avail() > 0:
3357 tt
= d
.getVarInt32()
3359 self
.set_app_id(d
.getPrefixedString())
3362 self
.set_id(d
.getVarInt64())
3365 length
= d
.getVarInt32()
3366 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3368 self
.mutable_definition().TryMerge(tmp
)
3371 self
.set_state(d
.getVarInt32())
3374 self
.set_only_use_if_required(d
.getBoolean())
3378 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3382 def __str__(self
, prefix
="", printElemNumber
=0):
3384 if self
.has_app_id_
: res
+=prefix
+("app_id: %s\n" % self
.DebugFormatString(self
.app_id_
))
3385 if self
.has_id_
: res
+=prefix
+("id: %s\n" % self
.DebugFormatInt64(self
.id_
))
3386 if self
.has_definition_
:
3387 res
+=prefix
+"definition <\n"
3388 res
+=self
.definition_
.__str
__(prefix
+ " ", printElemNumber
)
3390 if self
.has_state_
: res
+=prefix
+("state: %s\n" % self
.DebugFormatInt32(self
.state_
))
3391 if self
.has_only_use_if_required_
: res
+=prefix
+("only_use_if_required: %s\n" % self
.DebugFormatBool(self
.only_use_if_required_
))
3395 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3396 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3402 konly_use_if_required
= 6
3404 _TEXT
= _BuildTagLookupTable({
3410 6: "only_use_if_required",
3413 _TYPES
= _BuildTagLookupTable({
3414 0: ProtocolBuffer
.Encoder
.NUMERIC
,
3415 1: ProtocolBuffer
.Encoder
.STRING
,
3416 2: ProtocolBuffer
.Encoder
.NUMERIC
,
3417 3: ProtocolBuffer
.Encoder
.STRING
,
3418 4: ProtocolBuffer
.Encoder
.NUMERIC
,
3419 6: ProtocolBuffer
.Encoder
.NUMERIC
,
3420 }, 6, ProtocolBuffer
.Encoder
.MAX_TYPE
)
3424 _STYLE_CONTENT_TYPE
= """"""
3425 _PROTO_DESCRIPTOR_NAME
= 'storage_onestore_v3.CompositeIndex'
3426 class IndexPostfix_IndexValue(ProtocolBuffer
.ProtocolMessage
):
3427 has_property_name_
= 0
3431 def __init__(self
, contents
=None):
3432 self
.value_
= PropertyValue()
3433 if contents
is not None: self
.MergeFromString(contents
)
3435 def property_name(self
): return self
.property_name_
3437 def set_property_name(self
, x
):
3438 self
.has_property_name_
= 1
3439 self
.property_name_
= x
3441 def clear_property_name(self
):
3442 if self
.has_property_name_
:
3443 self
.has_property_name_
= 0
3444 self
.property_name_
= ""
3446 def has_property_name(self
): return self
.has_property_name_
3448 def value(self
): return self
.value_
3450 def mutable_value(self
): self
.has_value_
= 1; return self
.value_
3452 def clear_value(self
):self
.has_value_
= 0; self
.value_
.Clear()
3454 def has_value(self
): return self
.has_value_
3457 def MergeFrom(self
, x
):
3458 assert x
is not self
3459 if (x
.has_property_name()): self
.set_property_name(x
.property_name())
3460 if (x
.has_value()): self
.mutable_value().MergeFrom(x
.value())
3462 def Equals(self
, x
):
3463 if x
is self
: return 1
3464 if self
.has_property_name_
!= x
.has_property_name_
: return 0
3465 if self
.has_property_name_
and self
.property_name_
!= x
.property_name_
: return 0
3466 if self
.has_value_
!= x
.has_value_
: return 0
3467 if self
.has_value_
and self
.value_
!= x
.value_
: return 0
3470 def IsInitialized(self
, debug_strs
=None):
3472 if (not self
.has_property_name_
):
3474 if debug_strs
is not None:
3475 debug_strs
.append('Required field: property_name not set.')
3476 if (not self
.has_value_
):
3478 if debug_strs
is not None:
3479 debug_strs
.append('Required field: value not set.')
3480 elif not self
.value_
.IsInitialized(debug_strs
): initialized
= 0
3485 n
+= self
.lengthString(len(self
.property_name_
))
3486 n
+= self
.lengthString(self
.value_
.ByteSize())
3489 def ByteSizePartial(self
):
3491 if (self
.has_property_name_
):
3493 n
+= self
.lengthString(len(self
.property_name_
))
3494 if (self
.has_value_
):
3496 n
+= self
.lengthString(self
.value_
.ByteSizePartial())
3500 self
.clear_property_name()
3503 def OutputUnchecked(self
, out
):
3505 out
.putPrefixedString(self
.property_name_
)
3507 out
.putVarInt32(self
.value_
.ByteSize())
3508 self
.value_
.OutputUnchecked(out
)
3510 def OutputPartial(self
, out
):
3511 if (self
.has_property_name_
):
3513 out
.putPrefixedString(self
.property_name_
)
3514 if (self
.has_value_
):
3516 out
.putVarInt32(self
.value_
.ByteSizePartial())
3517 self
.value_
.OutputPartial(out
)
3519 def TryMerge(self
, d
):
3520 while d
.avail() > 0:
3521 tt
= d
.getVarInt32()
3523 self
.set_property_name(d
.getPrefixedString())
3526 length
= d
.getVarInt32()
3527 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3529 self
.mutable_value().TryMerge(tmp
)
3533 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3537 def __str__(self
, prefix
="", printElemNumber
=0):
3539 if self
.has_property_name_
: res
+=prefix
+("property_name: %s\n" % self
.DebugFormatString(self
.property_name_
))
3541 res
+=prefix
+"value <\n"
3542 res
+=self
.value_
.__str
__(prefix
+ " ", printElemNumber
)
3547 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3548 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3553 _TEXT
= _BuildTagLookupTable({
3559 _TYPES
= _BuildTagLookupTable({
3560 0: ProtocolBuffer
.Encoder
.NUMERIC
,
3561 1: ProtocolBuffer
.Encoder
.STRING
,
3562 2: ProtocolBuffer
.Encoder
.STRING
,
3563 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
3567 _STYLE_CONTENT_TYPE
= """"""
3568 _PROTO_DESCRIPTOR_NAME
= 'storage_onestore_v3.IndexPostfix_IndexValue'
3569 class IndexPostfix(ProtocolBuffer
.ProtocolMessage
):
3575 def __init__(self
, contents
=None):
3576 self
.index_value_
= []
3577 self
.lazy_init_lock_
= thread
.allocate_lock()
3578 if contents
is not None: self
.MergeFromString(contents
)
3580 def index_value_size(self
): return len(self
.index_value_
)
3581 def index_value_list(self
): return self
.index_value_
3583 def index_value(self
, i
):
3584 return self
.index_value_
[i
]
3586 def mutable_index_value(self
, i
):
3587 return self
.index_value_
[i
]
3589 def add_index_value(self
):
3590 x
= IndexPostfix_IndexValue()
3591 self
.index_value_
.append(x
)
3594 def clear_index_value(self
):
3595 self
.index_value_
= []
3597 if self
.key_
is None:
3598 self
.lazy_init_lock_
.acquire()
3600 if self
.key_
is None: self
.key_
= Reference()
3602 self
.lazy_init_lock_
.release()
3605 def mutable_key(self
): self
.has_key_
= 1; return self
.key()
3607 def clear_key(self
):
3611 if self
.key_
is not None: self
.key_
.Clear()
3613 def has_key(self
): return self
.has_key_
3615 def before(self
): return self
.before_
3617 def set_before(self
, x
):
3618 self
.has_before_
= 1
3621 def clear_before(self
):
3622 if self
.has_before_
:
3623 self
.has_before_
= 0
3626 def has_before(self
): return self
.has_before_
3629 def MergeFrom(self
, x
):
3630 assert x
is not self
3631 for i
in xrange(x
.index_value_size()): self
.add_index_value().CopyFrom(x
.index_value(i
))
3632 if (x
.has_key()): self
.mutable_key().MergeFrom(x
.key())
3633 if (x
.has_before()): self
.set_before(x
.before())
3635 def Equals(self
, x
):
3636 if x
is self
: return 1
3637 if len(self
.index_value_
) != len(x
.index_value_
): return 0
3638 for e1
, e2
in zip(self
.index_value_
, x
.index_value_
):
3639 if e1
!= e2
: return 0
3640 if self
.has_key_
!= x
.has_key_
: return 0
3641 if self
.has_key_
and self
.key_
!= x
.key_
: return 0
3642 if self
.has_before_
!= x
.has_before_
: return 0
3643 if self
.has_before_
and self
.before_
!= x
.before_
: return 0
3646 def IsInitialized(self
, debug_strs
=None):
3648 for p
in self
.index_value_
:
3649 if not p
.IsInitialized(debug_strs
): initialized
=0
3650 if (self
.has_key_
and not self
.key_
.IsInitialized(debug_strs
)): initialized
= 0
3655 n
+= 1 * len(self
.index_value_
)
3656 for i
in xrange(len(self
.index_value_
)): n
+= self
.lengthString(self
.index_value_
[i
].ByteSize())
3657 if (self
.has_key_
): n
+= 1 + self
.lengthString(self
.key_
.ByteSize())
3658 if (self
.has_before_
): n
+= 2
3661 def ByteSizePartial(self
):
3663 n
+= 1 * len(self
.index_value_
)
3664 for i
in xrange(len(self
.index_value_
)): n
+= self
.lengthString(self
.index_value_
[i
].ByteSizePartial())
3665 if (self
.has_key_
): n
+= 1 + self
.lengthString(self
.key_
.ByteSizePartial())
3666 if (self
.has_before_
): n
+= 2
3670 self
.clear_index_value()
3674 def OutputUnchecked(self
, out
):
3675 for i
in xrange(len(self
.index_value_
)):
3677 out
.putVarInt32(self
.index_value_
[i
].ByteSize())
3678 self
.index_value_
[i
].OutputUnchecked(out
)
3681 out
.putVarInt32(self
.key_
.ByteSize())
3682 self
.key_
.OutputUnchecked(out
)
3683 if (self
.has_before_
):
3685 out
.putBoolean(self
.before_
)
3687 def OutputPartial(self
, out
):
3688 for i
in xrange(len(self
.index_value_
)):
3690 out
.putVarInt32(self
.index_value_
[i
].ByteSizePartial())
3691 self
.index_value_
[i
].OutputPartial(out
)
3694 out
.putVarInt32(self
.key_
.ByteSizePartial())
3695 self
.key_
.OutputPartial(out
)
3696 if (self
.has_before_
):
3698 out
.putBoolean(self
.before_
)
3700 def TryMerge(self
, d
):
3701 while d
.avail() > 0:
3702 tt
= d
.getVarInt32()
3704 length
= d
.getVarInt32()
3705 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3707 self
.add_index_value().TryMerge(tmp
)
3710 length
= d
.getVarInt32()
3711 tmp
= ProtocolBuffer
.Decoder(d
.buffer(), d
.pos(), d
.pos() + length
)
3713 self
.mutable_key().TryMerge(tmp
)
3716 self
.set_before(d
.getBoolean())
3720 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
3724 def __str__(self
, prefix
="", printElemNumber
=0):
3727 for e
in self
.index_value_
:
3729 if printElemNumber
: elm
="(%d)" % cnt
3730 res
+=prefix
+("index_value%s <\n" % elm
)
3731 res
+=e
.__str
__(prefix
+ " ", printElemNumber
)
3735 res
+=prefix
+"key <\n"
3736 res
+=self
.key_
.__str
__(prefix
+ " ", printElemNumber
)
3738 if self
.has_before_
: res
+=prefix
+("before: %s\n" % self
.DebugFormatBool(self
.before_
))
3742 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
3743 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
3749 _TEXT
= _BuildTagLookupTable({
3756 _TYPES
= _BuildTagLookupTable({
3757 0: ProtocolBuffer
.Encoder
.NUMERIC
,
3758 1: ProtocolBuffer
.Encoder
.STRING
,
3759 2: ProtocolBuffer
.Encoder
.STRING
,
3760 3: ProtocolBuffer
.Encoder
.NUMERIC
,
3761 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
3765 _STYLE_CONTENT_TYPE
= """"""
3766 _PROTO_DESCRIPTOR_NAME
= 'storage_onestore_v3.IndexPostfix'
3767 if _extension_runtime
:
3770 __all__
= ['PropertyValue','PropertyValue_ReferenceValuePathElement','PropertyValue_PointValue','PropertyValue_UserValue','PropertyValue_ReferenceValue','Property','Path','Path_Element','Reference','User','EntityProto','CompositeProperty','Index','Index_Property','CompositeIndex','IndexPostfix_IndexValue','IndexPostfix']