1# Copyright 2016 Google LLC. All Rights Reserved. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# Generated by the protocol buffer compiler. DO NOT EDIT! 15# source: storage/onestore/v3/entity.proto 16 17from __future__ import absolute_import 18from googlecloudsdk.third_party.appengine.proto import ProtocolBuffer 19import abc 20import array 21 22 23try: 24 from six.moves._thread import allocate_lock as _Lock 25except ImportError: 26 from threading import Lock as _Lock 27 28if hasattr(__builtins__, 'xrange'): range = xrange 29 30if hasattr(ProtocolBuffer, 'ExtendableProtocolMessage'): 31 _extension_runtime = True 32 _ExtendableProtocolMessage = ProtocolBuffer.ExtendableProtocolMessage 33else: 34 _extension_runtime = False 35 _ExtendableProtocolMessage = ProtocolBuffer.ProtocolMessage 36 37class PropertyValue_ReferenceValuePathElement(ProtocolBuffer.ProtocolMessage): 38 has_type_ = 0 39 type_ = "" 40 has_id_ = 0 41 id_ = 0 42 has_name_ = 0 43 name_ = "" 44 45 def __init__(self, contents=None): 46 if contents is not None: self.MergeFromString(contents) 47 48 def type(self): return self.type_ 49 50 def set_type(self, x): 51 self.has_type_ = 1 52 self.type_ = x 53 54 def clear_type(self): 55 if self.has_type_: 56 self.has_type_ = 0 57 self.type_ = "" 58 59 def has_type(self): return self.has_type_ 60 61 def id(self): return self.id_ 62 63 def set_id(self, x): 64 self.has_id_ = 1 65 self.id_ = x 66 67 def clear_id(self): 68 if self.has_id_: 69 self.has_id_ = 0 70 self.id_ = 0 71 72 def has_id(self): return self.has_id_ 73 74 def name(self): return self.name_ 75 76 def set_name(self, x): 77 self.has_name_ = 1 78 self.name_ = x 79 80 def clear_name(self): 81 if self.has_name_: 82 self.has_name_ = 0 83 self.name_ = "" 84 85 def has_name(self): return self.has_name_ 86 87 88 def MergeFrom(self, x): 89 assert x is not self 90 if (x.has_type()): self.set_type(x.type()) 91 if (x.has_id()): self.set_id(x.id()) 92 if (x.has_name()): self.set_name(x.name()) 93 94 def Equals(self, x): 95 if x is self: return 1 96 if self.has_type_ != x.has_type_: return 0 97 if self.has_type_ and self.type_ != x.type_: return 0 98 if self.has_id_ != x.has_id_: return 0 99 if self.has_id_ and self.id_ != x.id_: return 0 100 if self.has_name_ != x.has_name_: return 0 101 if self.has_name_ and self.name_ != x.name_: return 0 102 return 1 103 104 def IsInitialized(self, debug_strs=None): 105 initialized = 1 106 if (not self.has_type_): 107 initialized = 0 108 if debug_strs is not None: 109 debug_strs.append('Required field: type not set.') 110 return initialized 111 112 def ByteSize(self): 113 n = 0 114 n += self.lengthString(len(self.type_)) 115 if (self.has_id_): n += 2 + self.lengthVarInt64(self.id_) 116 if (self.has_name_): n += 2 + self.lengthString(len(self.name_)) 117 return n + 1 118 119 def ByteSizePartial(self): 120 n = 0 121 if (self.has_type_): 122 n += 1 123 n += self.lengthString(len(self.type_)) 124 if (self.has_id_): n += 2 + self.lengthVarInt64(self.id_) 125 if (self.has_name_): n += 2 + self.lengthString(len(self.name_)) 126 return n 127 128 def Clear(self): 129 self.clear_type() 130 self.clear_id() 131 self.clear_name() 132 133 def OutputUnchecked(self, out): 134 out.putVarInt32(122) 135 out.putPrefixedString(self.type_) 136 if (self.has_id_): 137 out.putVarInt32(128) 138 out.putVarInt64(self.id_) 139 if (self.has_name_): 140 out.putVarInt32(138) 141 out.putPrefixedString(self.name_) 142 143 def OutputPartial(self, out): 144 if (self.has_type_): 145 out.putVarInt32(122) 146 out.putPrefixedString(self.type_) 147 if (self.has_id_): 148 out.putVarInt32(128) 149 out.putVarInt64(self.id_) 150 if (self.has_name_): 151 out.putVarInt32(138) 152 out.putPrefixedString(self.name_) 153 154 def TryMerge(self, d): 155 while 1: 156 tt = d.getVarInt32() 157 if tt == 116: break 158 if tt == 122: 159 self.set_type(d.getPrefixedString()) 160 continue 161 if tt == 128: 162 self.set_id(d.getVarInt64()) 163 continue 164 if tt == 138: 165 self.set_name(d.getPrefixedString()) 166 continue 167 # tag 0 is special: it's used to indicate an error. 168 # so if we see it we raise an exception. 169 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 170 d.skipData(tt) 171 172 173 def __str__(self, prefix="", printElemNumber=0): 174 res="" 175 if self.has_type_: res+=prefix+("type: %s\n" % self.DebugFormatString(self.type_)) 176 if self.has_id_: res+=prefix+("id: %s\n" % self.DebugFormatInt64(self.id_)) 177 if self.has_name_: res+=prefix+("name: %s\n" % self.DebugFormatString(self.name_)) 178 return res 179 180class PropertyValue_PointValue(ProtocolBuffer.ProtocolMessage): 181 has_x_ = 0 182 x_ = 0.0 183 has_y_ = 0 184 y_ = 0.0 185 186 def __init__(self, contents=None): 187 if contents is not None: self.MergeFromString(contents) 188 189 def x(self): return self.x_ 190 191 def set_x(self, x): 192 self.has_x_ = 1 193 self.x_ = x 194 195 def clear_x(self): 196 if self.has_x_: 197 self.has_x_ = 0 198 self.x_ = 0.0 199 200 def has_x(self): return self.has_x_ 201 202 def y(self): return self.y_ 203 204 def set_y(self, x): 205 self.has_y_ = 1 206 self.y_ = x 207 208 def clear_y(self): 209 if self.has_y_: 210 self.has_y_ = 0 211 self.y_ = 0.0 212 213 def has_y(self): return self.has_y_ 214 215 216 def MergeFrom(self, x): 217 assert x is not self 218 if (x.has_x()): self.set_x(x.x()) 219 if (x.has_y()): self.set_y(x.y()) 220 221 def Equals(self, x): 222 if x is self: return 1 223 if self.has_x_ != x.has_x_: return 0 224 if self.has_x_ and self.x_ != x.x_: return 0 225 if self.has_y_ != x.has_y_: return 0 226 if self.has_y_ and self.y_ != x.y_: return 0 227 return 1 228 229 def IsInitialized(self, debug_strs=None): 230 initialized = 1 231 if (not self.has_x_): 232 initialized = 0 233 if debug_strs is not None: 234 debug_strs.append('Required field: x not set.') 235 if (not self.has_y_): 236 initialized = 0 237 if debug_strs is not None: 238 debug_strs.append('Required field: y not set.') 239 return initialized 240 241 def ByteSize(self): 242 n = 0 243 return n + 18 244 245 def ByteSizePartial(self): 246 n = 0 247 if (self.has_x_): 248 n += 9 249 if (self.has_y_): 250 n += 9 251 return n 252 253 def Clear(self): 254 self.clear_x() 255 self.clear_y() 256 257 def OutputUnchecked(self, out): 258 out.putVarInt32(49) 259 out.putDouble(self.x_) 260 out.putVarInt32(57) 261 out.putDouble(self.y_) 262 263 def OutputPartial(self, out): 264 if (self.has_x_): 265 out.putVarInt32(49) 266 out.putDouble(self.x_) 267 if (self.has_y_): 268 out.putVarInt32(57) 269 out.putDouble(self.y_) 270 271 def TryMerge(self, d): 272 while 1: 273 tt = d.getVarInt32() 274 if tt == 44: break 275 if tt == 49: 276 self.set_x(d.getDouble()) 277 continue 278 if tt == 57: 279 self.set_y(d.getDouble()) 280 continue 281 # tag 0 is special: it's used to indicate an error. 282 # so if we see it we raise an exception. 283 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 284 d.skipData(tt) 285 286 287 def __str__(self, prefix="", printElemNumber=0): 288 res="" 289 if self.has_x_: res+=prefix+("x: %s\n" % self.DebugFormat(self.x_)) 290 if self.has_y_: res+=prefix+("y: %s\n" % self.DebugFormat(self.y_)) 291 return res 292 293class PropertyValue_UserValue(ProtocolBuffer.ProtocolMessage): 294 has_email_ = 0 295 email_ = "" 296 has_auth_domain_ = 0 297 auth_domain_ = "" 298 has_nickname_ = 0 299 nickname_ = "" 300 has_gaiaid_ = 0 301 gaiaid_ = 0 302 has_obfuscated_gaiaid_ = 0 303 obfuscated_gaiaid_ = "" 304 has_federated_identity_ = 0 305 federated_identity_ = "" 306 has_federated_provider_ = 0 307 federated_provider_ = "" 308 309 def __init__(self, contents=None): 310 if contents is not None: self.MergeFromString(contents) 311 312 def email(self): return self.email_ 313 314 def set_email(self, x): 315 self.has_email_ = 1 316 self.email_ = x 317 318 def clear_email(self): 319 if self.has_email_: 320 self.has_email_ = 0 321 self.email_ = "" 322 323 def has_email(self): return self.has_email_ 324 325 def auth_domain(self): return self.auth_domain_ 326 327 def set_auth_domain(self, x): 328 self.has_auth_domain_ = 1 329 self.auth_domain_ = x 330 331 def clear_auth_domain(self): 332 if self.has_auth_domain_: 333 self.has_auth_domain_ = 0 334 self.auth_domain_ = "" 335 336 def has_auth_domain(self): return self.has_auth_domain_ 337 338 def nickname(self): return self.nickname_ 339 340 def set_nickname(self, x): 341 self.has_nickname_ = 1 342 self.nickname_ = x 343 344 def clear_nickname(self): 345 if self.has_nickname_: 346 self.has_nickname_ = 0 347 self.nickname_ = "" 348 349 def has_nickname(self): return self.has_nickname_ 350 351 def gaiaid(self): return self.gaiaid_ 352 353 def set_gaiaid(self, x): 354 self.has_gaiaid_ = 1 355 self.gaiaid_ = x 356 357 def clear_gaiaid(self): 358 if self.has_gaiaid_: 359 self.has_gaiaid_ = 0 360 self.gaiaid_ = 0 361 362 def has_gaiaid(self): return self.has_gaiaid_ 363 364 def obfuscated_gaiaid(self): return self.obfuscated_gaiaid_ 365 366 def set_obfuscated_gaiaid(self, x): 367 self.has_obfuscated_gaiaid_ = 1 368 self.obfuscated_gaiaid_ = x 369 370 def clear_obfuscated_gaiaid(self): 371 if self.has_obfuscated_gaiaid_: 372 self.has_obfuscated_gaiaid_ = 0 373 self.obfuscated_gaiaid_ = "" 374 375 def has_obfuscated_gaiaid(self): return self.has_obfuscated_gaiaid_ 376 377 def federated_identity(self): return self.federated_identity_ 378 379 def set_federated_identity(self, x): 380 self.has_federated_identity_ = 1 381 self.federated_identity_ = x 382 383 def clear_federated_identity(self): 384 if self.has_federated_identity_: 385 self.has_federated_identity_ = 0 386 self.federated_identity_ = "" 387 388 def has_federated_identity(self): return self.has_federated_identity_ 389 390 def federated_provider(self): return self.federated_provider_ 391 392 def set_federated_provider(self, x): 393 self.has_federated_provider_ = 1 394 self.federated_provider_ = x 395 396 def clear_federated_provider(self): 397 if self.has_federated_provider_: 398 self.has_federated_provider_ = 0 399 self.federated_provider_ = "" 400 401 def has_federated_provider(self): return self.has_federated_provider_ 402 403 404 def MergeFrom(self, x): 405 assert x is not self 406 if (x.has_email()): self.set_email(x.email()) 407 if (x.has_auth_domain()): self.set_auth_domain(x.auth_domain()) 408 if (x.has_nickname()): self.set_nickname(x.nickname()) 409 if (x.has_gaiaid()): self.set_gaiaid(x.gaiaid()) 410 if (x.has_obfuscated_gaiaid()): self.set_obfuscated_gaiaid(x.obfuscated_gaiaid()) 411 if (x.has_federated_identity()): self.set_federated_identity(x.federated_identity()) 412 if (x.has_federated_provider()): self.set_federated_provider(x.federated_provider()) 413 414 def Equals(self, x): 415 if x is self: return 1 416 if self.has_email_ != x.has_email_: return 0 417 if self.has_email_ and self.email_ != x.email_: return 0 418 if self.has_auth_domain_ != x.has_auth_domain_: return 0 419 if self.has_auth_domain_ and self.auth_domain_ != x.auth_domain_: return 0 420 if self.has_nickname_ != x.has_nickname_: return 0 421 if self.has_nickname_ and self.nickname_ != x.nickname_: return 0 422 if self.has_gaiaid_ != x.has_gaiaid_: return 0 423 if self.has_gaiaid_ and self.gaiaid_ != x.gaiaid_: return 0 424 if self.has_obfuscated_gaiaid_ != x.has_obfuscated_gaiaid_: return 0 425 if self.has_obfuscated_gaiaid_ and self.obfuscated_gaiaid_ != x.obfuscated_gaiaid_: return 0 426 if self.has_federated_identity_ != x.has_federated_identity_: return 0 427 if self.has_federated_identity_ and self.federated_identity_ != x.federated_identity_: return 0 428 if self.has_federated_provider_ != x.has_federated_provider_: return 0 429 if self.has_federated_provider_ and self.federated_provider_ != x.federated_provider_: return 0 430 return 1 431 432 def IsInitialized(self, debug_strs=None): 433 initialized = 1 434 if (not self.has_email_): 435 initialized = 0 436 if debug_strs is not None: 437 debug_strs.append('Required field: email not set.') 438 if (not self.has_auth_domain_): 439 initialized = 0 440 if debug_strs is not None: 441 debug_strs.append('Required field: auth_domain not set.') 442 if (not self.has_gaiaid_): 443 initialized = 0 444 if debug_strs is not None: 445 debug_strs.append('Required field: gaiaid not set.') 446 return initialized 447 448 def ByteSize(self): 449 n = 0 450 n += self.lengthString(len(self.email_)) 451 n += self.lengthString(len(self.auth_domain_)) 452 if (self.has_nickname_): n += 1 + self.lengthString(len(self.nickname_)) 453 n += self.lengthVarInt64(self.gaiaid_) 454 if (self.has_obfuscated_gaiaid_): n += 2 + self.lengthString(len(self.obfuscated_gaiaid_)) 455 if (self.has_federated_identity_): n += 2 + self.lengthString(len(self.federated_identity_)) 456 if (self.has_federated_provider_): n += 2 + self.lengthString(len(self.federated_provider_)) 457 return n + 4 458 459 def ByteSizePartial(self): 460 n = 0 461 if (self.has_email_): 462 n += 1 463 n += self.lengthString(len(self.email_)) 464 if (self.has_auth_domain_): 465 n += 1 466 n += self.lengthString(len(self.auth_domain_)) 467 if (self.has_nickname_): n += 1 + self.lengthString(len(self.nickname_)) 468 if (self.has_gaiaid_): 469 n += 2 470 n += self.lengthVarInt64(self.gaiaid_) 471 if (self.has_obfuscated_gaiaid_): n += 2 + self.lengthString(len(self.obfuscated_gaiaid_)) 472 if (self.has_federated_identity_): n += 2 + self.lengthString(len(self.federated_identity_)) 473 if (self.has_federated_provider_): n += 2 + self.lengthString(len(self.federated_provider_)) 474 return n 475 476 def Clear(self): 477 self.clear_email() 478 self.clear_auth_domain() 479 self.clear_nickname() 480 self.clear_gaiaid() 481 self.clear_obfuscated_gaiaid() 482 self.clear_federated_identity() 483 self.clear_federated_provider() 484 485 def OutputUnchecked(self, out): 486 out.putVarInt32(74) 487 out.putPrefixedString(self.email_) 488 out.putVarInt32(82) 489 out.putPrefixedString(self.auth_domain_) 490 if (self.has_nickname_): 491 out.putVarInt32(90) 492 out.putPrefixedString(self.nickname_) 493 out.putVarInt32(144) 494 out.putVarInt64(self.gaiaid_) 495 if (self.has_obfuscated_gaiaid_): 496 out.putVarInt32(154) 497 out.putPrefixedString(self.obfuscated_gaiaid_) 498 if (self.has_federated_identity_): 499 out.putVarInt32(170) 500 out.putPrefixedString(self.federated_identity_) 501 if (self.has_federated_provider_): 502 out.putVarInt32(178) 503 out.putPrefixedString(self.federated_provider_) 504 505 def OutputPartial(self, out): 506 if (self.has_email_): 507 out.putVarInt32(74) 508 out.putPrefixedString(self.email_) 509 if (self.has_auth_domain_): 510 out.putVarInt32(82) 511 out.putPrefixedString(self.auth_domain_) 512 if (self.has_nickname_): 513 out.putVarInt32(90) 514 out.putPrefixedString(self.nickname_) 515 if (self.has_gaiaid_): 516 out.putVarInt32(144) 517 out.putVarInt64(self.gaiaid_) 518 if (self.has_obfuscated_gaiaid_): 519 out.putVarInt32(154) 520 out.putPrefixedString(self.obfuscated_gaiaid_) 521 if (self.has_federated_identity_): 522 out.putVarInt32(170) 523 out.putPrefixedString(self.federated_identity_) 524 if (self.has_federated_provider_): 525 out.putVarInt32(178) 526 out.putPrefixedString(self.federated_provider_) 527 528 def TryMerge(self, d): 529 while 1: 530 tt = d.getVarInt32() 531 if tt == 68: break 532 if tt == 74: 533 self.set_email(d.getPrefixedString()) 534 continue 535 if tt == 82: 536 self.set_auth_domain(d.getPrefixedString()) 537 continue 538 if tt == 90: 539 self.set_nickname(d.getPrefixedString()) 540 continue 541 if tt == 144: 542 self.set_gaiaid(d.getVarInt64()) 543 continue 544 if tt == 154: 545 self.set_obfuscated_gaiaid(d.getPrefixedString()) 546 continue 547 if tt == 170: 548 self.set_federated_identity(d.getPrefixedString()) 549 continue 550 if tt == 178: 551 self.set_federated_provider(d.getPrefixedString()) 552 continue 553 # tag 0 is special: it's used to indicate an error. 554 # so if we see it we raise an exception. 555 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 556 d.skipData(tt) 557 558 559 def __str__(self, prefix="", printElemNumber=0): 560 res="" 561 if self.has_email_: res+=prefix+("email: %s\n" % self.DebugFormatString(self.email_)) 562 if self.has_auth_domain_: res+=prefix+("auth_domain: %s\n" % self.DebugFormatString(self.auth_domain_)) 563 if self.has_nickname_: res+=prefix+("nickname: %s\n" % self.DebugFormatString(self.nickname_)) 564 if self.has_gaiaid_: res+=prefix+("gaiaid: %s\n" % self.DebugFormatInt64(self.gaiaid_)) 565 if self.has_obfuscated_gaiaid_: res+=prefix+("obfuscated_gaiaid: %s\n" % self.DebugFormatString(self.obfuscated_gaiaid_)) 566 if self.has_federated_identity_: res+=prefix+("federated_identity: %s\n" % self.DebugFormatString(self.federated_identity_)) 567 if self.has_federated_provider_: res+=prefix+("federated_provider: %s\n" % self.DebugFormatString(self.federated_provider_)) 568 return res 569 570class PropertyValue_ReferenceValue(ProtocolBuffer.ProtocolMessage): 571 has_app_ = 0 572 app_ = "" 573 has_name_space_ = 0 574 name_space_ = "" 575 has_database_id_ = 0 576 database_id_ = "" 577 578 def __init__(self, contents=None): 579 self.pathelement_ = [] 580 if contents is not None: self.MergeFromString(contents) 581 582 def app(self): return self.app_ 583 584 def set_app(self, x): 585 self.has_app_ = 1 586 self.app_ = x 587 588 def clear_app(self): 589 if self.has_app_: 590 self.has_app_ = 0 591 self.app_ = "" 592 593 def has_app(self): return self.has_app_ 594 595 def name_space(self): return self.name_space_ 596 597 def set_name_space(self, x): 598 self.has_name_space_ = 1 599 self.name_space_ = x 600 601 def clear_name_space(self): 602 if self.has_name_space_: 603 self.has_name_space_ = 0 604 self.name_space_ = "" 605 606 def has_name_space(self): return self.has_name_space_ 607 608 def pathelement_size(self): return len(self.pathelement_) 609 def pathelement_list(self): return self.pathelement_ 610 611 def pathelement(self, i): 612 return self.pathelement_[i] 613 614 def mutable_pathelement(self, i): 615 return self.pathelement_[i] 616 617 def add_pathelement(self): 618 x = PropertyValue_ReferenceValuePathElement() 619 self.pathelement_.append(x) 620 return x 621 622 def clear_pathelement(self): 623 self.pathelement_ = [] 624 def database_id(self): return self.database_id_ 625 626 def set_database_id(self, x): 627 self.has_database_id_ = 1 628 self.database_id_ = x 629 630 def clear_database_id(self): 631 if self.has_database_id_: 632 self.has_database_id_ = 0 633 self.database_id_ = "" 634 635 def has_database_id(self): return self.has_database_id_ 636 637 638 def MergeFrom(self, x): 639 assert x is not self 640 if (x.has_app()): self.set_app(x.app()) 641 if (x.has_name_space()): self.set_name_space(x.name_space()) 642 for i in range(x.pathelement_size()): self.add_pathelement().CopyFrom(x.pathelement(i)) 643 if (x.has_database_id()): self.set_database_id(x.database_id()) 644 645 def Equals(self, x): 646 if x is self: return 1 647 if self.has_app_ != x.has_app_: return 0 648 if self.has_app_ and self.app_ != x.app_: return 0 649 if self.has_name_space_ != x.has_name_space_: return 0 650 if self.has_name_space_ and self.name_space_ != x.name_space_: return 0 651 if len(self.pathelement_) != len(x.pathelement_): return 0 652 for e1, e2 in zip(self.pathelement_, x.pathelement_): 653 if e1 != e2: return 0 654 if self.has_database_id_ != x.has_database_id_: return 0 655 if self.has_database_id_ and self.database_id_ != x.database_id_: return 0 656 return 1 657 658 def IsInitialized(self, debug_strs=None): 659 initialized = 1 660 if (not self.has_app_): 661 initialized = 0 662 if debug_strs is not None: 663 debug_strs.append('Required field: app not set.') 664 for p in self.pathelement_: 665 if not p.IsInitialized(debug_strs): initialized=0 666 return initialized 667 668 def ByteSize(self): 669 n = 0 670 n += self.lengthString(len(self.app_)) 671 if (self.has_name_space_): n += 2 + self.lengthString(len(self.name_space_)) 672 n += 2 * len(self.pathelement_) 673 for i in range(len(self.pathelement_)): n += self.pathelement_[i].ByteSize() 674 if (self.has_database_id_): n += 2 + self.lengthString(len(self.database_id_)) 675 return n + 1 676 677 def ByteSizePartial(self): 678 n = 0 679 if (self.has_app_): 680 n += 1 681 n += self.lengthString(len(self.app_)) 682 if (self.has_name_space_): n += 2 + self.lengthString(len(self.name_space_)) 683 n += 2 * len(self.pathelement_) 684 for i in range(len(self.pathelement_)): n += self.pathelement_[i].ByteSizePartial() 685 if (self.has_database_id_): n += 2 + self.lengthString(len(self.database_id_)) 686 return n 687 688 def Clear(self): 689 self.clear_app() 690 self.clear_name_space() 691 self.clear_pathelement() 692 self.clear_database_id() 693 694 def OutputUnchecked(self, out): 695 out.putVarInt32(106) 696 out.putPrefixedString(self.app_) 697 for i in range(len(self.pathelement_)): 698 out.putVarInt32(115) 699 self.pathelement_[i].OutputUnchecked(out) 700 out.putVarInt32(116) 701 if (self.has_name_space_): 702 out.putVarInt32(162) 703 out.putPrefixedString(self.name_space_) 704 if (self.has_database_id_): 705 out.putVarInt32(186) 706 out.putPrefixedString(self.database_id_) 707 708 def OutputPartial(self, out): 709 if (self.has_app_): 710 out.putVarInt32(106) 711 out.putPrefixedString(self.app_) 712 for i in range(len(self.pathelement_)): 713 out.putVarInt32(115) 714 self.pathelement_[i].OutputPartial(out) 715 out.putVarInt32(116) 716 if (self.has_name_space_): 717 out.putVarInt32(162) 718 out.putPrefixedString(self.name_space_) 719 if (self.has_database_id_): 720 out.putVarInt32(186) 721 out.putPrefixedString(self.database_id_) 722 723 def TryMerge(self, d): 724 while 1: 725 tt = d.getVarInt32() 726 if tt == 100: break 727 if tt == 106: 728 self.set_app(d.getPrefixedString()) 729 continue 730 if tt == 115: 731 self.add_pathelement().TryMerge(d) 732 continue 733 if tt == 162: 734 self.set_name_space(d.getPrefixedString()) 735 continue 736 if tt == 186: 737 self.set_database_id(d.getPrefixedString()) 738 continue 739 # tag 0 is special: it's used to indicate an error. 740 # so if we see it we raise an exception. 741 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 742 d.skipData(tt) 743 744 745 def __str__(self, prefix="", printElemNumber=0): 746 res="" 747 if self.has_app_: res+=prefix+("app: %s\n" % self.DebugFormatString(self.app_)) 748 if self.has_name_space_: res+=prefix+("name_space: %s\n" % self.DebugFormatString(self.name_space_)) 749 cnt=0 750 for e in self.pathelement_: 751 elm="" 752 if printElemNumber: elm="(%d)" % cnt 753 res+=prefix+("PathElement%s {\n" % elm) 754 res+=e.__str__(prefix + " ", printElemNumber) 755 res+=prefix+"}\n" 756 cnt+=1 757 if self.has_database_id_: res+=prefix+("database_id: %s\n" % self.DebugFormatString(self.database_id_)) 758 return res 759 760class PropertyValue(ProtocolBuffer.ProtocolMessage): 761 has_int64value_ = 0 762 int64value_ = 0 763 has_booleanvalue_ = 0 764 booleanvalue_ = 0 765 has_stringvalue_ = 0 766 stringvalue_ = "" 767 has_doublevalue_ = 0 768 doublevalue_ = 0.0 769 has_pointvalue_ = 0 770 pointvalue_ = None 771 has_uservalue_ = 0 772 uservalue_ = None 773 has_referencevalue_ = 0 774 referencevalue_ = None 775 776 def __init__(self, contents=None): 777 self.lazy_init_lock_ = _Lock() 778 if contents is not None: self.MergeFromString(contents) 779 780 def int64value(self): return self.int64value_ 781 782 def set_int64value(self, x): 783 self.has_int64value_ = 1 784 self.int64value_ = x 785 786 def clear_int64value(self): 787 if self.has_int64value_: 788 self.has_int64value_ = 0 789 self.int64value_ = 0 790 791 def has_int64value(self): return self.has_int64value_ 792 793 def booleanvalue(self): return self.booleanvalue_ 794 795 def set_booleanvalue(self, x): 796 self.has_booleanvalue_ = 1 797 self.booleanvalue_ = x 798 799 def clear_booleanvalue(self): 800 if self.has_booleanvalue_: 801 self.has_booleanvalue_ = 0 802 self.booleanvalue_ = 0 803 804 def has_booleanvalue(self): return self.has_booleanvalue_ 805 806 def stringvalue(self): return self.stringvalue_ 807 808 def set_stringvalue(self, x): 809 self.has_stringvalue_ = 1 810 self.stringvalue_ = x 811 812 def clear_stringvalue(self): 813 if self.has_stringvalue_: 814 self.has_stringvalue_ = 0 815 self.stringvalue_ = "" 816 817 def has_stringvalue(self): return self.has_stringvalue_ 818 819 def doublevalue(self): return self.doublevalue_ 820 821 def set_doublevalue(self, x): 822 self.has_doublevalue_ = 1 823 self.doublevalue_ = x 824 825 def clear_doublevalue(self): 826 if self.has_doublevalue_: 827 self.has_doublevalue_ = 0 828 self.doublevalue_ = 0.0 829 830 def has_doublevalue(self): return self.has_doublevalue_ 831 832 def pointvalue(self): 833 if self.pointvalue_ is None: 834 self.lazy_init_lock_.acquire() 835 try: 836 if self.pointvalue_ is None: self.pointvalue_ = PropertyValue_PointValue() 837 finally: 838 self.lazy_init_lock_.release() 839 return self.pointvalue_ 840 841 def mutable_pointvalue(self): self.has_pointvalue_ = 1; return self.pointvalue() 842 843 def clear_pointvalue(self): 844 # Warning: this method does not acquire the lock. 845 if self.has_pointvalue_: 846 self.has_pointvalue_ = 0; 847 if self.pointvalue_ is not None: self.pointvalue_.Clear() 848 849 def has_pointvalue(self): return self.has_pointvalue_ 850 851 def uservalue(self): 852 if self.uservalue_ is None: 853 self.lazy_init_lock_.acquire() 854 try: 855 if self.uservalue_ is None: self.uservalue_ = PropertyValue_UserValue() 856 finally: 857 self.lazy_init_lock_.release() 858 return self.uservalue_ 859 860 def mutable_uservalue(self): self.has_uservalue_ = 1; return self.uservalue() 861 862 def clear_uservalue(self): 863 # Warning: this method does not acquire the lock. 864 if self.has_uservalue_: 865 self.has_uservalue_ = 0; 866 if self.uservalue_ is not None: self.uservalue_.Clear() 867 868 def has_uservalue(self): return self.has_uservalue_ 869 870 def referencevalue(self): 871 if self.referencevalue_ is None: 872 self.lazy_init_lock_.acquire() 873 try: 874 if self.referencevalue_ is None: self.referencevalue_ = PropertyValue_ReferenceValue() 875 finally: 876 self.lazy_init_lock_.release() 877 return self.referencevalue_ 878 879 def mutable_referencevalue(self): self.has_referencevalue_ = 1; return self.referencevalue() 880 881 def clear_referencevalue(self): 882 # Warning: this method does not acquire the lock. 883 if self.has_referencevalue_: 884 self.has_referencevalue_ = 0; 885 if self.referencevalue_ is not None: self.referencevalue_.Clear() 886 887 def has_referencevalue(self): return self.has_referencevalue_ 888 889 890 def MergeFrom(self, x): 891 assert x is not self 892 if (x.has_int64value()): self.set_int64value(x.int64value()) 893 if (x.has_booleanvalue()): self.set_booleanvalue(x.booleanvalue()) 894 if (x.has_stringvalue()): self.set_stringvalue(x.stringvalue()) 895 if (x.has_doublevalue()): self.set_doublevalue(x.doublevalue()) 896 if (x.has_pointvalue()): self.mutable_pointvalue().MergeFrom(x.pointvalue()) 897 if (x.has_uservalue()): self.mutable_uservalue().MergeFrom(x.uservalue()) 898 if (x.has_referencevalue()): self.mutable_referencevalue().MergeFrom(x.referencevalue()) 899 900 def Equals(self, x): 901 if x is self: return 1 902 if self.has_int64value_ != x.has_int64value_: return 0 903 if self.has_int64value_ and self.int64value_ != x.int64value_: return 0 904 if self.has_booleanvalue_ != x.has_booleanvalue_: return 0 905 if self.has_booleanvalue_ and self.booleanvalue_ != x.booleanvalue_: return 0 906 if self.has_stringvalue_ != x.has_stringvalue_: return 0 907 if self.has_stringvalue_ and self.stringvalue_ != x.stringvalue_: return 0 908 if self.has_doublevalue_ != x.has_doublevalue_: return 0 909 if self.has_doublevalue_ and self.doublevalue_ != x.doublevalue_: return 0 910 if self.has_pointvalue_ != x.has_pointvalue_: return 0 911 if self.has_pointvalue_ and self.pointvalue_ != x.pointvalue_: return 0 912 if self.has_uservalue_ != x.has_uservalue_: return 0 913 if self.has_uservalue_ and self.uservalue_ != x.uservalue_: return 0 914 if self.has_referencevalue_ != x.has_referencevalue_: return 0 915 if self.has_referencevalue_ and self.referencevalue_ != x.referencevalue_: return 0 916 return 1 917 918 def IsInitialized(self, debug_strs=None): 919 initialized = 1 920 if (self.has_pointvalue_ and not self.pointvalue_.IsInitialized(debug_strs)): initialized = 0 921 if (self.has_uservalue_ and not self.uservalue_.IsInitialized(debug_strs)): initialized = 0 922 if (self.has_referencevalue_ and not self.referencevalue_.IsInitialized(debug_strs)): initialized = 0 923 return initialized 924 925 def ByteSize(self): 926 n = 0 927 if (self.has_int64value_): n += 1 + self.lengthVarInt64(self.int64value_) 928 if (self.has_booleanvalue_): n += 2 929 if (self.has_stringvalue_): n += 1 + self.lengthString(len(self.stringvalue_)) 930 if (self.has_doublevalue_): n += 9 931 if (self.has_pointvalue_): n += 2 + self.pointvalue_.ByteSize() 932 if (self.has_uservalue_): n += 2 + self.uservalue_.ByteSize() 933 if (self.has_referencevalue_): n += 2 + self.referencevalue_.ByteSize() 934 return n 935 936 def ByteSizePartial(self): 937 n = 0 938 if (self.has_int64value_): n += 1 + self.lengthVarInt64(self.int64value_) 939 if (self.has_booleanvalue_): n += 2 940 if (self.has_stringvalue_): n += 1 + self.lengthString(len(self.stringvalue_)) 941 if (self.has_doublevalue_): n += 9 942 if (self.has_pointvalue_): n += 2 + self.pointvalue_.ByteSizePartial() 943 if (self.has_uservalue_): n += 2 + self.uservalue_.ByteSizePartial() 944 if (self.has_referencevalue_): n += 2 + self.referencevalue_.ByteSizePartial() 945 return n 946 947 def Clear(self): 948 self.clear_int64value() 949 self.clear_booleanvalue() 950 self.clear_stringvalue() 951 self.clear_doublevalue() 952 self.clear_pointvalue() 953 self.clear_uservalue() 954 self.clear_referencevalue() 955 956 def OutputUnchecked(self, out): 957 if (self.has_int64value_): 958 out.putVarInt32(8) 959 out.putVarInt64(self.int64value_) 960 if (self.has_booleanvalue_): 961 out.putVarInt32(16) 962 out.putBoolean(self.booleanvalue_) 963 if (self.has_stringvalue_): 964 out.putVarInt32(26) 965 out.putPrefixedString(self.stringvalue_) 966 if (self.has_doublevalue_): 967 out.putVarInt32(33) 968 out.putDouble(self.doublevalue_) 969 if (self.has_pointvalue_): 970 out.putVarInt32(43) 971 self.pointvalue_.OutputUnchecked(out) 972 out.putVarInt32(44) 973 if (self.has_uservalue_): 974 out.putVarInt32(67) 975 self.uservalue_.OutputUnchecked(out) 976 out.putVarInt32(68) 977 if (self.has_referencevalue_): 978 out.putVarInt32(99) 979 self.referencevalue_.OutputUnchecked(out) 980 out.putVarInt32(100) 981 982 def OutputPartial(self, out): 983 if (self.has_int64value_): 984 out.putVarInt32(8) 985 out.putVarInt64(self.int64value_) 986 if (self.has_booleanvalue_): 987 out.putVarInt32(16) 988 out.putBoolean(self.booleanvalue_) 989 if (self.has_stringvalue_): 990 out.putVarInt32(26) 991 out.putPrefixedString(self.stringvalue_) 992 if (self.has_doublevalue_): 993 out.putVarInt32(33) 994 out.putDouble(self.doublevalue_) 995 if (self.has_pointvalue_): 996 out.putVarInt32(43) 997 self.pointvalue_.OutputPartial(out) 998 out.putVarInt32(44) 999 if (self.has_uservalue_): 1000 out.putVarInt32(67) 1001 self.uservalue_.OutputPartial(out) 1002 out.putVarInt32(68) 1003 if (self.has_referencevalue_): 1004 out.putVarInt32(99) 1005 self.referencevalue_.OutputPartial(out) 1006 out.putVarInt32(100) 1007 1008 def TryMerge(self, d): 1009 while d.avail() > 0: 1010 tt = d.getVarInt32() 1011 if tt == 8: 1012 self.set_int64value(d.getVarInt64()) 1013 continue 1014 if tt == 16: 1015 self.set_booleanvalue(d.getBoolean()) 1016 continue 1017 if tt == 26: 1018 self.set_stringvalue(d.getPrefixedString()) 1019 continue 1020 if tt == 33: 1021 self.set_doublevalue(d.getDouble()) 1022 continue 1023 if tt == 43: 1024 self.mutable_pointvalue().TryMerge(d) 1025 continue 1026 if tt == 67: 1027 self.mutable_uservalue().TryMerge(d) 1028 continue 1029 if tt == 99: 1030 self.mutable_referencevalue().TryMerge(d) 1031 continue 1032 # tag 0 is special: it's used to indicate an error. 1033 # so if we see it we raise an exception. 1034 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 1035 d.skipData(tt) 1036 1037 1038 def __str__(self, prefix="", printElemNumber=0): 1039 res="" 1040 if self.has_int64value_: res+=prefix+("int64Value: %s\n" % self.DebugFormatInt64(self.int64value_)) 1041 if self.has_booleanvalue_: res+=prefix+("booleanValue: %s\n" % self.DebugFormatBool(self.booleanvalue_)) 1042 if self.has_stringvalue_: res+=prefix+("stringValue: %s\n" % self.DebugFormatString(self.stringvalue_)) 1043 if self.has_doublevalue_: res+=prefix+("doubleValue: %s\n" % self.DebugFormat(self.doublevalue_)) 1044 if self.has_pointvalue_: 1045 res+=prefix+"PointValue {\n" 1046 res+=self.pointvalue_.__str__(prefix + " ", printElemNumber) 1047 res+=prefix+"}\n" 1048 if self.has_uservalue_: 1049 res+=prefix+"UserValue {\n" 1050 res+=self.uservalue_.__str__(prefix + " ", printElemNumber) 1051 res+=prefix+"}\n" 1052 if self.has_referencevalue_: 1053 res+=prefix+"ReferenceValue {\n" 1054 res+=self.referencevalue_.__str__(prefix + " ", printElemNumber) 1055 res+=prefix+"}\n" 1056 return res 1057 1058 1059 def _BuildTagLookupTable(sparse, maxtag, default=None): 1060 return tuple([sparse.get(i, default) for i in range(0, 1+maxtag)]) 1061 1062 kint64Value = 1 1063 kbooleanValue = 2 1064 kstringValue = 3 1065 kdoubleValue = 4 1066 kPointValueGroup = 5 1067 kPointValuex = 6 1068 kPointValuey = 7 1069 kUserValueGroup = 8 1070 kUserValueemail = 9 1071 kUserValueauth_domain = 10 1072 kUserValuenickname = 11 1073 kUserValuegaiaid = 18 1074 kUserValueobfuscated_gaiaid = 19 1075 kUserValuefederated_identity = 21 1076 kUserValuefederated_provider = 22 1077 kReferenceValueGroup = 12 1078 kReferenceValueapp = 13 1079 kReferenceValuename_space = 20 1080 kReferenceValuePathElementGroup = 14 1081 kReferenceValuePathElementtype = 15 1082 kReferenceValuePathElementid = 16 1083 kReferenceValuePathElementname = 17 1084 kReferenceValuedatabase_id = 23 1085 1086 _TEXT = _BuildTagLookupTable({ 1087 0: "ErrorCode", 1088 1: "int64Value", 1089 2: "booleanValue", 1090 3: "stringValue", 1091 4: "doubleValue", 1092 5: "PointValue", 1093 6: "x", 1094 7: "y", 1095 8: "UserValue", 1096 9: "email", 1097 10: "auth_domain", 1098 11: "nickname", 1099 12: "ReferenceValue", 1100 13: "app", 1101 14: "PathElement", 1102 15: "type", 1103 16: "id", 1104 17: "name", 1105 18: "gaiaid", 1106 19: "obfuscated_gaiaid", 1107 20: "name_space", 1108 21: "federated_identity", 1109 22: "federated_provider", 1110 23: "database_id", 1111 }, 23) 1112 1113 _TYPES = _BuildTagLookupTable({ 1114 0: ProtocolBuffer.Encoder.NUMERIC, 1115 1: ProtocolBuffer.Encoder.NUMERIC, 1116 2: ProtocolBuffer.Encoder.NUMERIC, 1117 3: ProtocolBuffer.Encoder.STRING, 1118 4: ProtocolBuffer.Encoder.DOUBLE, 1119 5: ProtocolBuffer.Encoder.STARTGROUP, 1120 6: ProtocolBuffer.Encoder.DOUBLE, 1121 7: ProtocolBuffer.Encoder.DOUBLE, 1122 8: ProtocolBuffer.Encoder.STARTGROUP, 1123 9: ProtocolBuffer.Encoder.STRING, 1124 10: ProtocolBuffer.Encoder.STRING, 1125 11: ProtocolBuffer.Encoder.STRING, 1126 12: ProtocolBuffer.Encoder.STARTGROUP, 1127 13: ProtocolBuffer.Encoder.STRING, 1128 14: ProtocolBuffer.Encoder.STARTGROUP, 1129 15: ProtocolBuffer.Encoder.STRING, 1130 16: ProtocolBuffer.Encoder.NUMERIC, 1131 17: ProtocolBuffer.Encoder.STRING, 1132 18: ProtocolBuffer.Encoder.NUMERIC, 1133 19: ProtocolBuffer.Encoder.STRING, 1134 20: ProtocolBuffer.Encoder.STRING, 1135 21: ProtocolBuffer.Encoder.STRING, 1136 22: ProtocolBuffer.Encoder.STRING, 1137 23: ProtocolBuffer.Encoder.STRING, 1138 }, 23, ProtocolBuffer.Encoder.MAX_TYPE) 1139 1140 # stylesheet for XML output 1141 _STYLE = \ 1142 """""" 1143 _STYLE_CONTENT_TYPE = \ 1144 """""" 1145 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.PropertyValue' 1146class Property(ProtocolBuffer.ProtocolMessage): 1147 1148 # Meaning values 1149 NO_MEANING = 0 1150 BLOB = 14 1151 TEXT = 15 1152 BYTESTRING = 16 1153 ATOM_CATEGORY = 1 1154 ATOM_LINK = 2 1155 ATOM_TITLE = 3 1156 ATOM_CONTENT = 4 1157 ATOM_SUMMARY = 5 1158 ATOM_AUTHOR = 6 1159 GD_WHEN = 7 1160 GD_EMAIL = 8 1161 GEORSS_POINT = 9 1162 GD_IM = 10 1163 GD_PHONENUMBER = 11 1164 GD_POSTALADDRESS = 12 1165 GD_RATING = 13 1166 BLOBKEY = 17 1167 ENTITY_PROTO = 19 1168 EMPTY_LIST = 24 1169 INDEX_VALUE = 18 1170 1171 _Meaning_NAMES = { 1172 0: "NO_MEANING", 1173 14: "BLOB", 1174 15: "TEXT", 1175 16: "BYTESTRING", 1176 1: "ATOM_CATEGORY", 1177 2: "ATOM_LINK", 1178 3: "ATOM_TITLE", 1179 4: "ATOM_CONTENT", 1180 5: "ATOM_SUMMARY", 1181 6: "ATOM_AUTHOR", 1182 7: "GD_WHEN", 1183 8: "GD_EMAIL", 1184 9: "GEORSS_POINT", 1185 10: "GD_IM", 1186 11: "GD_PHONENUMBER", 1187 12: "GD_POSTALADDRESS", 1188 13: "GD_RATING", 1189 17: "BLOBKEY", 1190 19: "ENTITY_PROTO", 1191 24: "EMPTY_LIST", 1192 18: "INDEX_VALUE", 1193 } 1194 1195 def Meaning_Name(cls, x): return cls._Meaning_NAMES.get(x, "") 1196 Meaning_Name = classmethod(Meaning_Name) 1197 1198 has_meaning_ = 0 1199 meaning_ = 0 1200 has_meaning_uri_ = 0 1201 meaning_uri_ = "" 1202 has_name_ = 0 1203 name_ = "" 1204 has_value_ = 0 1205 has_multiple_ = 0 1206 multiple_ = 0 1207 has_stashed_ = 0 1208 stashed_ = -1 1209 has_computed_ = 0 1210 computed_ = 0 1211 1212 def __init__(self, contents=None): 1213 self.value_ = PropertyValue() 1214 if contents is not None: self.MergeFromString(contents) 1215 1216 def meaning(self): return self.meaning_ 1217 1218 def set_meaning(self, x): 1219 self.has_meaning_ = 1 1220 self.meaning_ = x 1221 1222 def clear_meaning(self): 1223 if self.has_meaning_: 1224 self.has_meaning_ = 0 1225 self.meaning_ = 0 1226 1227 def has_meaning(self): return self.has_meaning_ 1228 1229 def meaning_uri(self): return self.meaning_uri_ 1230 1231 def set_meaning_uri(self, x): 1232 self.has_meaning_uri_ = 1 1233 self.meaning_uri_ = x 1234 1235 def clear_meaning_uri(self): 1236 if self.has_meaning_uri_: 1237 self.has_meaning_uri_ = 0 1238 self.meaning_uri_ = "" 1239 1240 def has_meaning_uri(self): return self.has_meaning_uri_ 1241 1242 def name(self): return self.name_ 1243 1244 def set_name(self, x): 1245 self.has_name_ = 1 1246 self.name_ = x 1247 1248 def clear_name(self): 1249 if self.has_name_: 1250 self.has_name_ = 0 1251 self.name_ = "" 1252 1253 def has_name(self): return self.has_name_ 1254 1255 def value(self): return self.value_ 1256 1257 def mutable_value(self): self.has_value_ = 1; return self.value_ 1258 1259 def clear_value(self):self.has_value_ = 0; self.value_.Clear() 1260 1261 def has_value(self): return self.has_value_ 1262 1263 def multiple(self): return self.multiple_ 1264 1265 def set_multiple(self, x): 1266 self.has_multiple_ = 1 1267 self.multiple_ = x 1268 1269 def clear_multiple(self): 1270 if self.has_multiple_: 1271 self.has_multiple_ = 0 1272 self.multiple_ = 0 1273 1274 def has_multiple(self): return self.has_multiple_ 1275 1276 def stashed(self): return self.stashed_ 1277 1278 def set_stashed(self, x): 1279 self.has_stashed_ = 1 1280 self.stashed_ = x 1281 1282 def clear_stashed(self): 1283 if self.has_stashed_: 1284 self.has_stashed_ = 0 1285 self.stashed_ = -1 1286 1287 def has_stashed(self): return self.has_stashed_ 1288 1289 def computed(self): return self.computed_ 1290 1291 def set_computed(self, x): 1292 self.has_computed_ = 1 1293 self.computed_ = x 1294 1295 def clear_computed(self): 1296 if self.has_computed_: 1297 self.has_computed_ = 0 1298 self.computed_ = 0 1299 1300 def has_computed(self): return self.has_computed_ 1301 1302 1303 def MergeFrom(self, x): 1304 assert x is not self 1305 if (x.has_meaning()): self.set_meaning(x.meaning()) 1306 if (x.has_meaning_uri()): self.set_meaning_uri(x.meaning_uri()) 1307 if (x.has_name()): self.set_name(x.name()) 1308 if (x.has_value()): self.mutable_value().MergeFrom(x.value()) 1309 if (x.has_multiple()): self.set_multiple(x.multiple()) 1310 if (x.has_stashed()): self.set_stashed(x.stashed()) 1311 if (x.has_computed()): self.set_computed(x.computed()) 1312 1313 def Equals(self, x): 1314 if x is self: return 1 1315 if self.has_meaning_ != x.has_meaning_: return 0 1316 if self.has_meaning_ and self.meaning_ != x.meaning_: return 0 1317 if self.has_meaning_uri_ != x.has_meaning_uri_: return 0 1318 if self.has_meaning_uri_ and self.meaning_uri_ != x.meaning_uri_: return 0 1319 if self.has_name_ != x.has_name_: return 0 1320 if self.has_name_ and self.name_ != x.name_: return 0 1321 if self.has_value_ != x.has_value_: return 0 1322 if self.has_value_ and self.value_ != x.value_: return 0 1323 if self.has_multiple_ != x.has_multiple_: return 0 1324 if self.has_multiple_ and self.multiple_ != x.multiple_: return 0 1325 if self.has_stashed_ != x.has_stashed_: return 0 1326 if self.has_stashed_ and self.stashed_ != x.stashed_: return 0 1327 if self.has_computed_ != x.has_computed_: return 0 1328 if self.has_computed_ and self.computed_ != x.computed_: return 0 1329 return 1 1330 1331 def IsInitialized(self, debug_strs=None): 1332 initialized = 1 1333 if (not self.has_name_): 1334 initialized = 0 1335 if debug_strs is not None: 1336 debug_strs.append('Required field: name not set.') 1337 if (not self.has_value_): 1338 initialized = 0 1339 if debug_strs is not None: 1340 debug_strs.append('Required field: value not set.') 1341 elif not self.value_.IsInitialized(debug_strs): initialized = 0 1342 if (not self.has_multiple_): 1343 initialized = 0 1344 if debug_strs is not None: 1345 debug_strs.append('Required field: multiple not set.') 1346 return initialized 1347 1348 def ByteSize(self): 1349 n = 0 1350 if (self.has_meaning_): n += 1 + self.lengthVarInt64(self.meaning_) 1351 if (self.has_meaning_uri_): n += 1 + self.lengthString(len(self.meaning_uri_)) 1352 n += self.lengthString(len(self.name_)) 1353 n += self.lengthString(self.value_.ByteSize()) 1354 if (self.has_stashed_): n += 1 + self.lengthVarInt64(self.stashed_) 1355 if (self.has_computed_): n += 2 1356 return n + 4 1357 1358 def ByteSizePartial(self): 1359 n = 0 1360 if (self.has_meaning_): n += 1 + self.lengthVarInt64(self.meaning_) 1361 if (self.has_meaning_uri_): n += 1 + self.lengthString(len(self.meaning_uri_)) 1362 if (self.has_name_): 1363 n += 1 1364 n += self.lengthString(len(self.name_)) 1365 if (self.has_value_): 1366 n += 1 1367 n += self.lengthString(self.value_.ByteSizePartial()) 1368 if (self.has_multiple_): 1369 n += 2 1370 if (self.has_stashed_): n += 1 + self.lengthVarInt64(self.stashed_) 1371 if (self.has_computed_): n += 2 1372 return n 1373 1374 def Clear(self): 1375 self.clear_meaning() 1376 self.clear_meaning_uri() 1377 self.clear_name() 1378 self.clear_value() 1379 self.clear_multiple() 1380 self.clear_stashed() 1381 self.clear_computed() 1382 1383 def OutputUnchecked(self, out): 1384 if (self.has_meaning_): 1385 out.putVarInt32(8) 1386 out.putVarInt32(self.meaning_) 1387 if (self.has_meaning_uri_): 1388 out.putVarInt32(18) 1389 out.putPrefixedString(self.meaning_uri_) 1390 out.putVarInt32(26) 1391 out.putPrefixedString(self.name_) 1392 out.putVarInt32(32) 1393 out.putBoolean(self.multiple_) 1394 out.putVarInt32(42) 1395 out.putVarInt32(self.value_.ByteSize()) 1396 self.value_.OutputUnchecked(out) 1397 if (self.has_stashed_): 1398 out.putVarInt32(48) 1399 out.putVarInt32(self.stashed_) 1400 if (self.has_computed_): 1401 out.putVarInt32(56) 1402 out.putBoolean(self.computed_) 1403 1404 def OutputPartial(self, out): 1405 if (self.has_meaning_): 1406 out.putVarInt32(8) 1407 out.putVarInt32(self.meaning_) 1408 if (self.has_meaning_uri_): 1409 out.putVarInt32(18) 1410 out.putPrefixedString(self.meaning_uri_) 1411 if (self.has_name_): 1412 out.putVarInt32(26) 1413 out.putPrefixedString(self.name_) 1414 if (self.has_multiple_): 1415 out.putVarInt32(32) 1416 out.putBoolean(self.multiple_) 1417 if (self.has_value_): 1418 out.putVarInt32(42) 1419 out.putVarInt32(self.value_.ByteSizePartial()) 1420 self.value_.OutputPartial(out) 1421 if (self.has_stashed_): 1422 out.putVarInt32(48) 1423 out.putVarInt32(self.stashed_) 1424 if (self.has_computed_): 1425 out.putVarInt32(56) 1426 out.putBoolean(self.computed_) 1427 1428 def TryMerge(self, d): 1429 while d.avail() > 0: 1430 tt = d.getVarInt32() 1431 if tt == 8: 1432 self.set_meaning(d.getVarInt32()) 1433 continue 1434 if tt == 18: 1435 self.set_meaning_uri(d.getPrefixedString()) 1436 continue 1437 if tt == 26: 1438 self.set_name(d.getPrefixedString()) 1439 continue 1440 if tt == 32: 1441 self.set_multiple(d.getBoolean()) 1442 continue 1443 if tt == 42: 1444 length = d.getVarInt32() 1445 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) 1446 d.skip(length) 1447 self.mutable_value().TryMerge(tmp) 1448 continue 1449 if tt == 48: 1450 self.set_stashed(d.getVarInt32()) 1451 continue 1452 if tt == 56: 1453 self.set_computed(d.getBoolean()) 1454 continue 1455 # tag 0 is special: it's used to indicate an error. 1456 # so if we see it we raise an exception. 1457 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 1458 d.skipData(tt) 1459 1460 1461 def __str__(self, prefix="", printElemNumber=0): 1462 res="" 1463 if self.has_meaning_: res+=prefix+("meaning: %s\n" % self.DebugFormatInt32(self.meaning_)) 1464 if self.has_meaning_uri_: res+=prefix+("meaning_uri: %s\n" % self.DebugFormatString(self.meaning_uri_)) 1465 if self.has_name_: res+=prefix+("name: %s\n" % self.DebugFormatString(self.name_)) 1466 if self.has_value_: 1467 res+=prefix+"value <\n" 1468 res+=self.value_.__str__(prefix + " ", printElemNumber) 1469 res+=prefix+">\n" 1470 if self.has_multiple_: res+=prefix+("multiple: %s\n" % self.DebugFormatBool(self.multiple_)) 1471 if self.has_stashed_: res+=prefix+("stashed: %s\n" % self.DebugFormatInt32(self.stashed_)) 1472 if self.has_computed_: res+=prefix+("computed: %s\n" % self.DebugFormatBool(self.computed_)) 1473 return res 1474 1475 1476 def _BuildTagLookupTable(sparse, maxtag, default=None): 1477 return tuple([sparse.get(i, default) for i in range(0, 1+maxtag)]) 1478 1479 kmeaning = 1 1480 kmeaning_uri = 2 1481 kname = 3 1482 kvalue = 5 1483 kmultiple = 4 1484 kstashed = 6 1485 kcomputed = 7 1486 1487 _TEXT = _BuildTagLookupTable({ 1488 0: "ErrorCode", 1489 1: "meaning", 1490 2: "meaning_uri", 1491 3: "name", 1492 4: "multiple", 1493 5: "value", 1494 6: "stashed", 1495 7: "computed", 1496 }, 7) 1497 1498 _TYPES = _BuildTagLookupTable({ 1499 0: ProtocolBuffer.Encoder.NUMERIC, 1500 1: ProtocolBuffer.Encoder.NUMERIC, 1501 2: ProtocolBuffer.Encoder.STRING, 1502 3: ProtocolBuffer.Encoder.STRING, 1503 4: ProtocolBuffer.Encoder.NUMERIC, 1504 5: ProtocolBuffer.Encoder.STRING, 1505 6: ProtocolBuffer.Encoder.NUMERIC, 1506 7: ProtocolBuffer.Encoder.NUMERIC, 1507 }, 7, ProtocolBuffer.Encoder.MAX_TYPE) 1508 1509 # stylesheet for XML output 1510 _STYLE = \ 1511 """""" 1512 _STYLE_CONTENT_TYPE = \ 1513 """""" 1514 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.Property' 1515class Path_Element(ProtocolBuffer.ProtocolMessage): 1516 has_type_ = 0 1517 type_ = "" 1518 has_id_ = 0 1519 id_ = 0 1520 has_name_ = 0 1521 name_ = "" 1522 1523 def __init__(self, contents=None): 1524 if contents is not None: self.MergeFromString(contents) 1525 1526 def type(self): return self.type_ 1527 1528 def set_type(self, x): 1529 self.has_type_ = 1 1530 self.type_ = x 1531 1532 def clear_type(self): 1533 if self.has_type_: 1534 self.has_type_ = 0 1535 self.type_ = "" 1536 1537 def has_type(self): return self.has_type_ 1538 1539 def id(self): return self.id_ 1540 1541 def set_id(self, x): 1542 self.has_id_ = 1 1543 self.id_ = x 1544 1545 def clear_id(self): 1546 if self.has_id_: 1547 self.has_id_ = 0 1548 self.id_ = 0 1549 1550 def has_id(self): return self.has_id_ 1551 1552 def name(self): return self.name_ 1553 1554 def set_name(self, x): 1555 self.has_name_ = 1 1556 self.name_ = x 1557 1558 def clear_name(self): 1559 if self.has_name_: 1560 self.has_name_ = 0 1561 self.name_ = "" 1562 1563 def has_name(self): return self.has_name_ 1564 1565 1566 def MergeFrom(self, x): 1567 assert x is not self 1568 if (x.has_type()): self.set_type(x.type()) 1569 if (x.has_id()): self.set_id(x.id()) 1570 if (x.has_name()): self.set_name(x.name()) 1571 1572 def Equals(self, x): 1573 if x is self: return 1 1574 if self.has_type_ != x.has_type_: return 0 1575 if self.has_type_ and self.type_ != x.type_: return 0 1576 if self.has_id_ != x.has_id_: return 0 1577 if self.has_id_ and self.id_ != x.id_: return 0 1578 if self.has_name_ != x.has_name_: return 0 1579 if self.has_name_ and self.name_ != x.name_: return 0 1580 return 1 1581 1582 def IsInitialized(self, debug_strs=None): 1583 initialized = 1 1584 if (not self.has_type_): 1585 initialized = 0 1586 if debug_strs is not None: 1587 debug_strs.append('Required field: type not set.') 1588 return initialized 1589 1590 def ByteSize(self): 1591 n = 0 1592 n += self.lengthString(len(self.type_)) 1593 if (self.has_id_): n += 1 + self.lengthVarInt64(self.id_) 1594 if (self.has_name_): n += 1 + self.lengthString(len(self.name_)) 1595 return n + 1 1596 1597 def ByteSizePartial(self): 1598 n = 0 1599 if (self.has_type_): 1600 n += 1 1601 n += self.lengthString(len(self.type_)) 1602 if (self.has_id_): n += 1 + self.lengthVarInt64(self.id_) 1603 if (self.has_name_): n += 1 + self.lengthString(len(self.name_)) 1604 return n 1605 1606 def Clear(self): 1607 self.clear_type() 1608 self.clear_id() 1609 self.clear_name() 1610 1611 def OutputUnchecked(self, out): 1612 out.putVarInt32(18) 1613 out.putPrefixedString(self.type_) 1614 if (self.has_id_): 1615 out.putVarInt32(24) 1616 out.putVarInt64(self.id_) 1617 if (self.has_name_): 1618 out.putVarInt32(34) 1619 out.putPrefixedString(self.name_) 1620 1621 def OutputPartial(self, out): 1622 if (self.has_type_): 1623 out.putVarInt32(18) 1624 out.putPrefixedString(self.type_) 1625 if (self.has_id_): 1626 out.putVarInt32(24) 1627 out.putVarInt64(self.id_) 1628 if (self.has_name_): 1629 out.putVarInt32(34) 1630 out.putPrefixedString(self.name_) 1631 1632 def TryMerge(self, d): 1633 while 1: 1634 tt = d.getVarInt32() 1635 if tt == 12: break 1636 if tt == 18: 1637 self.set_type(d.getPrefixedString()) 1638 continue 1639 if tt == 24: 1640 self.set_id(d.getVarInt64()) 1641 continue 1642 if tt == 34: 1643 self.set_name(d.getPrefixedString()) 1644 continue 1645 # tag 0 is special: it's used to indicate an error. 1646 # so if we see it we raise an exception. 1647 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 1648 d.skipData(tt) 1649 1650 1651 def __str__(self, prefix="", printElemNumber=0): 1652 res="" 1653 if self.has_type_: res+=prefix+("type: %s\n" % self.DebugFormatString(self.type_)) 1654 if self.has_id_: res+=prefix+("id: %s\n" % self.DebugFormatInt64(self.id_)) 1655 if self.has_name_: res+=prefix+("name: %s\n" % self.DebugFormatString(self.name_)) 1656 return res 1657 1658class Path(ProtocolBuffer.ProtocolMessage): 1659 1660 def __init__(self, contents=None): 1661 self.element_ = [] 1662 if contents is not None: self.MergeFromString(contents) 1663 1664 def element_size(self): return len(self.element_) 1665 def element_list(self): return self.element_ 1666 1667 def element(self, i): 1668 return self.element_[i] 1669 1670 def mutable_element(self, i): 1671 return self.element_[i] 1672 1673 def add_element(self): 1674 x = Path_Element() 1675 self.element_.append(x) 1676 return x 1677 1678 def clear_element(self): 1679 self.element_ = [] 1680 1681 def MergeFrom(self, x): 1682 assert x is not self 1683 for i in range(x.element_size()): self.add_element().CopyFrom(x.element(i)) 1684 1685 def Equals(self, x): 1686 if x is self: return 1 1687 if len(self.element_) != len(x.element_): return 0 1688 for e1, e2 in zip(self.element_, x.element_): 1689 if e1 != e2: return 0 1690 return 1 1691 1692 def IsInitialized(self, debug_strs=None): 1693 initialized = 1 1694 for p in self.element_: 1695 if not p.IsInitialized(debug_strs): initialized=0 1696 return initialized 1697 1698 def ByteSize(self): 1699 n = 0 1700 n += 2 * len(self.element_) 1701 for i in range(len(self.element_)): n += self.element_[i].ByteSize() 1702 return n 1703 1704 def ByteSizePartial(self): 1705 n = 0 1706 n += 2 * len(self.element_) 1707 for i in range(len(self.element_)): n += self.element_[i].ByteSizePartial() 1708 return n 1709 1710 def Clear(self): 1711 self.clear_element() 1712 1713 def OutputUnchecked(self, out): 1714 for i in range(len(self.element_)): 1715 out.putVarInt32(11) 1716 self.element_[i].OutputUnchecked(out) 1717 out.putVarInt32(12) 1718 1719 def OutputPartial(self, out): 1720 for i in range(len(self.element_)): 1721 out.putVarInt32(11) 1722 self.element_[i].OutputPartial(out) 1723 out.putVarInt32(12) 1724 1725 def TryMerge(self, d): 1726 while d.avail() > 0: 1727 tt = d.getVarInt32() 1728 if tt == 11: 1729 self.add_element().TryMerge(d) 1730 continue 1731 # tag 0 is special: it's used to indicate an error. 1732 # so if we see it we raise an exception. 1733 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 1734 d.skipData(tt) 1735 1736 1737 def __str__(self, prefix="", printElemNumber=0): 1738 res="" 1739 cnt=0 1740 for e in self.element_: 1741 elm="" 1742 if printElemNumber: elm="(%d)" % cnt 1743 res+=prefix+("Element%s {\n" % elm) 1744 res+=e.__str__(prefix + " ", printElemNumber) 1745 res+=prefix+"}\n" 1746 cnt+=1 1747 return res 1748 1749 1750 def _BuildTagLookupTable(sparse, maxtag, default=None): 1751 return tuple([sparse.get(i, default) for i in range(0, 1+maxtag)]) 1752 1753 kElementGroup = 1 1754 kElementtype = 2 1755 kElementid = 3 1756 kElementname = 4 1757 1758 _TEXT = _BuildTagLookupTable({ 1759 0: "ErrorCode", 1760 1: "Element", 1761 2: "type", 1762 3: "id", 1763 4: "name", 1764 }, 4) 1765 1766 _TYPES = _BuildTagLookupTable({ 1767 0: ProtocolBuffer.Encoder.NUMERIC, 1768 1: ProtocolBuffer.Encoder.STARTGROUP, 1769 2: ProtocolBuffer.Encoder.STRING, 1770 3: ProtocolBuffer.Encoder.NUMERIC, 1771 4: ProtocolBuffer.Encoder.STRING, 1772 }, 4, ProtocolBuffer.Encoder.MAX_TYPE) 1773 1774 # stylesheet for XML output 1775 _STYLE = \ 1776 """""" 1777 _STYLE_CONTENT_TYPE = \ 1778 """""" 1779 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.Path' 1780class Reference(ProtocolBuffer.ProtocolMessage): 1781 has_app_ = 0 1782 app_ = "" 1783 has_name_space_ = 0 1784 name_space_ = "" 1785 has_path_ = 0 1786 has_database_id_ = 0 1787 database_id_ = "" 1788 1789 def __init__(self, contents=None): 1790 self.path_ = Path() 1791 if contents is not None: self.MergeFromString(contents) 1792 1793 def app(self): return self.app_ 1794 1795 def set_app(self, x): 1796 self.has_app_ = 1 1797 self.app_ = x 1798 1799 def clear_app(self): 1800 if self.has_app_: 1801 self.has_app_ = 0 1802 self.app_ = "" 1803 1804 def has_app(self): return self.has_app_ 1805 1806 def name_space(self): return self.name_space_ 1807 1808 def set_name_space(self, x): 1809 self.has_name_space_ = 1 1810 self.name_space_ = x 1811 1812 def clear_name_space(self): 1813 if self.has_name_space_: 1814 self.has_name_space_ = 0 1815 self.name_space_ = "" 1816 1817 def has_name_space(self): return self.has_name_space_ 1818 1819 def path(self): return self.path_ 1820 1821 def mutable_path(self): self.has_path_ = 1; return self.path_ 1822 1823 def clear_path(self):self.has_path_ = 0; self.path_.Clear() 1824 1825 def has_path(self): return self.has_path_ 1826 1827 def database_id(self): return self.database_id_ 1828 1829 def set_database_id(self, x): 1830 self.has_database_id_ = 1 1831 self.database_id_ = x 1832 1833 def clear_database_id(self): 1834 if self.has_database_id_: 1835 self.has_database_id_ = 0 1836 self.database_id_ = "" 1837 1838 def has_database_id(self): return self.has_database_id_ 1839 1840 1841 def MergeFrom(self, x): 1842 assert x is not self 1843 if (x.has_app()): self.set_app(x.app()) 1844 if (x.has_name_space()): self.set_name_space(x.name_space()) 1845 if (x.has_path()): self.mutable_path().MergeFrom(x.path()) 1846 if (x.has_database_id()): self.set_database_id(x.database_id()) 1847 1848 def Equals(self, x): 1849 if x is self: return 1 1850 if self.has_app_ != x.has_app_: return 0 1851 if self.has_app_ and self.app_ != x.app_: return 0 1852 if self.has_name_space_ != x.has_name_space_: return 0 1853 if self.has_name_space_ and self.name_space_ != x.name_space_: return 0 1854 if self.has_path_ != x.has_path_: return 0 1855 if self.has_path_ and self.path_ != x.path_: return 0 1856 if self.has_database_id_ != x.has_database_id_: return 0 1857 if self.has_database_id_ and self.database_id_ != x.database_id_: return 0 1858 return 1 1859 1860 def IsInitialized(self, debug_strs=None): 1861 initialized = 1 1862 if (not self.has_app_): 1863 initialized = 0 1864 if debug_strs is not None: 1865 debug_strs.append('Required field: app not set.') 1866 if (not self.has_path_): 1867 initialized = 0 1868 if debug_strs is not None: 1869 debug_strs.append('Required field: path not set.') 1870 elif not self.path_.IsInitialized(debug_strs): initialized = 0 1871 return initialized 1872 1873 def ByteSize(self): 1874 n = 0 1875 n += self.lengthString(len(self.app_)) 1876 if (self.has_name_space_): n += 2 + self.lengthString(len(self.name_space_)) 1877 n += self.lengthString(self.path_.ByteSize()) 1878 if (self.has_database_id_): n += 2 + self.lengthString(len(self.database_id_)) 1879 return n + 2 1880 1881 def ByteSizePartial(self): 1882 n = 0 1883 if (self.has_app_): 1884 n += 1 1885 n += self.lengthString(len(self.app_)) 1886 if (self.has_name_space_): n += 2 + self.lengthString(len(self.name_space_)) 1887 if (self.has_path_): 1888 n += 1 1889 n += self.lengthString(self.path_.ByteSizePartial()) 1890 if (self.has_database_id_): n += 2 + self.lengthString(len(self.database_id_)) 1891 return n 1892 1893 def Clear(self): 1894 self.clear_app() 1895 self.clear_name_space() 1896 self.clear_path() 1897 self.clear_database_id() 1898 1899 def OutputUnchecked(self, out): 1900 out.putVarInt32(106) 1901 out.putPrefixedString(self.app_) 1902 out.putVarInt32(114) 1903 out.putVarInt32(self.path_.ByteSize()) 1904 self.path_.OutputUnchecked(out) 1905 if (self.has_name_space_): 1906 out.putVarInt32(162) 1907 out.putPrefixedString(self.name_space_) 1908 if (self.has_database_id_): 1909 out.putVarInt32(186) 1910 out.putPrefixedString(self.database_id_) 1911 1912 def OutputPartial(self, out): 1913 if (self.has_app_): 1914 out.putVarInt32(106) 1915 out.putPrefixedString(self.app_) 1916 if (self.has_path_): 1917 out.putVarInt32(114) 1918 out.putVarInt32(self.path_.ByteSizePartial()) 1919 self.path_.OutputPartial(out) 1920 if (self.has_name_space_): 1921 out.putVarInt32(162) 1922 out.putPrefixedString(self.name_space_) 1923 if (self.has_database_id_): 1924 out.putVarInt32(186) 1925 out.putPrefixedString(self.database_id_) 1926 1927 def TryMerge(self, d): 1928 while d.avail() > 0: 1929 tt = d.getVarInt32() 1930 if tt == 106: 1931 self.set_app(d.getPrefixedString()) 1932 continue 1933 if tt == 114: 1934 length = d.getVarInt32() 1935 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) 1936 d.skip(length) 1937 self.mutable_path().TryMerge(tmp) 1938 continue 1939 if tt == 162: 1940 self.set_name_space(d.getPrefixedString()) 1941 continue 1942 if tt == 186: 1943 self.set_database_id(d.getPrefixedString()) 1944 continue 1945 # tag 0 is special: it's used to indicate an error. 1946 # so if we see it we raise an exception. 1947 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 1948 d.skipData(tt) 1949 1950 1951 def __str__(self, prefix="", printElemNumber=0): 1952 res="" 1953 if self.has_app_: res+=prefix+("app: %s\n" % self.DebugFormatString(self.app_)) 1954 if self.has_name_space_: res+=prefix+("name_space: %s\n" % self.DebugFormatString(self.name_space_)) 1955 if self.has_path_: 1956 res+=prefix+"path <\n" 1957 res+=self.path_.__str__(prefix + " ", printElemNumber) 1958 res+=prefix+">\n" 1959 if self.has_database_id_: res+=prefix+("database_id: %s\n" % self.DebugFormatString(self.database_id_)) 1960 return res 1961 1962 1963 def _BuildTagLookupTable(sparse, maxtag, default=None): 1964 return tuple([sparse.get(i, default) for i in range(0, 1+maxtag)]) 1965 1966 kapp = 13 1967 kname_space = 20 1968 kpath = 14 1969 kdatabase_id = 23 1970 1971 _TEXT = _BuildTagLookupTable({ 1972 0: "ErrorCode", 1973 13: "app", 1974 14: "path", 1975 20: "name_space", 1976 23: "database_id", 1977 }, 23) 1978 1979 _TYPES = _BuildTagLookupTable({ 1980 0: ProtocolBuffer.Encoder.NUMERIC, 1981 13: ProtocolBuffer.Encoder.STRING, 1982 14: ProtocolBuffer.Encoder.STRING, 1983 20: ProtocolBuffer.Encoder.STRING, 1984 23: ProtocolBuffer.Encoder.STRING, 1985 }, 23, ProtocolBuffer.Encoder.MAX_TYPE) 1986 1987 # stylesheet for XML output 1988 _STYLE = \ 1989 """""" 1990 _STYLE_CONTENT_TYPE = \ 1991 """""" 1992 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.Reference' 1993class User(ProtocolBuffer.ProtocolMessage): 1994 has_email_ = 0 1995 email_ = "" 1996 has_auth_domain_ = 0 1997 auth_domain_ = "" 1998 has_nickname_ = 0 1999 nickname_ = "" 2000 has_gaiaid_ = 0 2001 gaiaid_ = 0 2002 has_obfuscated_gaiaid_ = 0 2003 obfuscated_gaiaid_ = "" 2004 has_federated_identity_ = 0 2005 federated_identity_ = "" 2006 has_federated_provider_ = 0 2007 federated_provider_ = "" 2008 2009 def __init__(self, contents=None): 2010 if contents is not None: self.MergeFromString(contents) 2011 2012 def email(self): return self.email_ 2013 2014 def set_email(self, x): 2015 self.has_email_ = 1 2016 self.email_ = x 2017 2018 def clear_email(self): 2019 if self.has_email_: 2020 self.has_email_ = 0 2021 self.email_ = "" 2022 2023 def has_email(self): return self.has_email_ 2024 2025 def auth_domain(self): return self.auth_domain_ 2026 2027 def set_auth_domain(self, x): 2028 self.has_auth_domain_ = 1 2029 self.auth_domain_ = x 2030 2031 def clear_auth_domain(self): 2032 if self.has_auth_domain_: 2033 self.has_auth_domain_ = 0 2034 self.auth_domain_ = "" 2035 2036 def has_auth_domain(self): return self.has_auth_domain_ 2037 2038 def nickname(self): return self.nickname_ 2039 2040 def set_nickname(self, x): 2041 self.has_nickname_ = 1 2042 self.nickname_ = x 2043 2044 def clear_nickname(self): 2045 if self.has_nickname_: 2046 self.has_nickname_ = 0 2047 self.nickname_ = "" 2048 2049 def has_nickname(self): return self.has_nickname_ 2050 2051 def gaiaid(self): return self.gaiaid_ 2052 2053 def set_gaiaid(self, x): 2054 self.has_gaiaid_ = 1 2055 self.gaiaid_ = x 2056 2057 def clear_gaiaid(self): 2058 if self.has_gaiaid_: 2059 self.has_gaiaid_ = 0 2060 self.gaiaid_ = 0 2061 2062 def has_gaiaid(self): return self.has_gaiaid_ 2063 2064 def obfuscated_gaiaid(self): return self.obfuscated_gaiaid_ 2065 2066 def set_obfuscated_gaiaid(self, x): 2067 self.has_obfuscated_gaiaid_ = 1 2068 self.obfuscated_gaiaid_ = x 2069 2070 def clear_obfuscated_gaiaid(self): 2071 if self.has_obfuscated_gaiaid_: 2072 self.has_obfuscated_gaiaid_ = 0 2073 self.obfuscated_gaiaid_ = "" 2074 2075 def has_obfuscated_gaiaid(self): return self.has_obfuscated_gaiaid_ 2076 2077 def federated_identity(self): return self.federated_identity_ 2078 2079 def set_federated_identity(self, x): 2080 self.has_federated_identity_ = 1 2081 self.federated_identity_ = x 2082 2083 def clear_federated_identity(self): 2084 if self.has_federated_identity_: 2085 self.has_federated_identity_ = 0 2086 self.federated_identity_ = "" 2087 2088 def has_federated_identity(self): return self.has_federated_identity_ 2089 2090 def federated_provider(self): return self.federated_provider_ 2091 2092 def set_federated_provider(self, x): 2093 self.has_federated_provider_ = 1 2094 self.federated_provider_ = x 2095 2096 def clear_federated_provider(self): 2097 if self.has_federated_provider_: 2098 self.has_federated_provider_ = 0 2099 self.federated_provider_ = "" 2100 2101 def has_federated_provider(self): return self.has_federated_provider_ 2102 2103 2104 def MergeFrom(self, x): 2105 assert x is not self 2106 if (x.has_email()): self.set_email(x.email()) 2107 if (x.has_auth_domain()): self.set_auth_domain(x.auth_domain()) 2108 if (x.has_nickname()): self.set_nickname(x.nickname()) 2109 if (x.has_gaiaid()): self.set_gaiaid(x.gaiaid()) 2110 if (x.has_obfuscated_gaiaid()): self.set_obfuscated_gaiaid(x.obfuscated_gaiaid()) 2111 if (x.has_federated_identity()): self.set_federated_identity(x.federated_identity()) 2112 if (x.has_federated_provider()): self.set_federated_provider(x.federated_provider()) 2113 2114 def Equals(self, x): 2115 if x is self: return 1 2116 if self.has_email_ != x.has_email_: return 0 2117 if self.has_email_ and self.email_ != x.email_: return 0 2118 if self.has_auth_domain_ != x.has_auth_domain_: return 0 2119 if self.has_auth_domain_ and self.auth_domain_ != x.auth_domain_: return 0 2120 if self.has_nickname_ != x.has_nickname_: return 0 2121 if self.has_nickname_ and self.nickname_ != x.nickname_: return 0 2122 if self.has_gaiaid_ != x.has_gaiaid_: return 0 2123 if self.has_gaiaid_ and self.gaiaid_ != x.gaiaid_: return 0 2124 if self.has_obfuscated_gaiaid_ != x.has_obfuscated_gaiaid_: return 0 2125 if self.has_obfuscated_gaiaid_ and self.obfuscated_gaiaid_ != x.obfuscated_gaiaid_: return 0 2126 if self.has_federated_identity_ != x.has_federated_identity_: return 0 2127 if self.has_federated_identity_ and self.federated_identity_ != x.federated_identity_: return 0 2128 if self.has_federated_provider_ != x.has_federated_provider_: return 0 2129 if self.has_federated_provider_ and self.federated_provider_ != x.federated_provider_: return 0 2130 return 1 2131 2132 def IsInitialized(self, debug_strs=None): 2133 initialized = 1 2134 if (not self.has_email_): 2135 initialized = 0 2136 if debug_strs is not None: 2137 debug_strs.append('Required field: email not set.') 2138 if (not self.has_auth_domain_): 2139 initialized = 0 2140 if debug_strs is not None: 2141 debug_strs.append('Required field: auth_domain not set.') 2142 if (not self.has_gaiaid_): 2143 initialized = 0 2144 if debug_strs is not None: 2145 debug_strs.append('Required field: gaiaid not set.') 2146 return initialized 2147 2148 def ByteSize(self): 2149 n = 0 2150 n += self.lengthString(len(self.email_)) 2151 n += self.lengthString(len(self.auth_domain_)) 2152 if (self.has_nickname_): n += 1 + self.lengthString(len(self.nickname_)) 2153 n += self.lengthVarInt64(self.gaiaid_) 2154 if (self.has_obfuscated_gaiaid_): n += 1 + self.lengthString(len(self.obfuscated_gaiaid_)) 2155 if (self.has_federated_identity_): n += 1 + self.lengthString(len(self.federated_identity_)) 2156 if (self.has_federated_provider_): n += 1 + self.lengthString(len(self.federated_provider_)) 2157 return n + 3 2158 2159 def ByteSizePartial(self): 2160 n = 0 2161 if (self.has_email_): 2162 n += 1 2163 n += self.lengthString(len(self.email_)) 2164 if (self.has_auth_domain_): 2165 n += 1 2166 n += self.lengthString(len(self.auth_domain_)) 2167 if (self.has_nickname_): n += 1 + self.lengthString(len(self.nickname_)) 2168 if (self.has_gaiaid_): 2169 n += 1 2170 n += self.lengthVarInt64(self.gaiaid_) 2171 if (self.has_obfuscated_gaiaid_): n += 1 + self.lengthString(len(self.obfuscated_gaiaid_)) 2172 if (self.has_federated_identity_): n += 1 + self.lengthString(len(self.federated_identity_)) 2173 if (self.has_federated_provider_): n += 1 + self.lengthString(len(self.federated_provider_)) 2174 return n 2175 2176 def Clear(self): 2177 self.clear_email() 2178 self.clear_auth_domain() 2179 self.clear_nickname() 2180 self.clear_gaiaid() 2181 self.clear_obfuscated_gaiaid() 2182 self.clear_federated_identity() 2183 self.clear_federated_provider() 2184 2185 def OutputUnchecked(self, out): 2186 out.putVarInt32(10) 2187 out.putPrefixedString(self.email_) 2188 out.putVarInt32(18) 2189 out.putPrefixedString(self.auth_domain_) 2190 if (self.has_nickname_): 2191 out.putVarInt32(26) 2192 out.putPrefixedString(self.nickname_) 2193 out.putVarInt32(32) 2194 out.putVarInt64(self.gaiaid_) 2195 if (self.has_obfuscated_gaiaid_): 2196 out.putVarInt32(42) 2197 out.putPrefixedString(self.obfuscated_gaiaid_) 2198 if (self.has_federated_identity_): 2199 out.putVarInt32(50) 2200 out.putPrefixedString(self.federated_identity_) 2201 if (self.has_federated_provider_): 2202 out.putVarInt32(58) 2203 out.putPrefixedString(self.federated_provider_) 2204 2205 def OutputPartial(self, out): 2206 if (self.has_email_): 2207 out.putVarInt32(10) 2208 out.putPrefixedString(self.email_) 2209 if (self.has_auth_domain_): 2210 out.putVarInt32(18) 2211 out.putPrefixedString(self.auth_domain_) 2212 if (self.has_nickname_): 2213 out.putVarInt32(26) 2214 out.putPrefixedString(self.nickname_) 2215 if (self.has_gaiaid_): 2216 out.putVarInt32(32) 2217 out.putVarInt64(self.gaiaid_) 2218 if (self.has_obfuscated_gaiaid_): 2219 out.putVarInt32(42) 2220 out.putPrefixedString(self.obfuscated_gaiaid_) 2221 if (self.has_federated_identity_): 2222 out.putVarInt32(50) 2223 out.putPrefixedString(self.federated_identity_) 2224 if (self.has_federated_provider_): 2225 out.putVarInt32(58) 2226 out.putPrefixedString(self.federated_provider_) 2227 2228 def TryMerge(self, d): 2229 while d.avail() > 0: 2230 tt = d.getVarInt32() 2231 if tt == 10: 2232 self.set_email(d.getPrefixedString()) 2233 continue 2234 if tt == 18: 2235 self.set_auth_domain(d.getPrefixedString()) 2236 continue 2237 if tt == 26: 2238 self.set_nickname(d.getPrefixedString()) 2239 continue 2240 if tt == 32: 2241 self.set_gaiaid(d.getVarInt64()) 2242 continue 2243 if tt == 42: 2244 self.set_obfuscated_gaiaid(d.getPrefixedString()) 2245 continue 2246 if tt == 50: 2247 self.set_federated_identity(d.getPrefixedString()) 2248 continue 2249 if tt == 58: 2250 self.set_federated_provider(d.getPrefixedString()) 2251 continue 2252 # tag 0 is special: it's used to indicate an error. 2253 # so if we see it we raise an exception. 2254 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 2255 d.skipData(tt) 2256 2257 2258 def __str__(self, prefix="", printElemNumber=0): 2259 res="" 2260 if self.has_email_: res+=prefix+("email: %s\n" % self.DebugFormatString(self.email_)) 2261 if self.has_auth_domain_: res+=prefix+("auth_domain: %s\n" % self.DebugFormatString(self.auth_domain_)) 2262 if self.has_nickname_: res+=prefix+("nickname: %s\n" % self.DebugFormatString(self.nickname_)) 2263 if self.has_gaiaid_: res+=prefix+("gaiaid: %s\n" % self.DebugFormatInt64(self.gaiaid_)) 2264 if self.has_obfuscated_gaiaid_: res+=prefix+("obfuscated_gaiaid: %s\n" % self.DebugFormatString(self.obfuscated_gaiaid_)) 2265 if self.has_federated_identity_: res+=prefix+("federated_identity: %s\n" % self.DebugFormatString(self.federated_identity_)) 2266 if self.has_federated_provider_: res+=prefix+("federated_provider: %s\n" % self.DebugFormatString(self.federated_provider_)) 2267 return res 2268 2269 2270 def _BuildTagLookupTable(sparse, maxtag, default=None): 2271 return tuple([sparse.get(i, default) for i in range(0, 1+maxtag)]) 2272 2273 kemail = 1 2274 kauth_domain = 2 2275 knickname = 3 2276 kgaiaid = 4 2277 kobfuscated_gaiaid = 5 2278 kfederated_identity = 6 2279 kfederated_provider = 7 2280 2281 _TEXT = _BuildTagLookupTable({ 2282 0: "ErrorCode", 2283 1: "email", 2284 2: "auth_domain", 2285 3: "nickname", 2286 4: "gaiaid", 2287 5: "obfuscated_gaiaid", 2288 6: "federated_identity", 2289 7: "federated_provider", 2290 }, 7) 2291 2292 _TYPES = _BuildTagLookupTable({ 2293 0: ProtocolBuffer.Encoder.NUMERIC, 2294 1: ProtocolBuffer.Encoder.STRING, 2295 2: ProtocolBuffer.Encoder.STRING, 2296 3: ProtocolBuffer.Encoder.STRING, 2297 4: ProtocolBuffer.Encoder.NUMERIC, 2298 5: ProtocolBuffer.Encoder.STRING, 2299 6: ProtocolBuffer.Encoder.STRING, 2300 7: ProtocolBuffer.Encoder.STRING, 2301 }, 7, ProtocolBuffer.Encoder.MAX_TYPE) 2302 2303 # stylesheet for XML output 2304 _STYLE = \ 2305 """""" 2306 _STYLE_CONTENT_TYPE = \ 2307 """""" 2308 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.User' 2309class EntityProto(ProtocolBuffer.ProtocolMessage): 2310 2311 # Kind values 2312 GD_CONTACT = 1 2313 GD_EVENT = 2 2314 GD_MESSAGE = 3 2315 2316 _Kind_NAMES = { 2317 1: "GD_CONTACT", 2318 2: "GD_EVENT", 2319 3: "GD_MESSAGE", 2320 } 2321 2322 def Kind_Name(cls, x): return cls._Kind_NAMES.get(x, "") 2323 Kind_Name = classmethod(Kind_Name) 2324 2325 has_key_ = 0 2326 has_entity_group_ = 0 2327 has_owner_ = 0 2328 owner_ = None 2329 has_kind_ = 0 2330 kind_ = 0 2331 has_kind_uri_ = 0 2332 kind_uri_ = "" 2333 2334 def __init__(self, contents=None): 2335 self.key_ = Reference() 2336 self.entity_group_ = Path() 2337 self.property_ = [] 2338 self.raw_property_ = [] 2339 self.lazy_init_lock_ = _Lock() 2340 if contents is not None: self.MergeFromString(contents) 2341 2342 def key(self): return self.key_ 2343 2344 def mutable_key(self): self.has_key_ = 1; return self.key_ 2345 2346 def clear_key(self):self.has_key_ = 0; self.key_.Clear() 2347 2348 def has_key(self): return self.has_key_ 2349 2350 def entity_group(self): return self.entity_group_ 2351 2352 def mutable_entity_group(self): self.has_entity_group_ = 1; return self.entity_group_ 2353 2354 def clear_entity_group(self):self.has_entity_group_ = 0; self.entity_group_.Clear() 2355 2356 def has_entity_group(self): return self.has_entity_group_ 2357 2358 def owner(self): 2359 if self.owner_ is None: 2360 self.lazy_init_lock_.acquire() 2361 try: 2362 if self.owner_ is None: self.owner_ = User() 2363 finally: 2364 self.lazy_init_lock_.release() 2365 return self.owner_ 2366 2367 def mutable_owner(self): self.has_owner_ = 1; return self.owner() 2368 2369 def clear_owner(self): 2370 # Warning: this method does not acquire the lock. 2371 if self.has_owner_: 2372 self.has_owner_ = 0; 2373 if self.owner_ is not None: self.owner_.Clear() 2374 2375 def has_owner(self): return self.has_owner_ 2376 2377 def kind(self): return self.kind_ 2378 2379 def set_kind(self, x): 2380 self.has_kind_ = 1 2381 self.kind_ = x 2382 2383 def clear_kind(self): 2384 if self.has_kind_: 2385 self.has_kind_ = 0 2386 self.kind_ = 0 2387 2388 def has_kind(self): return self.has_kind_ 2389 2390 def kind_uri(self): return self.kind_uri_ 2391 2392 def set_kind_uri(self, x): 2393 self.has_kind_uri_ = 1 2394 self.kind_uri_ = x 2395 2396 def clear_kind_uri(self): 2397 if self.has_kind_uri_: 2398 self.has_kind_uri_ = 0 2399 self.kind_uri_ = "" 2400 2401 def has_kind_uri(self): return self.has_kind_uri_ 2402 2403 def property_size(self): return len(self.property_) 2404 def property_list(self): return self.property_ 2405 2406 def property(self, i): 2407 return self.property_[i] 2408 2409 def mutable_property(self, i): 2410 return self.property_[i] 2411 2412 def add_property(self): 2413 x = Property() 2414 self.property_.append(x) 2415 return x 2416 2417 def clear_property(self): 2418 self.property_ = [] 2419 def raw_property_size(self): return len(self.raw_property_) 2420 def raw_property_list(self): return self.raw_property_ 2421 2422 def raw_property(self, i): 2423 return self.raw_property_[i] 2424 2425 def mutable_raw_property(self, i): 2426 return self.raw_property_[i] 2427 2428 def add_raw_property(self): 2429 x = Property() 2430 self.raw_property_.append(x) 2431 return x 2432 2433 def clear_raw_property(self): 2434 self.raw_property_ = [] 2435 2436 def MergeFrom(self, x): 2437 assert x is not self 2438 if (x.has_key()): self.mutable_key().MergeFrom(x.key()) 2439 if (x.has_entity_group()): self.mutable_entity_group().MergeFrom(x.entity_group()) 2440 if (x.has_owner()): self.mutable_owner().MergeFrom(x.owner()) 2441 if (x.has_kind()): self.set_kind(x.kind()) 2442 if (x.has_kind_uri()): self.set_kind_uri(x.kind_uri()) 2443 for i in range(x.property_size()): self.add_property().CopyFrom(x.property(i)) 2444 for i in range(x.raw_property_size()): self.add_raw_property().CopyFrom(x.raw_property(i)) 2445 2446 def Equals(self, x): 2447 if x is self: return 1 2448 if self.has_key_ != x.has_key_: return 0 2449 if self.has_key_ and self.key_ != x.key_: return 0 2450 if self.has_entity_group_ != x.has_entity_group_: return 0 2451 if self.has_entity_group_ and self.entity_group_ != x.entity_group_: return 0 2452 if self.has_owner_ != x.has_owner_: return 0 2453 if self.has_owner_ and self.owner_ != x.owner_: return 0 2454 if self.has_kind_ != x.has_kind_: return 0 2455 if self.has_kind_ and self.kind_ != x.kind_: return 0 2456 if self.has_kind_uri_ != x.has_kind_uri_: return 0 2457 if self.has_kind_uri_ and self.kind_uri_ != x.kind_uri_: return 0 2458 if len(self.property_) != len(x.property_): return 0 2459 for e1, e2 in zip(self.property_, x.property_): 2460 if e1 != e2: return 0 2461 if len(self.raw_property_) != len(x.raw_property_): return 0 2462 for e1, e2 in zip(self.raw_property_, x.raw_property_): 2463 if e1 != e2: return 0 2464 return 1 2465 2466 def IsInitialized(self, debug_strs=None): 2467 initialized = 1 2468 if (not self.has_key_): 2469 initialized = 0 2470 if debug_strs is not None: 2471 debug_strs.append('Required field: key not set.') 2472 elif not self.key_.IsInitialized(debug_strs): initialized = 0 2473 if (not self.has_entity_group_): 2474 initialized = 0 2475 if debug_strs is not None: 2476 debug_strs.append('Required field: entity_group not set.') 2477 elif not self.entity_group_.IsInitialized(debug_strs): initialized = 0 2478 if (self.has_owner_ and not self.owner_.IsInitialized(debug_strs)): initialized = 0 2479 for p in self.property_: 2480 if not p.IsInitialized(debug_strs): initialized=0 2481 for p in self.raw_property_: 2482 if not p.IsInitialized(debug_strs): initialized=0 2483 return initialized 2484 2485 def ByteSize(self): 2486 n = 0 2487 n += self.lengthString(self.key_.ByteSize()) 2488 n += self.lengthString(self.entity_group_.ByteSize()) 2489 if (self.has_owner_): n += 2 + self.lengthString(self.owner_.ByteSize()) 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 range(len(self.property_)): n += self.lengthString(self.property_[i].ByteSize()) 2494 n += 1 * len(self.raw_property_) 2495 for i in range(len(self.raw_property_)): n += self.lengthString(self.raw_property_[i].ByteSize()) 2496 return n + 3 2497 2498 def ByteSizePartial(self): 2499 n = 0 2500 if (self.has_key_): 2501 n += 1 2502 n += self.lengthString(self.key_.ByteSizePartial()) 2503 if (self.has_entity_group_): 2504 n += 2 2505 n += self.lengthString(self.entity_group_.ByteSizePartial()) 2506 if (self.has_owner_): n += 2 + self.lengthString(self.owner_.ByteSizePartial()) 2507 if (self.has_kind_): n += 1 + self.lengthVarInt64(self.kind_) 2508 if (self.has_kind_uri_): n += 1 + self.lengthString(len(self.kind_uri_)) 2509 n += 1 * len(self.property_) 2510 for i in range(len(self.property_)): n += self.lengthString(self.property_[i].ByteSizePartial()) 2511 n += 1 * len(self.raw_property_) 2512 for i in range(len(self.raw_property_)): n += self.lengthString(self.raw_property_[i].ByteSizePartial()) 2513 return n 2514 2515 def Clear(self): 2516 self.clear_key() 2517 self.clear_entity_group() 2518 self.clear_owner() 2519 self.clear_kind() 2520 self.clear_kind_uri() 2521 self.clear_property() 2522 self.clear_raw_property() 2523 2524 def OutputUnchecked(self, out): 2525 if (self.has_kind_): 2526 out.putVarInt32(32) 2527 out.putVarInt32(self.kind_) 2528 if (self.has_kind_uri_): 2529 out.putVarInt32(42) 2530 out.putPrefixedString(self.kind_uri_) 2531 out.putVarInt32(106) 2532 out.putVarInt32(self.key_.ByteSize()) 2533 self.key_.OutputUnchecked(out) 2534 for i in range(len(self.property_)): 2535 out.putVarInt32(114) 2536 out.putVarInt32(self.property_[i].ByteSize()) 2537 self.property_[i].OutputUnchecked(out) 2538 for i in range(len(self.raw_property_)): 2539 out.putVarInt32(122) 2540 out.putVarInt32(self.raw_property_[i].ByteSize()) 2541 self.raw_property_[i].OutputUnchecked(out) 2542 out.putVarInt32(130) 2543 out.putVarInt32(self.entity_group_.ByteSize()) 2544 self.entity_group_.OutputUnchecked(out) 2545 if (self.has_owner_): 2546 out.putVarInt32(138) 2547 out.putVarInt32(self.owner_.ByteSize()) 2548 self.owner_.OutputUnchecked(out) 2549 2550 def OutputPartial(self, out): 2551 if (self.has_kind_): 2552 out.putVarInt32(32) 2553 out.putVarInt32(self.kind_) 2554 if (self.has_kind_uri_): 2555 out.putVarInt32(42) 2556 out.putPrefixedString(self.kind_uri_) 2557 if (self.has_key_): 2558 out.putVarInt32(106) 2559 out.putVarInt32(self.key_.ByteSizePartial()) 2560 self.key_.OutputPartial(out) 2561 for i in range(len(self.property_)): 2562 out.putVarInt32(114) 2563 out.putVarInt32(self.property_[i].ByteSizePartial()) 2564 self.property_[i].OutputPartial(out) 2565 for i in range(len(self.raw_property_)): 2566 out.putVarInt32(122) 2567 out.putVarInt32(self.raw_property_[i].ByteSizePartial()) 2568 self.raw_property_[i].OutputPartial(out) 2569 if (self.has_entity_group_): 2570 out.putVarInt32(130) 2571 out.putVarInt32(self.entity_group_.ByteSizePartial()) 2572 self.entity_group_.OutputPartial(out) 2573 if (self.has_owner_): 2574 out.putVarInt32(138) 2575 out.putVarInt32(self.owner_.ByteSizePartial()) 2576 self.owner_.OutputPartial(out) 2577 2578 def TryMerge(self, d): 2579 while d.avail() > 0: 2580 tt = d.getVarInt32() 2581 if tt == 32: 2582 self.set_kind(d.getVarInt32()) 2583 continue 2584 if tt == 42: 2585 self.set_kind_uri(d.getPrefixedString()) 2586 continue 2587 if tt == 106: 2588 length = d.getVarInt32() 2589 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) 2590 d.skip(length) 2591 self.mutable_key().TryMerge(tmp) 2592 continue 2593 if tt == 114: 2594 length = d.getVarInt32() 2595 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) 2596 d.skip(length) 2597 self.add_property().TryMerge(tmp) 2598 continue 2599 if tt == 122: 2600 length = d.getVarInt32() 2601 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) 2602 d.skip(length) 2603 self.add_raw_property().TryMerge(tmp) 2604 continue 2605 if tt == 130: 2606 length = d.getVarInt32() 2607 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) 2608 d.skip(length) 2609 self.mutable_entity_group().TryMerge(tmp) 2610 continue 2611 if tt == 138: 2612 length = d.getVarInt32() 2613 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) 2614 d.skip(length) 2615 self.mutable_owner().TryMerge(tmp) 2616 continue 2617 # tag 0 is special: it's used to indicate an error. 2618 # so if we see it we raise an exception. 2619 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 2620 d.skipData(tt) 2621 2622 2623 def __str__(self, prefix="", printElemNumber=0): 2624 res="" 2625 if self.has_key_: 2626 res+=prefix+"key <\n" 2627 res+=self.key_.__str__(prefix + " ", printElemNumber) 2628 res+=prefix+">\n" 2629 if self.has_entity_group_: 2630 res+=prefix+"entity_group <\n" 2631 res+=self.entity_group_.__str__(prefix + " ", printElemNumber) 2632 res+=prefix+">\n" 2633 if self.has_owner_: 2634 res+=prefix+"owner <\n" 2635 res+=self.owner_.__str__(prefix + " ", printElemNumber) 2636 res+=prefix+">\n" 2637 if self.has_kind_: res+=prefix+("kind: %s\n" % self.DebugFormatInt32(self.kind_)) 2638 if self.has_kind_uri_: res+=prefix+("kind_uri: %s\n" % self.DebugFormatString(self.kind_uri_)) 2639 cnt=0 2640 for e in self.property_: 2641 elm="" 2642 if printElemNumber: elm="(%d)" % cnt 2643 res+=prefix+("property%s <\n" % elm) 2644 res+=e.__str__(prefix + " ", printElemNumber) 2645 res+=prefix+">\n" 2646 cnt+=1 2647 cnt=0 2648 for e in self.raw_property_: 2649 elm="" 2650 if printElemNumber: elm="(%d)" % cnt 2651 res+=prefix+("raw_property%s <\n" % elm) 2652 res+=e.__str__(prefix + " ", printElemNumber) 2653 res+=prefix+">\n" 2654 cnt+=1 2655 return res 2656 2657 2658 def _BuildTagLookupTable(sparse, maxtag, default=None): 2659 return tuple([sparse.get(i, default) for i in range(0, 1+maxtag)]) 2660 2661 kkey = 13 2662 kentity_group = 16 2663 kowner = 17 2664 kkind = 4 2665 kkind_uri = 5 2666 kproperty = 14 2667 kraw_property = 15 2668 2669 _TEXT = _BuildTagLookupTable({ 2670 0: "ErrorCode", 2671 4: "kind", 2672 5: "kind_uri", 2673 13: "key", 2674 14: "property", 2675 15: "raw_property", 2676 16: "entity_group", 2677 17: "owner", 2678 }, 17) 2679 2680 _TYPES = _BuildTagLookupTable({ 2681 0: ProtocolBuffer.Encoder.NUMERIC, 2682 4: ProtocolBuffer.Encoder.NUMERIC, 2683 5: ProtocolBuffer.Encoder.STRING, 2684 13: ProtocolBuffer.Encoder.STRING, 2685 14: ProtocolBuffer.Encoder.STRING, 2686 15: ProtocolBuffer.Encoder.STRING, 2687 16: ProtocolBuffer.Encoder.STRING, 2688 17: ProtocolBuffer.Encoder.STRING, 2689 }, 17, ProtocolBuffer.Encoder.MAX_TYPE) 2690 2691 # stylesheet for XML output 2692 _STYLE = \ 2693 """""" 2694 _STYLE_CONTENT_TYPE = \ 2695 """""" 2696 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.EntityProto' 2697class EntityMetadata(ProtocolBuffer.ProtocolMessage): 2698 has_created_version_ = 0 2699 created_version_ = 0 2700 has_updated_version_ = 0 2701 updated_version_ = 0 2702 2703 def __init__(self, contents=None): 2704 if contents is not None: self.MergeFromString(contents) 2705 2706 def created_version(self): return self.created_version_ 2707 2708 def set_created_version(self, x): 2709 self.has_created_version_ = 1 2710 self.created_version_ = x 2711 2712 def clear_created_version(self): 2713 if self.has_created_version_: 2714 self.has_created_version_ = 0 2715 self.created_version_ = 0 2716 2717 def has_created_version(self): return self.has_created_version_ 2718 2719 def updated_version(self): return self.updated_version_ 2720 2721 def set_updated_version(self, x): 2722 self.has_updated_version_ = 1 2723 self.updated_version_ = x 2724 2725 def clear_updated_version(self): 2726 if self.has_updated_version_: 2727 self.has_updated_version_ = 0 2728 self.updated_version_ = 0 2729 2730 def has_updated_version(self): return self.has_updated_version_ 2731 2732 2733 def MergeFrom(self, x): 2734 assert x is not self 2735 if (x.has_created_version()): self.set_created_version(x.created_version()) 2736 if (x.has_updated_version()): self.set_updated_version(x.updated_version()) 2737 2738 def Equals(self, x): 2739 if x is self: return 1 2740 if self.has_created_version_ != x.has_created_version_: return 0 2741 if self.has_created_version_ and self.created_version_ != x.created_version_: return 0 2742 if self.has_updated_version_ != x.has_updated_version_: return 0 2743 if self.has_updated_version_ and self.updated_version_ != x.updated_version_: return 0 2744 return 1 2745 2746 def IsInitialized(self, debug_strs=None): 2747 initialized = 1 2748 return initialized 2749 2750 def ByteSize(self): 2751 n = 0 2752 if (self.has_created_version_): n += 1 + self.lengthVarInt64(self.created_version_) 2753 if (self.has_updated_version_): n += 1 + self.lengthVarInt64(self.updated_version_) 2754 return n 2755 2756 def ByteSizePartial(self): 2757 n = 0 2758 if (self.has_created_version_): n += 1 + self.lengthVarInt64(self.created_version_) 2759 if (self.has_updated_version_): n += 1 + self.lengthVarInt64(self.updated_version_) 2760 return n 2761 2762 def Clear(self): 2763 self.clear_created_version() 2764 self.clear_updated_version() 2765 2766 def OutputUnchecked(self, out): 2767 if (self.has_created_version_): 2768 out.putVarInt32(8) 2769 out.putVarInt64(self.created_version_) 2770 if (self.has_updated_version_): 2771 out.putVarInt32(16) 2772 out.putVarInt64(self.updated_version_) 2773 2774 def OutputPartial(self, out): 2775 if (self.has_created_version_): 2776 out.putVarInt32(8) 2777 out.putVarInt64(self.created_version_) 2778 if (self.has_updated_version_): 2779 out.putVarInt32(16) 2780 out.putVarInt64(self.updated_version_) 2781 2782 def TryMerge(self, d): 2783 while d.avail() > 0: 2784 tt = d.getVarInt32() 2785 if tt == 8: 2786 self.set_created_version(d.getVarInt64()) 2787 continue 2788 if tt == 16: 2789 self.set_updated_version(d.getVarInt64()) 2790 continue 2791 # tag 0 is special: it's used to indicate an error. 2792 # so if we see it we raise an exception. 2793 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 2794 d.skipData(tt) 2795 2796 2797 def __str__(self, prefix="", printElemNumber=0): 2798 res="" 2799 if self.has_created_version_: res+=prefix+("created_version: %s\n" % self.DebugFormatInt64(self.created_version_)) 2800 if self.has_updated_version_: res+=prefix+("updated_version: %s\n" % self.DebugFormatInt64(self.updated_version_)) 2801 return res 2802 2803 2804 def _BuildTagLookupTable(sparse, maxtag, default=None): 2805 return tuple([sparse.get(i, default) for i in range(0, 1+maxtag)]) 2806 2807 kcreated_version = 1 2808 kupdated_version = 2 2809 2810 _TEXT = _BuildTagLookupTable({ 2811 0: "ErrorCode", 2812 1: "created_version", 2813 2: "updated_version", 2814 }, 2) 2815 2816 _TYPES = _BuildTagLookupTable({ 2817 0: ProtocolBuffer.Encoder.NUMERIC, 2818 1: ProtocolBuffer.Encoder.NUMERIC, 2819 2: ProtocolBuffer.Encoder.NUMERIC, 2820 }, 2, ProtocolBuffer.Encoder.MAX_TYPE) 2821 2822 # stylesheet for XML output 2823 _STYLE = \ 2824 """""" 2825 _STYLE_CONTENT_TYPE = \ 2826 """""" 2827 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.EntityMetadata' 2828class EntitySummary_PropertySummary(ProtocolBuffer.ProtocolMessage): 2829 has_name_ = 0 2830 name_ = "" 2831 has_property_type_for_stats_ = 0 2832 property_type_for_stats_ = "" 2833 has_size_bytes_ = 0 2834 size_bytes_ = 0 2835 2836 def __init__(self, contents=None): 2837 if contents is not None: self.MergeFromString(contents) 2838 2839 def name(self): return self.name_ 2840 2841 def set_name(self, x): 2842 self.has_name_ = 1 2843 self.name_ = x 2844 2845 def clear_name(self): 2846 if self.has_name_: 2847 self.has_name_ = 0 2848 self.name_ = "" 2849 2850 def has_name(self): return self.has_name_ 2851 2852 def property_type_for_stats(self): return self.property_type_for_stats_ 2853 2854 def set_property_type_for_stats(self, x): 2855 self.has_property_type_for_stats_ = 1 2856 self.property_type_for_stats_ = x 2857 2858 def clear_property_type_for_stats(self): 2859 if self.has_property_type_for_stats_: 2860 self.has_property_type_for_stats_ = 0 2861 self.property_type_for_stats_ = "" 2862 2863 def has_property_type_for_stats(self): return self.has_property_type_for_stats_ 2864 2865 def size_bytes(self): return self.size_bytes_ 2866 2867 def set_size_bytes(self, x): 2868 self.has_size_bytes_ = 1 2869 self.size_bytes_ = x 2870 2871 def clear_size_bytes(self): 2872 if self.has_size_bytes_: 2873 self.has_size_bytes_ = 0 2874 self.size_bytes_ = 0 2875 2876 def has_size_bytes(self): return self.has_size_bytes_ 2877 2878 2879 def MergeFrom(self, x): 2880 assert x is not self 2881 if (x.has_name()): self.set_name(x.name()) 2882 if (x.has_property_type_for_stats()): self.set_property_type_for_stats(x.property_type_for_stats()) 2883 if (x.has_size_bytes()): self.set_size_bytes(x.size_bytes()) 2884 2885 def Equals(self, x): 2886 if x is self: return 1 2887 if self.has_name_ != x.has_name_: return 0 2888 if self.has_name_ and self.name_ != x.name_: return 0 2889 if self.has_property_type_for_stats_ != x.has_property_type_for_stats_: return 0 2890 if self.has_property_type_for_stats_ and self.property_type_for_stats_ != x.property_type_for_stats_: return 0 2891 if self.has_size_bytes_ != x.has_size_bytes_: return 0 2892 if self.has_size_bytes_ and self.size_bytes_ != x.size_bytes_: return 0 2893 return 1 2894 2895 def IsInitialized(self, debug_strs=None): 2896 initialized = 1 2897 if (not self.has_name_): 2898 initialized = 0 2899 if debug_strs is not None: 2900 debug_strs.append('Required field: name not set.') 2901 return initialized 2902 2903 def ByteSize(self): 2904 n = 0 2905 n += self.lengthString(len(self.name_)) 2906 if (self.has_property_type_for_stats_): n += 1 + self.lengthString(len(self.property_type_for_stats_)) 2907 if (self.has_size_bytes_): n += 1 + self.lengthVarInt64(self.size_bytes_) 2908 return n + 1 2909 2910 def ByteSizePartial(self): 2911 n = 0 2912 if (self.has_name_): 2913 n += 1 2914 n += self.lengthString(len(self.name_)) 2915 if (self.has_property_type_for_stats_): n += 1 + self.lengthString(len(self.property_type_for_stats_)) 2916 if (self.has_size_bytes_): n += 1 + self.lengthVarInt64(self.size_bytes_) 2917 return n 2918 2919 def Clear(self): 2920 self.clear_name() 2921 self.clear_property_type_for_stats() 2922 self.clear_size_bytes() 2923 2924 def OutputUnchecked(self, out): 2925 out.putVarInt32(10) 2926 out.putPrefixedString(self.name_) 2927 if (self.has_property_type_for_stats_): 2928 out.putVarInt32(18) 2929 out.putPrefixedString(self.property_type_for_stats_) 2930 if (self.has_size_bytes_): 2931 out.putVarInt32(24) 2932 out.putVarInt32(self.size_bytes_) 2933 2934 def OutputPartial(self, out): 2935 if (self.has_name_): 2936 out.putVarInt32(10) 2937 out.putPrefixedString(self.name_) 2938 if (self.has_property_type_for_stats_): 2939 out.putVarInt32(18) 2940 out.putPrefixedString(self.property_type_for_stats_) 2941 if (self.has_size_bytes_): 2942 out.putVarInt32(24) 2943 out.putVarInt32(self.size_bytes_) 2944 2945 def TryMerge(self, d): 2946 while d.avail() > 0: 2947 tt = d.getVarInt32() 2948 if tt == 10: 2949 self.set_name(d.getPrefixedString()) 2950 continue 2951 if tt == 18: 2952 self.set_property_type_for_stats(d.getPrefixedString()) 2953 continue 2954 if tt == 24: 2955 self.set_size_bytes(d.getVarInt32()) 2956 continue 2957 # tag 0 is special: it's used to indicate an error. 2958 # so if we see it we raise an exception. 2959 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 2960 d.skipData(tt) 2961 2962 2963 def __str__(self, prefix="", printElemNumber=0): 2964 res="" 2965 if self.has_name_: res+=prefix+("name: %s\n" % self.DebugFormatString(self.name_)) 2966 if self.has_property_type_for_stats_: res+=prefix+("property_type_for_stats: %s\n" % self.DebugFormatString(self.property_type_for_stats_)) 2967 if self.has_size_bytes_: res+=prefix+("size_bytes: %s\n" % self.DebugFormatInt32(self.size_bytes_)) 2968 return res 2969 2970 2971 def _BuildTagLookupTable(sparse, maxtag, default=None): 2972 return tuple([sparse.get(i, default) for i in range(0, 1+maxtag)]) 2973 2974 kname = 1 2975 kproperty_type_for_stats = 2 2976 ksize_bytes = 3 2977 2978 _TEXT = _BuildTagLookupTable({ 2979 0: "ErrorCode", 2980 1: "name", 2981 2: "property_type_for_stats", 2982 3: "size_bytes", 2983 }, 3) 2984 2985 _TYPES = _BuildTagLookupTable({ 2986 0: ProtocolBuffer.Encoder.NUMERIC, 2987 1: ProtocolBuffer.Encoder.STRING, 2988 2: ProtocolBuffer.Encoder.STRING, 2989 3: ProtocolBuffer.Encoder.NUMERIC, 2990 }, 3, ProtocolBuffer.Encoder.MAX_TYPE) 2991 2992 # stylesheet for XML output 2993 _STYLE = \ 2994 """""" 2995 _STYLE_CONTENT_TYPE = \ 2996 """""" 2997 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.EntitySummary_PropertySummary' 2998class EntitySummary(ProtocolBuffer.ProtocolMessage): 2999 3000 def __init__(self, contents=None): 3001 self.large_raw_property_ = [] 3002 if contents is not None: self.MergeFromString(contents) 3003 3004 def large_raw_property_size(self): return len(self.large_raw_property_) 3005 def large_raw_property_list(self): return self.large_raw_property_ 3006 3007 def large_raw_property(self, i): 3008 return self.large_raw_property_[i] 3009 3010 def mutable_large_raw_property(self, i): 3011 return self.large_raw_property_[i] 3012 3013 def add_large_raw_property(self): 3014 x = EntitySummary_PropertySummary() 3015 self.large_raw_property_.append(x) 3016 return x 3017 3018 def clear_large_raw_property(self): 3019 self.large_raw_property_ = [] 3020 3021 def MergeFrom(self, x): 3022 assert x is not self 3023 for i in range(x.large_raw_property_size()): self.add_large_raw_property().CopyFrom(x.large_raw_property(i)) 3024 3025 def Equals(self, x): 3026 if x is self: return 1 3027 if len(self.large_raw_property_) != len(x.large_raw_property_): return 0 3028 for e1, e2 in zip(self.large_raw_property_, x.large_raw_property_): 3029 if e1 != e2: return 0 3030 return 1 3031 3032 def IsInitialized(self, debug_strs=None): 3033 initialized = 1 3034 for p in self.large_raw_property_: 3035 if not p.IsInitialized(debug_strs): initialized=0 3036 return initialized 3037 3038 def ByteSize(self): 3039 n = 0 3040 n += 1 * len(self.large_raw_property_) 3041 for i in range(len(self.large_raw_property_)): n += self.lengthString(self.large_raw_property_[i].ByteSize()) 3042 return n 3043 3044 def ByteSizePartial(self): 3045 n = 0 3046 n += 1 * len(self.large_raw_property_) 3047 for i in range(len(self.large_raw_property_)): n += self.lengthString(self.large_raw_property_[i].ByteSizePartial()) 3048 return n 3049 3050 def Clear(self): 3051 self.clear_large_raw_property() 3052 3053 def OutputUnchecked(self, out): 3054 for i in range(len(self.large_raw_property_)): 3055 out.putVarInt32(10) 3056 out.putVarInt32(self.large_raw_property_[i].ByteSize()) 3057 self.large_raw_property_[i].OutputUnchecked(out) 3058 3059 def OutputPartial(self, out): 3060 for i in range(len(self.large_raw_property_)): 3061 out.putVarInt32(10) 3062 out.putVarInt32(self.large_raw_property_[i].ByteSizePartial()) 3063 self.large_raw_property_[i].OutputPartial(out) 3064 3065 def TryMerge(self, d): 3066 while d.avail() > 0: 3067 tt = d.getVarInt32() 3068 if tt == 10: 3069 length = d.getVarInt32() 3070 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) 3071 d.skip(length) 3072 self.add_large_raw_property().TryMerge(tmp) 3073 continue 3074 # tag 0 is special: it's used to indicate an error. 3075 # so if we see it we raise an exception. 3076 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 3077 d.skipData(tt) 3078 3079 3080 def __str__(self, prefix="", printElemNumber=0): 3081 res="" 3082 cnt=0 3083 for e in self.large_raw_property_: 3084 elm="" 3085 if printElemNumber: elm="(%d)" % cnt 3086 res+=prefix+("large_raw_property%s <\n" % elm) 3087 res+=e.__str__(prefix + " ", printElemNumber) 3088 res+=prefix+">\n" 3089 cnt+=1 3090 return res 3091 3092 3093 def _BuildTagLookupTable(sparse, maxtag, default=None): 3094 return tuple([sparse.get(i, default) for i in range(0, 1+maxtag)]) 3095 3096 klarge_raw_property = 1 3097 3098 _TEXT = _BuildTagLookupTable({ 3099 0: "ErrorCode", 3100 1: "large_raw_property", 3101 }, 1) 3102 3103 _TYPES = _BuildTagLookupTable({ 3104 0: ProtocolBuffer.Encoder.NUMERIC, 3105 1: ProtocolBuffer.Encoder.STRING, 3106 }, 1, ProtocolBuffer.Encoder.MAX_TYPE) 3107 3108 # stylesheet for XML output 3109 _STYLE = \ 3110 """""" 3111 _STYLE_CONTENT_TYPE = \ 3112 """""" 3113 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.EntitySummary' 3114class CompositeProperty(ProtocolBuffer.ProtocolMessage): 3115 has_index_id_ = 0 3116 index_id_ = 0 3117 3118 def __init__(self, contents=None): 3119 self.value_ = [] 3120 if contents is not None: self.MergeFromString(contents) 3121 3122 def index_id(self): return self.index_id_ 3123 3124 def set_index_id(self, x): 3125 self.has_index_id_ = 1 3126 self.index_id_ = x 3127 3128 def clear_index_id(self): 3129 if self.has_index_id_: 3130 self.has_index_id_ = 0 3131 self.index_id_ = 0 3132 3133 def has_index_id(self): return self.has_index_id_ 3134 3135 def value_size(self): return len(self.value_) 3136 def value_list(self): return self.value_ 3137 3138 def value(self, i): 3139 return self.value_[i] 3140 3141 def set_value(self, i, x): 3142 self.value_[i] = x 3143 3144 def add_value(self, x): 3145 self.value_.append(x) 3146 3147 def clear_value(self): 3148 self.value_ = [] 3149 3150 3151 def MergeFrom(self, x): 3152 assert x is not self 3153 if (x.has_index_id()): self.set_index_id(x.index_id()) 3154 for i in range(x.value_size()): self.add_value(x.value(i)) 3155 3156 def Equals(self, x): 3157 if x is self: return 1 3158 if self.has_index_id_ != x.has_index_id_: return 0 3159 if self.has_index_id_ and self.index_id_ != x.index_id_: return 0 3160 if len(self.value_) != len(x.value_): return 0 3161 for e1, e2 in zip(self.value_, x.value_): 3162 if e1 != e2: return 0 3163 return 1 3164 3165 def IsInitialized(self, debug_strs=None): 3166 initialized = 1 3167 if (not self.has_index_id_): 3168 initialized = 0 3169 if debug_strs is not None: 3170 debug_strs.append('Required field: index_id not set.') 3171 return initialized 3172 3173 def ByteSize(self): 3174 n = 0 3175 n += self.lengthVarInt64(self.index_id_) 3176 n += 1 * len(self.value_) 3177 for i in range(len(self.value_)): n += self.lengthString(len(self.value_[i])) 3178 return n + 1 3179 3180 def ByteSizePartial(self): 3181 n = 0 3182 if (self.has_index_id_): 3183 n += 1 3184 n += self.lengthVarInt64(self.index_id_) 3185 n += 1 * len(self.value_) 3186 for i in range(len(self.value_)): n += self.lengthString(len(self.value_[i])) 3187 return n 3188 3189 def Clear(self): 3190 self.clear_index_id() 3191 self.clear_value() 3192 3193 def OutputUnchecked(self, out): 3194 out.putVarInt32(8) 3195 out.putVarInt64(self.index_id_) 3196 for i in range(len(self.value_)): 3197 out.putVarInt32(18) 3198 out.putPrefixedString(self.value_[i]) 3199 3200 def OutputPartial(self, out): 3201 if (self.has_index_id_): 3202 out.putVarInt32(8) 3203 out.putVarInt64(self.index_id_) 3204 for i in range(len(self.value_)): 3205 out.putVarInt32(18) 3206 out.putPrefixedString(self.value_[i]) 3207 3208 def TryMerge(self, d): 3209 while d.avail() > 0: 3210 tt = d.getVarInt32() 3211 if tt == 8: 3212 self.set_index_id(d.getVarInt64()) 3213 continue 3214 if tt == 18: 3215 self.add_value(d.getPrefixedString()) 3216 continue 3217 # tag 0 is special: it's used to indicate an error. 3218 # so if we see it we raise an exception. 3219 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 3220 d.skipData(tt) 3221 3222 3223 def __str__(self, prefix="", printElemNumber=0): 3224 res="" 3225 if self.has_index_id_: res+=prefix+("index_id: %s\n" % self.DebugFormatInt64(self.index_id_)) 3226 cnt=0 3227 for e in self.value_: 3228 elm="" 3229 if printElemNumber: elm="(%d)" % cnt 3230 res+=prefix+("value%s: %s\n" % (elm, self.DebugFormatString(e))) 3231 cnt+=1 3232 return res 3233 3234 3235 def _BuildTagLookupTable(sparse, maxtag, default=None): 3236 return tuple([sparse.get(i, default) for i in range(0, 1+maxtag)]) 3237 3238 kindex_id = 1 3239 kvalue = 2 3240 3241 _TEXT = _BuildTagLookupTable({ 3242 0: "ErrorCode", 3243 1: "index_id", 3244 2: "value", 3245 }, 2) 3246 3247 _TYPES = _BuildTagLookupTable({ 3248 0: ProtocolBuffer.Encoder.NUMERIC, 3249 1: ProtocolBuffer.Encoder.NUMERIC, 3250 2: ProtocolBuffer.Encoder.STRING, 3251 }, 2, ProtocolBuffer.Encoder.MAX_TYPE) 3252 3253 # stylesheet for XML output 3254 _STYLE = \ 3255 """""" 3256 _STYLE_CONTENT_TYPE = \ 3257 """""" 3258 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.CompositeProperty' 3259class Index_Property(ProtocolBuffer.ProtocolMessage): 3260 3261 # Direction values 3262 DIRECTION_UNSPECIFIED = 0 3263 ASCENDING = 1 3264 DESCENDING = 2 3265 3266 _Direction_NAMES = { 3267 0: "DIRECTION_UNSPECIFIED", 3268 1: "ASCENDING", 3269 2: "DESCENDING", 3270 } 3271 3272 def Direction_Name(cls, x): return cls._Direction_NAMES.get(x, "") 3273 Direction_Name = classmethod(Direction_Name) 3274 3275 3276 # Mode values 3277 MODE_UNSPECIFIED = 0 3278 GEOSPATIAL = 3 3279 ARRAY_CONTAINS = 4 3280 3281 _Mode_NAMES = { 3282 0: "MODE_UNSPECIFIED", 3283 3: "GEOSPATIAL", 3284 4: "ARRAY_CONTAINS", 3285 } 3286 3287 def Mode_Name(cls, x): return cls._Mode_NAMES.get(x, "") 3288 Mode_Name = classmethod(Mode_Name) 3289 3290 has_name_ = 0 3291 name_ = "" 3292 has_direction_ = 0 3293 direction_ = 0 3294 has_mode_ = 0 3295 mode_ = 0 3296 3297 def __init__(self, contents=None): 3298 if contents is not None: self.MergeFromString(contents) 3299 3300 def name(self): return self.name_ 3301 3302 def set_name(self, x): 3303 self.has_name_ = 1 3304 self.name_ = x 3305 3306 def clear_name(self): 3307 if self.has_name_: 3308 self.has_name_ = 0 3309 self.name_ = "" 3310 3311 def has_name(self): return self.has_name_ 3312 3313 def direction(self): return self.direction_ 3314 3315 def set_direction(self, x): 3316 self.has_direction_ = 1 3317 self.direction_ = x 3318 3319 def clear_direction(self): 3320 if self.has_direction_: 3321 self.has_direction_ = 0 3322 self.direction_ = 0 3323 3324 def has_direction(self): return self.has_direction_ 3325 3326 def mode(self): return self.mode_ 3327 3328 def set_mode(self, x): 3329 self.has_mode_ = 1 3330 self.mode_ = x 3331 3332 def clear_mode(self): 3333 if self.has_mode_: 3334 self.has_mode_ = 0 3335 self.mode_ = 0 3336 3337 def has_mode(self): return self.has_mode_ 3338 3339 3340 def MergeFrom(self, x): 3341 assert x is not self 3342 if (x.has_name()): self.set_name(x.name()) 3343 if (x.has_direction()): self.set_direction(x.direction()) 3344 if (x.has_mode()): self.set_mode(x.mode()) 3345 3346 def Equals(self, x): 3347 if x is self: return 1 3348 if self.has_name_ != x.has_name_: return 0 3349 if self.has_name_ and self.name_ != x.name_: return 0 3350 if self.has_direction_ != x.has_direction_: return 0 3351 if self.has_direction_ and self.direction_ != x.direction_: return 0 3352 if self.has_mode_ != x.has_mode_: return 0 3353 if self.has_mode_ and self.mode_ != x.mode_: return 0 3354 return 1 3355 3356 def IsInitialized(self, debug_strs=None): 3357 initialized = 1 3358 if (not self.has_name_): 3359 initialized = 0 3360 if debug_strs is not None: 3361 debug_strs.append('Required field: name not set.') 3362 return initialized 3363 3364 def ByteSize(self): 3365 n = 0 3366 n += self.lengthString(len(self.name_)) 3367 if (self.has_direction_): n += 1 + self.lengthVarInt64(self.direction_) 3368 if (self.has_mode_): n += 1 + self.lengthVarInt64(self.mode_) 3369 return n + 1 3370 3371 def ByteSizePartial(self): 3372 n = 0 3373 if (self.has_name_): 3374 n += 1 3375 n += self.lengthString(len(self.name_)) 3376 if (self.has_direction_): n += 1 + self.lengthVarInt64(self.direction_) 3377 if (self.has_mode_): n += 1 + self.lengthVarInt64(self.mode_) 3378 return n 3379 3380 def Clear(self): 3381 self.clear_name() 3382 self.clear_direction() 3383 self.clear_mode() 3384 3385 def OutputUnchecked(self, out): 3386 out.putVarInt32(26) 3387 out.putPrefixedString(self.name_) 3388 if (self.has_direction_): 3389 out.putVarInt32(32) 3390 out.putVarInt32(self.direction_) 3391 if (self.has_mode_): 3392 out.putVarInt32(48) 3393 out.putVarInt32(self.mode_) 3394 3395 def OutputPartial(self, out): 3396 if (self.has_name_): 3397 out.putVarInt32(26) 3398 out.putPrefixedString(self.name_) 3399 if (self.has_direction_): 3400 out.putVarInt32(32) 3401 out.putVarInt32(self.direction_) 3402 if (self.has_mode_): 3403 out.putVarInt32(48) 3404 out.putVarInt32(self.mode_) 3405 3406 def TryMerge(self, d): 3407 while 1: 3408 tt = d.getVarInt32() 3409 if tt == 20: break 3410 if tt == 26: 3411 self.set_name(d.getPrefixedString()) 3412 continue 3413 if tt == 32: 3414 self.set_direction(d.getVarInt32()) 3415 continue 3416 if tt == 48: 3417 self.set_mode(d.getVarInt32()) 3418 continue 3419 # tag 0 is special: it's used to indicate an error. 3420 # so if we see it we raise an exception. 3421 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 3422 d.skipData(tt) 3423 3424 3425 def __str__(self, prefix="", printElemNumber=0): 3426 res="" 3427 if self.has_name_: res+=prefix+("name: %s\n" % self.DebugFormatString(self.name_)) 3428 if self.has_direction_: res+=prefix+("direction: %s\n" % self.DebugFormatInt32(self.direction_)) 3429 if self.has_mode_: res+=prefix+("mode: %s\n" % self.DebugFormatInt32(self.mode_)) 3430 return res 3431 3432class Index(ProtocolBuffer.ProtocolMessage): 3433 3434 # Version values 3435 VERSION_UNSPECIFIED = 0 3436 V1 = 1 3437 V2 = 2 3438 V3 = 3 3439 3440 _Version_NAMES = { 3441 0: "VERSION_UNSPECIFIED", 3442 1: "V1", 3443 2: "V2", 3444 3: "V3", 3445 } 3446 3447 def Version_Name(cls, x): return cls._Version_NAMES.get(x, "") 3448 Version_Name = classmethod(Version_Name) 3449 3450 has_entity_type_ = 0 3451 entity_type_ = "" 3452 has_ancestor_ = 0 3453 ancestor_ = 0 3454 has_parent_ = 0 3455 parent_ = 0 3456 has_version_ = 0 3457 version_ = 0 3458 3459 def __init__(self, contents=None): 3460 self.property_ = [] 3461 if contents is not None: self.MergeFromString(contents) 3462 3463 def entity_type(self): return self.entity_type_ 3464 3465 def set_entity_type(self, x): 3466 self.has_entity_type_ = 1 3467 self.entity_type_ = x 3468 3469 def clear_entity_type(self): 3470 if self.has_entity_type_: 3471 self.has_entity_type_ = 0 3472 self.entity_type_ = "" 3473 3474 def has_entity_type(self): return self.has_entity_type_ 3475 3476 def ancestor(self): return self.ancestor_ 3477 3478 def set_ancestor(self, x): 3479 self.has_ancestor_ = 1 3480 self.ancestor_ = x 3481 3482 def clear_ancestor(self): 3483 if self.has_ancestor_: 3484 self.has_ancestor_ = 0 3485 self.ancestor_ = 0 3486 3487 def has_ancestor(self): return self.has_ancestor_ 3488 3489 def parent(self): return self.parent_ 3490 3491 def set_parent(self, x): 3492 self.has_parent_ = 1 3493 self.parent_ = x 3494 3495 def clear_parent(self): 3496 if self.has_parent_: 3497 self.has_parent_ = 0 3498 self.parent_ = 0 3499 3500 def has_parent(self): return self.has_parent_ 3501 3502 def version(self): return self.version_ 3503 3504 def set_version(self, x): 3505 self.has_version_ = 1 3506 self.version_ = x 3507 3508 def clear_version(self): 3509 if self.has_version_: 3510 self.has_version_ = 0 3511 self.version_ = 0 3512 3513 def has_version(self): return self.has_version_ 3514 3515 def property_size(self): return len(self.property_) 3516 def property_list(self): return self.property_ 3517 3518 def property(self, i): 3519 return self.property_[i] 3520 3521 def mutable_property(self, i): 3522 return self.property_[i] 3523 3524 def add_property(self): 3525 x = Index_Property() 3526 self.property_.append(x) 3527 return x 3528 3529 def clear_property(self): 3530 self.property_ = [] 3531 3532 def MergeFrom(self, x): 3533 assert x is not self 3534 if (x.has_entity_type()): self.set_entity_type(x.entity_type()) 3535 if (x.has_ancestor()): self.set_ancestor(x.ancestor()) 3536 if (x.has_parent()): self.set_parent(x.parent()) 3537 if (x.has_version()): self.set_version(x.version()) 3538 for i in range(x.property_size()): self.add_property().CopyFrom(x.property(i)) 3539 3540 def Equals(self, x): 3541 if x is self: return 1 3542 if self.has_entity_type_ != x.has_entity_type_: return 0 3543 if self.has_entity_type_ and self.entity_type_ != x.entity_type_: return 0 3544 if self.has_ancestor_ != x.has_ancestor_: return 0 3545 if self.has_ancestor_ and self.ancestor_ != x.ancestor_: return 0 3546 if self.has_parent_ != x.has_parent_: return 0 3547 if self.has_parent_ and self.parent_ != x.parent_: return 0 3548 if self.has_version_ != x.has_version_: return 0 3549 if self.has_version_ and self.version_ != x.version_: return 0 3550 if len(self.property_) != len(x.property_): return 0 3551 for e1, e2 in zip(self.property_, x.property_): 3552 if e1 != e2: return 0 3553 return 1 3554 3555 def IsInitialized(self, debug_strs=None): 3556 initialized = 1 3557 if (not self.has_entity_type_): 3558 initialized = 0 3559 if debug_strs is not None: 3560 debug_strs.append('Required field: entity_type not set.') 3561 if (not self.has_ancestor_): 3562 initialized = 0 3563 if debug_strs is not None: 3564 debug_strs.append('Required field: ancestor not set.') 3565 for p in self.property_: 3566 if not p.IsInitialized(debug_strs): initialized=0 3567 return initialized 3568 3569 def ByteSize(self): 3570 n = 0 3571 n += self.lengthString(len(self.entity_type_)) 3572 if (self.has_parent_): n += 2 3573 if (self.has_version_): n += 1 + self.lengthVarInt64(self.version_) 3574 n += 2 * len(self.property_) 3575 for i in range(len(self.property_)): n += self.property_[i].ByteSize() 3576 return n + 3 3577 3578 def ByteSizePartial(self): 3579 n = 0 3580 if (self.has_entity_type_): 3581 n += 1 3582 n += self.lengthString(len(self.entity_type_)) 3583 if (self.has_ancestor_): 3584 n += 2 3585 if (self.has_parent_): n += 2 3586 if (self.has_version_): n += 1 + self.lengthVarInt64(self.version_) 3587 n += 2 * len(self.property_) 3588 for i in range(len(self.property_)): n += self.property_[i].ByteSizePartial() 3589 return n 3590 3591 def Clear(self): 3592 self.clear_entity_type() 3593 self.clear_ancestor() 3594 self.clear_parent() 3595 self.clear_version() 3596 self.clear_property() 3597 3598 def OutputUnchecked(self, out): 3599 out.putVarInt32(10) 3600 out.putPrefixedString(self.entity_type_) 3601 for i in range(len(self.property_)): 3602 out.putVarInt32(19) 3603 self.property_[i].OutputUnchecked(out) 3604 out.putVarInt32(20) 3605 out.putVarInt32(40) 3606 out.putBoolean(self.ancestor_) 3607 if (self.has_parent_): 3608 out.putVarInt32(56) 3609 out.putBoolean(self.parent_) 3610 if (self.has_version_): 3611 out.putVarInt32(64) 3612 out.putVarInt32(self.version_) 3613 3614 def OutputPartial(self, out): 3615 if (self.has_entity_type_): 3616 out.putVarInt32(10) 3617 out.putPrefixedString(self.entity_type_) 3618 for i in range(len(self.property_)): 3619 out.putVarInt32(19) 3620 self.property_[i].OutputPartial(out) 3621 out.putVarInt32(20) 3622 if (self.has_ancestor_): 3623 out.putVarInt32(40) 3624 out.putBoolean(self.ancestor_) 3625 if (self.has_parent_): 3626 out.putVarInt32(56) 3627 out.putBoolean(self.parent_) 3628 if (self.has_version_): 3629 out.putVarInt32(64) 3630 out.putVarInt32(self.version_) 3631 3632 def TryMerge(self, d): 3633 while d.avail() > 0: 3634 tt = d.getVarInt32() 3635 if tt == 10: 3636 self.set_entity_type(d.getPrefixedString()) 3637 continue 3638 if tt == 19: 3639 self.add_property().TryMerge(d) 3640 continue 3641 if tt == 40: 3642 self.set_ancestor(d.getBoolean()) 3643 continue 3644 if tt == 56: 3645 self.set_parent(d.getBoolean()) 3646 continue 3647 if tt == 64: 3648 self.set_version(d.getVarInt32()) 3649 continue 3650 # tag 0 is special: it's used to indicate an error. 3651 # so if we see it we raise an exception. 3652 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 3653 d.skipData(tt) 3654 3655 3656 def __str__(self, prefix="", printElemNumber=0): 3657 res="" 3658 if self.has_entity_type_: res+=prefix+("entity_type: %s\n" % self.DebugFormatString(self.entity_type_)) 3659 if self.has_ancestor_: res+=prefix+("ancestor: %s\n" % self.DebugFormatBool(self.ancestor_)) 3660 if self.has_parent_: res+=prefix+("parent: %s\n" % self.DebugFormatBool(self.parent_)) 3661 if self.has_version_: res+=prefix+("version: %s\n" % self.DebugFormatInt32(self.version_)) 3662 cnt=0 3663 for e in self.property_: 3664 elm="" 3665 if printElemNumber: elm="(%d)" % cnt 3666 res+=prefix+("Property%s {\n" % elm) 3667 res+=e.__str__(prefix + " ", printElemNumber) 3668 res+=prefix+"}\n" 3669 cnt+=1 3670 return res 3671 3672 3673 def _BuildTagLookupTable(sparse, maxtag, default=None): 3674 return tuple([sparse.get(i, default) for i in range(0, 1+maxtag)]) 3675 3676 kentity_type = 1 3677 kancestor = 5 3678 kparent = 7 3679 kversion = 8 3680 kPropertyGroup = 2 3681 kPropertyname = 3 3682 kPropertydirection = 4 3683 kPropertymode = 6 3684 3685 _TEXT = _BuildTagLookupTable({ 3686 0: "ErrorCode", 3687 1: "entity_type", 3688 2: "Property", 3689 3: "name", 3690 4: "direction", 3691 5: "ancestor", 3692 6: "mode", 3693 7: "parent", 3694 8: "version", 3695 }, 8) 3696 3697 _TYPES = _BuildTagLookupTable({ 3698 0: ProtocolBuffer.Encoder.NUMERIC, 3699 1: ProtocolBuffer.Encoder.STRING, 3700 2: ProtocolBuffer.Encoder.STARTGROUP, 3701 3: ProtocolBuffer.Encoder.STRING, 3702 4: ProtocolBuffer.Encoder.NUMERIC, 3703 5: ProtocolBuffer.Encoder.NUMERIC, 3704 6: ProtocolBuffer.Encoder.NUMERIC, 3705 7: ProtocolBuffer.Encoder.NUMERIC, 3706 8: ProtocolBuffer.Encoder.NUMERIC, 3707 }, 8, ProtocolBuffer.Encoder.MAX_TYPE) 3708 3709 # stylesheet for XML output 3710 _STYLE = \ 3711 """""" 3712 _STYLE_CONTENT_TYPE = \ 3713 """""" 3714 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.Index' 3715class CompositeIndex(ProtocolBuffer.ProtocolMessage): 3716 3717 # State values 3718 WRITE_ONLY = 1 3719 READ_WRITE = 2 3720 DELETED = 3 3721 ERROR = 4 3722 3723 _State_NAMES = { 3724 1: "WRITE_ONLY", 3725 2: "READ_WRITE", 3726 3: "DELETED", 3727 4: "ERROR", 3728 } 3729 3730 def State_Name(cls, x): return cls._State_NAMES.get(x, "") 3731 State_Name = classmethod(State_Name) 3732 3733 3734 # WorkflowState values 3735 PENDING = 1 3736 ACTIVE = 2 3737 COMPLETED = 3 3738 3739 _WorkflowState_NAMES = { 3740 1: "PENDING", 3741 2: "ACTIVE", 3742 3: "COMPLETED", 3743 } 3744 3745 def WorkflowState_Name(cls, x): return cls._WorkflowState_NAMES.get(x, "") 3746 WorkflowState_Name = classmethod(WorkflowState_Name) 3747 3748 has_app_id_ = 0 3749 app_id_ = "" 3750 has_database_id_ = 0 3751 database_id_ = "" 3752 has_id_ = 0 3753 id_ = 0 3754 has_definition_ = 0 3755 has_state_ = 0 3756 state_ = 0 3757 has_workflow_state_ = 0 3758 workflow_state_ = 0 3759 has_error_message_ = 0 3760 error_message_ = "" 3761 has_only_use_if_required_ = 0 3762 only_use_if_required_ = 0 3763 has_disabled_index_ = 0 3764 disabled_index_ = 0 3765 has_deprecated_write_division_family_ = 0 3766 deprecated_write_division_family_ = "" 3767 3768 def __init__(self, contents=None): 3769 self.definition_ = Index() 3770 self.deprecated_read_division_family_ = [] 3771 if contents is not None: self.MergeFromString(contents) 3772 3773 def app_id(self): return self.app_id_ 3774 3775 def set_app_id(self, x): 3776 self.has_app_id_ = 1 3777 self.app_id_ = x 3778 3779 def clear_app_id(self): 3780 if self.has_app_id_: 3781 self.has_app_id_ = 0 3782 self.app_id_ = "" 3783 3784 def has_app_id(self): return self.has_app_id_ 3785 3786 def database_id(self): return self.database_id_ 3787 3788 def set_database_id(self, x): 3789 self.has_database_id_ = 1 3790 self.database_id_ = x 3791 3792 def clear_database_id(self): 3793 if self.has_database_id_: 3794 self.has_database_id_ = 0 3795 self.database_id_ = "" 3796 3797 def has_database_id(self): return self.has_database_id_ 3798 3799 def id(self): return self.id_ 3800 3801 def set_id(self, x): 3802 self.has_id_ = 1 3803 self.id_ = x 3804 3805 def clear_id(self): 3806 if self.has_id_: 3807 self.has_id_ = 0 3808 self.id_ = 0 3809 3810 def has_id(self): return self.has_id_ 3811 3812 def definition(self): return self.definition_ 3813 3814 def mutable_definition(self): self.has_definition_ = 1; return self.definition_ 3815 3816 def clear_definition(self):self.has_definition_ = 0; self.definition_.Clear() 3817 3818 def has_definition(self): return self.has_definition_ 3819 3820 def state(self): return self.state_ 3821 3822 def set_state(self, x): 3823 self.has_state_ = 1 3824 self.state_ = x 3825 3826 def clear_state(self): 3827 if self.has_state_: 3828 self.has_state_ = 0 3829 self.state_ = 0 3830 3831 def has_state(self): return self.has_state_ 3832 3833 def workflow_state(self): return self.workflow_state_ 3834 3835 def set_workflow_state(self, x): 3836 self.has_workflow_state_ = 1 3837 self.workflow_state_ = x 3838 3839 def clear_workflow_state(self): 3840 if self.has_workflow_state_: 3841 self.has_workflow_state_ = 0 3842 self.workflow_state_ = 0 3843 3844 def has_workflow_state(self): return self.has_workflow_state_ 3845 3846 def error_message(self): return self.error_message_ 3847 3848 def set_error_message(self, x): 3849 self.has_error_message_ = 1 3850 self.error_message_ = x 3851 3852 def clear_error_message(self): 3853 if self.has_error_message_: 3854 self.has_error_message_ = 0 3855 self.error_message_ = "" 3856 3857 def has_error_message(self): return self.has_error_message_ 3858 3859 def only_use_if_required(self): return self.only_use_if_required_ 3860 3861 def set_only_use_if_required(self, x): 3862 self.has_only_use_if_required_ = 1 3863 self.only_use_if_required_ = x 3864 3865 def clear_only_use_if_required(self): 3866 if self.has_only_use_if_required_: 3867 self.has_only_use_if_required_ = 0 3868 self.only_use_if_required_ = 0 3869 3870 def has_only_use_if_required(self): return self.has_only_use_if_required_ 3871 3872 def disabled_index(self): return self.disabled_index_ 3873 3874 def set_disabled_index(self, x): 3875 self.has_disabled_index_ = 1 3876 self.disabled_index_ = x 3877 3878 def clear_disabled_index(self): 3879 if self.has_disabled_index_: 3880 self.has_disabled_index_ = 0 3881 self.disabled_index_ = 0 3882 3883 def has_disabled_index(self): return self.has_disabled_index_ 3884 3885 def deprecated_read_division_family_size(self): return len(self.deprecated_read_division_family_) 3886 def deprecated_read_division_family_list(self): return self.deprecated_read_division_family_ 3887 3888 def deprecated_read_division_family(self, i): 3889 return self.deprecated_read_division_family_[i] 3890 3891 def set_deprecated_read_division_family(self, i, x): 3892 self.deprecated_read_division_family_[i] = x 3893 3894 def add_deprecated_read_division_family(self, x): 3895 self.deprecated_read_division_family_.append(x) 3896 3897 def clear_deprecated_read_division_family(self): 3898 self.deprecated_read_division_family_ = [] 3899 3900 def deprecated_write_division_family(self): return self.deprecated_write_division_family_ 3901 3902 def set_deprecated_write_division_family(self, x): 3903 self.has_deprecated_write_division_family_ = 1 3904 self.deprecated_write_division_family_ = x 3905 3906 def clear_deprecated_write_division_family(self): 3907 if self.has_deprecated_write_division_family_: 3908 self.has_deprecated_write_division_family_ = 0 3909 self.deprecated_write_division_family_ = "" 3910 3911 def has_deprecated_write_division_family(self): return self.has_deprecated_write_division_family_ 3912 3913 3914 def MergeFrom(self, x): 3915 assert x is not self 3916 if (x.has_app_id()): self.set_app_id(x.app_id()) 3917 if (x.has_database_id()): self.set_database_id(x.database_id()) 3918 if (x.has_id()): self.set_id(x.id()) 3919 if (x.has_definition()): self.mutable_definition().MergeFrom(x.definition()) 3920 if (x.has_state()): self.set_state(x.state()) 3921 if (x.has_workflow_state()): self.set_workflow_state(x.workflow_state()) 3922 if (x.has_error_message()): self.set_error_message(x.error_message()) 3923 if (x.has_only_use_if_required()): self.set_only_use_if_required(x.only_use_if_required()) 3924 if (x.has_disabled_index()): self.set_disabled_index(x.disabled_index()) 3925 for i in range(x.deprecated_read_division_family_size()): self.add_deprecated_read_division_family(x.deprecated_read_division_family(i)) 3926 if (x.has_deprecated_write_division_family()): self.set_deprecated_write_division_family(x.deprecated_write_division_family()) 3927 3928 def Equals(self, x): 3929 if x is self: return 1 3930 if self.has_app_id_ != x.has_app_id_: return 0 3931 if self.has_app_id_ and self.app_id_ != x.app_id_: return 0 3932 if self.has_database_id_ != x.has_database_id_: return 0 3933 if self.has_database_id_ and self.database_id_ != x.database_id_: return 0 3934 if self.has_id_ != x.has_id_: return 0 3935 if self.has_id_ and self.id_ != x.id_: return 0 3936 if self.has_definition_ != x.has_definition_: return 0 3937 if self.has_definition_ and self.definition_ != x.definition_: return 0 3938 if self.has_state_ != x.has_state_: return 0 3939 if self.has_state_ and self.state_ != x.state_: return 0 3940 if self.has_workflow_state_ != x.has_workflow_state_: return 0 3941 if self.has_workflow_state_ and self.workflow_state_ != x.workflow_state_: return 0 3942 if self.has_error_message_ != x.has_error_message_: return 0 3943 if self.has_error_message_ and self.error_message_ != x.error_message_: return 0 3944 if self.has_only_use_if_required_ != x.has_only_use_if_required_: return 0 3945 if self.has_only_use_if_required_ and self.only_use_if_required_ != x.only_use_if_required_: return 0 3946 if self.has_disabled_index_ != x.has_disabled_index_: return 0 3947 if self.has_disabled_index_ and self.disabled_index_ != x.disabled_index_: return 0 3948 if len(self.deprecated_read_division_family_) != len(x.deprecated_read_division_family_): return 0 3949 for e1, e2 in zip(self.deprecated_read_division_family_, x.deprecated_read_division_family_): 3950 if e1 != e2: return 0 3951 if self.has_deprecated_write_division_family_ != x.has_deprecated_write_division_family_: return 0 3952 if self.has_deprecated_write_division_family_ and self.deprecated_write_division_family_ != x.deprecated_write_division_family_: return 0 3953 return 1 3954 3955 def IsInitialized(self, debug_strs=None): 3956 initialized = 1 3957 if (not self.has_app_id_): 3958 initialized = 0 3959 if debug_strs is not None: 3960 debug_strs.append('Required field: app_id not set.') 3961 if (not self.has_id_): 3962 initialized = 0 3963 if debug_strs is not None: 3964 debug_strs.append('Required field: id not set.') 3965 if (not self.has_definition_): 3966 initialized = 0 3967 if debug_strs is not None: 3968 debug_strs.append('Required field: definition not set.') 3969 elif not self.definition_.IsInitialized(debug_strs): initialized = 0 3970 if (not self.has_state_): 3971 initialized = 0 3972 if debug_strs is not None: 3973 debug_strs.append('Required field: state not set.') 3974 return initialized 3975 3976 def ByteSize(self): 3977 n = 0 3978 n += self.lengthString(len(self.app_id_)) 3979 if (self.has_database_id_): n += 1 + self.lengthString(len(self.database_id_)) 3980 n += self.lengthVarInt64(self.id_) 3981 n += self.lengthString(self.definition_.ByteSize()) 3982 n += self.lengthVarInt64(self.state_) 3983 if (self.has_workflow_state_): n += 1 + self.lengthVarInt64(self.workflow_state_) 3984 if (self.has_error_message_): n += 1 + self.lengthString(len(self.error_message_)) 3985 if (self.has_only_use_if_required_): n += 2 3986 if (self.has_disabled_index_): n += 2 3987 n += 1 * len(self.deprecated_read_division_family_) 3988 for i in range(len(self.deprecated_read_division_family_)): n += self.lengthString(len(self.deprecated_read_division_family_[i])) 3989 if (self.has_deprecated_write_division_family_): n += 1 + self.lengthString(len(self.deprecated_write_division_family_)) 3990 return n + 4 3991 3992 def ByteSizePartial(self): 3993 n = 0 3994 if (self.has_app_id_): 3995 n += 1 3996 n += self.lengthString(len(self.app_id_)) 3997 if (self.has_database_id_): n += 1 + self.lengthString(len(self.database_id_)) 3998 if (self.has_id_): 3999 n += 1 4000 n += self.lengthVarInt64(self.id_) 4001 if (self.has_definition_): 4002 n += 1 4003 n += self.lengthString(self.definition_.ByteSizePartial()) 4004 if (self.has_state_): 4005 n += 1 4006 n += self.lengthVarInt64(self.state_) 4007 if (self.has_workflow_state_): n += 1 + self.lengthVarInt64(self.workflow_state_) 4008 if (self.has_error_message_): n += 1 + self.lengthString(len(self.error_message_)) 4009 if (self.has_only_use_if_required_): n += 2 4010 if (self.has_disabled_index_): n += 2 4011 n += 1 * len(self.deprecated_read_division_family_) 4012 for i in range(len(self.deprecated_read_division_family_)): n += self.lengthString(len(self.deprecated_read_division_family_[i])) 4013 if (self.has_deprecated_write_division_family_): n += 1 + self.lengthString(len(self.deprecated_write_division_family_)) 4014 return n 4015 4016 def Clear(self): 4017 self.clear_app_id() 4018 self.clear_database_id() 4019 self.clear_id() 4020 self.clear_definition() 4021 self.clear_state() 4022 self.clear_workflow_state() 4023 self.clear_error_message() 4024 self.clear_only_use_if_required() 4025 self.clear_disabled_index() 4026 self.clear_deprecated_read_division_family() 4027 self.clear_deprecated_write_division_family() 4028 4029 def OutputUnchecked(self, out): 4030 out.putVarInt32(10) 4031 out.putPrefixedString(self.app_id_) 4032 out.putVarInt32(16) 4033 out.putVarInt64(self.id_) 4034 out.putVarInt32(26) 4035 out.putVarInt32(self.definition_.ByteSize()) 4036 self.definition_.OutputUnchecked(out) 4037 out.putVarInt32(32) 4038 out.putVarInt32(self.state_) 4039 if (self.has_only_use_if_required_): 4040 out.putVarInt32(48) 4041 out.putBoolean(self.only_use_if_required_) 4042 for i in range(len(self.deprecated_read_division_family_)): 4043 out.putVarInt32(58) 4044 out.putPrefixedString(self.deprecated_read_division_family_[i]) 4045 if (self.has_deprecated_write_division_family_): 4046 out.putVarInt32(66) 4047 out.putPrefixedString(self.deprecated_write_division_family_) 4048 if (self.has_disabled_index_): 4049 out.putVarInt32(72) 4050 out.putBoolean(self.disabled_index_) 4051 if (self.has_workflow_state_): 4052 out.putVarInt32(80) 4053 out.putVarInt32(self.workflow_state_) 4054 if (self.has_error_message_): 4055 out.putVarInt32(90) 4056 out.putPrefixedString(self.error_message_) 4057 if (self.has_database_id_): 4058 out.putVarInt32(98) 4059 out.putPrefixedString(self.database_id_) 4060 4061 def OutputPartial(self, out): 4062 if (self.has_app_id_): 4063 out.putVarInt32(10) 4064 out.putPrefixedString(self.app_id_) 4065 if (self.has_id_): 4066 out.putVarInt32(16) 4067 out.putVarInt64(self.id_) 4068 if (self.has_definition_): 4069 out.putVarInt32(26) 4070 out.putVarInt32(self.definition_.ByteSizePartial()) 4071 self.definition_.OutputPartial(out) 4072 if (self.has_state_): 4073 out.putVarInt32(32) 4074 out.putVarInt32(self.state_) 4075 if (self.has_only_use_if_required_): 4076 out.putVarInt32(48) 4077 out.putBoolean(self.only_use_if_required_) 4078 for i in range(len(self.deprecated_read_division_family_)): 4079 out.putVarInt32(58) 4080 out.putPrefixedString(self.deprecated_read_division_family_[i]) 4081 if (self.has_deprecated_write_division_family_): 4082 out.putVarInt32(66) 4083 out.putPrefixedString(self.deprecated_write_division_family_) 4084 if (self.has_disabled_index_): 4085 out.putVarInt32(72) 4086 out.putBoolean(self.disabled_index_) 4087 if (self.has_workflow_state_): 4088 out.putVarInt32(80) 4089 out.putVarInt32(self.workflow_state_) 4090 if (self.has_error_message_): 4091 out.putVarInt32(90) 4092 out.putPrefixedString(self.error_message_) 4093 if (self.has_database_id_): 4094 out.putVarInt32(98) 4095 out.putPrefixedString(self.database_id_) 4096 4097 def TryMerge(self, d): 4098 while d.avail() > 0: 4099 tt = d.getVarInt32() 4100 if tt == 10: 4101 self.set_app_id(d.getPrefixedString()) 4102 continue 4103 if tt == 16: 4104 self.set_id(d.getVarInt64()) 4105 continue 4106 if tt == 26: 4107 length = d.getVarInt32() 4108 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) 4109 d.skip(length) 4110 self.mutable_definition().TryMerge(tmp) 4111 continue 4112 if tt == 32: 4113 self.set_state(d.getVarInt32()) 4114 continue 4115 if tt == 48: 4116 self.set_only_use_if_required(d.getBoolean()) 4117 continue 4118 if tt == 58: 4119 self.add_deprecated_read_division_family(d.getPrefixedString()) 4120 continue 4121 if tt == 66: 4122 self.set_deprecated_write_division_family(d.getPrefixedString()) 4123 continue 4124 if tt == 72: 4125 self.set_disabled_index(d.getBoolean()) 4126 continue 4127 if tt == 80: 4128 self.set_workflow_state(d.getVarInt32()) 4129 continue 4130 if tt == 90: 4131 self.set_error_message(d.getPrefixedString()) 4132 continue 4133 if tt == 98: 4134 self.set_database_id(d.getPrefixedString()) 4135 continue 4136 # tag 0 is special: it's used to indicate an error. 4137 # so if we see it we raise an exception. 4138 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 4139 d.skipData(tt) 4140 4141 4142 def __str__(self, prefix="", printElemNumber=0): 4143 res="" 4144 if self.has_app_id_: res+=prefix+("app_id: %s\n" % self.DebugFormatString(self.app_id_)) 4145 if self.has_database_id_: res+=prefix+("database_id: %s\n" % self.DebugFormatString(self.database_id_)) 4146 if self.has_id_: res+=prefix+("id: %s\n" % self.DebugFormatInt64(self.id_)) 4147 if self.has_definition_: 4148 res+=prefix+"definition <\n" 4149 res+=self.definition_.__str__(prefix + " ", printElemNumber) 4150 res+=prefix+">\n" 4151 if self.has_state_: res+=prefix+("state: %s\n" % self.DebugFormatInt32(self.state_)) 4152 if self.has_workflow_state_: res+=prefix+("workflow_state: %s\n" % self.DebugFormatInt32(self.workflow_state_)) 4153 if self.has_error_message_: res+=prefix+("error_message: %s\n" % self.DebugFormatString(self.error_message_)) 4154 if self.has_only_use_if_required_: res+=prefix+("only_use_if_required: %s\n" % self.DebugFormatBool(self.only_use_if_required_)) 4155 if self.has_disabled_index_: res+=prefix+("disabled_index: %s\n" % self.DebugFormatBool(self.disabled_index_)) 4156 cnt=0 4157 for e in self.deprecated_read_division_family_: 4158 elm="" 4159 if printElemNumber: elm="(%d)" % cnt 4160 res+=prefix+("deprecated_read_division_family%s: %s\n" % (elm, self.DebugFormatString(e))) 4161 cnt+=1 4162 if self.has_deprecated_write_division_family_: res+=prefix+("deprecated_write_division_family: %s\n" % self.DebugFormatString(self.deprecated_write_division_family_)) 4163 return res 4164 4165 4166 def _BuildTagLookupTable(sparse, maxtag, default=None): 4167 return tuple([sparse.get(i, default) for i in range(0, 1+maxtag)]) 4168 4169 kapp_id = 1 4170 kdatabase_id = 12 4171 kid = 2 4172 kdefinition = 3 4173 kstate = 4 4174 kworkflow_state = 10 4175 kerror_message = 11 4176 konly_use_if_required = 6 4177 kdisabled_index = 9 4178 kdeprecated_read_division_family = 7 4179 kdeprecated_write_division_family = 8 4180 4181 _TEXT = _BuildTagLookupTable({ 4182 0: "ErrorCode", 4183 1: "app_id", 4184 2: "id", 4185 3: "definition", 4186 4: "state", 4187 6: "only_use_if_required", 4188 7: "deprecated_read_division_family", 4189 8: "deprecated_write_division_family", 4190 9: "disabled_index", 4191 10: "workflow_state", 4192 11: "error_message", 4193 12: "database_id", 4194 }, 12) 4195 4196 _TYPES = _BuildTagLookupTable({ 4197 0: ProtocolBuffer.Encoder.NUMERIC, 4198 1: ProtocolBuffer.Encoder.STRING, 4199 2: ProtocolBuffer.Encoder.NUMERIC, 4200 3: ProtocolBuffer.Encoder.STRING, 4201 4: ProtocolBuffer.Encoder.NUMERIC, 4202 6: ProtocolBuffer.Encoder.NUMERIC, 4203 7: ProtocolBuffer.Encoder.STRING, 4204 8: ProtocolBuffer.Encoder.STRING, 4205 9: ProtocolBuffer.Encoder.NUMERIC, 4206 10: ProtocolBuffer.Encoder.NUMERIC, 4207 11: ProtocolBuffer.Encoder.STRING, 4208 12: ProtocolBuffer.Encoder.STRING, 4209 }, 12, ProtocolBuffer.Encoder.MAX_TYPE) 4210 4211 # stylesheet for XML output 4212 _STYLE = \ 4213 """""" 4214 _STYLE_CONTENT_TYPE = \ 4215 """""" 4216 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.CompositeIndex' 4217class SearchIndexEntry(ProtocolBuffer.ProtocolMessage): 4218 has_index_id_ = 0 4219 index_id_ = 0 4220 has_write_division_family_ = 0 4221 write_division_family_ = "" 4222 has_fingerprint_1999_ = 0 4223 fingerprint_1999_ = 0 4224 has_fingerprint_2011_ = 0 4225 fingerprint_2011_ = 0 4226 4227 def __init__(self, contents=None): 4228 if contents is not None: self.MergeFromString(contents) 4229 4230 def index_id(self): return self.index_id_ 4231 4232 def set_index_id(self, x): 4233 self.has_index_id_ = 1 4234 self.index_id_ = x 4235 4236 def clear_index_id(self): 4237 if self.has_index_id_: 4238 self.has_index_id_ = 0 4239 self.index_id_ = 0 4240 4241 def has_index_id(self): return self.has_index_id_ 4242 4243 def write_division_family(self): return self.write_division_family_ 4244 4245 def set_write_division_family(self, x): 4246 self.has_write_division_family_ = 1 4247 self.write_division_family_ = x 4248 4249 def clear_write_division_family(self): 4250 if self.has_write_division_family_: 4251 self.has_write_division_family_ = 0 4252 self.write_division_family_ = "" 4253 4254 def has_write_division_family(self): return self.has_write_division_family_ 4255 4256 def fingerprint_1999(self): return self.fingerprint_1999_ 4257 4258 def set_fingerprint_1999(self, x): 4259 self.has_fingerprint_1999_ = 1 4260 self.fingerprint_1999_ = x 4261 4262 def clear_fingerprint_1999(self): 4263 if self.has_fingerprint_1999_: 4264 self.has_fingerprint_1999_ = 0 4265 self.fingerprint_1999_ = 0 4266 4267 def has_fingerprint_1999(self): return self.has_fingerprint_1999_ 4268 4269 def fingerprint_2011(self): return self.fingerprint_2011_ 4270 4271 def set_fingerprint_2011(self, x): 4272 self.has_fingerprint_2011_ = 1 4273 self.fingerprint_2011_ = x 4274 4275 def clear_fingerprint_2011(self): 4276 if self.has_fingerprint_2011_: 4277 self.has_fingerprint_2011_ = 0 4278 self.fingerprint_2011_ = 0 4279 4280 def has_fingerprint_2011(self): return self.has_fingerprint_2011_ 4281 4282 4283 def MergeFrom(self, x): 4284 assert x is not self 4285 if (x.has_index_id()): self.set_index_id(x.index_id()) 4286 if (x.has_write_division_family()): self.set_write_division_family(x.write_division_family()) 4287 if (x.has_fingerprint_1999()): self.set_fingerprint_1999(x.fingerprint_1999()) 4288 if (x.has_fingerprint_2011()): self.set_fingerprint_2011(x.fingerprint_2011()) 4289 4290 def Equals(self, x): 4291 if x is self: return 1 4292 if self.has_index_id_ != x.has_index_id_: return 0 4293 if self.has_index_id_ and self.index_id_ != x.index_id_: return 0 4294 if self.has_write_division_family_ != x.has_write_division_family_: return 0 4295 if self.has_write_division_family_ and self.write_division_family_ != x.write_division_family_: return 0 4296 if self.has_fingerprint_1999_ != x.has_fingerprint_1999_: return 0 4297 if self.has_fingerprint_1999_ and self.fingerprint_1999_ != x.fingerprint_1999_: return 0 4298 if self.has_fingerprint_2011_ != x.has_fingerprint_2011_: return 0 4299 if self.has_fingerprint_2011_ and self.fingerprint_2011_ != x.fingerprint_2011_: return 0 4300 return 1 4301 4302 def IsInitialized(self, debug_strs=None): 4303 initialized = 1 4304 if (not self.has_index_id_): 4305 initialized = 0 4306 if debug_strs is not None: 4307 debug_strs.append('Required field: index_id not set.') 4308 if (not self.has_write_division_family_): 4309 initialized = 0 4310 if debug_strs is not None: 4311 debug_strs.append('Required field: write_division_family not set.') 4312 return initialized 4313 4314 def ByteSize(self): 4315 n = 0 4316 n += self.lengthVarInt64(self.index_id_) 4317 n += self.lengthString(len(self.write_division_family_)) 4318 if (self.has_fingerprint_1999_): n += 9 4319 if (self.has_fingerprint_2011_): n += 9 4320 return n + 2 4321 4322 def ByteSizePartial(self): 4323 n = 0 4324 if (self.has_index_id_): 4325 n += 1 4326 n += self.lengthVarInt64(self.index_id_) 4327 if (self.has_write_division_family_): 4328 n += 1 4329 n += self.lengthString(len(self.write_division_family_)) 4330 if (self.has_fingerprint_1999_): n += 9 4331 if (self.has_fingerprint_2011_): n += 9 4332 return n 4333 4334 def Clear(self): 4335 self.clear_index_id() 4336 self.clear_write_division_family() 4337 self.clear_fingerprint_1999() 4338 self.clear_fingerprint_2011() 4339 4340 def OutputUnchecked(self, out): 4341 out.putVarInt32(8) 4342 out.putVarInt64(self.index_id_) 4343 out.putVarInt32(18) 4344 out.putPrefixedString(self.write_division_family_) 4345 if (self.has_fingerprint_1999_): 4346 out.putVarInt32(25) 4347 out.put64(self.fingerprint_1999_) 4348 if (self.has_fingerprint_2011_): 4349 out.putVarInt32(33) 4350 out.put64(self.fingerprint_2011_) 4351 4352 def OutputPartial(self, out): 4353 if (self.has_index_id_): 4354 out.putVarInt32(8) 4355 out.putVarInt64(self.index_id_) 4356 if (self.has_write_division_family_): 4357 out.putVarInt32(18) 4358 out.putPrefixedString(self.write_division_family_) 4359 if (self.has_fingerprint_1999_): 4360 out.putVarInt32(25) 4361 out.put64(self.fingerprint_1999_) 4362 if (self.has_fingerprint_2011_): 4363 out.putVarInt32(33) 4364 out.put64(self.fingerprint_2011_) 4365 4366 def TryMerge(self, d): 4367 while d.avail() > 0: 4368 tt = d.getVarInt32() 4369 if tt == 8: 4370 self.set_index_id(d.getVarInt64()) 4371 continue 4372 if tt == 18: 4373 self.set_write_division_family(d.getPrefixedString()) 4374 continue 4375 if tt == 25: 4376 self.set_fingerprint_1999(d.get64()) 4377 continue 4378 if tt == 33: 4379 self.set_fingerprint_2011(d.get64()) 4380 continue 4381 # tag 0 is special: it's used to indicate an error. 4382 # so if we see it we raise an exception. 4383 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 4384 d.skipData(tt) 4385 4386 4387 def __str__(self, prefix="", printElemNumber=0): 4388 res="" 4389 if self.has_index_id_: res+=prefix+("index_id: %s\n" % self.DebugFormatInt64(self.index_id_)) 4390 if self.has_write_division_family_: res+=prefix+("write_division_family: %s\n" % self.DebugFormatString(self.write_division_family_)) 4391 if self.has_fingerprint_1999_: res+=prefix+("fingerprint_1999: %s\n" % self.DebugFormatFixed64(self.fingerprint_1999_)) 4392 if self.has_fingerprint_2011_: res+=prefix+("fingerprint_2011: %s\n" % self.DebugFormatFixed64(self.fingerprint_2011_)) 4393 return res 4394 4395 4396 def _BuildTagLookupTable(sparse, maxtag, default=None): 4397 return tuple([sparse.get(i, default) for i in range(0, 1+maxtag)]) 4398 4399 kindex_id = 1 4400 kwrite_division_family = 2 4401 kfingerprint_1999 = 3 4402 kfingerprint_2011 = 4 4403 4404 _TEXT = _BuildTagLookupTable({ 4405 0: "ErrorCode", 4406 1: "index_id", 4407 2: "write_division_family", 4408 3: "fingerprint_1999", 4409 4: "fingerprint_2011", 4410 }, 4) 4411 4412 _TYPES = _BuildTagLookupTable({ 4413 0: ProtocolBuffer.Encoder.NUMERIC, 4414 1: ProtocolBuffer.Encoder.NUMERIC, 4415 2: ProtocolBuffer.Encoder.STRING, 4416 3: ProtocolBuffer.Encoder.DOUBLE, 4417 4: ProtocolBuffer.Encoder.DOUBLE, 4418 }, 4, ProtocolBuffer.Encoder.MAX_TYPE) 4419 4420 # stylesheet for XML output 4421 _STYLE = \ 4422 """""" 4423 _STYLE_CONTENT_TYPE = \ 4424 """""" 4425 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.SearchIndexEntry' 4426class IndexPostfix_IndexValue(ProtocolBuffer.ProtocolMessage): 4427 has_property_name_ = 0 4428 property_name_ = "" 4429 has_value_ = 0 4430 4431 def __init__(self, contents=None): 4432 self.value_ = PropertyValue() 4433 if contents is not None: self.MergeFromString(contents) 4434 4435 def property_name(self): return self.property_name_ 4436 4437 def set_property_name(self, x): 4438 self.has_property_name_ = 1 4439 self.property_name_ = x 4440 4441 def clear_property_name(self): 4442 if self.has_property_name_: 4443 self.has_property_name_ = 0 4444 self.property_name_ = "" 4445 4446 def has_property_name(self): return self.has_property_name_ 4447 4448 def value(self): return self.value_ 4449 4450 def mutable_value(self): self.has_value_ = 1; return self.value_ 4451 4452 def clear_value(self):self.has_value_ = 0; self.value_.Clear() 4453 4454 def has_value(self): return self.has_value_ 4455 4456 4457 def MergeFrom(self, x): 4458 assert x is not self 4459 if (x.has_property_name()): self.set_property_name(x.property_name()) 4460 if (x.has_value()): self.mutable_value().MergeFrom(x.value()) 4461 4462 def Equals(self, x): 4463 if x is self: return 1 4464 if self.has_property_name_ != x.has_property_name_: return 0 4465 if self.has_property_name_ and self.property_name_ != x.property_name_: return 0 4466 if self.has_value_ != x.has_value_: return 0 4467 if self.has_value_ and self.value_ != x.value_: return 0 4468 return 1 4469 4470 def IsInitialized(self, debug_strs=None): 4471 initialized = 1 4472 if (not self.has_property_name_): 4473 initialized = 0 4474 if debug_strs is not None: 4475 debug_strs.append('Required field: property_name not set.') 4476 if (not self.has_value_): 4477 initialized = 0 4478 if debug_strs is not None: 4479 debug_strs.append('Required field: value not set.') 4480 elif not self.value_.IsInitialized(debug_strs): initialized = 0 4481 return initialized 4482 4483 def ByteSize(self): 4484 n = 0 4485 n += self.lengthString(len(self.property_name_)) 4486 n += self.lengthString(self.value_.ByteSize()) 4487 return n + 2 4488 4489 def ByteSizePartial(self): 4490 n = 0 4491 if (self.has_property_name_): 4492 n += 1 4493 n += self.lengthString(len(self.property_name_)) 4494 if (self.has_value_): 4495 n += 1 4496 n += self.lengthString(self.value_.ByteSizePartial()) 4497 return n 4498 4499 def Clear(self): 4500 self.clear_property_name() 4501 self.clear_value() 4502 4503 def OutputUnchecked(self, out): 4504 out.putVarInt32(10) 4505 out.putPrefixedString(self.property_name_) 4506 out.putVarInt32(18) 4507 out.putVarInt32(self.value_.ByteSize()) 4508 self.value_.OutputUnchecked(out) 4509 4510 def OutputPartial(self, out): 4511 if (self.has_property_name_): 4512 out.putVarInt32(10) 4513 out.putPrefixedString(self.property_name_) 4514 if (self.has_value_): 4515 out.putVarInt32(18) 4516 out.putVarInt32(self.value_.ByteSizePartial()) 4517 self.value_.OutputPartial(out) 4518 4519 def TryMerge(self, d): 4520 while d.avail() > 0: 4521 tt = d.getVarInt32() 4522 if tt == 10: 4523 self.set_property_name(d.getPrefixedString()) 4524 continue 4525 if tt == 18: 4526 length = d.getVarInt32() 4527 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) 4528 d.skip(length) 4529 self.mutable_value().TryMerge(tmp) 4530 continue 4531 # tag 0 is special: it's used to indicate an error. 4532 # so if we see it we raise an exception. 4533 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 4534 d.skipData(tt) 4535 4536 4537 def __str__(self, prefix="", printElemNumber=0): 4538 res="" 4539 if self.has_property_name_: res+=prefix+("property_name: %s\n" % self.DebugFormatString(self.property_name_)) 4540 if self.has_value_: 4541 res+=prefix+"value <\n" 4542 res+=self.value_.__str__(prefix + " ", printElemNumber) 4543 res+=prefix+">\n" 4544 return res 4545 4546 4547 def _BuildTagLookupTable(sparse, maxtag, default=None): 4548 return tuple([sparse.get(i, default) for i in range(0, 1+maxtag)]) 4549 4550 kproperty_name = 1 4551 kvalue = 2 4552 4553 _TEXT = _BuildTagLookupTable({ 4554 0: "ErrorCode", 4555 1: "property_name", 4556 2: "value", 4557 }, 2) 4558 4559 _TYPES = _BuildTagLookupTable({ 4560 0: ProtocolBuffer.Encoder.NUMERIC, 4561 1: ProtocolBuffer.Encoder.STRING, 4562 2: ProtocolBuffer.Encoder.STRING, 4563 }, 2, ProtocolBuffer.Encoder.MAX_TYPE) 4564 4565 # stylesheet for XML output 4566 _STYLE = \ 4567 """""" 4568 _STYLE_CONTENT_TYPE = \ 4569 """""" 4570 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.IndexPostfix_IndexValue' 4571class IndexPostfix(ProtocolBuffer.ProtocolMessage): 4572 has_key_ = 0 4573 key_ = None 4574 has_before_ = 0 4575 before_ = 1 4576 has_before_ascending_ = 0 4577 before_ascending_ = 0 4578 4579 def __init__(self, contents=None): 4580 self.index_value_ = [] 4581 self.lazy_init_lock_ = _Lock() 4582 if contents is not None: self.MergeFromString(contents) 4583 4584 def index_value_size(self): return len(self.index_value_) 4585 def index_value_list(self): return self.index_value_ 4586 4587 def index_value(self, i): 4588 return self.index_value_[i] 4589 4590 def mutable_index_value(self, i): 4591 return self.index_value_[i] 4592 4593 def add_index_value(self): 4594 x = IndexPostfix_IndexValue() 4595 self.index_value_.append(x) 4596 return x 4597 4598 def clear_index_value(self): 4599 self.index_value_ = [] 4600 def key(self): 4601 if self.key_ is None: 4602 self.lazy_init_lock_.acquire() 4603 try: 4604 if self.key_ is None: self.key_ = Reference() 4605 finally: 4606 self.lazy_init_lock_.release() 4607 return self.key_ 4608 4609 def mutable_key(self): self.has_key_ = 1; return self.key() 4610 4611 def clear_key(self): 4612 # Warning: this method does not acquire the lock. 4613 if self.has_key_: 4614 self.has_key_ = 0; 4615 if self.key_ is not None: self.key_.Clear() 4616 4617 def has_key(self): return self.has_key_ 4618 4619 def before(self): return self.before_ 4620 4621 def set_before(self, x): 4622 self.has_before_ = 1 4623 self.before_ = x 4624 4625 def clear_before(self): 4626 if self.has_before_: 4627 self.has_before_ = 0 4628 self.before_ = 1 4629 4630 def has_before(self): return self.has_before_ 4631 4632 def before_ascending(self): return self.before_ascending_ 4633 4634 def set_before_ascending(self, x): 4635 self.has_before_ascending_ = 1 4636 self.before_ascending_ = x 4637 4638 def clear_before_ascending(self): 4639 if self.has_before_ascending_: 4640 self.has_before_ascending_ = 0 4641 self.before_ascending_ = 0 4642 4643 def has_before_ascending(self): return self.has_before_ascending_ 4644 4645 4646 def MergeFrom(self, x): 4647 assert x is not self 4648 for i in range(x.index_value_size()): self.add_index_value().CopyFrom(x.index_value(i)) 4649 if (x.has_key()): self.mutable_key().MergeFrom(x.key()) 4650 if (x.has_before()): self.set_before(x.before()) 4651 if (x.has_before_ascending()): self.set_before_ascending(x.before_ascending()) 4652 4653 def Equals(self, x): 4654 if x is self: return 1 4655 if len(self.index_value_) != len(x.index_value_): return 0 4656 for e1, e2 in zip(self.index_value_, x.index_value_): 4657 if e1 != e2: return 0 4658 if self.has_key_ != x.has_key_: return 0 4659 if self.has_key_ and self.key_ != x.key_: return 0 4660 if self.has_before_ != x.has_before_: return 0 4661 if self.has_before_ and self.before_ != x.before_: return 0 4662 if self.has_before_ascending_ != x.has_before_ascending_: return 0 4663 if self.has_before_ascending_ and self.before_ascending_ != x.before_ascending_: return 0 4664 return 1 4665 4666 def IsInitialized(self, debug_strs=None): 4667 initialized = 1 4668 for p in self.index_value_: 4669 if not p.IsInitialized(debug_strs): initialized=0 4670 if (self.has_key_ and not self.key_.IsInitialized(debug_strs)): initialized = 0 4671 return initialized 4672 4673 def ByteSize(self): 4674 n = 0 4675 n += 1 * len(self.index_value_) 4676 for i in range(len(self.index_value_)): n += self.lengthString(self.index_value_[i].ByteSize()) 4677 if (self.has_key_): n += 1 + self.lengthString(self.key_.ByteSize()) 4678 if (self.has_before_): n += 2 4679 if (self.has_before_ascending_): n += 2 4680 return n 4681 4682 def ByteSizePartial(self): 4683 n = 0 4684 n += 1 * len(self.index_value_) 4685 for i in range(len(self.index_value_)): n += self.lengthString(self.index_value_[i].ByteSizePartial()) 4686 if (self.has_key_): n += 1 + self.lengthString(self.key_.ByteSizePartial()) 4687 if (self.has_before_): n += 2 4688 if (self.has_before_ascending_): n += 2 4689 return n 4690 4691 def Clear(self): 4692 self.clear_index_value() 4693 self.clear_key() 4694 self.clear_before() 4695 self.clear_before_ascending() 4696 4697 def OutputUnchecked(self, out): 4698 for i in range(len(self.index_value_)): 4699 out.putVarInt32(10) 4700 out.putVarInt32(self.index_value_[i].ByteSize()) 4701 self.index_value_[i].OutputUnchecked(out) 4702 if (self.has_key_): 4703 out.putVarInt32(18) 4704 out.putVarInt32(self.key_.ByteSize()) 4705 self.key_.OutputUnchecked(out) 4706 if (self.has_before_): 4707 out.putVarInt32(24) 4708 out.putBoolean(self.before_) 4709 if (self.has_before_ascending_): 4710 out.putVarInt32(32) 4711 out.putBoolean(self.before_ascending_) 4712 4713 def OutputPartial(self, out): 4714 for i in range(len(self.index_value_)): 4715 out.putVarInt32(10) 4716 out.putVarInt32(self.index_value_[i].ByteSizePartial()) 4717 self.index_value_[i].OutputPartial(out) 4718 if (self.has_key_): 4719 out.putVarInt32(18) 4720 out.putVarInt32(self.key_.ByteSizePartial()) 4721 self.key_.OutputPartial(out) 4722 if (self.has_before_): 4723 out.putVarInt32(24) 4724 out.putBoolean(self.before_) 4725 if (self.has_before_ascending_): 4726 out.putVarInt32(32) 4727 out.putBoolean(self.before_ascending_) 4728 4729 def TryMerge(self, d): 4730 while d.avail() > 0: 4731 tt = d.getVarInt32() 4732 if tt == 10: 4733 length = d.getVarInt32() 4734 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) 4735 d.skip(length) 4736 self.add_index_value().TryMerge(tmp) 4737 continue 4738 if tt == 18: 4739 length = d.getVarInt32() 4740 tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length) 4741 d.skip(length) 4742 self.mutable_key().TryMerge(tmp) 4743 continue 4744 if tt == 24: 4745 self.set_before(d.getBoolean()) 4746 continue 4747 if tt == 32: 4748 self.set_before_ascending(d.getBoolean()) 4749 continue 4750 # tag 0 is special: it's used to indicate an error. 4751 # so if we see it we raise an exception. 4752 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 4753 d.skipData(tt) 4754 4755 4756 def __str__(self, prefix="", printElemNumber=0): 4757 res="" 4758 cnt=0 4759 for e in self.index_value_: 4760 elm="" 4761 if printElemNumber: elm="(%d)" % cnt 4762 res+=prefix+("index_value%s <\n" % elm) 4763 res+=e.__str__(prefix + " ", printElemNumber) 4764 res+=prefix+">\n" 4765 cnt+=1 4766 if self.has_key_: 4767 res+=prefix+"key <\n" 4768 res+=self.key_.__str__(prefix + " ", printElemNumber) 4769 res+=prefix+">\n" 4770 if self.has_before_: res+=prefix+("before: %s\n" % self.DebugFormatBool(self.before_)) 4771 if self.has_before_ascending_: res+=prefix+("before_ascending: %s\n" % self.DebugFormatBool(self.before_ascending_)) 4772 return res 4773 4774 4775 def _BuildTagLookupTable(sparse, maxtag, default=None): 4776 return tuple([sparse.get(i, default) for i in range(0, 1+maxtag)]) 4777 4778 kindex_value = 1 4779 kkey = 2 4780 kbefore = 3 4781 kbefore_ascending = 4 4782 4783 _TEXT = _BuildTagLookupTable({ 4784 0: "ErrorCode", 4785 1: "index_value", 4786 2: "key", 4787 3: "before", 4788 4: "before_ascending", 4789 }, 4) 4790 4791 _TYPES = _BuildTagLookupTable({ 4792 0: ProtocolBuffer.Encoder.NUMERIC, 4793 1: ProtocolBuffer.Encoder.STRING, 4794 2: ProtocolBuffer.Encoder.STRING, 4795 3: ProtocolBuffer.Encoder.NUMERIC, 4796 4: ProtocolBuffer.Encoder.NUMERIC, 4797 }, 4, ProtocolBuffer.Encoder.MAX_TYPE) 4798 4799 # stylesheet for XML output 4800 _STYLE = \ 4801 """""" 4802 _STYLE_CONTENT_TYPE = \ 4803 """""" 4804 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.IndexPostfix' 4805class IndexPosition(ProtocolBuffer.ProtocolMessage): 4806 has_key_ = 0 4807 key_ = "" 4808 has_before_ = 0 4809 before_ = 1 4810 has_before_ascending_ = 0 4811 before_ascending_ = 0 4812 4813 def __init__(self, contents=None): 4814 if contents is not None: self.MergeFromString(contents) 4815 4816 def key(self): return self.key_ 4817 4818 def set_key(self, x): 4819 self.has_key_ = 1 4820 self.key_ = x 4821 4822 def clear_key(self): 4823 if self.has_key_: 4824 self.has_key_ = 0 4825 self.key_ = "" 4826 4827 def has_key(self): return self.has_key_ 4828 4829 def before(self): return self.before_ 4830 4831 def set_before(self, x): 4832 self.has_before_ = 1 4833 self.before_ = x 4834 4835 def clear_before(self): 4836 if self.has_before_: 4837 self.has_before_ = 0 4838 self.before_ = 1 4839 4840 def has_before(self): return self.has_before_ 4841 4842 def before_ascending(self): return self.before_ascending_ 4843 4844 def set_before_ascending(self, x): 4845 self.has_before_ascending_ = 1 4846 self.before_ascending_ = x 4847 4848 def clear_before_ascending(self): 4849 if self.has_before_ascending_: 4850 self.has_before_ascending_ = 0 4851 self.before_ascending_ = 0 4852 4853 def has_before_ascending(self): return self.has_before_ascending_ 4854 4855 4856 def MergeFrom(self, x): 4857 assert x is not self 4858 if (x.has_key()): self.set_key(x.key()) 4859 if (x.has_before()): self.set_before(x.before()) 4860 if (x.has_before_ascending()): self.set_before_ascending(x.before_ascending()) 4861 4862 def Equals(self, x): 4863 if x is self: return 1 4864 if self.has_key_ != x.has_key_: return 0 4865 if self.has_key_ and self.key_ != x.key_: return 0 4866 if self.has_before_ != x.has_before_: return 0 4867 if self.has_before_ and self.before_ != x.before_: return 0 4868 if self.has_before_ascending_ != x.has_before_ascending_: return 0 4869 if self.has_before_ascending_ and self.before_ascending_ != x.before_ascending_: return 0 4870 return 1 4871 4872 def IsInitialized(self, debug_strs=None): 4873 initialized = 1 4874 return initialized 4875 4876 def ByteSize(self): 4877 n = 0 4878 if (self.has_key_): n += 1 + self.lengthString(len(self.key_)) 4879 if (self.has_before_): n += 2 4880 if (self.has_before_ascending_): n += 2 4881 return n 4882 4883 def ByteSizePartial(self): 4884 n = 0 4885 if (self.has_key_): n += 1 + self.lengthString(len(self.key_)) 4886 if (self.has_before_): n += 2 4887 if (self.has_before_ascending_): n += 2 4888 return n 4889 4890 def Clear(self): 4891 self.clear_key() 4892 self.clear_before() 4893 self.clear_before_ascending() 4894 4895 def OutputUnchecked(self, out): 4896 if (self.has_key_): 4897 out.putVarInt32(10) 4898 out.putPrefixedString(self.key_) 4899 if (self.has_before_): 4900 out.putVarInt32(16) 4901 out.putBoolean(self.before_) 4902 if (self.has_before_ascending_): 4903 out.putVarInt32(24) 4904 out.putBoolean(self.before_ascending_) 4905 4906 def OutputPartial(self, out): 4907 if (self.has_key_): 4908 out.putVarInt32(10) 4909 out.putPrefixedString(self.key_) 4910 if (self.has_before_): 4911 out.putVarInt32(16) 4912 out.putBoolean(self.before_) 4913 if (self.has_before_ascending_): 4914 out.putVarInt32(24) 4915 out.putBoolean(self.before_ascending_) 4916 4917 def TryMerge(self, d): 4918 while d.avail() > 0: 4919 tt = d.getVarInt32() 4920 if tt == 10: 4921 self.set_key(d.getPrefixedString()) 4922 continue 4923 if tt == 16: 4924 self.set_before(d.getBoolean()) 4925 continue 4926 if tt == 24: 4927 self.set_before_ascending(d.getBoolean()) 4928 continue 4929 # tag 0 is special: it's used to indicate an error. 4930 # so if we see it we raise an exception. 4931 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError() 4932 d.skipData(tt) 4933 4934 4935 def __str__(self, prefix="", printElemNumber=0): 4936 res="" 4937 if self.has_key_: res+=prefix+("key: %s\n" % self.DebugFormatString(self.key_)) 4938 if self.has_before_: res+=prefix+("before: %s\n" % self.DebugFormatBool(self.before_)) 4939 if self.has_before_ascending_: res+=prefix+("before_ascending: %s\n" % self.DebugFormatBool(self.before_ascending_)) 4940 return res 4941 4942 4943 def _BuildTagLookupTable(sparse, maxtag, default=None): 4944 return tuple([sparse.get(i, default) for i in range(0, 1+maxtag)]) 4945 4946 kkey = 1 4947 kbefore = 2 4948 kbefore_ascending = 3 4949 4950 _TEXT = _BuildTagLookupTable({ 4951 0: "ErrorCode", 4952 1: "key", 4953 2: "before", 4954 3: "before_ascending", 4955 }, 3) 4956 4957 _TYPES = _BuildTagLookupTable({ 4958 0: ProtocolBuffer.Encoder.NUMERIC, 4959 1: ProtocolBuffer.Encoder.STRING, 4960 2: ProtocolBuffer.Encoder.NUMERIC, 4961 3: ProtocolBuffer.Encoder.NUMERIC, 4962 }, 3, ProtocolBuffer.Encoder.MAX_TYPE) 4963 4964 # stylesheet for XML output 4965 _STYLE = \ 4966 """""" 4967 _STYLE_CONTENT_TYPE = \ 4968 """""" 4969 _PROTO_DESCRIPTOR_NAME = 'storage_onestore_v3.IndexPosition' 4970if _extension_runtime: 4971 pass 4972 4973__all__ = ['PropertyValue','PropertyValue_ReferenceValuePathElement','PropertyValue_PointValue','PropertyValue_UserValue','PropertyValue_ReferenceValue','Property','Path','Path_Element','Reference','User','EntityProto','EntityMetadata','EntitySummary_PropertySummary','EntitySummary','CompositeProperty','Index','Index_Property','CompositeIndex','SearchIndexEntry','IndexPostfix_IndexValue','IndexPostfix','IndexPosition'] 4974