App Engine Python SDK version 1.7.7
[gae.git] / python / google / appengine / datastore / entity_pb.py
blobbfe53b07a37f578cdeb1019b991be616660f0d8e
1 #!/usr/bin/env python
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
21 import array
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
30 else:
31 _extension_runtime = False
32 _ExtendableProtocolMessage = ProtocolBuffer.ProtocolMessage
34 class PropertyValue_ReferenceValuePathElement(ProtocolBuffer.ProtocolMessage):
35 has_type_ = 0
36 type_ = ""
37 has_id_ = 0
38 id_ = 0
39 has_name_ = 0
40 name_ = ""
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):
48 self.has_type_ = 1
49 self.type_ = x
51 def clear_type(self):
52 if self.has_type_:
53 self.has_type_ = 0
54 self.type_ = ""
56 def has_type(self): return self.has_type_
58 def id(self): return self.id_
60 def set_id(self, x):
61 self.has_id_ = 1
62 self.id_ = x
64 def clear_id(self):
65 if self.has_id_:
66 self.has_id_ = 0
67 self.id_ = 0
69 def has_id(self): return self.has_id_
71 def name(self): return self.name_
73 def set_name(self, x):
74 self.has_name_ = 1
75 self.name_ = x
77 def clear_name(self):
78 if self.has_name_:
79 self.has_name_ = 0
80 self.name_ = ""
82 def has_name(self): return self.has_name_
85 def MergeFrom(self, x):
86 assert x is not self
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())
91 def Equals(self, x):
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
99 return 1
101 def IsInitialized(self, debug_strs=None):
102 initialized = 1
103 if (not self.has_type_):
104 initialized = 0
105 if debug_strs is not None:
106 debug_strs.append('Required field: type not set.')
107 return initialized
109 def ByteSize(self):
110 n = 0
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_))
114 return n + 1
116 def ByteSizePartial(self):
117 n = 0
118 if (self.has_type_):
119 n += 1
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_))
123 return n
125 def Clear(self):
126 self.clear_type()
127 self.clear_id()
128 self.clear_name()
130 def OutputUnchecked(self, out):
131 out.putVarInt32(122)
132 out.putPrefixedString(self.type_)
133 if (self.has_id_):
134 out.putVarInt32(128)
135 out.putVarInt64(self.id_)
136 if (self.has_name_):
137 out.putVarInt32(138)
138 out.putPrefixedString(self.name_)
140 def OutputPartial(self, out):
141 if (self.has_type_):
142 out.putVarInt32(122)
143 out.putPrefixedString(self.type_)
144 if (self.has_id_):
145 out.putVarInt32(128)
146 out.putVarInt64(self.id_)
147 if (self.has_name_):
148 out.putVarInt32(138)
149 out.putPrefixedString(self.name_)
151 def TryMerge(self, d):
152 while 1:
153 tt = d.getVarInt32()
154 if tt == 116: break
155 if tt == 122:
156 self.set_type(d.getPrefixedString())
157 continue
158 if tt == 128:
159 self.set_id(d.getVarInt64())
160 continue
161 if tt == 138:
162 self.set_name(d.getPrefixedString())
163 continue
166 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
167 d.skipData(tt)
170 def __str__(self, prefix="", printElemNumber=0):
171 res=""
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_))
175 return res
177 class PropertyValue_PointValue(ProtocolBuffer.ProtocolMessage):
178 has_x_ = 0
179 x_ = 0.0
180 has_y_ = 0
181 y_ = 0.0
183 def __init__(self, contents=None):
184 if contents is not None: self.MergeFromString(contents)
186 def x(self): return self.x_
188 def set_x(self, x):
189 self.has_x_ = 1
190 self.x_ = x
192 def clear_x(self):
193 if self.has_x_:
194 self.has_x_ = 0
195 self.x_ = 0.0
197 def has_x(self): return self.has_x_
199 def y(self): return self.y_
201 def set_y(self, x):
202 self.has_y_ = 1
203 self.y_ = x
205 def clear_y(self):
206 if self.has_y_:
207 self.has_y_ = 0
208 self.y_ = 0.0
210 def has_y(self): return self.has_y_
213 def MergeFrom(self, x):
214 assert x is not self
215 if (x.has_x()): self.set_x(x.x())
216 if (x.has_y()): self.set_y(x.y())
218 def Equals(self, x):
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
224 return 1
226 def IsInitialized(self, debug_strs=None):
227 initialized = 1
228 if (not self.has_x_):
229 initialized = 0
230 if debug_strs is not None:
231 debug_strs.append('Required field: x not set.')
232 if (not self.has_y_):
233 initialized = 0
234 if debug_strs is not None:
235 debug_strs.append('Required field: y not set.')
236 return initialized
238 def ByteSize(self):
239 n = 0
240 return n + 18
242 def ByteSizePartial(self):
243 n = 0
244 if (self.has_x_):
245 n += 9
246 if (self.has_y_):
247 n += 9
248 return n
250 def Clear(self):
251 self.clear_x()
252 self.clear_y()
254 def OutputUnchecked(self, out):
255 out.putVarInt32(49)
256 out.putDouble(self.x_)
257 out.putVarInt32(57)
258 out.putDouble(self.y_)
260 def OutputPartial(self, out):
261 if (self.has_x_):
262 out.putVarInt32(49)
263 out.putDouble(self.x_)
264 if (self.has_y_):
265 out.putVarInt32(57)
266 out.putDouble(self.y_)
268 def TryMerge(self, d):
269 while 1:
270 tt = d.getVarInt32()
271 if tt == 44: break
272 if tt == 49:
273 self.set_x(d.getDouble())
274 continue
275 if tt == 57:
276 self.set_y(d.getDouble())
277 continue
280 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
281 d.skipData(tt)
284 def __str__(self, prefix="", printElemNumber=0):
285 res=""
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_))
288 return res
290 class PropertyValue_UserValue(ProtocolBuffer.ProtocolMessage):
291 has_email_ = 0
292 email_ = ""
293 has_auth_domain_ = 0
294 auth_domain_ = ""
295 has_nickname_ = 0
296 nickname_ = ""
297 has_gaiaid_ = 0
298 gaiaid_ = 0
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):
312 self.has_email_ = 1
313 self.email_ = x
315 def clear_email(self):
316 if self.has_email_:
317 self.has_email_ = 0
318 self.email_ = ""
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
339 self.nickname_ = x
341 def clear_nickname(self):
342 if self.has_nickname_:
343 self.has_nickname_ = 0
344 self.nickname_ = ""
346 def has_nickname(self): return self.has_nickname_
348 def gaiaid(self): return self.gaiaid_
350 def set_gaiaid(self, x):
351 self.has_gaiaid_ = 1
352 self.gaiaid_ = x
354 def clear_gaiaid(self):
355 if self.has_gaiaid_:
356 self.has_gaiaid_ = 0
357 self.gaiaid_ = 0
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):
402 assert x is not self
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())
411 def Equals(self, x):
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
427 return 1
429 def IsInitialized(self, debug_strs=None):
430 initialized = 1
431 if (not self.has_email_):
432 initialized = 0
433 if debug_strs is not None:
434 debug_strs.append('Required field: email not set.')
435 if (not self.has_auth_domain_):
436 initialized = 0
437 if debug_strs is not None:
438 debug_strs.append('Required field: auth_domain not set.')
439 if (not self.has_gaiaid_):
440 initialized = 0
441 if debug_strs is not None:
442 debug_strs.append('Required field: gaiaid not set.')
443 return initialized
445 def ByteSize(self):
446 n = 0
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_))
454 return n + 4
456 def ByteSizePartial(self):
457 n = 0
458 if (self.has_email_):
459 n += 1
460 n += self.lengthString(len(self.email_))
461 if (self.has_auth_domain_):
462 n += 1
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_):
466 n += 2
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_))
471 return n
473 def Clear(self):
474 self.clear_email()
475 self.clear_auth_domain()
476 self.clear_nickname()
477 self.clear_gaiaid()
478 self.clear_obfuscated_gaiaid()
479 self.clear_federated_identity()
480 self.clear_federated_provider()
482 def OutputUnchecked(self, out):
483 out.putVarInt32(74)
484 out.putPrefixedString(self.email_)
485 out.putVarInt32(82)
486 out.putPrefixedString(self.auth_domain_)
487 if (self.has_nickname_):
488 out.putVarInt32(90)
489 out.putPrefixedString(self.nickname_)
490 out.putVarInt32(144)
491 out.putVarInt64(self.gaiaid_)
492 if (self.has_obfuscated_gaiaid_):
493 out.putVarInt32(154)
494 out.putPrefixedString(self.obfuscated_gaiaid_)
495 if (self.has_federated_identity_):
496 out.putVarInt32(170)
497 out.putPrefixedString(self.federated_identity_)
498 if (self.has_federated_provider_):
499 out.putVarInt32(178)
500 out.putPrefixedString(self.federated_provider_)
502 def OutputPartial(self, out):
503 if (self.has_email_):
504 out.putVarInt32(74)
505 out.putPrefixedString(self.email_)
506 if (self.has_auth_domain_):
507 out.putVarInt32(82)
508 out.putPrefixedString(self.auth_domain_)
509 if (self.has_nickname_):
510 out.putVarInt32(90)
511 out.putPrefixedString(self.nickname_)
512 if (self.has_gaiaid_):
513 out.putVarInt32(144)
514 out.putVarInt64(self.gaiaid_)
515 if (self.has_obfuscated_gaiaid_):
516 out.putVarInt32(154)
517 out.putPrefixedString(self.obfuscated_gaiaid_)
518 if (self.has_federated_identity_):
519 out.putVarInt32(170)
520 out.putPrefixedString(self.federated_identity_)
521 if (self.has_federated_provider_):
522 out.putVarInt32(178)
523 out.putPrefixedString(self.federated_provider_)
525 def TryMerge(self, d):
526 while 1:
527 tt = d.getVarInt32()
528 if tt == 68: break
529 if tt == 74:
530 self.set_email(d.getPrefixedString())
531 continue
532 if tt == 82:
533 self.set_auth_domain(d.getPrefixedString())
534 continue
535 if tt == 90:
536 self.set_nickname(d.getPrefixedString())
537 continue
538 if tt == 144:
539 self.set_gaiaid(d.getVarInt64())
540 continue
541 if tt == 154:
542 self.set_obfuscated_gaiaid(d.getPrefixedString())
543 continue
544 if tt == 170:
545 self.set_federated_identity(d.getPrefixedString())
546 continue
547 if tt == 178:
548 self.set_federated_provider(d.getPrefixedString())
549 continue
552 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
553 d.skipData(tt)
556 def __str__(self, prefix="", printElemNumber=0):
557 res=""
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_))
565 return res
567 class PropertyValue_ReferenceValue(ProtocolBuffer.ProtocolMessage):
568 has_app_ = 0
569 app_ = ""
570 has_name_space_ = 0
571 name_space_ = ""
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):
580 self.has_app_ = 1
581 self.app_ = x
583 def clear_app(self):
584 if self.has_app_:
585 self.has_app_ = 0
586 self.app_ = ""
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
594 self.name_space_ = x
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)
615 return x
617 def clear_pathelement(self):
618 self.pathelement_ = []
620 def MergeFrom(self, x):
621 assert x is not self
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))
626 def Equals(self, x):
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
635 return 1
637 def IsInitialized(self, debug_strs=None):
638 initialized = 1
639 if (not self.has_app_):
640 initialized = 0
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
645 return initialized
647 def ByteSize(self):
648 n = 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()
653 return n + 1
655 def ByteSizePartial(self):
656 n = 0
657 if (self.has_app_):
658 n += 1
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()
663 return n
665 def Clear(self):
666 self.clear_app()
667 self.clear_name_space()
668 self.clear_pathelement()
670 def OutputUnchecked(self, out):
671 out.putVarInt32(106)
672 out.putPrefixedString(self.app_)
673 for i in xrange(len(self.pathelement_)):
674 out.putVarInt32(115)
675 self.pathelement_[i].OutputUnchecked(out)
676 out.putVarInt32(116)
677 if (self.has_name_space_):
678 out.putVarInt32(162)
679 out.putPrefixedString(self.name_space_)
681 def OutputPartial(self, out):
682 if (self.has_app_):
683 out.putVarInt32(106)
684 out.putPrefixedString(self.app_)
685 for i in xrange(len(self.pathelement_)):
686 out.putVarInt32(115)
687 self.pathelement_[i].OutputPartial(out)
688 out.putVarInt32(116)
689 if (self.has_name_space_):
690 out.putVarInt32(162)
691 out.putPrefixedString(self.name_space_)
693 def TryMerge(self, d):
694 while 1:
695 tt = d.getVarInt32()
696 if tt == 100: break
697 if tt == 106:
698 self.set_app(d.getPrefixedString())
699 continue
700 if tt == 115:
701 self.add_pathelement().TryMerge(d)
702 continue
703 if tt == 162:
704 self.set_name_space(d.getPrefixedString())
705 continue
708 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
709 d.skipData(tt)
712 def __str__(self, prefix="", printElemNumber=0):
713 res=""
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_))
716 cnt=0
717 for e in self.pathelement_:
718 elm=""
719 if printElemNumber: elm="(%d)" % cnt
720 res+=prefix+("PathElement%s {\n" % elm)
721 res+=e.__str__(prefix + " ", printElemNumber)
722 res+=prefix+"}\n"
723 cnt+=1
724 return res
726 class PropertyValue(ProtocolBuffer.ProtocolMessage):
727 has_int64value_ = 0
728 int64value_ = 0
729 has_booleanvalue_ = 0
730 booleanvalue_ = 0
731 has_stringvalue_ = 0
732 stringvalue_ = ""
733 has_doublevalue_ = 0
734 doublevalue_ = 0.0
735 has_pointvalue_ = 0
736 pointvalue_ = None
737 has_uservalue_ = 0
738 uservalue_ = None
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
750 self.int64value_ = x
752 def clear_int64value(self):
753 if self.has_int64value_:
754 self.has_int64value_ = 0
755 self.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()
801 try:
802 if self.pointvalue_ is None: self.pointvalue_ = PropertyValue_PointValue()
803 finally:
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_
817 def uservalue(self):
818 if self.uservalue_ is None:
819 self.lazy_init_lock_.acquire()
820 try:
821 if self.uservalue_ is None: self.uservalue_ = PropertyValue_UserValue()
822 finally:
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()
839 try:
840 if self.referencevalue_ is None: self.referencevalue_ = PropertyValue_ReferenceValue()
841 finally:
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):
857 assert x is not self
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())
866 def Equals(self, x):
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
882 return 1
884 def IsInitialized(self, debug_strs=None):
885 initialized = 1
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
889 return initialized
891 def ByteSize(self):
892 n = 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()
900 return n
902 def ByteSizePartial(self):
903 n = 0
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()
911 return n
913 def Clear(self):
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_):
924 out.putVarInt32(8)
925 out.putVarInt64(self.int64value_)
926 if (self.has_booleanvalue_):
927 out.putVarInt32(16)
928 out.putBoolean(self.booleanvalue_)
929 if (self.has_stringvalue_):
930 out.putVarInt32(26)
931 out.putPrefixedString(self.stringvalue_)
932 if (self.has_doublevalue_):
933 out.putVarInt32(33)
934 out.putDouble(self.doublevalue_)
935 if (self.has_pointvalue_):
936 out.putVarInt32(43)
937 self.pointvalue_.OutputUnchecked(out)
938 out.putVarInt32(44)
939 if (self.has_uservalue_):
940 out.putVarInt32(67)
941 self.uservalue_.OutputUnchecked(out)
942 out.putVarInt32(68)
943 if (self.has_referencevalue_):
944 out.putVarInt32(99)
945 self.referencevalue_.OutputUnchecked(out)
946 out.putVarInt32(100)
948 def OutputPartial(self, out):
949 if (self.has_int64value_):
950 out.putVarInt32(8)
951 out.putVarInt64(self.int64value_)
952 if (self.has_booleanvalue_):
953 out.putVarInt32(16)
954 out.putBoolean(self.booleanvalue_)
955 if (self.has_stringvalue_):
956 out.putVarInt32(26)
957 out.putPrefixedString(self.stringvalue_)
958 if (self.has_doublevalue_):
959 out.putVarInt32(33)
960 out.putDouble(self.doublevalue_)
961 if (self.has_pointvalue_):
962 out.putVarInt32(43)
963 self.pointvalue_.OutputPartial(out)
964 out.putVarInt32(44)
965 if (self.has_uservalue_):
966 out.putVarInt32(67)
967 self.uservalue_.OutputPartial(out)
968 out.putVarInt32(68)
969 if (self.has_referencevalue_):
970 out.putVarInt32(99)
971 self.referencevalue_.OutputPartial(out)
972 out.putVarInt32(100)
974 def TryMerge(self, d):
975 while d.avail() > 0:
976 tt = d.getVarInt32()
977 if tt == 8:
978 self.set_int64value(d.getVarInt64())
979 continue
980 if tt == 16:
981 self.set_booleanvalue(d.getBoolean())
982 continue
983 if tt == 26:
984 self.set_stringvalue(d.getPrefixedString())
985 continue
986 if tt == 33:
987 self.set_doublevalue(d.getDouble())
988 continue
989 if tt == 43:
990 self.mutable_pointvalue().TryMerge(d)
991 continue
992 if tt == 67:
993 self.mutable_uservalue().TryMerge(d)
994 continue
995 if tt == 99:
996 self.mutable_referencevalue().TryMerge(d)
997 continue
1000 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1001 d.skipData(tt)
1004 def __str__(self, prefix="", printElemNumber=0):
1005 res=""
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)
1013 res+=prefix+"}\n"
1014 if self.has_uservalue_:
1015 res+=prefix+"UserValue {\n"
1016 res+=self.uservalue_.__str__(prefix + " ", printElemNumber)
1017 res+=prefix+"}\n"
1018 if self.has_referencevalue_:
1019 res+=prefix+"ReferenceValue {\n"
1020 res+=self.referencevalue_.__str__(prefix + " ", printElemNumber)
1021 res+=prefix+"}\n"
1022 return res
1025 def _BuildTagLookupTable(sparse, maxtag, default=None):
1026 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1028 kint64Value = 1
1029 kbooleanValue = 2
1030 kstringValue = 3
1031 kdoubleValue = 4
1032 kPointValueGroup = 5
1033 kPointValuex = 6
1034 kPointValuey = 7
1035 kUserValueGroup = 8
1036 kUserValueemail = 9
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({
1052 0: "ErrorCode",
1053 1: "int64Value",
1054 2: "booleanValue",
1055 3: "stringValue",
1056 4: "doubleValue",
1057 5: "PointValue",
1058 6: "x",
1059 7: "y",
1060 8: "UserValue",
1061 9: "email",
1062 10: "auth_domain",
1063 11: "nickname",
1064 12: "ReferenceValue",
1065 13: "app",
1066 14: "PathElement",
1067 15: "type",
1068 16: "id",
1069 17: "name",
1070 18: "gaiaid",
1071 19: "obfuscated_gaiaid",
1072 20: "name_space",
1073 21: "federated_identity",
1074 22: "federated_provider",
1075 }, 22)
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)
1104 _STYLE = """"""
1105 _STYLE_CONTENT_TYPE = """"""
1106 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.PropertyValue'
1107 class Property(ProtocolBuffer.ProtocolMessage):
1110 NO_MEANING = 0
1111 BLOB = 14
1112 TEXT = 15
1113 BYTESTRING = 16
1114 ATOM_CATEGORY = 1
1115 ATOM_LINK = 2
1116 ATOM_TITLE = 3
1117 ATOM_CONTENT = 4
1118 ATOM_SUMMARY = 5
1119 ATOM_AUTHOR = 6
1120 GD_WHEN = 7
1121 GD_EMAIL = 8
1122 GEORSS_POINT = 9
1123 GD_IM = 10
1124 GD_PHONENUMBER = 11
1125 GD_POSTALADDRESS = 12
1126 GD_RATING = 13
1127 BLOBKEY = 17
1128 ENTITY_PROTO = 19
1129 INDEX_VALUE = 18
1131 _Meaning_NAMES = {
1132 0: "NO_MEANING",
1133 14: "BLOB",
1134 15: "TEXT",
1135 16: "BYTESTRING",
1136 1: "ATOM_CATEGORY",
1137 2: "ATOM_LINK",
1138 3: "ATOM_TITLE",
1139 4: "ATOM_CONTENT",
1140 5: "ATOM_SUMMARY",
1141 6: "ATOM_AUTHOR",
1142 7: "GD_WHEN",
1143 8: "GD_EMAIL",
1144 9: "GEORSS_POINT",
1145 10: "GD_IM",
1146 11: "GD_PHONENUMBER",
1147 12: "GD_POSTALADDRESS",
1148 13: "GD_RATING",
1149 17: "BLOBKEY",
1150 19: "ENTITY_PROTO",
1151 18: "INDEX_VALUE",
1154 def Meaning_Name(cls, x): return cls._Meaning_NAMES.get(x, "")
1155 Meaning_Name = classmethod(Meaning_Name)
1159 HTML = 1
1160 ATOM = 2
1162 _FtsTokenizationOption_NAMES = {
1163 1: "HTML",
1164 2: "ATOM",
1167 def FtsTokenizationOption_Name(cls, x): return cls._FtsTokenizationOption_NAMES.get(x, "")
1168 FtsTokenizationOption_Name = classmethod(FtsTokenizationOption_Name)
1170 has_meaning_ = 0
1171 meaning_ = 0
1172 has_meaning_uri_ = 0
1173 meaning_uri_ = ""
1174 has_name_ = 0
1175 name_ = ""
1176 has_value_ = 0
1177 has_multiple_ = 0
1178 multiple_ = 0
1179 has_searchable_ = 0
1180 searchable_ = 0
1181 has_fts_tokenization_option_ = 0
1182 fts_tokenization_option_ = 0
1183 has_locale_ = 0
1184 locale_ = "en"
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
1194 self.meaning_ = x
1196 def clear_meaning(self):
1197 if self.has_meaning_:
1198 self.has_meaning_ = 0
1199 self.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):
1219 self.has_name_ = 1
1220 self.name_ = x
1222 def clear_name(self):
1223 if self.has_name_:
1224 self.has_name_ = 0
1225 self.name_ = ""
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
1241 self.multiple_ = x
1243 def clear_multiple(self):
1244 if self.has_multiple_:
1245 self.has_multiple_ = 0
1246 self.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
1280 self.locale_ = x
1282 def clear_locale(self):
1283 if self.has_locale_:
1284 self.has_locale_ = 0
1285 self.locale_ = "en"
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
1319 return 1
1321 def IsInitialized(self, debug_strs=None):
1322 initialized = 1
1323 if (not self.has_name_):
1324 initialized = 0
1325 if debug_strs is not None:
1326 debug_strs.append('Required field: name not set.')
1327 if (not self.has_value_):
1328 initialized = 0
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_):
1333 initialized = 0
1334 if debug_strs is not None:
1335 debug_strs.append('Required field: multiple not set.')
1336 return initialized
1338 def ByteSize(self):
1339 n = 0
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_))
1347 return n + 4
1349 def ByteSizePartial(self):
1350 n = 0
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_):
1354 n += 1
1355 n += self.lengthString(len(self.name_))
1356 if (self.has_value_):
1357 n += 1
1358 n += self.lengthString(self.value_.ByteSizePartial())
1359 if (self.has_multiple_):
1360 n += 2
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_))
1364 return n
1366 def Clear(self):
1367 self.clear_meaning()
1368 self.clear_meaning_uri()
1369 self.clear_name()
1370 self.clear_value()
1371 self.clear_multiple()
1372 self.clear_searchable()
1373 self.clear_fts_tokenization_option()
1374 self.clear_locale()
1376 def OutputUnchecked(self, out):
1377 if (self.has_meaning_):
1378 out.putVarInt32(8)
1379 out.putVarInt32(self.meaning_)
1380 if (self.has_meaning_uri_):
1381 out.putVarInt32(18)
1382 out.putPrefixedString(self.meaning_uri_)
1383 out.putVarInt32(26)
1384 out.putPrefixedString(self.name_)
1385 out.putVarInt32(32)
1386 out.putBoolean(self.multiple_)
1387 out.putVarInt32(42)
1388 out.putVarInt32(self.value_.ByteSize())
1389 self.value_.OutputUnchecked(out)
1390 if (self.has_searchable_):
1391 out.putVarInt32(48)
1392 out.putBoolean(self.searchable_)
1393 if (self.has_fts_tokenization_option_):
1394 out.putVarInt32(64)
1395 out.putVarInt32(self.fts_tokenization_option_)
1396 if (self.has_locale_):
1397 out.putVarInt32(74)
1398 out.putPrefixedString(self.locale_)
1400 def OutputPartial(self, out):
1401 if (self.has_meaning_):
1402 out.putVarInt32(8)
1403 out.putVarInt32(self.meaning_)
1404 if (self.has_meaning_uri_):
1405 out.putVarInt32(18)
1406 out.putPrefixedString(self.meaning_uri_)
1407 if (self.has_name_):
1408 out.putVarInt32(26)
1409 out.putPrefixedString(self.name_)
1410 if (self.has_multiple_):
1411 out.putVarInt32(32)
1412 out.putBoolean(self.multiple_)
1413 if (self.has_value_):
1414 out.putVarInt32(42)
1415 out.putVarInt32(self.value_.ByteSizePartial())
1416 self.value_.OutputPartial(out)
1417 if (self.has_searchable_):
1418 out.putVarInt32(48)
1419 out.putBoolean(self.searchable_)
1420 if (self.has_fts_tokenization_option_):
1421 out.putVarInt32(64)
1422 out.putVarInt32(self.fts_tokenization_option_)
1423 if (self.has_locale_):
1424 out.putVarInt32(74)
1425 out.putPrefixedString(self.locale_)
1427 def TryMerge(self, d):
1428 while d.avail() > 0:
1429 tt = d.getVarInt32()
1430 if tt == 8:
1431 self.set_meaning(d.getVarInt32())
1432 continue
1433 if tt == 18:
1434 self.set_meaning_uri(d.getPrefixedString())
1435 continue
1436 if tt == 26:
1437 self.set_name(d.getPrefixedString())
1438 continue
1439 if tt == 32:
1440 self.set_multiple(d.getBoolean())
1441 continue
1442 if tt == 42:
1443 length = d.getVarInt32()
1444 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
1445 d.skip(length)
1446 self.mutable_value().TryMerge(tmp)
1447 continue
1448 if tt == 48:
1449 self.set_searchable(d.getBoolean())
1450 continue
1451 if tt == 64:
1452 self.set_fts_tokenization_option(d.getVarInt32())
1453 continue
1454 if tt == 74:
1455 self.set_locale(d.getPrefixedString())
1456 continue
1459 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1460 d.skipData(tt)
1463 def __str__(self, prefix="", printElemNumber=0):
1464 res=""
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_))
1468 if self.has_value_:
1469 res+=prefix+"value <\n"
1470 res+=self.value_.__str__(prefix + " ", printElemNumber)
1471 res+=prefix+">\n"
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_))
1476 return res
1479 def _BuildTagLookupTable(sparse, maxtag, default=None):
1480 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1482 kmeaning = 1
1483 kmeaning_uri = 2
1484 kname = 3
1485 kvalue = 5
1486 kmultiple = 4
1487 ksearchable = 6
1488 kfts_tokenization_option = 8
1489 klocale = 9
1491 _TEXT = _BuildTagLookupTable({
1492 0: "ErrorCode",
1493 1: "meaning",
1494 2: "meaning_uri",
1495 3: "name",
1496 4: "multiple",
1497 5: "value",
1498 6: "searchable",
1499 8: "fts_tokenization_option",
1500 9: "locale",
1501 }, 9)
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)
1516 _STYLE = """"""
1517 _STYLE_CONTENT_TYPE = """"""
1518 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.Property'
1519 class Path_Element(ProtocolBuffer.ProtocolMessage):
1520 has_type_ = 0
1521 type_ = ""
1522 has_id_ = 0
1523 id_ = 0
1524 has_name_ = 0
1525 name_ = ""
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):
1533 self.has_type_ = 1
1534 self.type_ = x
1536 def clear_type(self):
1537 if self.has_type_:
1538 self.has_type_ = 0
1539 self.type_ = ""
1541 def has_type(self): return self.has_type_
1543 def id(self): return self.id_
1545 def set_id(self, x):
1546 self.has_id_ = 1
1547 self.id_ = x
1549 def clear_id(self):
1550 if self.has_id_:
1551 self.has_id_ = 0
1552 self.id_ = 0
1554 def has_id(self): return self.has_id_
1556 def name(self): return self.name_
1558 def set_name(self, x):
1559 self.has_name_ = 1
1560 self.name_ = x
1562 def clear_name(self):
1563 if self.has_name_:
1564 self.has_name_ = 0
1565 self.name_ = ""
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
1584 return 1
1586 def IsInitialized(self, debug_strs=None):
1587 initialized = 1
1588 if (not self.has_type_):
1589 initialized = 0
1590 if debug_strs is not None:
1591 debug_strs.append('Required field: type not set.')
1592 return initialized
1594 def ByteSize(self):
1595 n = 0
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_))
1599 return n + 1
1601 def ByteSizePartial(self):
1602 n = 0
1603 if (self.has_type_):
1604 n += 1
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_))
1608 return n
1610 def Clear(self):
1611 self.clear_type()
1612 self.clear_id()
1613 self.clear_name()
1615 def OutputUnchecked(self, out):
1616 out.putVarInt32(18)
1617 out.putPrefixedString(self.type_)
1618 if (self.has_id_):
1619 out.putVarInt32(24)
1620 out.putVarInt64(self.id_)
1621 if (self.has_name_):
1622 out.putVarInt32(34)
1623 out.putPrefixedString(self.name_)
1625 def OutputPartial(self, out):
1626 if (self.has_type_):
1627 out.putVarInt32(18)
1628 out.putPrefixedString(self.type_)
1629 if (self.has_id_):
1630 out.putVarInt32(24)
1631 out.putVarInt64(self.id_)
1632 if (self.has_name_):
1633 out.putVarInt32(34)
1634 out.putPrefixedString(self.name_)
1636 def TryMerge(self, d):
1637 while 1:
1638 tt = d.getVarInt32()
1639 if tt == 12: break
1640 if tt == 18:
1641 self.set_type(d.getPrefixedString())
1642 continue
1643 if tt == 24:
1644 self.set_id(d.getVarInt64())
1645 continue
1646 if tt == 34:
1647 self.set_name(d.getPrefixedString())
1648 continue
1651 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1652 d.skipData(tt)
1655 def __str__(self, prefix="", printElemNumber=0):
1656 res=""
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_))
1660 return res
1662 class Path(ProtocolBuffer.ProtocolMessage):
1664 def __init__(self, contents=None):
1665 self.element_ = []
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):
1678 x = Path_Element()
1679 self.element_.append(x)
1680 return x
1682 def clear_element(self):
1683 self.element_ = []
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
1694 return 1
1696 def IsInitialized(self, debug_strs=None):
1697 initialized = 1
1698 for p in self.element_:
1699 if not p.IsInitialized(debug_strs): initialized=0
1700 return initialized
1702 def ByteSize(self):
1703 n = 0
1704 n += 2 * len(self.element_)
1705 for i in xrange(len(self.element_)): n += self.element_[i].ByteSize()
1706 return n
1708 def ByteSizePartial(self):
1709 n = 0
1710 n += 2 * len(self.element_)
1711 for i in xrange(len(self.element_)): n += self.element_[i].ByteSizePartial()
1712 return n
1714 def Clear(self):
1715 self.clear_element()
1717 def OutputUnchecked(self, out):
1718 for i in xrange(len(self.element_)):
1719 out.putVarInt32(11)
1720 self.element_[i].OutputUnchecked(out)
1721 out.putVarInt32(12)
1723 def OutputPartial(self, out):
1724 for i in xrange(len(self.element_)):
1725 out.putVarInt32(11)
1726 self.element_[i].OutputPartial(out)
1727 out.putVarInt32(12)
1729 def TryMerge(self, d):
1730 while d.avail() > 0:
1731 tt = d.getVarInt32()
1732 if tt == 11:
1733 self.add_element().TryMerge(d)
1734 continue
1737 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1738 d.skipData(tt)
1741 def __str__(self, prefix="", printElemNumber=0):
1742 res=""
1743 cnt=0
1744 for e in self.element_:
1745 elm=""
1746 if printElemNumber: elm="(%d)" % cnt
1747 res+=prefix+("Element%s {\n" % elm)
1748 res+=e.__str__(prefix + " ", printElemNumber)
1749 res+=prefix+"}\n"
1750 cnt+=1
1751 return res
1754 def _BuildTagLookupTable(sparse, maxtag, default=None):
1755 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1757 kElementGroup = 1
1758 kElementtype = 2
1759 kElementid = 3
1760 kElementname = 4
1762 _TEXT = _BuildTagLookupTable({
1763 0: "ErrorCode",
1764 1: "Element",
1765 2: "type",
1766 3: "id",
1767 4: "name",
1768 }, 4)
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)
1779 _STYLE = """"""
1780 _STYLE_CONTENT_TYPE = """"""
1781 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.Path'
1782 class Reference(ProtocolBuffer.ProtocolMessage):
1783 has_app_ = 0
1784 app_ = ""
1785 has_name_space_ = 0
1786 name_space_ = ""
1787 has_path_ = 0
1789 def __init__(self, contents=None):
1790 self.path_ = Path()
1791 if contents is not None: self.MergeFromString(contents)
1793 def app(self): return self.app_
1795 def set_app(self, x):
1796 self.has_app_ = 1
1797 self.app_ = x
1799 def clear_app(self):
1800 if self.has_app_:
1801 self.has_app_ = 0
1802 self.app_ = ""
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
1842 return 1
1844 def IsInitialized(self, debug_strs=None):
1845 initialized = 1
1846 if (not self.has_app_):
1847 initialized = 0
1848 if debug_strs is not None:
1849 debug_strs.append('Required field: app not set.')
1850 if (not self.has_path_):
1851 initialized = 0
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
1855 return initialized
1857 def ByteSize(self):
1858 n = 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())
1862 return n + 2
1864 def ByteSizePartial(self):
1865 n = 0
1866 if (self.has_app_):
1867 n += 1
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_):
1871 n += 1
1872 n += self.lengthString(self.path_.ByteSizePartial())
1873 return n
1875 def Clear(self):
1876 self.clear_app()
1877 self.clear_name_space()
1878 self.clear_path()
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):
1891 if (self.has_app_):
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()
1905 if tt == 106:
1906 self.set_app(d.getPrefixedString())
1907 continue
1908 if tt == 114:
1909 length = d.getVarInt32()
1910 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
1911 d.skip(length)
1912 self.mutable_path().TryMerge(tmp)
1913 continue
1914 if tt == 162:
1915 self.set_name_space(d.getPrefixedString())
1916 continue
1919 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1920 d.skipData(tt)
1923 def __str__(self, prefix="", printElemNumber=0):
1924 res=""
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_))
1927 if self.has_path_:
1928 res+=prefix+"path <\n"
1929 res+=self.path_.__str__(prefix + " ", printElemNumber)
1930 res+=prefix+">\n"
1931 return res
1934 def _BuildTagLookupTable(sparse, maxtag, default=None):
1935 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1937 kapp = 13
1938 kname_space = 20
1939 kpath = 14
1941 _TEXT = _BuildTagLookupTable({
1942 0: "ErrorCode",
1943 13: "app",
1944 14: "path",
1945 20: "name_space",
1946 }, 20)
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)
1956 _STYLE = """"""
1957 _STYLE_CONTENT_TYPE = """"""
1958 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.Reference'
1959 class User(ProtocolBuffer.ProtocolMessage):
1960 has_email_ = 0
1961 email_ = ""
1962 has_auth_domain_ = 0
1963 auth_domain_ = ""
1964 has_nickname_ = 0
1965 nickname_ = ""
1966 has_gaiaid_ = 0
1967 gaiaid_ = 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):
1981 self.has_email_ = 1
1982 self.email_ = x
1984 def clear_email(self):
1985 if self.has_email_:
1986 self.has_email_ = 0
1987 self.email_ = ""
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
2008 self.nickname_ = x
2010 def clear_nickname(self):
2011 if self.has_nickname_:
2012 self.has_nickname_ = 0
2013 self.nickname_ = ""
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
2021 self.gaiaid_ = x
2023 def clear_gaiaid(self):
2024 if self.has_gaiaid_:
2025 self.has_gaiaid_ = 0
2026 self.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
2096 return 1
2098 def IsInitialized(self, debug_strs=None):
2099 initialized = 1
2100 if (not self.has_email_):
2101 initialized = 0
2102 if debug_strs is not None:
2103 debug_strs.append('Required field: email not set.')
2104 if (not self.has_auth_domain_):
2105 initialized = 0
2106 if debug_strs is not None:
2107 debug_strs.append('Required field: auth_domain not set.')
2108 if (not self.has_gaiaid_):
2109 initialized = 0
2110 if debug_strs is not None:
2111 debug_strs.append('Required field: gaiaid not set.')
2112 return initialized
2114 def ByteSize(self):
2115 n = 0
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_))
2123 return n + 3
2125 def ByteSizePartial(self):
2126 n = 0
2127 if (self.has_email_):
2128 n += 1
2129 n += self.lengthString(len(self.email_))
2130 if (self.has_auth_domain_):
2131 n += 1
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_):
2135 n += 1
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_))
2140 return n
2142 def Clear(self):
2143 self.clear_email()
2144 self.clear_auth_domain()
2145 self.clear_nickname()
2146 self.clear_gaiaid()
2147 self.clear_obfuscated_gaiaid()
2148 self.clear_federated_identity()
2149 self.clear_federated_provider()
2151 def OutputUnchecked(self, out):
2152 out.putVarInt32(10)
2153 out.putPrefixedString(self.email_)
2154 out.putVarInt32(18)
2155 out.putPrefixedString(self.auth_domain_)
2156 if (self.has_nickname_):
2157 out.putVarInt32(26)
2158 out.putPrefixedString(self.nickname_)
2159 out.putVarInt32(32)
2160 out.putVarInt64(self.gaiaid_)
2161 if (self.has_obfuscated_gaiaid_):
2162 out.putVarInt32(42)
2163 out.putPrefixedString(self.obfuscated_gaiaid_)
2164 if (self.has_federated_identity_):
2165 out.putVarInt32(50)
2166 out.putPrefixedString(self.federated_identity_)
2167 if (self.has_federated_provider_):
2168 out.putVarInt32(58)
2169 out.putPrefixedString(self.federated_provider_)
2171 def OutputPartial(self, out):
2172 if (self.has_email_):
2173 out.putVarInt32(10)
2174 out.putPrefixedString(self.email_)
2175 if (self.has_auth_domain_):
2176 out.putVarInt32(18)
2177 out.putPrefixedString(self.auth_domain_)
2178 if (self.has_nickname_):
2179 out.putVarInt32(26)
2180 out.putPrefixedString(self.nickname_)
2181 if (self.has_gaiaid_):
2182 out.putVarInt32(32)
2183 out.putVarInt64(self.gaiaid_)
2184 if (self.has_obfuscated_gaiaid_):
2185 out.putVarInt32(42)
2186 out.putPrefixedString(self.obfuscated_gaiaid_)
2187 if (self.has_federated_identity_):
2188 out.putVarInt32(50)
2189 out.putPrefixedString(self.federated_identity_)
2190 if (self.has_federated_provider_):
2191 out.putVarInt32(58)
2192 out.putPrefixedString(self.federated_provider_)
2194 def TryMerge(self, d):
2195 while d.avail() > 0:
2196 tt = d.getVarInt32()
2197 if tt == 10:
2198 self.set_email(d.getPrefixedString())
2199 continue
2200 if tt == 18:
2201 self.set_auth_domain(d.getPrefixedString())
2202 continue
2203 if tt == 26:
2204 self.set_nickname(d.getPrefixedString())
2205 continue
2206 if tt == 32:
2207 self.set_gaiaid(d.getVarInt64())
2208 continue
2209 if tt == 42:
2210 self.set_obfuscated_gaiaid(d.getPrefixedString())
2211 continue
2212 if tt == 50:
2213 self.set_federated_identity(d.getPrefixedString())
2214 continue
2215 if tt == 58:
2216 self.set_federated_provider(d.getPrefixedString())
2217 continue
2220 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
2221 d.skipData(tt)
2224 def __str__(self, prefix="", printElemNumber=0):
2225 res=""
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_))
2233 return res
2236 def _BuildTagLookupTable(sparse, maxtag, default=None):
2237 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
2239 kemail = 1
2240 kauth_domain = 2
2241 knickname = 3
2242 kgaiaid = 4
2243 kobfuscated_gaiaid = 5
2244 kfederated_identity = 6
2245 kfederated_provider = 7
2247 _TEXT = _BuildTagLookupTable({
2248 0: "ErrorCode",
2249 1: "email",
2250 2: "auth_domain",
2251 3: "nickname",
2252 4: "gaiaid",
2253 5: "obfuscated_gaiaid",
2254 6: "federated_identity",
2255 7: "federated_provider",
2256 }, 7)
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)
2270 _STYLE = """"""
2271 _STYLE_CONTENT_TYPE = """"""
2272 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.User'
2273 class EntityProto(ProtocolBuffer.ProtocolMessage):
2276 GD_CONTACT = 1
2277 GD_EVENT = 2
2278 GD_MESSAGE = 3
2280 _Kind_NAMES = {
2281 1: "GD_CONTACT",
2282 2: "GD_EVENT",
2283 3: "GD_MESSAGE",
2286 def Kind_Name(cls, x): return cls._Kind_NAMES.get(x, "")
2287 Kind_Name = classmethod(Kind_Name)
2289 has_key_ = 0
2290 has_entity_group_ = 0
2291 has_owner_ = 0
2292 owner_ = None
2293 has_kind_ = 0
2294 kind_ = 0
2295 has_kind_uri_ = 0
2296 kind_uri_ = ""
2297 has_rank_ = 0
2298 rank_ = 0
2300 def __init__(self, contents=None):
2301 self.key_ = Reference()
2302 self.entity_group_ = Path()
2303 self.property_ = []
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_
2324 def owner(self):
2325 if self.owner_ is None:
2326 self.lazy_init_lock_.acquire()
2327 try:
2328 if self.owner_ is None: self.owner_ = User()
2329 finally:
2330 self.lazy_init_lock_.release()
2331 return self.owner_
2333 def mutable_owner(self): self.has_owner_ = 1; return self.owner()
2335 def clear_owner(self):
2337 if self.has_owner_:
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):
2346 self.has_kind_ = 1
2347 self.kind_ = x
2349 def clear_kind(self):
2350 if self.has_kind_:
2351 self.has_kind_ = 0
2352 self.kind_ = 0
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
2360 self.kind_uri_ = x
2362 def clear_kind_uri(self):
2363 if self.has_kind_uri_:
2364 self.has_kind_uri_ = 0
2365 self.kind_uri_ = ""
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):
2379 x = Property()
2380 self.property_.append(x)
2381 return x
2383 def clear_property(self):
2384 self.property_ = []
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):
2395 x = Property()
2396 self.raw_property_.append(x)
2397 return x
2399 def clear_raw_property(self):
2400 self.raw_property_ = []
2401 def rank(self): return self.rank_
2403 def set_rank(self, x):
2404 self.has_rank_ = 1
2405 self.rank_ = x
2407 def clear_rank(self):
2408 if self.has_rank_:
2409 self.has_rank_ = 0
2410 self.rank_ = 0
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
2446 return 1
2448 def IsInitialized(self, debug_strs=None):
2449 initialized = 1
2450 if (not self.has_key_):
2451 initialized = 0
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_):
2456 initialized = 0
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
2465 return initialized
2467 def ByteSize(self):
2468 n = 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_)
2479 return n + 3
2481 def ByteSizePartial(self):
2482 n = 0
2483 if (self.has_key_):
2484 n += 1
2485 n += self.lengthString(self.key_.ByteSizePartial())
2486 if (self.has_entity_group_):
2487 n += 2
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_)
2497 return n
2499 def Clear(self):
2500 self.clear_key()
2501 self.clear_entity_group()
2502 self.clear_owner()
2503 self.clear_kind()
2504 self.clear_kind_uri()
2505 self.clear_property()
2506 self.clear_raw_property()
2507 self.clear_rank()
2509 def OutputUnchecked(self, out):
2510 if (self.has_kind_):
2511 out.putVarInt32(32)
2512 out.putVarInt32(self.kind_)
2513 if (self.has_kind_uri_):
2514 out.putVarInt32(42)
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_):
2540 out.putVarInt32(32)
2541 out.putVarInt32(self.kind_)
2542 if (self.has_kind_uri_):
2543 out.putVarInt32(42)
2544 out.putPrefixedString(self.kind_uri_)
2545 if (self.has_key_):
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()
2572 if tt == 32:
2573 self.set_kind(d.getVarInt32())
2574 continue
2575 if tt == 42:
2576 self.set_kind_uri(d.getPrefixedString())
2577 continue
2578 if tt == 106:
2579 length = d.getVarInt32()
2580 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2581 d.skip(length)
2582 self.mutable_key().TryMerge(tmp)
2583 continue
2584 if tt == 114:
2585 length = d.getVarInt32()
2586 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2587 d.skip(length)
2588 self.add_property().TryMerge(tmp)
2589 continue
2590 if tt == 122:
2591 length = d.getVarInt32()
2592 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2593 d.skip(length)
2594 self.add_raw_property().TryMerge(tmp)
2595 continue
2596 if tt == 130:
2597 length = d.getVarInt32()
2598 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2599 d.skip(length)
2600 self.mutable_entity_group().TryMerge(tmp)
2601 continue
2602 if tt == 138:
2603 length = d.getVarInt32()
2604 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
2605 d.skip(length)
2606 self.mutable_owner().TryMerge(tmp)
2607 continue
2608 if tt == 144:
2609 self.set_rank(d.getVarInt32())
2610 continue
2613 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
2614 d.skipData(tt)
2617 def __str__(self, prefix="", printElemNumber=0):
2618 res=""
2619 if self.has_key_:
2620 res+=prefix+"key <\n"
2621 res+=self.key_.__str__(prefix + " ", printElemNumber)
2622 res+=prefix+">\n"
2623 if self.has_entity_group_:
2624 res+=prefix+"entity_group <\n"
2625 res+=self.entity_group_.__str__(prefix + " ", printElemNumber)
2626 res+=prefix+">\n"
2627 if self.has_owner_:
2628 res+=prefix+"owner <\n"
2629 res+=self.owner_.__str__(prefix + " ", printElemNumber)
2630 res+=prefix+">\n"
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_))
2633 cnt=0
2634 for e in self.property_:
2635 elm=""
2636 if printElemNumber: elm="(%d)" % cnt
2637 res+=prefix+("property%s <\n" % elm)
2638 res+=e.__str__(prefix + " ", printElemNumber)
2639 res+=prefix+">\n"
2640 cnt+=1
2641 cnt=0
2642 for e in self.raw_property_:
2643 elm=""
2644 if printElemNumber: elm="(%d)" % cnt
2645 res+=prefix+("raw_property%s <\n" % elm)
2646 res+=e.__str__(prefix + " ", printElemNumber)
2647 res+=prefix+">\n"
2648 cnt+=1
2649 if self.has_rank_: res+=prefix+("rank: %s\n" % self.DebugFormatInt32(self.rank_))
2650 return res
2653 def _BuildTagLookupTable(sparse, maxtag, default=None):
2654 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
2656 kkey = 13
2657 kentity_group = 16
2658 kowner = 17
2659 kkind = 4
2660 kkind_uri = 5
2661 kproperty = 14
2662 kraw_property = 15
2663 krank = 18
2665 _TEXT = _BuildTagLookupTable({
2666 0: "ErrorCode",
2667 4: "kind",
2668 5: "kind_uri",
2669 13: "key",
2670 14: "property",
2671 15: "raw_property",
2672 16: "entity_group",
2673 17: "owner",
2674 18: "rank",
2675 }, 18)
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)
2690 _STYLE = """"""
2691 _STYLE_CONTENT_TYPE = """"""
2692 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.EntityProto'
2693 class CompositeProperty(ProtocolBuffer.ProtocolMessage):
2694 has_index_id_ = 0
2695 index_id_ = 0
2697 def __init__(self, contents=None):
2698 self.value_ = []
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
2705 self.index_id_ = x
2707 def clear_index_id(self):
2708 if self.has_index_id_:
2709 self.has_index_id_ = 0
2710 self.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_
2717 def value(self, i):
2718 return self.value_[i]
2720 def set_value(self, i, x):
2721 self.value_[i] = x
2723 def add_value(self, x):
2724 self.value_.append(x)
2726 def clear_value(self):
2727 self.value_ = []
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
2742 return 1
2744 def IsInitialized(self, debug_strs=None):
2745 initialized = 1
2746 if (not self.has_index_id_):
2747 initialized = 0
2748 if debug_strs is not None:
2749 debug_strs.append('Required field: index_id not set.')
2750 return initialized
2752 def ByteSize(self):
2753 n = 0
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]))
2757 return n + 1
2759 def ByteSizePartial(self):
2760 n = 0
2761 if (self.has_index_id_):
2762 n += 1
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]))
2766 return n
2768 def Clear(self):
2769 self.clear_index_id()
2770 self.clear_value()
2772 def OutputUnchecked(self, out):
2773 out.putVarInt32(8)
2774 out.putVarInt64(self.index_id_)
2775 for i in xrange(len(self.value_)):
2776 out.putVarInt32(18)
2777 out.putPrefixedString(self.value_[i])
2779 def OutputPartial(self, out):
2780 if (self.has_index_id_):
2781 out.putVarInt32(8)
2782 out.putVarInt64(self.index_id_)
2783 for i in xrange(len(self.value_)):
2784 out.putVarInt32(18)
2785 out.putPrefixedString(self.value_[i])
2787 def TryMerge(self, d):
2788 while d.avail() > 0:
2789 tt = d.getVarInt32()
2790 if tt == 8:
2791 self.set_index_id(d.getVarInt64())
2792 continue
2793 if tt == 18:
2794 self.add_value(d.getPrefixedString())
2795 continue
2798 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
2799 d.skipData(tt)
2802 def __str__(self, prefix="", printElemNumber=0):
2803 res=""
2804 if self.has_index_id_: res+=prefix+("index_id: %s\n" % self.DebugFormatInt64(self.index_id_))
2805 cnt=0
2806 for e in self.value_:
2807 elm=""
2808 if printElemNumber: elm="(%d)" % cnt
2809 res+=prefix+("value%s: %s\n" % (elm, self.DebugFormatString(e)))
2810 cnt+=1
2811 return res
2814 def _BuildTagLookupTable(sparse, maxtag, default=None):
2815 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
2817 kindex_id = 1
2818 kvalue = 2
2820 _TEXT = _BuildTagLookupTable({
2821 0: "ErrorCode",
2822 1: "index_id",
2823 2: "value",
2824 }, 2)
2826 _TYPES = _BuildTagLookupTable({
2827 0: ProtocolBuffer.Encoder.NUMERIC,
2828 1: ProtocolBuffer.Encoder.NUMERIC,
2829 2: ProtocolBuffer.Encoder.STRING,
2830 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
2833 _STYLE = """"""
2834 _STYLE_CONTENT_TYPE = """"""
2835 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.CompositeProperty'
2836 class Index_Property(ProtocolBuffer.ProtocolMessage):
2839 ASCENDING = 1
2840 DESCENDING = 2
2842 _Direction_NAMES = {
2843 1: "ASCENDING",
2844 2: "DESCENDING",
2847 def Direction_Name(cls, x): return cls._Direction_NAMES.get(x, "")
2848 Direction_Name = classmethod(Direction_Name)
2850 has_name_ = 0
2851 name_ = ""
2852 has_direction_ = 0
2853 direction_ = 1
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):
2861 self.has_name_ = 1
2862 self.name_ = x
2864 def clear_name(self):
2865 if self.has_name_:
2866 self.has_name_ = 0
2867 self.name_ = ""
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
2875 self.direction_ = x
2877 def clear_direction(self):
2878 if self.has_direction_:
2879 self.has_direction_ = 0
2880 self.direction_ = 1
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
2896 return 1
2898 def IsInitialized(self, debug_strs=None):
2899 initialized = 1
2900 if (not self.has_name_):
2901 initialized = 0
2902 if debug_strs is not None:
2903 debug_strs.append('Required field: name not set.')
2904 return initialized
2906 def ByteSize(self):
2907 n = 0
2908 n += self.lengthString(len(self.name_))
2909 if (self.has_direction_): n += 1 + self.lengthVarInt64(self.direction_)
2910 return n + 1
2912 def ByteSizePartial(self):
2913 n = 0
2914 if (self.has_name_):
2915 n += 1
2916 n += self.lengthString(len(self.name_))
2917 if (self.has_direction_): n += 1 + self.lengthVarInt64(self.direction_)
2918 return n
2920 def Clear(self):
2921 self.clear_name()
2922 self.clear_direction()
2924 def OutputUnchecked(self, out):
2925 out.putVarInt32(26)
2926 out.putPrefixedString(self.name_)
2927 if (self.has_direction_):
2928 out.putVarInt32(32)
2929 out.putVarInt32(self.direction_)
2931 def OutputPartial(self, out):
2932 if (self.has_name_):
2933 out.putVarInt32(26)
2934 out.putPrefixedString(self.name_)
2935 if (self.has_direction_):
2936 out.putVarInt32(32)
2937 out.putVarInt32(self.direction_)
2939 def TryMerge(self, d):
2940 while 1:
2941 tt = d.getVarInt32()
2942 if tt == 20: break
2943 if tt == 26:
2944 self.set_name(d.getPrefixedString())
2945 continue
2946 if tt == 32:
2947 self.set_direction(d.getVarInt32())
2948 continue
2951 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
2952 d.skipData(tt)
2955 def __str__(self, prefix="", printElemNumber=0):
2956 res=""
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_))
2959 return res
2961 class Index(ProtocolBuffer.ProtocolMessage):
2962 has_entity_type_ = 0
2963 entity_type_ = ""
2964 has_ancestor_ = 0
2965 ancestor_ = 0
2967 def __init__(self, contents=None):
2968 self.property_ = []
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
2988 self.ancestor_ = x
2990 def clear_ancestor(self):
2991 if self.has_ancestor_:
2992 self.has_ancestor_ = 0
2993 self.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)
3009 return x
3011 def clear_property(self):
3012 self.property_ = []
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
3029 return 1
3031 def IsInitialized(self, debug_strs=None):
3032 initialized = 1
3033 if (not self.has_entity_type_):
3034 initialized = 0
3035 if debug_strs is not None:
3036 debug_strs.append('Required field: entity_type not set.')
3037 if (not self.has_ancestor_):
3038 initialized = 0
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
3043 return initialized
3045 def ByteSize(self):
3046 n = 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()
3050 return n + 3
3052 def ByteSizePartial(self):
3053 n = 0
3054 if (self.has_entity_type_):
3055 n += 1
3056 n += self.lengthString(len(self.entity_type_))
3057 if (self.has_ancestor_):
3058 n += 2
3059 n += 2 * len(self.property_)
3060 for i in xrange(len(self.property_)): n += self.property_[i].ByteSizePartial()
3061 return n
3063 def Clear(self):
3064 self.clear_entity_type()
3065 self.clear_ancestor()
3066 self.clear_property()
3068 def OutputUnchecked(self, out):
3069 out.putVarInt32(10)
3070 out.putPrefixedString(self.entity_type_)
3071 for i in xrange(len(self.property_)):
3072 out.putVarInt32(19)
3073 self.property_[i].OutputUnchecked(out)
3074 out.putVarInt32(20)
3075 out.putVarInt32(40)
3076 out.putBoolean(self.ancestor_)
3078 def OutputPartial(self, out):
3079 if (self.has_entity_type_):
3080 out.putVarInt32(10)
3081 out.putPrefixedString(self.entity_type_)
3082 for i in xrange(len(self.property_)):
3083 out.putVarInt32(19)
3084 self.property_[i].OutputPartial(out)
3085 out.putVarInt32(20)
3086 if (self.has_ancestor_):
3087 out.putVarInt32(40)
3088 out.putBoolean(self.ancestor_)
3090 def TryMerge(self, d):
3091 while d.avail() > 0:
3092 tt = d.getVarInt32()
3093 if tt == 10:
3094 self.set_entity_type(d.getPrefixedString())
3095 continue
3096 if tt == 19:
3097 self.add_property().TryMerge(d)
3098 continue
3099 if tt == 40:
3100 self.set_ancestor(d.getBoolean())
3101 continue
3104 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
3105 d.skipData(tt)
3108 def __str__(self, prefix="", printElemNumber=0):
3109 res=""
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_))
3112 cnt=0
3113 for e in self.property_:
3114 elm=""
3115 if printElemNumber: elm="(%d)" % cnt
3116 res+=prefix+("Property%s {\n" % elm)
3117 res+=e.__str__(prefix + " ", printElemNumber)
3118 res+=prefix+"}\n"
3119 cnt+=1
3120 return res
3123 def _BuildTagLookupTable(sparse, maxtag, default=None):
3124 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
3126 kentity_type = 1
3127 kancestor = 5
3128 kPropertyGroup = 2
3129 kPropertyname = 3
3130 kPropertydirection = 4
3132 _TEXT = _BuildTagLookupTable({
3133 0: "ErrorCode",
3134 1: "entity_type",
3135 2: "Property",
3136 3: "name",
3137 4: "direction",
3138 5: "ancestor",
3139 }, 5)
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)
3151 _STYLE = """"""
3152 _STYLE_CONTENT_TYPE = """"""
3153 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.Index'
3154 class CompositeIndex(ProtocolBuffer.ProtocolMessage):
3157 WRITE_ONLY = 1
3158 READ_WRITE = 2
3159 DELETED = 3
3160 ERROR = 4
3162 _State_NAMES = {
3163 1: "WRITE_ONLY",
3164 2: "READ_WRITE",
3165 3: "DELETED",
3166 4: "ERROR",
3169 def State_Name(cls, x): return cls._State_NAMES.get(x, "")
3170 State_Name = classmethod(State_Name)
3172 has_app_id_ = 0
3173 app_id_ = ""
3174 has_id_ = 0
3175 id_ = 0
3176 has_definition_ = 0
3177 has_state_ = 0
3178 state_ = 0
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
3190 self.app_id_ = x
3192 def clear_app_id(self):
3193 if self.has_app_id_:
3194 self.has_app_id_ = 0
3195 self.app_id_ = ""
3197 def has_app_id(self): return self.has_app_id_
3199 def id(self): return self.id_
3201 def set_id(self, x):
3202 self.has_id_ = 1
3203 self.id_ = x
3205 def clear_id(self):
3206 if self.has_id_:
3207 self.has_id_ = 0
3208 self.id_ = 0
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):
3223 self.has_state_ = 1
3224 self.state_ = x
3226 def clear_state(self):
3227 if self.has_state_:
3228 self.has_state_ = 0
3229 self.state_ = 0
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
3267 return 1
3269 def IsInitialized(self, debug_strs=None):
3270 initialized = 1
3271 if (not self.has_app_id_):
3272 initialized = 0
3273 if debug_strs is not None:
3274 debug_strs.append('Required field: app_id not set.')
3275 if (not self.has_id_):
3276 initialized = 0
3277 if debug_strs is not None:
3278 debug_strs.append('Required field: id not set.')
3279 if (not self.has_definition_):
3280 initialized = 0
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_):
3285 initialized = 0
3286 if debug_strs is not None:
3287 debug_strs.append('Required field: state not set.')
3288 return initialized
3290 def ByteSize(self):
3291 n = 0
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
3297 return n + 4
3299 def ByteSizePartial(self):
3300 n = 0
3301 if (self.has_app_id_):
3302 n += 1
3303 n += self.lengthString(len(self.app_id_))
3304 if (self.has_id_):
3305 n += 1
3306 n += self.lengthVarInt64(self.id_)
3307 if (self.has_definition_):
3308 n += 1
3309 n += self.lengthString(self.definition_.ByteSizePartial())
3310 if (self.has_state_):
3311 n += 1
3312 n += self.lengthVarInt64(self.state_)
3313 if (self.has_only_use_if_required_): n += 2
3314 return n
3316 def Clear(self):
3317 self.clear_app_id()
3318 self.clear_id()
3319 self.clear_definition()
3320 self.clear_state()
3321 self.clear_only_use_if_required()
3323 def OutputUnchecked(self, out):
3324 out.putVarInt32(10)
3325 out.putPrefixedString(self.app_id_)
3326 out.putVarInt32(16)
3327 out.putVarInt64(self.id_)
3328 out.putVarInt32(26)
3329 out.putVarInt32(self.definition_.ByteSize())
3330 self.definition_.OutputUnchecked(out)
3331 out.putVarInt32(32)
3332 out.putVarInt32(self.state_)
3333 if (self.has_only_use_if_required_):
3334 out.putVarInt32(48)
3335 out.putBoolean(self.only_use_if_required_)
3337 def OutputPartial(self, out):
3338 if (self.has_app_id_):
3339 out.putVarInt32(10)
3340 out.putPrefixedString(self.app_id_)
3341 if (self.has_id_):
3342 out.putVarInt32(16)
3343 out.putVarInt64(self.id_)
3344 if (self.has_definition_):
3345 out.putVarInt32(26)
3346 out.putVarInt32(self.definition_.ByteSizePartial())
3347 self.definition_.OutputPartial(out)
3348 if (self.has_state_):
3349 out.putVarInt32(32)
3350 out.putVarInt32(self.state_)
3351 if (self.has_only_use_if_required_):
3352 out.putVarInt32(48)
3353 out.putBoolean(self.only_use_if_required_)
3355 def TryMerge(self, d):
3356 while d.avail() > 0:
3357 tt = d.getVarInt32()
3358 if tt == 10:
3359 self.set_app_id(d.getPrefixedString())
3360 continue
3361 if tt == 16:
3362 self.set_id(d.getVarInt64())
3363 continue
3364 if tt == 26:
3365 length = d.getVarInt32()
3366 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
3367 d.skip(length)
3368 self.mutable_definition().TryMerge(tmp)
3369 continue
3370 if tt == 32:
3371 self.set_state(d.getVarInt32())
3372 continue
3373 if tt == 48:
3374 self.set_only_use_if_required(d.getBoolean())
3375 continue
3378 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
3379 d.skipData(tt)
3382 def __str__(self, prefix="", printElemNumber=0):
3383 res=""
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)
3389 res+=prefix+">\n"
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_))
3392 return res
3395 def _BuildTagLookupTable(sparse, maxtag, default=None):
3396 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
3398 kapp_id = 1
3399 kid = 2
3400 kdefinition = 3
3401 kstate = 4
3402 konly_use_if_required = 6
3404 _TEXT = _BuildTagLookupTable({
3405 0: "ErrorCode",
3406 1: "app_id",
3407 2: "id",
3408 3: "definition",
3409 4: "state",
3410 6: "only_use_if_required",
3411 }, 6)
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)
3423 _STYLE = """"""
3424 _STYLE_CONTENT_TYPE = """"""
3425 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.CompositeIndex'
3426 class IndexPostfix_IndexValue(ProtocolBuffer.ProtocolMessage):
3427 has_property_name_ = 0
3428 property_name_ = ""
3429 has_value_ = 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
3468 return 1
3470 def IsInitialized(self, debug_strs=None):
3471 initialized = 1
3472 if (not self.has_property_name_):
3473 initialized = 0
3474 if debug_strs is not None:
3475 debug_strs.append('Required field: property_name not set.')
3476 if (not self.has_value_):
3477 initialized = 0
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
3481 return initialized
3483 def ByteSize(self):
3484 n = 0
3485 n += self.lengthString(len(self.property_name_))
3486 n += self.lengthString(self.value_.ByteSize())
3487 return n + 2
3489 def ByteSizePartial(self):
3490 n = 0
3491 if (self.has_property_name_):
3492 n += 1
3493 n += self.lengthString(len(self.property_name_))
3494 if (self.has_value_):
3495 n += 1
3496 n += self.lengthString(self.value_.ByteSizePartial())
3497 return n
3499 def Clear(self):
3500 self.clear_property_name()
3501 self.clear_value()
3503 def OutputUnchecked(self, out):
3504 out.putVarInt32(10)
3505 out.putPrefixedString(self.property_name_)
3506 out.putVarInt32(18)
3507 out.putVarInt32(self.value_.ByteSize())
3508 self.value_.OutputUnchecked(out)
3510 def OutputPartial(self, out):
3511 if (self.has_property_name_):
3512 out.putVarInt32(10)
3513 out.putPrefixedString(self.property_name_)
3514 if (self.has_value_):
3515 out.putVarInt32(18)
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()
3522 if tt == 10:
3523 self.set_property_name(d.getPrefixedString())
3524 continue
3525 if tt == 18:
3526 length = d.getVarInt32()
3527 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
3528 d.skip(length)
3529 self.mutable_value().TryMerge(tmp)
3530 continue
3533 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
3534 d.skipData(tt)
3537 def __str__(self, prefix="", printElemNumber=0):
3538 res=""
3539 if self.has_property_name_: res+=prefix+("property_name: %s\n" % self.DebugFormatString(self.property_name_))
3540 if self.has_value_:
3541 res+=prefix+"value <\n"
3542 res+=self.value_.__str__(prefix + " ", printElemNumber)
3543 res+=prefix+">\n"
3544 return res
3547 def _BuildTagLookupTable(sparse, maxtag, default=None):
3548 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
3550 kproperty_name = 1
3551 kvalue = 2
3553 _TEXT = _BuildTagLookupTable({
3554 0: "ErrorCode",
3555 1: "property_name",
3556 2: "value",
3557 }, 2)
3559 _TYPES = _BuildTagLookupTable({
3560 0: ProtocolBuffer.Encoder.NUMERIC,
3561 1: ProtocolBuffer.Encoder.STRING,
3562 2: ProtocolBuffer.Encoder.STRING,
3563 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
3566 _STYLE = """"""
3567 _STYLE_CONTENT_TYPE = """"""
3568 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.IndexPostfix_IndexValue'
3569 class IndexPostfix(ProtocolBuffer.ProtocolMessage):
3570 has_key_ = 0
3571 key_ = None
3572 has_before_ = 0
3573 before_ = 1
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)
3592 return x
3594 def clear_index_value(self):
3595 self.index_value_ = []
3596 def key(self):
3597 if self.key_ is None:
3598 self.lazy_init_lock_.acquire()
3599 try:
3600 if self.key_ is None: self.key_ = Reference()
3601 finally:
3602 self.lazy_init_lock_.release()
3603 return self.key_
3605 def mutable_key(self): self.has_key_ = 1; return self.key()
3607 def clear_key(self):
3609 if self.has_key_:
3610 self.has_key_ = 0;
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
3619 self.before_ = x
3621 def clear_before(self):
3622 if self.has_before_:
3623 self.has_before_ = 0
3624 self.before_ = 1
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
3644 return 1
3646 def IsInitialized(self, debug_strs=None):
3647 initialized = 1
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
3651 return initialized
3653 def ByteSize(self):
3654 n = 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
3659 return n
3661 def ByteSizePartial(self):
3662 n = 0
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
3667 return n
3669 def Clear(self):
3670 self.clear_index_value()
3671 self.clear_key()
3672 self.clear_before()
3674 def OutputUnchecked(self, out):
3675 for i in xrange(len(self.index_value_)):
3676 out.putVarInt32(10)
3677 out.putVarInt32(self.index_value_[i].ByteSize())
3678 self.index_value_[i].OutputUnchecked(out)
3679 if (self.has_key_):
3680 out.putVarInt32(18)
3681 out.putVarInt32(self.key_.ByteSize())
3682 self.key_.OutputUnchecked(out)
3683 if (self.has_before_):
3684 out.putVarInt32(24)
3685 out.putBoolean(self.before_)
3687 def OutputPartial(self, out):
3688 for i in xrange(len(self.index_value_)):
3689 out.putVarInt32(10)
3690 out.putVarInt32(self.index_value_[i].ByteSizePartial())
3691 self.index_value_[i].OutputPartial(out)
3692 if (self.has_key_):
3693 out.putVarInt32(18)
3694 out.putVarInt32(self.key_.ByteSizePartial())
3695 self.key_.OutputPartial(out)
3696 if (self.has_before_):
3697 out.putVarInt32(24)
3698 out.putBoolean(self.before_)
3700 def TryMerge(self, d):
3701 while d.avail() > 0:
3702 tt = d.getVarInt32()
3703 if tt == 10:
3704 length = d.getVarInt32()
3705 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
3706 d.skip(length)
3707 self.add_index_value().TryMerge(tmp)
3708 continue
3709 if tt == 18:
3710 length = d.getVarInt32()
3711 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
3712 d.skip(length)
3713 self.mutable_key().TryMerge(tmp)
3714 continue
3715 if tt == 24:
3716 self.set_before(d.getBoolean())
3717 continue
3720 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
3721 d.skipData(tt)
3724 def __str__(self, prefix="", printElemNumber=0):
3725 res=""
3726 cnt=0
3727 for e in self.index_value_:
3728 elm=""
3729 if printElemNumber: elm="(%d)" % cnt
3730 res+=prefix+("index_value%s <\n" % elm)
3731 res+=e.__str__(prefix + " ", printElemNumber)
3732 res+=prefix+">\n"
3733 cnt+=1
3734 if self.has_key_:
3735 res+=prefix+"key <\n"
3736 res+=self.key_.__str__(prefix + " ", printElemNumber)
3737 res+=prefix+">\n"
3738 if self.has_before_: res+=prefix+("before: %s\n" % self.DebugFormatBool(self.before_))
3739 return res
3742 def _BuildTagLookupTable(sparse, maxtag, default=None):
3743 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
3745 kindex_value = 1
3746 kkey = 2
3747 kbefore = 3
3749 _TEXT = _BuildTagLookupTable({
3750 0: "ErrorCode",
3751 1: "index_value",
3752 2: "key",
3753 3: "before",
3754 }, 3)
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)
3764 _STYLE = """"""
3765 _STYLE_CONTENT_TYPE = """"""
3766 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.IndexPostfix'
3767 if _extension_runtime:
3768 pass
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']