1# 2# Autogenerated by Thrift 3# 4# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 5# @generated 6# 7 8from __future__ import absolute_import 9import sys 10from thrift.util.Recursive import fix_spec 11from thrift.Thrift import TType, TMessageType, TPriority, TRequestContext, TProcessorEventHandler, TServerInterface, TProcessor, TException, TApplicationException, UnimplementedTypedef 12from thrift.protocol.TProtocol import TProtocolException 13 14 15import include.ttypes 16 17 18import pprint 19import warnings 20from thrift import Thrift 21from thrift.transport import TTransport 22from thrift.protocol import TBinaryProtocol 23from thrift.protocol import TCompactProtocol 24from thrift.protocol import THeaderProtocol 25fastproto = None 26try: 27 from thrift.protocol import fastproto 28except ImportError: 29 pass 30all_structs = [] 31UTF8STRINGS = bool(0) or sys.version_info.major >= 3 32 33__all__ = ['UTF8STRINGS', 'has_bitwise_ops', 'is_unscoped', 'MyForwardRefEnum', 'MyEnumA', 'decorated_struct', 'ContainerStruct', 'CppTypeStruct', 'VirtualStruct', 'MyStructWithForwardRefEnum', 'TrivialNumeric', 'TrivialNestedWithDefault', 'ComplexString', 'ComplexNestedWithDefault', 'MinPadding', 'MyStruct', 'MyDataItem', 'Renaming', 'AnnotatedTypes', 'ForwardUsageRoot', 'ForwardUsageStruct', 'ForwardUsageByRef', 'NoexceptMoveEmpty', 'NoexceptMoveSimpleStruct', 'NoexceptMoveComplexStruct', 'NoExceptMoveUnion', 'AllocatorAware', 'AllocatorAware2', 'TypedefStruct', 'StructWithDoubleUnderscores', 'TBinary', 'IntTypedef', 'UintTypedef'] 34 35class has_bitwise_ops: 36 none = 0 37 zero = 1 38 one = 2 39 two = 4 40 three = 8 41 42 _VALUES_TO_NAMES = { 43 0: "none", 44 1: "zero", 45 2: "one", 46 4: "two", 47 8: "three", 48 } 49 50 _NAMES_TO_VALUES = { 51 "none": 0, 52 "zero": 1, 53 "one": 2, 54 "two": 4, 55 "three": 8, 56 } 57 58class is_unscoped: 59 hello = 0 60 world = 1 61 62 _VALUES_TO_NAMES = { 63 0: "hello", 64 1: "world", 65 } 66 67 _NAMES_TO_VALUES = { 68 "hello": 0, 69 "world": 1, 70 } 71 72class MyForwardRefEnum: 73 ZERO = 0 74 NONZERO = 12 75 76 _VALUES_TO_NAMES = { 77 0: "ZERO", 78 12: "NONZERO", 79 } 80 81 _NAMES_TO_VALUES = { 82 "ZERO": 0, 83 "NONZERO": 12, 84 } 85 86class MyEnumA: 87 fieldA = 1 88 fieldB = 2 89 fieldC = 4 90 91 _VALUES_TO_NAMES = { 92 1: "fieldA", 93 2: "fieldB", 94 4: "fieldC", 95 } 96 97 _NAMES_TO_VALUES = { 98 "fieldA": 1, 99 "fieldB": 2, 100 "fieldC": 4, 101 } 102 103class decorated_struct: 104 """ 105 Attributes: 106 - field 107 """ 108 109 thrift_spec = None 110 thrift_field_annotations = None 111 thrift_struct_annotations = None 112 __init__ = None 113 @staticmethod 114 def isUnion(): 115 return False 116 117 def read(self, iprot): 118 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 119 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 120 return 121 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 122 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 123 return 124 iprot.readStructBegin() 125 while True: 126 (fname, ftype, fid) = iprot.readFieldBegin() 127 if ftype == TType.STOP: 128 break 129 if fid == 1: 130 if ftype == TType.STRING: 131 self.field = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 132 else: 133 iprot.skip(ftype) 134 else: 135 iprot.skip(ftype) 136 iprot.readFieldEnd() 137 iprot.readStructEnd() 138 139 def write(self, oprot): 140 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 141 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 142 return 143 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 144 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 145 return 146 oprot.writeStructBegin('decorated_struct') 147 if self.field != None: 148 oprot.writeFieldBegin('field', TType.STRING, 1) 149 oprot.writeString(self.field.encode('utf-8')) if UTF8STRINGS and not isinstance(self.field, bytes) else oprot.writeString(self.field) 150 oprot.writeFieldEnd() 151 oprot.writeFieldStop() 152 oprot.writeStructEnd() 153 154 def __repr__(self): 155 L = [] 156 padding = ' ' * 4 157 if self.field is not None: 158 value = pprint.pformat(self.field, indent=0) 159 value = padding.join(value.splitlines(True)) 160 L.append(' field=%s' % (value)) 161 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 162 163 def __eq__(self, other): 164 if not isinstance(other, self.__class__): 165 return False 166 167 return self.__dict__ == other.__dict__ 168 169 def __ne__(self, other): 170 return not (self == other) 171 172 # Override the __hash__ function for Python3 - t10434117 173 __hash__ = object.__hash__ 174 175class ContainerStruct: 176 """ 177 Attributes: 178 - fieldA 179 - fieldB 180 - fieldC 181 - fieldD 182 - fieldE 183 - fieldF 184 - fieldG 185 - fieldH 186 """ 187 188 thrift_spec = None 189 thrift_field_annotations = None 190 thrift_struct_annotations = None 191 __init__ = None 192 @staticmethod 193 def isUnion(): 194 return False 195 196 def read(self, iprot): 197 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 198 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 199 return 200 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 201 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 202 return 203 iprot.readStructBegin() 204 while True: 205 (fname, ftype, fid) = iprot.readFieldBegin() 206 if ftype == TType.STOP: 207 break 208 if fid == 12: 209 if ftype == TType.LIST: 210 self.fieldA = [] 211 (_etype3, _size0) = iprot.readListBegin() 212 if _size0 >= 0: 213 for _i4 in range(_size0): 214 _elem5 = iprot.readI32() 215 self.fieldA.append(_elem5) 216 else: 217 while iprot.peekList(): 218 _elem6 = iprot.readI32() 219 self.fieldA.append(_elem6) 220 iprot.readListEnd() 221 else: 222 iprot.skip(ftype) 223 elif fid == 2: 224 if ftype == TType.LIST: 225 self.fieldB = [] 226 (_etype10, _size7) = iprot.readListBegin() 227 if _size7 >= 0: 228 for _i11 in range(_size7): 229 _elem12 = iprot.readI32() 230 self.fieldB.append(_elem12) 231 else: 232 while iprot.peekList(): 233 _elem13 = iprot.readI32() 234 self.fieldB.append(_elem13) 235 iprot.readListEnd() 236 else: 237 iprot.skip(ftype) 238 elif fid == 3: 239 if ftype == TType.LIST: 240 self.fieldC = [] 241 (_etype17, _size14) = iprot.readListBegin() 242 if _size14 >= 0: 243 for _i18 in range(_size14): 244 _elem19 = iprot.readI32() 245 self.fieldC.append(_elem19) 246 else: 247 while iprot.peekList(): 248 _elem20 = iprot.readI32() 249 self.fieldC.append(_elem20) 250 iprot.readListEnd() 251 else: 252 iprot.skip(ftype) 253 elif fid == 4: 254 if ftype == TType.LIST: 255 self.fieldD = [] 256 (_etype24, _size21) = iprot.readListBegin() 257 if _size21 >= 0: 258 for _i25 in range(_size21): 259 _elem26 = iprot.readI32() 260 self.fieldD.append(_elem26) 261 else: 262 while iprot.peekList(): 263 _elem27 = iprot.readI32() 264 self.fieldD.append(_elem27) 265 iprot.readListEnd() 266 else: 267 iprot.skip(ftype) 268 elif fid == 5: 269 if ftype == TType.LIST: 270 self.fieldE = [] 271 (_etype31, _size28) = iprot.readListBegin() 272 if _size28 >= 0: 273 for _i32 in range(_size28): 274 _elem33 = iprot.readI32() 275 self.fieldE.append(_elem33) 276 else: 277 while iprot.peekList(): 278 _elem34 = iprot.readI32() 279 self.fieldE.append(_elem34) 280 iprot.readListEnd() 281 else: 282 iprot.skip(ftype) 283 elif fid == 6: 284 if ftype == TType.SET: 285 self.fieldF = set() 286 (_etype38, _size35) = iprot.readSetBegin() 287 if _size35 >= 0: 288 for _i39 in range(_size35): 289 _elem40 = iprot.readI32() 290 self.fieldF.add(_elem40) 291 else: 292 while iprot.peekSet(): 293 _elem41 = iprot.readI32() 294 self.fieldF.add(_elem41) 295 iprot.readSetEnd() 296 else: 297 iprot.skip(ftype) 298 elif fid == 7: 299 if ftype == TType.MAP: 300 self.fieldG = {} 301 (_ktype43, _vtype44, _size42 ) = iprot.readMapBegin() 302 if _size42 >= 0: 303 for _i46 in range(_size42): 304 _key47 = iprot.readI32() 305 _val48 = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 306 self.fieldG[_key47] = _val48 307 else: 308 while iprot.peekMap(): 309 _key49 = iprot.readI32() 310 _val50 = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 311 self.fieldG[_key49] = _val50 312 iprot.readMapEnd() 313 else: 314 iprot.skip(ftype) 315 elif fid == 8: 316 if ftype == TType.MAP: 317 self.fieldH = {} 318 (_ktype52, _vtype53, _size51 ) = iprot.readMapBegin() 319 if _size51 >= 0: 320 for _i55 in range(_size51): 321 _key56 = iprot.readI32() 322 _val57 = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 323 self.fieldH[_key56] = _val57 324 else: 325 while iprot.peekMap(): 326 _key58 = iprot.readI32() 327 _val59 = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 328 self.fieldH[_key58] = _val59 329 iprot.readMapEnd() 330 else: 331 iprot.skip(ftype) 332 else: 333 iprot.skip(ftype) 334 iprot.readFieldEnd() 335 iprot.readStructEnd() 336 337 def write(self, oprot): 338 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 339 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 340 return 341 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 342 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 343 return 344 oprot.writeStructBegin('ContainerStruct') 345 if self.fieldB != None: 346 oprot.writeFieldBegin('fieldB', TType.LIST, 2) 347 oprot.writeListBegin(TType.I32, len(self.fieldB)) 348 for iter60 in self.fieldB: 349 oprot.writeI32(iter60) 350 oprot.writeListEnd() 351 oprot.writeFieldEnd() 352 if self.fieldC != None: 353 oprot.writeFieldBegin('fieldC', TType.LIST, 3) 354 oprot.writeListBegin(TType.I32, len(self.fieldC)) 355 for iter61 in self.fieldC: 356 oprot.writeI32(iter61) 357 oprot.writeListEnd() 358 oprot.writeFieldEnd() 359 if self.fieldD != None: 360 oprot.writeFieldBegin('fieldD', TType.LIST, 4) 361 oprot.writeListBegin(TType.I32, len(self.fieldD)) 362 for iter62 in self.fieldD: 363 oprot.writeI32(iter62) 364 oprot.writeListEnd() 365 oprot.writeFieldEnd() 366 if self.fieldE != None: 367 oprot.writeFieldBegin('fieldE', TType.LIST, 5) 368 oprot.writeListBegin(TType.I32, len(self.fieldE)) 369 for iter63 in self.fieldE: 370 oprot.writeI32(iter63) 371 oprot.writeListEnd() 372 oprot.writeFieldEnd() 373 if self.fieldF != None: 374 oprot.writeFieldBegin('fieldF', TType.SET, 6) 375 oprot.writeSetBegin(TType.I32, len(self.fieldF)) 376 for iter64 in self.fieldF: 377 oprot.writeI32(iter64) 378 oprot.writeSetEnd() 379 oprot.writeFieldEnd() 380 if self.fieldG != None: 381 oprot.writeFieldBegin('fieldG', TType.MAP, 7) 382 oprot.writeMapBegin(TType.I32, TType.STRING, len(self.fieldG)) 383 for kiter65,viter66 in self.fieldG.items(): 384 oprot.writeI32(kiter65) 385 oprot.writeString(viter66.encode('utf-8')) if UTF8STRINGS and not isinstance(viter66, bytes) else oprot.writeString(viter66) 386 oprot.writeMapEnd() 387 oprot.writeFieldEnd() 388 if self.fieldH != None: 389 oprot.writeFieldBegin('fieldH', TType.MAP, 8) 390 oprot.writeMapBegin(TType.I32, TType.STRING, len(self.fieldH)) 391 for kiter67,viter68 in self.fieldH.items(): 392 oprot.writeI32(kiter67) 393 oprot.writeString(viter68.encode('utf-8')) if UTF8STRINGS and not isinstance(viter68, bytes) else oprot.writeString(viter68) 394 oprot.writeMapEnd() 395 oprot.writeFieldEnd() 396 if self.fieldA != None: 397 oprot.writeFieldBegin('fieldA', TType.LIST, 12) 398 oprot.writeListBegin(TType.I32, len(self.fieldA)) 399 for iter69 in self.fieldA: 400 oprot.writeI32(iter69) 401 oprot.writeListEnd() 402 oprot.writeFieldEnd() 403 oprot.writeFieldStop() 404 oprot.writeStructEnd() 405 406 def __repr__(self): 407 L = [] 408 padding = ' ' * 4 409 if self.fieldA is not None: 410 value = pprint.pformat(self.fieldA, indent=0) 411 value = padding.join(value.splitlines(True)) 412 L.append(' fieldA=%s' % (value)) 413 if self.fieldB is not None: 414 value = pprint.pformat(self.fieldB, indent=0) 415 value = padding.join(value.splitlines(True)) 416 L.append(' fieldB=%s' % (value)) 417 if self.fieldC is not None: 418 value = pprint.pformat(self.fieldC, indent=0) 419 value = padding.join(value.splitlines(True)) 420 L.append(' fieldC=%s' % (value)) 421 if self.fieldD is not None: 422 value = pprint.pformat(self.fieldD, indent=0) 423 value = padding.join(value.splitlines(True)) 424 L.append(' fieldD=%s' % (value)) 425 if self.fieldE is not None: 426 value = pprint.pformat(self.fieldE, indent=0) 427 value = padding.join(value.splitlines(True)) 428 L.append(' fieldE=%s' % (value)) 429 if self.fieldF is not None: 430 value = pprint.pformat(self.fieldF, indent=0) 431 value = padding.join(value.splitlines(True)) 432 L.append(' fieldF=%s' % (value)) 433 if self.fieldG is not None: 434 value = pprint.pformat(self.fieldG, indent=0) 435 value = padding.join(value.splitlines(True)) 436 L.append(' fieldG=%s' % (value)) 437 if self.fieldH is not None: 438 value = pprint.pformat(self.fieldH, indent=0) 439 value = padding.join(value.splitlines(True)) 440 L.append(' fieldH=%s' % (value)) 441 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 442 443 def __eq__(self, other): 444 if not isinstance(other, self.__class__): 445 return False 446 447 return self.__dict__ == other.__dict__ 448 449 def __ne__(self, other): 450 return not (self == other) 451 452 # Override the __hash__ function for Python3 - t10434117 453 __hash__ = object.__hash__ 454 455class CppTypeStruct: 456 """ 457 Attributes: 458 - fieldA 459 """ 460 461 thrift_spec = None 462 thrift_field_annotations = None 463 thrift_struct_annotations = None 464 __init__ = None 465 @staticmethod 466 def isUnion(): 467 return False 468 469 def read(self, iprot): 470 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 471 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 472 return 473 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 474 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 475 return 476 iprot.readStructBegin() 477 while True: 478 (fname, ftype, fid) = iprot.readFieldBegin() 479 if ftype == TType.STOP: 480 break 481 if fid == 1: 482 if ftype == TType.LIST: 483 self.fieldA = [] 484 (_etype73, _size70) = iprot.readListBegin() 485 if _size70 >= 0: 486 for _i74 in range(_size70): 487 _elem75 = iprot.readI32() 488 self.fieldA.append(_elem75) 489 else: 490 while iprot.peekList(): 491 _elem76 = iprot.readI32() 492 self.fieldA.append(_elem76) 493 iprot.readListEnd() 494 else: 495 iprot.skip(ftype) 496 else: 497 iprot.skip(ftype) 498 iprot.readFieldEnd() 499 iprot.readStructEnd() 500 501 def write(self, oprot): 502 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 503 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 504 return 505 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 506 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 507 return 508 oprot.writeStructBegin('CppTypeStruct') 509 if self.fieldA != None: 510 oprot.writeFieldBegin('fieldA', TType.LIST, 1) 511 oprot.writeListBegin(TType.I32, len(self.fieldA)) 512 for iter77 in self.fieldA: 513 oprot.writeI32(iter77) 514 oprot.writeListEnd() 515 oprot.writeFieldEnd() 516 oprot.writeFieldStop() 517 oprot.writeStructEnd() 518 519 def __repr__(self): 520 L = [] 521 padding = ' ' * 4 522 if self.fieldA is not None: 523 value = pprint.pformat(self.fieldA, indent=0) 524 value = padding.join(value.splitlines(True)) 525 L.append(' fieldA=%s' % (value)) 526 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 527 528 def __eq__(self, other): 529 if not isinstance(other, self.__class__): 530 return False 531 532 return self.__dict__ == other.__dict__ 533 534 def __ne__(self, other): 535 return not (self == other) 536 537 # Override the __hash__ function for Python3 - t10434117 538 __hash__ = object.__hash__ 539 540class VirtualStruct: 541 """ 542 Attributes: 543 - MyIntField 544 """ 545 546 thrift_spec = None 547 thrift_field_annotations = None 548 thrift_struct_annotations = None 549 __init__ = None 550 @staticmethod 551 def isUnion(): 552 return False 553 554 def read(self, iprot): 555 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 556 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 557 return 558 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 559 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 560 return 561 iprot.readStructBegin() 562 while True: 563 (fname, ftype, fid) = iprot.readFieldBegin() 564 if ftype == TType.STOP: 565 break 566 if fid == 1: 567 if ftype == TType.I64: 568 self.MyIntField = iprot.readI64() 569 else: 570 iprot.skip(ftype) 571 else: 572 iprot.skip(ftype) 573 iprot.readFieldEnd() 574 iprot.readStructEnd() 575 576 def write(self, oprot): 577 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 578 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 579 return 580 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 581 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 582 return 583 oprot.writeStructBegin('VirtualStruct') 584 if self.MyIntField != None: 585 oprot.writeFieldBegin('MyIntField', TType.I64, 1) 586 oprot.writeI64(self.MyIntField) 587 oprot.writeFieldEnd() 588 oprot.writeFieldStop() 589 oprot.writeStructEnd() 590 591 def __repr__(self): 592 L = [] 593 padding = ' ' * 4 594 if self.MyIntField is not None: 595 value = pprint.pformat(self.MyIntField, indent=0) 596 value = padding.join(value.splitlines(True)) 597 L.append(' MyIntField=%s' % (value)) 598 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 599 600 def __eq__(self, other): 601 if not isinstance(other, self.__class__): 602 return False 603 604 return self.__dict__ == other.__dict__ 605 606 def __ne__(self, other): 607 return not (self == other) 608 609 # Override the __hash__ function for Python3 - t10434117 610 __hash__ = object.__hash__ 611 612class MyStructWithForwardRefEnum: 613 """ 614 Attributes: 615 - a 616 - b 617 """ 618 619 thrift_spec = None 620 thrift_field_annotations = None 621 thrift_struct_annotations = None 622 __init__ = None 623 @staticmethod 624 def isUnion(): 625 return False 626 627 def read(self, iprot): 628 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 629 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 630 return 631 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 632 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 633 return 634 iprot.readStructBegin() 635 while True: 636 (fname, ftype, fid) = iprot.readFieldBegin() 637 if ftype == TType.STOP: 638 break 639 if fid == 1: 640 if ftype == TType.I32: 641 self.a = iprot.readI32() 642 else: 643 iprot.skip(ftype) 644 elif fid == 2: 645 if ftype == TType.I32: 646 self.b = iprot.readI32() 647 else: 648 iprot.skip(ftype) 649 else: 650 iprot.skip(ftype) 651 iprot.readFieldEnd() 652 iprot.readStructEnd() 653 654 def write(self, oprot): 655 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 656 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 657 return 658 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 659 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 660 return 661 oprot.writeStructBegin('MyStructWithForwardRefEnum') 662 if self.a != None: 663 oprot.writeFieldBegin('a', TType.I32, 1) 664 oprot.writeI32(self.a) 665 oprot.writeFieldEnd() 666 if self.b != None: 667 oprot.writeFieldBegin('b', TType.I32, 2) 668 oprot.writeI32(self.b) 669 oprot.writeFieldEnd() 670 oprot.writeFieldStop() 671 oprot.writeStructEnd() 672 673 def __repr__(self): 674 L = [] 675 padding = ' ' * 4 676 if self.a is not None: 677 value = pprint.pformat(self.a, indent=0) 678 value = padding.join(value.splitlines(True)) 679 L.append(' a=%s' % (value)) 680 if self.b is not None: 681 value = pprint.pformat(self.b, indent=0) 682 value = padding.join(value.splitlines(True)) 683 L.append(' b=%s' % (value)) 684 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 685 686 def __eq__(self, other): 687 if not isinstance(other, self.__class__): 688 return False 689 690 return self.__dict__ == other.__dict__ 691 692 def __ne__(self, other): 693 return not (self == other) 694 695 # Override the __hash__ function for Python3 - t10434117 696 __hash__ = object.__hash__ 697 698class TrivialNumeric: 699 """ 700 Attributes: 701 - a 702 - b 703 """ 704 705 thrift_spec = None 706 thrift_field_annotations = None 707 thrift_struct_annotations = None 708 __init__ = None 709 @staticmethod 710 def isUnion(): 711 return False 712 713 def read(self, iprot): 714 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 715 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 716 return 717 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 718 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 719 return 720 iprot.readStructBegin() 721 while True: 722 (fname, ftype, fid) = iprot.readFieldBegin() 723 if ftype == TType.STOP: 724 break 725 if fid == 1: 726 if ftype == TType.I32: 727 self.a = iprot.readI32() 728 else: 729 iprot.skip(ftype) 730 elif fid == 2: 731 if ftype == TType.BOOL: 732 self.b = iprot.readBool() 733 else: 734 iprot.skip(ftype) 735 else: 736 iprot.skip(ftype) 737 iprot.readFieldEnd() 738 iprot.readStructEnd() 739 740 def write(self, oprot): 741 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 742 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 743 return 744 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 745 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 746 return 747 oprot.writeStructBegin('TrivialNumeric') 748 if self.a != None: 749 oprot.writeFieldBegin('a', TType.I32, 1) 750 oprot.writeI32(self.a) 751 oprot.writeFieldEnd() 752 if self.b != None: 753 oprot.writeFieldBegin('b', TType.BOOL, 2) 754 oprot.writeBool(self.b) 755 oprot.writeFieldEnd() 756 oprot.writeFieldStop() 757 oprot.writeStructEnd() 758 759 def __repr__(self): 760 L = [] 761 padding = ' ' * 4 762 if self.a is not None: 763 value = pprint.pformat(self.a, indent=0) 764 value = padding.join(value.splitlines(True)) 765 L.append(' a=%s' % (value)) 766 if self.b is not None: 767 value = pprint.pformat(self.b, indent=0) 768 value = padding.join(value.splitlines(True)) 769 L.append(' b=%s' % (value)) 770 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 771 772 def __eq__(self, other): 773 if not isinstance(other, self.__class__): 774 return False 775 776 return self.__dict__ == other.__dict__ 777 778 def __ne__(self, other): 779 return not (self == other) 780 781 # Override the __hash__ function for Python3 - t10434117 782 __hash__ = object.__hash__ 783 784class TrivialNestedWithDefault: 785 """ 786 Attributes: 787 - z 788 - n 789 """ 790 791 thrift_spec = None 792 thrift_field_annotations = None 793 thrift_struct_annotations = None 794 __init__ = None 795 @staticmethod 796 def isUnion(): 797 return False 798 799 def read(self, iprot): 800 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 801 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 802 return 803 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 804 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 805 return 806 iprot.readStructBegin() 807 while True: 808 (fname, ftype, fid) = iprot.readFieldBegin() 809 if ftype == TType.STOP: 810 break 811 if fid == 1: 812 if ftype == TType.I32: 813 self.z = iprot.readI32() 814 else: 815 iprot.skip(ftype) 816 elif fid == 2: 817 if ftype == TType.STRUCT: 818 self.n = TrivialNumeric() 819 self.n.read(iprot) 820 else: 821 iprot.skip(ftype) 822 else: 823 iprot.skip(ftype) 824 iprot.readFieldEnd() 825 iprot.readStructEnd() 826 827 def write(self, oprot): 828 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 829 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 830 return 831 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 832 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 833 return 834 oprot.writeStructBegin('TrivialNestedWithDefault') 835 if self.z != None: 836 oprot.writeFieldBegin('z', TType.I32, 1) 837 oprot.writeI32(self.z) 838 oprot.writeFieldEnd() 839 if self.n != None: 840 oprot.writeFieldBegin('n', TType.STRUCT, 2) 841 self.n.write(oprot) 842 oprot.writeFieldEnd() 843 oprot.writeFieldStop() 844 oprot.writeStructEnd() 845 846 def __repr__(self): 847 L = [] 848 padding = ' ' * 4 849 if self.z is not None: 850 value = pprint.pformat(self.z, indent=0) 851 value = padding.join(value.splitlines(True)) 852 L.append(' z=%s' % (value)) 853 if self.n is not None: 854 value = pprint.pformat(self.n, indent=0) 855 value = padding.join(value.splitlines(True)) 856 L.append(' n=%s' % (value)) 857 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 858 859 def __eq__(self, other): 860 if not isinstance(other, self.__class__): 861 return False 862 863 return self.__dict__ == other.__dict__ 864 865 def __ne__(self, other): 866 return not (self == other) 867 868 # Override the __hash__ function for Python3 - t10434117 869 __hash__ = object.__hash__ 870 871class ComplexString: 872 """ 873 Attributes: 874 - a 875 - b 876 """ 877 878 thrift_spec = None 879 thrift_field_annotations = None 880 thrift_struct_annotations = None 881 __init__ = None 882 @staticmethod 883 def isUnion(): 884 return False 885 886 def read(self, iprot): 887 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 888 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 889 return 890 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 891 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 892 return 893 iprot.readStructBegin() 894 while True: 895 (fname, ftype, fid) = iprot.readFieldBegin() 896 if ftype == TType.STOP: 897 break 898 if fid == 1: 899 if ftype == TType.STRING: 900 self.a = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 901 else: 902 iprot.skip(ftype) 903 elif fid == 2: 904 if ftype == TType.MAP: 905 self.b = {} 906 (_ktype79, _vtype80, _size78 ) = iprot.readMapBegin() 907 if _size78 >= 0: 908 for _i82 in range(_size78): 909 _key83 = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 910 _val84 = iprot.readI32() 911 self.b[_key83] = _val84 912 else: 913 while iprot.peekMap(): 914 _key85 = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 915 _val86 = iprot.readI32() 916 self.b[_key85] = _val86 917 iprot.readMapEnd() 918 else: 919 iprot.skip(ftype) 920 else: 921 iprot.skip(ftype) 922 iprot.readFieldEnd() 923 iprot.readStructEnd() 924 925 def write(self, oprot): 926 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 927 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 928 return 929 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 930 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 931 return 932 oprot.writeStructBegin('ComplexString') 933 if self.a != None: 934 oprot.writeFieldBegin('a', TType.STRING, 1) 935 oprot.writeString(self.a.encode('utf-8')) if UTF8STRINGS and not isinstance(self.a, bytes) else oprot.writeString(self.a) 936 oprot.writeFieldEnd() 937 if self.b != None: 938 oprot.writeFieldBegin('b', TType.MAP, 2) 939 oprot.writeMapBegin(TType.STRING, TType.I32, len(self.b)) 940 for kiter87,viter88 in self.b.items(): 941 oprot.writeString(kiter87.encode('utf-8')) if UTF8STRINGS and not isinstance(kiter87, bytes) else oprot.writeString(kiter87) 942 oprot.writeI32(viter88) 943 oprot.writeMapEnd() 944 oprot.writeFieldEnd() 945 oprot.writeFieldStop() 946 oprot.writeStructEnd() 947 948 def __repr__(self): 949 L = [] 950 padding = ' ' * 4 951 if self.a is not None: 952 value = pprint.pformat(self.a, indent=0) 953 value = padding.join(value.splitlines(True)) 954 L.append(' a=%s' % (value)) 955 if self.b is not None: 956 value = pprint.pformat(self.b, indent=0) 957 value = padding.join(value.splitlines(True)) 958 L.append(' b=%s' % (value)) 959 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 960 961 def __eq__(self, other): 962 if not isinstance(other, self.__class__): 963 return False 964 965 return self.__dict__ == other.__dict__ 966 967 def __ne__(self, other): 968 return not (self == other) 969 970 # Override the __hash__ function for Python3 - t10434117 971 __hash__ = object.__hash__ 972 973class ComplexNestedWithDefault: 974 """ 975 Attributes: 976 - z 977 - n 978 """ 979 980 thrift_spec = None 981 thrift_field_annotations = None 982 thrift_struct_annotations = None 983 __init__ = None 984 @staticmethod 985 def isUnion(): 986 return False 987 988 def read(self, iprot): 989 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 990 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 991 return 992 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 993 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 994 return 995 iprot.readStructBegin() 996 while True: 997 (fname, ftype, fid) = iprot.readFieldBegin() 998 if ftype == TType.STOP: 999 break 1000 if fid == 1: 1001 if ftype == TType.STRING: 1002 self.z = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 1003 else: 1004 iprot.skip(ftype) 1005 elif fid == 2: 1006 if ftype == TType.STRUCT: 1007 self.n = ComplexString() 1008 self.n.read(iprot) 1009 else: 1010 iprot.skip(ftype) 1011 else: 1012 iprot.skip(ftype) 1013 iprot.readFieldEnd() 1014 iprot.readStructEnd() 1015 1016 def write(self, oprot): 1017 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1018 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 1019 return 1020 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1021 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 1022 return 1023 oprot.writeStructBegin('ComplexNestedWithDefault') 1024 if self.z != None: 1025 oprot.writeFieldBegin('z', TType.STRING, 1) 1026 oprot.writeString(self.z.encode('utf-8')) if UTF8STRINGS and not isinstance(self.z, bytes) else oprot.writeString(self.z) 1027 oprot.writeFieldEnd() 1028 if self.n != None: 1029 oprot.writeFieldBegin('n', TType.STRUCT, 2) 1030 self.n.write(oprot) 1031 oprot.writeFieldEnd() 1032 oprot.writeFieldStop() 1033 oprot.writeStructEnd() 1034 1035 def __repr__(self): 1036 L = [] 1037 padding = ' ' * 4 1038 if self.z is not None: 1039 value = pprint.pformat(self.z, indent=0) 1040 value = padding.join(value.splitlines(True)) 1041 L.append(' z=%s' % (value)) 1042 if self.n is not None: 1043 value = pprint.pformat(self.n, indent=0) 1044 value = padding.join(value.splitlines(True)) 1045 L.append(' n=%s' % (value)) 1046 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 1047 1048 def __eq__(self, other): 1049 if not isinstance(other, self.__class__): 1050 return False 1051 1052 return self.__dict__ == other.__dict__ 1053 1054 def __ne__(self, other): 1055 return not (self == other) 1056 1057 # Override the __hash__ function for Python3 - t10434117 1058 __hash__ = object.__hash__ 1059 1060class MinPadding: 1061 """ 1062 Attributes: 1063 - small 1064 - big 1065 - medium 1066 - biggish 1067 - tiny 1068 """ 1069 1070 thrift_spec = None 1071 thrift_field_annotations = None 1072 thrift_struct_annotations = None 1073 __init__ = None 1074 @staticmethod 1075 def isUnion(): 1076 return False 1077 1078 def read(self, iprot): 1079 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1080 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 1081 return 1082 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1083 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 1084 return 1085 iprot.readStructBegin() 1086 while True: 1087 (fname, ftype, fid) = iprot.readFieldBegin() 1088 if ftype == TType.STOP: 1089 break 1090 if fid == 1: 1091 if ftype == TType.BYTE: 1092 self.small = iprot.readByte() 1093 else: 1094 iprot.skip(ftype) 1095 elif fid == 2: 1096 if ftype == TType.I64: 1097 self.big = iprot.readI64() 1098 else: 1099 iprot.skip(ftype) 1100 elif fid == 3: 1101 if ftype == TType.I16: 1102 self.medium = iprot.readI16() 1103 else: 1104 iprot.skip(ftype) 1105 elif fid == 4: 1106 if ftype == TType.I32: 1107 self.biggish = iprot.readI32() 1108 else: 1109 iprot.skip(ftype) 1110 elif fid == 5: 1111 if ftype == TType.BYTE: 1112 self.tiny = iprot.readByte() 1113 else: 1114 iprot.skip(ftype) 1115 else: 1116 iprot.skip(ftype) 1117 iprot.readFieldEnd() 1118 iprot.readStructEnd() 1119 1120 def write(self, oprot): 1121 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1122 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 1123 return 1124 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1125 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 1126 return 1127 oprot.writeStructBegin('MinPadding') 1128 if self.small != None: 1129 oprot.writeFieldBegin('small', TType.BYTE, 1) 1130 oprot.writeByte(self.small) 1131 oprot.writeFieldEnd() 1132 if self.big != None: 1133 oprot.writeFieldBegin('big', TType.I64, 2) 1134 oprot.writeI64(self.big) 1135 oprot.writeFieldEnd() 1136 if self.medium != None: 1137 oprot.writeFieldBegin('medium', TType.I16, 3) 1138 oprot.writeI16(self.medium) 1139 oprot.writeFieldEnd() 1140 if self.biggish != None: 1141 oprot.writeFieldBegin('biggish', TType.I32, 4) 1142 oprot.writeI32(self.biggish) 1143 oprot.writeFieldEnd() 1144 if self.tiny != None: 1145 oprot.writeFieldBegin('tiny', TType.BYTE, 5) 1146 oprot.writeByte(self.tiny) 1147 oprot.writeFieldEnd() 1148 oprot.writeFieldStop() 1149 oprot.writeStructEnd() 1150 1151 def __repr__(self): 1152 L = [] 1153 padding = ' ' * 4 1154 if self.small is not None: 1155 value = pprint.pformat(self.small, indent=0) 1156 value = padding.join(value.splitlines(True)) 1157 L.append(' small=%s' % (value)) 1158 if self.big is not None: 1159 value = pprint.pformat(self.big, indent=0) 1160 value = padding.join(value.splitlines(True)) 1161 L.append(' big=%s' % (value)) 1162 if self.medium is not None: 1163 value = pprint.pformat(self.medium, indent=0) 1164 value = padding.join(value.splitlines(True)) 1165 L.append(' medium=%s' % (value)) 1166 if self.biggish is not None: 1167 value = pprint.pformat(self.biggish, indent=0) 1168 value = padding.join(value.splitlines(True)) 1169 L.append(' biggish=%s' % (value)) 1170 if self.tiny is not None: 1171 value = pprint.pformat(self.tiny, indent=0) 1172 value = padding.join(value.splitlines(True)) 1173 L.append(' tiny=%s' % (value)) 1174 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 1175 1176 def __eq__(self, other): 1177 if not isinstance(other, self.__class__): 1178 return False 1179 1180 return self.__dict__ == other.__dict__ 1181 1182 def __ne__(self, other): 1183 return not (self == other) 1184 1185 # Override the __hash__ function for Python3 - t10434117 1186 __hash__ = object.__hash__ 1187 1188class MyStruct: 1189 """ 1190 Attributes: 1191 - MyIntField 1192 - MyStringField 1193 - majorVer 1194 - data 1195 """ 1196 1197 thrift_spec = None 1198 thrift_field_annotations = None 1199 thrift_struct_annotations = None 1200 __init__ = None 1201 @staticmethod 1202 def isUnion(): 1203 return False 1204 1205 def read(self, iprot): 1206 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1207 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 1208 return 1209 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1210 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 1211 return 1212 iprot.readStructBegin() 1213 while True: 1214 (fname, ftype, fid) = iprot.readFieldBegin() 1215 if ftype == TType.STOP: 1216 break 1217 if fid == 1: 1218 if ftype == TType.I64: 1219 self.MyIntField = iprot.readI64() 1220 else: 1221 iprot.skip(ftype) 1222 elif fid == 2: 1223 if ftype == TType.STRING: 1224 self.MyStringField = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 1225 else: 1226 iprot.skip(ftype) 1227 elif fid == 3: 1228 if ftype == TType.I64: 1229 self.majorVer = iprot.readI64() 1230 else: 1231 iprot.skip(ftype) 1232 elif fid == 4: 1233 if ftype == TType.STRUCT: 1234 self.data = MyDataItem() 1235 self.data.read(iprot) 1236 else: 1237 iprot.skip(ftype) 1238 else: 1239 iprot.skip(ftype) 1240 iprot.readFieldEnd() 1241 iprot.readStructEnd() 1242 1243 def write(self, oprot): 1244 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1245 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 1246 return 1247 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1248 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 1249 return 1250 oprot.writeStructBegin('MyStruct') 1251 if self.MyIntField != None: 1252 oprot.writeFieldBegin('MyIntField', TType.I64, 1) 1253 oprot.writeI64(self.MyIntField) 1254 oprot.writeFieldEnd() 1255 if self.MyStringField != None: 1256 oprot.writeFieldBegin('MyStringField', TType.STRING, 2) 1257 oprot.writeString(self.MyStringField.encode('utf-8')) if UTF8STRINGS and not isinstance(self.MyStringField, bytes) else oprot.writeString(self.MyStringField) 1258 oprot.writeFieldEnd() 1259 if self.majorVer != None: 1260 oprot.writeFieldBegin('majorVer', TType.I64, 3) 1261 oprot.writeI64(self.majorVer) 1262 oprot.writeFieldEnd() 1263 if self.data != None: 1264 oprot.writeFieldBegin('data', TType.STRUCT, 4) 1265 self.data.write(oprot) 1266 oprot.writeFieldEnd() 1267 oprot.writeFieldStop() 1268 oprot.writeStructEnd() 1269 1270 def __repr__(self): 1271 L = [] 1272 padding = ' ' * 4 1273 if self.MyIntField is not None: 1274 value = pprint.pformat(self.MyIntField, indent=0) 1275 value = padding.join(value.splitlines(True)) 1276 L.append(' MyIntField=%s' % (value)) 1277 if self.MyStringField is not None: 1278 value = pprint.pformat(self.MyStringField, indent=0) 1279 value = padding.join(value.splitlines(True)) 1280 L.append(' MyStringField=%s' % (value)) 1281 if self.majorVer is not None: 1282 value = pprint.pformat(self.majorVer, indent=0) 1283 value = padding.join(value.splitlines(True)) 1284 L.append(' majorVer=%s' % (value)) 1285 if self.data is not None: 1286 value = pprint.pformat(self.data, indent=0) 1287 value = padding.join(value.splitlines(True)) 1288 L.append(' data=%s' % (value)) 1289 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 1290 1291 def __eq__(self, other): 1292 if not isinstance(other, self.__class__): 1293 return False 1294 1295 return self.__dict__ == other.__dict__ 1296 1297 def __ne__(self, other): 1298 return not (self == other) 1299 1300 # Override the __hash__ function for Python3 - t10434117 1301 __hash__ = object.__hash__ 1302 1303class MyDataItem: 1304 1305 thrift_spec = None 1306 thrift_field_annotations = None 1307 thrift_struct_annotations = None 1308 @staticmethod 1309 def isUnion(): 1310 return False 1311 1312 def read(self, iprot): 1313 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1314 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 1315 return 1316 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1317 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 1318 return 1319 iprot.readStructBegin() 1320 while True: 1321 (fname, ftype, fid) = iprot.readFieldBegin() 1322 if ftype == TType.STOP: 1323 break 1324 else: 1325 iprot.skip(ftype) 1326 iprot.readFieldEnd() 1327 iprot.readStructEnd() 1328 1329 def write(self, oprot): 1330 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1331 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 1332 return 1333 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1334 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 1335 return 1336 oprot.writeStructBegin('MyDataItem') 1337 oprot.writeFieldStop() 1338 oprot.writeStructEnd() 1339 1340 def __repr__(self): 1341 L = [] 1342 padding = ' ' * 4 1343 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 1344 1345 def __eq__(self, other): 1346 if not isinstance(other, self.__class__): 1347 return False 1348 1349 return self.__dict__ == other.__dict__ 1350 1351 def __ne__(self, other): 1352 return not (self == other) 1353 1354 # Override the __hash__ function for Python3 - t10434117 1355 __hash__ = object.__hash__ 1356 1357class Renaming: 1358 """ 1359 Attributes: 1360 - foo 1361 """ 1362 1363 thrift_spec = None 1364 thrift_field_annotations = None 1365 thrift_struct_annotations = None 1366 __init__ = None 1367 @staticmethod 1368 def isUnion(): 1369 return False 1370 1371 def read(self, iprot): 1372 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1373 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 1374 return 1375 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1376 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 1377 return 1378 iprot.readStructBegin() 1379 while True: 1380 (fname, ftype, fid) = iprot.readFieldBegin() 1381 if ftype == TType.STOP: 1382 break 1383 if fid == 1: 1384 if ftype == TType.I64: 1385 self.foo = iprot.readI64() 1386 else: 1387 iprot.skip(ftype) 1388 else: 1389 iprot.skip(ftype) 1390 iprot.readFieldEnd() 1391 iprot.readStructEnd() 1392 1393 def write(self, oprot): 1394 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1395 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 1396 return 1397 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1398 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 1399 return 1400 oprot.writeStructBegin('Renaming') 1401 if self.foo != None: 1402 oprot.writeFieldBegin('foo', TType.I64, 1) 1403 oprot.writeI64(self.foo) 1404 oprot.writeFieldEnd() 1405 oprot.writeFieldStop() 1406 oprot.writeStructEnd() 1407 1408 def __repr__(self): 1409 L = [] 1410 padding = ' ' * 4 1411 if self.foo is not None: 1412 value = pprint.pformat(self.foo, indent=0) 1413 value = padding.join(value.splitlines(True)) 1414 L.append(' foo=%s' % (value)) 1415 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 1416 1417 def __eq__(self, other): 1418 if not isinstance(other, self.__class__): 1419 return False 1420 1421 return self.__dict__ == other.__dict__ 1422 1423 def __ne__(self, other): 1424 return not (self == other) 1425 1426 # Override the __hash__ function for Python3 - t10434117 1427 __hash__ = object.__hash__ 1428 1429class AnnotatedTypes: 1430 """ 1431 Attributes: 1432 - binary_field 1433 - list_field 1434 """ 1435 1436 thrift_spec = None 1437 thrift_field_annotations = None 1438 thrift_struct_annotations = None 1439 __init__ = None 1440 @staticmethod 1441 def isUnion(): 1442 return False 1443 1444 def read(self, iprot): 1445 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1446 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 1447 return 1448 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1449 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 1450 return 1451 iprot.readStructBegin() 1452 while True: 1453 (fname, ftype, fid) = iprot.readFieldBegin() 1454 if ftype == TType.STOP: 1455 break 1456 if fid == 1: 1457 if ftype == TType.STRING: 1458 self.binary_field = iprot.readString() 1459 else: 1460 iprot.skip(ftype) 1461 elif fid == 2: 1462 if ftype == TType.LIST: 1463 self.list_field = [] 1464 (_etype92, _size89) = iprot.readListBegin() 1465 if _size89 >= 0: 1466 for _i93 in range(_size89): 1467 _elem94 = {} 1468 (_ktype96, _vtype97, _size95 ) = iprot.readMapBegin() 1469 if _size95 >= 0: 1470 for _i99 in range(_size95): 1471 _key100 = iprot.readI32() 1472 _val101 = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 1473 _elem94[_key100] = _val101 1474 else: 1475 while iprot.peekMap(): 1476 _key102 = iprot.readI32() 1477 _val103 = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 1478 _elem94[_key102] = _val103 1479 iprot.readMapEnd() 1480 self.list_field.append(_elem94) 1481 else: 1482 while iprot.peekList(): 1483 _elem104 = {} 1484 (_ktype106, _vtype107, _size105 ) = iprot.readMapBegin() 1485 if _size105 >= 0: 1486 for _i109 in range(_size105): 1487 _key110 = iprot.readI32() 1488 _val111 = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 1489 _elem104[_key110] = _val111 1490 else: 1491 while iprot.peekMap(): 1492 _key112 = iprot.readI32() 1493 _val113 = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 1494 _elem104[_key112] = _val113 1495 iprot.readMapEnd() 1496 self.list_field.append(_elem104) 1497 iprot.readListEnd() 1498 else: 1499 iprot.skip(ftype) 1500 else: 1501 iprot.skip(ftype) 1502 iprot.readFieldEnd() 1503 iprot.readStructEnd() 1504 1505 def write(self, oprot): 1506 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1507 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 1508 return 1509 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1510 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 1511 return 1512 oprot.writeStructBegin('AnnotatedTypes') 1513 if self.binary_field != None: 1514 oprot.writeFieldBegin('binary_field', TType.STRING, 1) 1515 oprot.writeString(self.binary_field) 1516 oprot.writeFieldEnd() 1517 if self.list_field != None: 1518 oprot.writeFieldBegin('list_field', TType.LIST, 2) 1519 oprot.writeListBegin(TType.MAP, len(self.list_field)) 1520 for iter114 in self.list_field: 1521 oprot.writeMapBegin(TType.I32, TType.STRING, len(iter114)) 1522 for kiter115,viter116 in iter114.items(): 1523 oprot.writeI32(kiter115) 1524 oprot.writeString(viter116.encode('utf-8')) if UTF8STRINGS and not isinstance(viter116, bytes) else oprot.writeString(viter116) 1525 oprot.writeMapEnd() 1526 oprot.writeListEnd() 1527 oprot.writeFieldEnd() 1528 oprot.writeFieldStop() 1529 oprot.writeStructEnd() 1530 1531 def __repr__(self): 1532 L = [] 1533 padding = ' ' * 4 1534 if self.binary_field is not None: 1535 value = pprint.pformat(self.binary_field, indent=0) 1536 value = padding.join(value.splitlines(True)) 1537 L.append(' binary_field=%s' % (value)) 1538 if self.list_field is not None: 1539 value = pprint.pformat(self.list_field, indent=0) 1540 value = padding.join(value.splitlines(True)) 1541 L.append(' list_field=%s' % (value)) 1542 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 1543 1544 def __eq__(self, other): 1545 if not isinstance(other, self.__class__): 1546 return False 1547 1548 return self.__dict__ == other.__dict__ 1549 1550 def __ne__(self, other): 1551 return not (self == other) 1552 1553 # Override the __hash__ function for Python3 - t10434117 1554 __hash__ = object.__hash__ 1555 1556class ForwardUsageRoot: 1557 """ 1558 Attributes: 1559 - ForwardUsageStruct 1560 - ForwardUsageByRef 1561 """ 1562 1563 thrift_spec = None 1564 thrift_field_annotations = None 1565 thrift_struct_annotations = None 1566 __init__ = None 1567 @staticmethod 1568 def isUnion(): 1569 return False 1570 1571 def read(self, iprot): 1572 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1573 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 1574 return 1575 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1576 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 1577 return 1578 iprot.readStructBegin() 1579 while True: 1580 (fname, ftype, fid) = iprot.readFieldBegin() 1581 if ftype == TType.STOP: 1582 break 1583 if fid == 1: 1584 if ftype == TType.STRUCT: 1585 self.ForwardUsageStruct = ForwardUsageStruct() 1586 self.ForwardUsageStruct.read(iprot) 1587 else: 1588 iprot.skip(ftype) 1589 elif fid == 2: 1590 if ftype == TType.STRUCT: 1591 self.ForwardUsageByRef = ForwardUsageByRef() 1592 self.ForwardUsageByRef.read(iprot) 1593 else: 1594 iprot.skip(ftype) 1595 else: 1596 iprot.skip(ftype) 1597 iprot.readFieldEnd() 1598 iprot.readStructEnd() 1599 1600 def write(self, oprot): 1601 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1602 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 1603 return 1604 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1605 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 1606 return 1607 oprot.writeStructBegin('ForwardUsageRoot') 1608 if self.ForwardUsageStruct != None: 1609 oprot.writeFieldBegin('ForwardUsageStruct', TType.STRUCT, 1) 1610 self.ForwardUsageStruct.write(oprot) 1611 oprot.writeFieldEnd() 1612 if self.ForwardUsageByRef != None: 1613 oprot.writeFieldBegin('ForwardUsageByRef', TType.STRUCT, 2) 1614 self.ForwardUsageByRef.write(oprot) 1615 oprot.writeFieldEnd() 1616 oprot.writeFieldStop() 1617 oprot.writeStructEnd() 1618 1619 def __repr__(self): 1620 L = [] 1621 padding = ' ' * 4 1622 if self.ForwardUsageStruct is not None: 1623 value = pprint.pformat(self.ForwardUsageStruct, indent=0) 1624 value = padding.join(value.splitlines(True)) 1625 L.append(' ForwardUsageStruct=%s' % (value)) 1626 if self.ForwardUsageByRef is not None: 1627 value = pprint.pformat(self.ForwardUsageByRef, indent=0) 1628 value = padding.join(value.splitlines(True)) 1629 L.append(' ForwardUsageByRef=%s' % (value)) 1630 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 1631 1632 def __eq__(self, other): 1633 if not isinstance(other, self.__class__): 1634 return False 1635 1636 return self.__dict__ == other.__dict__ 1637 1638 def __ne__(self, other): 1639 return not (self == other) 1640 1641 # Override the __hash__ function for Python3 - t10434117 1642 __hash__ = object.__hash__ 1643 1644class ForwardUsageStruct: 1645 """ 1646 Attributes: 1647 - foo 1648 """ 1649 1650 thrift_spec = None 1651 thrift_field_annotations = None 1652 thrift_struct_annotations = None 1653 __init__ = None 1654 @staticmethod 1655 def isUnion(): 1656 return False 1657 1658 def read(self, iprot): 1659 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1660 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 1661 return 1662 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1663 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 1664 return 1665 iprot.readStructBegin() 1666 while True: 1667 (fname, ftype, fid) = iprot.readFieldBegin() 1668 if ftype == TType.STOP: 1669 break 1670 if fid == 1: 1671 if ftype == TType.STRUCT: 1672 self.foo = ForwardUsageRoot() 1673 self.foo.read(iprot) 1674 else: 1675 iprot.skip(ftype) 1676 else: 1677 iprot.skip(ftype) 1678 iprot.readFieldEnd() 1679 iprot.readStructEnd() 1680 1681 def write(self, oprot): 1682 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1683 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 1684 return 1685 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1686 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 1687 return 1688 oprot.writeStructBegin('ForwardUsageStruct') 1689 if self.foo != None: 1690 oprot.writeFieldBegin('foo', TType.STRUCT, 1) 1691 self.foo.write(oprot) 1692 oprot.writeFieldEnd() 1693 oprot.writeFieldStop() 1694 oprot.writeStructEnd() 1695 1696 def __repr__(self): 1697 L = [] 1698 padding = ' ' * 4 1699 if self.foo is not None: 1700 value = pprint.pformat(self.foo, indent=0) 1701 value = padding.join(value.splitlines(True)) 1702 L.append(' foo=%s' % (value)) 1703 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 1704 1705 def __eq__(self, other): 1706 if not isinstance(other, self.__class__): 1707 return False 1708 1709 return self.__dict__ == other.__dict__ 1710 1711 def __ne__(self, other): 1712 return not (self == other) 1713 1714 # Override the __hash__ function for Python3 - t10434117 1715 __hash__ = object.__hash__ 1716 1717class ForwardUsageByRef: 1718 """ 1719 Attributes: 1720 - foo 1721 """ 1722 1723 thrift_spec = None 1724 thrift_field_annotations = None 1725 thrift_struct_annotations = None 1726 __init__ = None 1727 @staticmethod 1728 def isUnion(): 1729 return False 1730 1731 def read(self, iprot): 1732 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1733 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 1734 return 1735 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1736 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 1737 return 1738 iprot.readStructBegin() 1739 while True: 1740 (fname, ftype, fid) = iprot.readFieldBegin() 1741 if ftype == TType.STOP: 1742 break 1743 if fid == 1: 1744 if ftype == TType.STRUCT: 1745 self.foo = ForwardUsageRoot() 1746 self.foo.read(iprot) 1747 else: 1748 iprot.skip(ftype) 1749 else: 1750 iprot.skip(ftype) 1751 iprot.readFieldEnd() 1752 iprot.readStructEnd() 1753 1754 def write(self, oprot): 1755 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1756 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 1757 return 1758 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1759 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 1760 return 1761 oprot.writeStructBegin('ForwardUsageByRef') 1762 if self.foo != None: 1763 oprot.writeFieldBegin('foo', TType.STRUCT, 1) 1764 self.foo.write(oprot) 1765 oprot.writeFieldEnd() 1766 oprot.writeFieldStop() 1767 oprot.writeStructEnd() 1768 1769 def __repr__(self): 1770 L = [] 1771 padding = ' ' * 4 1772 if self.foo is not None: 1773 value = pprint.pformat(self.foo, indent=0) 1774 value = padding.join(value.splitlines(True)) 1775 L.append(' foo=%s' % (value)) 1776 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 1777 1778 def __eq__(self, other): 1779 if not isinstance(other, self.__class__): 1780 return False 1781 1782 return self.__dict__ == other.__dict__ 1783 1784 def __ne__(self, other): 1785 return not (self == other) 1786 1787 # Override the __hash__ function for Python3 - t10434117 1788 __hash__ = object.__hash__ 1789 1790class NoexceptMoveEmpty: 1791 1792 thrift_spec = None 1793 thrift_field_annotations = None 1794 thrift_struct_annotations = None 1795 @staticmethod 1796 def isUnion(): 1797 return False 1798 1799 def read(self, iprot): 1800 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1801 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 1802 return 1803 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1804 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 1805 return 1806 iprot.readStructBegin() 1807 while True: 1808 (fname, ftype, fid) = iprot.readFieldBegin() 1809 if ftype == TType.STOP: 1810 break 1811 else: 1812 iprot.skip(ftype) 1813 iprot.readFieldEnd() 1814 iprot.readStructEnd() 1815 1816 def write(self, oprot): 1817 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1818 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 1819 return 1820 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1821 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 1822 return 1823 oprot.writeStructBegin('NoexceptMoveEmpty') 1824 oprot.writeFieldStop() 1825 oprot.writeStructEnd() 1826 1827 def __repr__(self): 1828 L = [] 1829 padding = ' ' * 4 1830 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 1831 1832 def __eq__(self, other): 1833 if not isinstance(other, self.__class__): 1834 return False 1835 1836 return self.__dict__ == other.__dict__ 1837 1838 def __ne__(self, other): 1839 return not (self == other) 1840 1841 # Override the __hash__ function for Python3 - t10434117 1842 __hash__ = object.__hash__ 1843 1844class NoexceptMoveSimpleStruct: 1845 """ 1846 Attributes: 1847 - boolField 1848 """ 1849 1850 thrift_spec = None 1851 thrift_field_annotations = None 1852 thrift_struct_annotations = None 1853 __init__ = None 1854 @staticmethod 1855 def isUnion(): 1856 return False 1857 1858 def read(self, iprot): 1859 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1860 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 1861 return 1862 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1863 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 1864 return 1865 iprot.readStructBegin() 1866 while True: 1867 (fname, ftype, fid) = iprot.readFieldBegin() 1868 if ftype == TType.STOP: 1869 break 1870 if fid == 1: 1871 if ftype == TType.I64: 1872 self.boolField = iprot.readI64() 1873 else: 1874 iprot.skip(ftype) 1875 else: 1876 iprot.skip(ftype) 1877 iprot.readFieldEnd() 1878 iprot.readStructEnd() 1879 1880 def write(self, oprot): 1881 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1882 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 1883 return 1884 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 1885 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 1886 return 1887 oprot.writeStructBegin('NoexceptMoveSimpleStruct') 1888 if self.boolField != None: 1889 oprot.writeFieldBegin('boolField', TType.I64, 1) 1890 oprot.writeI64(self.boolField) 1891 oprot.writeFieldEnd() 1892 oprot.writeFieldStop() 1893 oprot.writeStructEnd() 1894 1895 def __repr__(self): 1896 L = [] 1897 padding = ' ' * 4 1898 if self.boolField is not None: 1899 value = pprint.pformat(self.boolField, indent=0) 1900 value = padding.join(value.splitlines(True)) 1901 L.append(' boolField=%s' % (value)) 1902 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 1903 1904 def __eq__(self, other): 1905 if not isinstance(other, self.__class__): 1906 return False 1907 1908 return self.__dict__ == other.__dict__ 1909 1910 def __ne__(self, other): 1911 return not (self == other) 1912 1913 # Override the __hash__ function for Python3 - t10434117 1914 __hash__ = object.__hash__ 1915 1916class NoexceptMoveComplexStruct: 1917 """ 1918 Attributes: 1919 - MyBoolField 1920 - MyIntField 1921 - MyStringField 1922 - MyStringField2 1923 - MyBinaryField 1924 - MyBinaryField2 1925 - MyBinaryField3 1926 - MyBinaryListField4 1927 - MyMapEnumAndInt 1928 """ 1929 1930 thrift_spec = None 1931 thrift_field_annotations = None 1932 thrift_struct_annotations = None 1933 __init__ = None 1934 @staticmethod 1935 def isUnion(): 1936 return False 1937 1938 def read(self, iprot): 1939 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1940 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 1941 return 1942 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 1943 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 1944 return 1945 iprot.readStructBegin() 1946 while True: 1947 (fname, ftype, fid) = iprot.readFieldBegin() 1948 if ftype == TType.STOP: 1949 break 1950 if fid == 1: 1951 if ftype == TType.BOOL: 1952 self.MyBoolField = iprot.readBool() 1953 else: 1954 iprot.skip(ftype) 1955 elif fid == 2: 1956 if ftype == TType.I64: 1957 self.MyIntField = iprot.readI64() 1958 else: 1959 iprot.skip(ftype) 1960 elif fid == 3: 1961 if ftype == TType.STRING: 1962 self.MyStringField = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 1963 else: 1964 iprot.skip(ftype) 1965 elif fid == 4: 1966 if ftype == TType.STRING: 1967 self.MyStringField2 = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 1968 else: 1969 iprot.skip(ftype) 1970 elif fid == 5: 1971 if ftype == TType.STRING: 1972 self.MyBinaryField = iprot.readString() 1973 else: 1974 iprot.skip(ftype) 1975 elif fid == 6: 1976 if ftype == TType.STRING: 1977 self.MyBinaryField2 = iprot.readString() 1978 else: 1979 iprot.skip(ftype) 1980 elif fid == 7: 1981 if ftype == TType.STRING: 1982 self.MyBinaryField3 = iprot.readString() 1983 else: 1984 iprot.skip(ftype) 1985 elif fid == 8: 1986 if ftype == TType.LIST: 1987 self.MyBinaryListField4 = [] 1988 (_etype120, _size117) = iprot.readListBegin() 1989 if _size117 >= 0: 1990 for _i121 in range(_size117): 1991 _elem122 = iprot.readString() 1992 self.MyBinaryListField4.append(_elem122) 1993 else: 1994 while iprot.peekList(): 1995 _elem123 = iprot.readString() 1996 self.MyBinaryListField4.append(_elem123) 1997 iprot.readListEnd() 1998 else: 1999 iprot.skip(ftype) 2000 elif fid == 9: 2001 if ftype == TType.MAP: 2002 self.MyMapEnumAndInt = {} 2003 (_ktype125, _vtype126, _size124 ) = iprot.readMapBegin() 2004 if _size124 >= 0: 2005 for _i128 in range(_size124): 2006 _key129 = iprot.readI32() 2007 _val130 = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 2008 self.MyMapEnumAndInt[_key129] = _val130 2009 else: 2010 while iprot.peekMap(): 2011 _key131 = iprot.readI32() 2012 _val132 = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 2013 self.MyMapEnumAndInt[_key131] = _val132 2014 iprot.readMapEnd() 2015 else: 2016 iprot.skip(ftype) 2017 else: 2018 iprot.skip(ftype) 2019 iprot.readFieldEnd() 2020 iprot.readStructEnd() 2021 2022 def write(self, oprot): 2023 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 2024 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 2025 return 2026 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 2027 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 2028 return 2029 oprot.writeStructBegin('NoexceptMoveComplexStruct') 2030 if self.MyBoolField != None: 2031 oprot.writeFieldBegin('MyBoolField', TType.BOOL, 1) 2032 oprot.writeBool(self.MyBoolField) 2033 oprot.writeFieldEnd() 2034 if self.MyIntField != None: 2035 oprot.writeFieldBegin('MyIntField', TType.I64, 2) 2036 oprot.writeI64(self.MyIntField) 2037 oprot.writeFieldEnd() 2038 if self.MyStringField != None: 2039 oprot.writeFieldBegin('MyStringField', TType.STRING, 3) 2040 oprot.writeString(self.MyStringField.encode('utf-8')) if UTF8STRINGS and not isinstance(self.MyStringField, bytes) else oprot.writeString(self.MyStringField) 2041 oprot.writeFieldEnd() 2042 if self.MyStringField2 != None: 2043 oprot.writeFieldBegin('MyStringField2', TType.STRING, 4) 2044 oprot.writeString(self.MyStringField2.encode('utf-8')) if UTF8STRINGS and not isinstance(self.MyStringField2, bytes) else oprot.writeString(self.MyStringField2) 2045 oprot.writeFieldEnd() 2046 if self.MyBinaryField != None: 2047 oprot.writeFieldBegin('MyBinaryField', TType.STRING, 5) 2048 oprot.writeString(self.MyBinaryField) 2049 oprot.writeFieldEnd() 2050 if self.MyBinaryField2 != None: 2051 oprot.writeFieldBegin('MyBinaryField2', TType.STRING, 6) 2052 oprot.writeString(self.MyBinaryField2) 2053 oprot.writeFieldEnd() 2054 if self.MyBinaryField3 != None: 2055 oprot.writeFieldBegin('MyBinaryField3', TType.STRING, 7) 2056 oprot.writeString(self.MyBinaryField3) 2057 oprot.writeFieldEnd() 2058 if self.MyBinaryListField4 != None: 2059 oprot.writeFieldBegin('MyBinaryListField4', TType.LIST, 8) 2060 oprot.writeListBegin(TType.STRING, len(self.MyBinaryListField4)) 2061 for iter133 in self.MyBinaryListField4: 2062 oprot.writeString(iter133) 2063 oprot.writeListEnd() 2064 oprot.writeFieldEnd() 2065 if self.MyMapEnumAndInt != None: 2066 oprot.writeFieldBegin('MyMapEnumAndInt', TType.MAP, 9) 2067 oprot.writeMapBegin(TType.I32, TType.STRING, len(self.MyMapEnumAndInt)) 2068 for kiter134,viter135 in self.MyMapEnumAndInt.items(): 2069 oprot.writeI32(kiter134) 2070 oprot.writeString(viter135.encode('utf-8')) if UTF8STRINGS and not isinstance(viter135, bytes) else oprot.writeString(viter135) 2071 oprot.writeMapEnd() 2072 oprot.writeFieldEnd() 2073 oprot.writeFieldStop() 2074 oprot.writeStructEnd() 2075 2076 def __repr__(self): 2077 L = [] 2078 padding = ' ' * 4 2079 if self.MyBoolField is not None: 2080 value = pprint.pformat(self.MyBoolField, indent=0) 2081 value = padding.join(value.splitlines(True)) 2082 L.append(' MyBoolField=%s' % (value)) 2083 if self.MyIntField is not None: 2084 value = pprint.pformat(self.MyIntField, indent=0) 2085 value = padding.join(value.splitlines(True)) 2086 L.append(' MyIntField=%s' % (value)) 2087 if self.MyStringField is not None: 2088 value = pprint.pformat(self.MyStringField, indent=0) 2089 value = padding.join(value.splitlines(True)) 2090 L.append(' MyStringField=%s' % (value)) 2091 if self.MyStringField2 is not None: 2092 value = pprint.pformat(self.MyStringField2, indent=0) 2093 value = padding.join(value.splitlines(True)) 2094 L.append(' MyStringField2=%s' % (value)) 2095 if self.MyBinaryField is not None: 2096 value = pprint.pformat(self.MyBinaryField, indent=0) 2097 value = padding.join(value.splitlines(True)) 2098 L.append(' MyBinaryField=%s' % (value)) 2099 if self.MyBinaryField2 is not None: 2100 value = pprint.pformat(self.MyBinaryField2, indent=0) 2101 value = padding.join(value.splitlines(True)) 2102 L.append(' MyBinaryField2=%s' % (value)) 2103 if self.MyBinaryField3 is not None: 2104 value = pprint.pformat(self.MyBinaryField3, indent=0) 2105 value = padding.join(value.splitlines(True)) 2106 L.append(' MyBinaryField3=%s' % (value)) 2107 if self.MyBinaryListField4 is not None: 2108 value = pprint.pformat(self.MyBinaryListField4, indent=0) 2109 value = padding.join(value.splitlines(True)) 2110 L.append(' MyBinaryListField4=%s' % (value)) 2111 if self.MyMapEnumAndInt is not None: 2112 value = pprint.pformat(self.MyMapEnumAndInt, indent=0) 2113 value = padding.join(value.splitlines(True)) 2114 L.append(' MyMapEnumAndInt=%s' % (value)) 2115 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 2116 2117 def __eq__(self, other): 2118 if not isinstance(other, self.__class__): 2119 return False 2120 2121 return self.__dict__ == other.__dict__ 2122 2123 def __ne__(self, other): 2124 return not (self == other) 2125 2126 # Override the __hash__ function for Python3 - t10434117 2127 __hash__ = object.__hash__ 2128 2129class NoExceptMoveUnion(object): 2130 """ 2131 Attributes: 2132 - string_field 2133 - i32_field 2134 """ 2135 2136 thrift_spec = None 2137 __init__ = None 2138 2139 __EMPTY__ = 0 2140 STRING_FIELD = 1 2141 I32_FIELD = 2 2142 2143 @staticmethod 2144 def isUnion(): 2145 return True 2146 2147 def get_string_field(self): 2148 assert self.field == 1 2149 return self.value 2150 2151 def get_i32_field(self): 2152 assert self.field == 2 2153 return self.value 2154 2155 def set_string_field(self, value): 2156 self.field = 1 2157 self.value = value 2158 2159 def set_i32_field(self, value): 2160 self.field = 2 2161 self.value = value 2162 2163 def getType(self): 2164 return self.field 2165 2166 def __repr__(self): 2167 value = pprint.pformat(self.value) 2168 member = '' 2169 if self.field == 1: 2170 padding = ' ' * 13 2171 value = padding.join(value.splitlines(True)) 2172 member = '\n %s=%s' % ('string_field', value) 2173 if self.field == 2: 2174 padding = ' ' * 10 2175 value = padding.join(value.splitlines(True)) 2176 member = '\n %s=%s' % ('i32_field', value) 2177 return "%s(%s)" % (self.__class__.__name__, member) 2178 2179 def read(self, iprot): 2180 self.field = 0 2181 self.value = None 2182 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 2183 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, True], utf8strings=UTF8STRINGS, protoid=0) 2184 return 2185 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 2186 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, True], utf8strings=UTF8STRINGS, protoid=2) 2187 return 2188 iprot.readStructBegin() 2189 while True: 2190 (fname, ftype, fid) = iprot.readFieldBegin() 2191 if ftype == TType.STOP: 2192 break 2193 2194 if fid == 1: 2195 if ftype == TType.STRING: 2196 string_field = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 2197 assert self.field == 0 and self.value is None 2198 self.set_string_field(string_field) 2199 else: 2200 iprot.skip(ftype) 2201 elif fid == 2: 2202 if ftype == TType.I32: 2203 i32_field = iprot.readI32() 2204 assert self.field == 0 and self.value is None 2205 self.set_i32_field(i32_field) 2206 else: 2207 iprot.skip(ftype) 2208 else: 2209 iprot.skip(ftype) 2210 iprot.readFieldEnd() 2211 iprot.readStructEnd() 2212 2213 def write(self, oprot): 2214 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 2215 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, True], utf8strings=UTF8STRINGS, protoid=0)) 2216 return 2217 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 2218 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, True], utf8strings=UTF8STRINGS, protoid=2)) 2219 return 2220 oprot.writeUnionBegin('NoExceptMoveUnion') 2221 if self.field == 1: 2222 oprot.writeFieldBegin('string_field', TType.STRING, 1) 2223 string_field = self.value 2224 oprot.writeString(string_field.encode('utf-8')) if UTF8STRINGS and not isinstance(string_field, bytes) else oprot.writeString(string_field) 2225 oprot.writeFieldEnd() 2226 if self.field == 2: 2227 oprot.writeFieldBegin('i32_field', TType.I32, 2) 2228 i32_field = self.value 2229 oprot.writeI32(i32_field) 2230 oprot.writeFieldEnd() 2231 oprot.writeFieldStop() 2232 oprot.writeUnionEnd() 2233 2234 def __eq__(self, other): 2235 if not isinstance(other, self.__class__): 2236 return False 2237 2238 return self.__dict__ == other.__dict__ 2239 2240 def __ne__(self, other): 2241 return not (self == other) 2242 2243class AllocatorAware: 2244 """ 2245 Attributes: 2246 - aa_list 2247 - aa_set 2248 - aa_map 2249 - aa_string 2250 - not_a_container 2251 """ 2252 2253 thrift_spec = None 2254 thrift_field_annotations = None 2255 thrift_struct_annotations = None 2256 __init__ = None 2257 @staticmethod 2258 def isUnion(): 2259 return False 2260 2261 def read(self, iprot): 2262 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 2263 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 2264 return 2265 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 2266 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 2267 return 2268 iprot.readStructBegin() 2269 while True: 2270 (fname, ftype, fid) = iprot.readFieldBegin() 2271 if ftype == TType.STOP: 2272 break 2273 if fid == 1: 2274 if ftype == TType.LIST: 2275 self.aa_list = [] 2276 (_etype139, _size136) = iprot.readListBegin() 2277 if _size136 >= 0: 2278 for _i140 in range(_size136): 2279 _elem141 = iprot.readI32() 2280 self.aa_list.append(_elem141) 2281 else: 2282 while iprot.peekList(): 2283 _elem142 = iprot.readI32() 2284 self.aa_list.append(_elem142) 2285 iprot.readListEnd() 2286 else: 2287 iprot.skip(ftype) 2288 elif fid == 2: 2289 if ftype == TType.SET: 2290 self.aa_set = set() 2291 (_etype146, _size143) = iprot.readSetBegin() 2292 if _size143 >= 0: 2293 for _i147 in range(_size143): 2294 _elem148 = iprot.readI32() 2295 self.aa_set.add(_elem148) 2296 else: 2297 while iprot.peekSet(): 2298 _elem149 = iprot.readI32() 2299 self.aa_set.add(_elem149) 2300 iprot.readSetEnd() 2301 else: 2302 iprot.skip(ftype) 2303 elif fid == 3: 2304 if ftype == TType.MAP: 2305 self.aa_map = {} 2306 (_ktype151, _vtype152, _size150 ) = iprot.readMapBegin() 2307 if _size150 >= 0: 2308 for _i154 in range(_size150): 2309 _key155 = iprot.readI32() 2310 _val156 = iprot.readI32() 2311 self.aa_map[_key155] = _val156 2312 else: 2313 while iprot.peekMap(): 2314 _key157 = iprot.readI32() 2315 _val158 = iprot.readI32() 2316 self.aa_map[_key157] = _val158 2317 iprot.readMapEnd() 2318 else: 2319 iprot.skip(ftype) 2320 elif fid == 4: 2321 if ftype == TType.STRING: 2322 self.aa_string = iprot.readString().decode('utf-8') if UTF8STRINGS else iprot.readString() 2323 else: 2324 iprot.skip(ftype) 2325 elif fid == 5: 2326 if ftype == TType.I32: 2327 self.not_a_container = iprot.readI32() 2328 else: 2329 iprot.skip(ftype) 2330 else: 2331 iprot.skip(ftype) 2332 iprot.readFieldEnd() 2333 iprot.readStructEnd() 2334 2335 def write(self, oprot): 2336 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 2337 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 2338 return 2339 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 2340 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 2341 return 2342 oprot.writeStructBegin('AllocatorAware') 2343 if self.aa_list != None: 2344 oprot.writeFieldBegin('aa_list', TType.LIST, 1) 2345 oprot.writeListBegin(TType.I32, len(self.aa_list)) 2346 for iter159 in self.aa_list: 2347 oprot.writeI32(iter159) 2348 oprot.writeListEnd() 2349 oprot.writeFieldEnd() 2350 if self.aa_set != None: 2351 oprot.writeFieldBegin('aa_set', TType.SET, 2) 2352 oprot.writeSetBegin(TType.I32, len(self.aa_set)) 2353 for iter160 in self.aa_set: 2354 oprot.writeI32(iter160) 2355 oprot.writeSetEnd() 2356 oprot.writeFieldEnd() 2357 if self.aa_map != None: 2358 oprot.writeFieldBegin('aa_map', TType.MAP, 3) 2359 oprot.writeMapBegin(TType.I32, TType.I32, len(self.aa_map)) 2360 for kiter161,viter162 in self.aa_map.items(): 2361 oprot.writeI32(kiter161) 2362 oprot.writeI32(viter162) 2363 oprot.writeMapEnd() 2364 oprot.writeFieldEnd() 2365 if self.aa_string != None: 2366 oprot.writeFieldBegin('aa_string', TType.STRING, 4) 2367 oprot.writeString(self.aa_string.encode('utf-8')) if UTF8STRINGS and not isinstance(self.aa_string, bytes) else oprot.writeString(self.aa_string) 2368 oprot.writeFieldEnd() 2369 if self.not_a_container != None: 2370 oprot.writeFieldBegin('not_a_container', TType.I32, 5) 2371 oprot.writeI32(self.not_a_container) 2372 oprot.writeFieldEnd() 2373 oprot.writeFieldStop() 2374 oprot.writeStructEnd() 2375 2376 def __repr__(self): 2377 L = [] 2378 padding = ' ' * 4 2379 if self.aa_list is not None: 2380 value = pprint.pformat(self.aa_list, indent=0) 2381 value = padding.join(value.splitlines(True)) 2382 L.append(' aa_list=%s' % (value)) 2383 if self.aa_set is not None: 2384 value = pprint.pformat(self.aa_set, indent=0) 2385 value = padding.join(value.splitlines(True)) 2386 L.append(' aa_set=%s' % (value)) 2387 if self.aa_map is not None: 2388 value = pprint.pformat(self.aa_map, indent=0) 2389 value = padding.join(value.splitlines(True)) 2390 L.append(' aa_map=%s' % (value)) 2391 if self.aa_string is not None: 2392 value = pprint.pformat(self.aa_string, indent=0) 2393 value = padding.join(value.splitlines(True)) 2394 L.append(' aa_string=%s' % (value)) 2395 if self.not_a_container is not None: 2396 value = pprint.pformat(self.not_a_container, indent=0) 2397 value = padding.join(value.splitlines(True)) 2398 L.append(' not_a_container=%s' % (value)) 2399 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 2400 2401 def __eq__(self, other): 2402 if not isinstance(other, self.__class__): 2403 return False 2404 2405 return self.__dict__ == other.__dict__ 2406 2407 def __ne__(self, other): 2408 return not (self == other) 2409 2410 # Override the __hash__ function for Python3 - t10434117 2411 __hash__ = object.__hash__ 2412 2413class AllocatorAware2: 2414 """ 2415 Attributes: 2416 - not_a_container 2417 """ 2418 2419 thrift_spec = None 2420 thrift_field_annotations = None 2421 thrift_struct_annotations = None 2422 __init__ = None 2423 @staticmethod 2424 def isUnion(): 2425 return False 2426 2427 def read(self, iprot): 2428 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 2429 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 2430 return 2431 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 2432 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 2433 return 2434 iprot.readStructBegin() 2435 while True: 2436 (fname, ftype, fid) = iprot.readFieldBegin() 2437 if ftype == TType.STOP: 2438 break 2439 if fid == 1: 2440 if ftype == TType.I32: 2441 self.not_a_container = iprot.readI32() 2442 else: 2443 iprot.skip(ftype) 2444 else: 2445 iprot.skip(ftype) 2446 iprot.readFieldEnd() 2447 iprot.readStructEnd() 2448 2449 def write(self, oprot): 2450 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 2451 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 2452 return 2453 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 2454 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 2455 return 2456 oprot.writeStructBegin('AllocatorAware2') 2457 if self.not_a_container != None: 2458 oprot.writeFieldBegin('not_a_container', TType.I32, 1) 2459 oprot.writeI32(self.not_a_container) 2460 oprot.writeFieldEnd() 2461 oprot.writeFieldStop() 2462 oprot.writeStructEnd() 2463 2464 def __repr__(self): 2465 L = [] 2466 padding = ' ' * 4 2467 if self.not_a_container is not None: 2468 value = pprint.pformat(self.not_a_container, indent=0) 2469 value = padding.join(value.splitlines(True)) 2470 L.append(' not_a_container=%s' % (value)) 2471 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 2472 2473 def __eq__(self, other): 2474 if not isinstance(other, self.__class__): 2475 return False 2476 2477 return self.__dict__ == other.__dict__ 2478 2479 def __ne__(self, other): 2480 return not (self == other) 2481 2482 # Override the __hash__ function for Python3 - t10434117 2483 __hash__ = object.__hash__ 2484 2485class TypedefStruct: 2486 """ 2487 Attributes: 2488 - i32_field 2489 - IntTypedef_field 2490 - UintTypedef_field 2491 """ 2492 2493 thrift_spec = None 2494 thrift_field_annotations = None 2495 thrift_struct_annotations = None 2496 __init__ = None 2497 @staticmethod 2498 def isUnion(): 2499 return False 2500 2501 def read(self, iprot): 2502 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 2503 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 2504 return 2505 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 2506 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 2507 return 2508 iprot.readStructBegin() 2509 while True: 2510 (fname, ftype, fid) = iprot.readFieldBegin() 2511 if ftype == TType.STOP: 2512 break 2513 if fid == 1: 2514 if ftype == TType.I32: 2515 self.i32_field = iprot.readI32() 2516 else: 2517 iprot.skip(ftype) 2518 elif fid == 2: 2519 if ftype == TType.I32: 2520 self.IntTypedef_field = iprot.readI32() 2521 else: 2522 iprot.skip(ftype) 2523 elif fid == 3: 2524 if ftype == TType.I32: 2525 self.UintTypedef_field = iprot.readI32() 2526 else: 2527 iprot.skip(ftype) 2528 else: 2529 iprot.skip(ftype) 2530 iprot.readFieldEnd() 2531 iprot.readStructEnd() 2532 2533 def write(self, oprot): 2534 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 2535 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 2536 return 2537 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 2538 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 2539 return 2540 oprot.writeStructBegin('TypedefStruct') 2541 if self.i32_field != None: 2542 oprot.writeFieldBegin('i32_field', TType.I32, 1) 2543 oprot.writeI32(self.i32_field) 2544 oprot.writeFieldEnd() 2545 if self.IntTypedef_field != None: 2546 oprot.writeFieldBegin('IntTypedef_field', TType.I32, 2) 2547 oprot.writeI32(self.IntTypedef_field) 2548 oprot.writeFieldEnd() 2549 if self.UintTypedef_field != None: 2550 oprot.writeFieldBegin('UintTypedef_field', TType.I32, 3) 2551 oprot.writeI32(self.UintTypedef_field) 2552 oprot.writeFieldEnd() 2553 oprot.writeFieldStop() 2554 oprot.writeStructEnd() 2555 2556 def __repr__(self): 2557 L = [] 2558 padding = ' ' * 4 2559 if self.i32_field is not None: 2560 value = pprint.pformat(self.i32_field, indent=0) 2561 value = padding.join(value.splitlines(True)) 2562 L.append(' i32_field=%s' % (value)) 2563 if self.IntTypedef_field is not None: 2564 value = pprint.pformat(self.IntTypedef_field, indent=0) 2565 value = padding.join(value.splitlines(True)) 2566 L.append(' IntTypedef_field=%s' % (value)) 2567 if self.UintTypedef_field is not None: 2568 value = pprint.pformat(self.UintTypedef_field, indent=0) 2569 value = padding.join(value.splitlines(True)) 2570 L.append(' UintTypedef_field=%s' % (value)) 2571 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 2572 2573 def __eq__(self, other): 2574 if not isinstance(other, self.__class__): 2575 return False 2576 2577 return self.__dict__ == other.__dict__ 2578 2579 def __ne__(self, other): 2580 return not (self == other) 2581 2582 # Override the __hash__ function for Python3 - t10434117 2583 __hash__ = object.__hash__ 2584 2585class StructWithDoubleUnderscores: 2586 """ 2587 Attributes: 2588 - __field 2589 """ 2590 2591 thrift_spec = None 2592 thrift_field_annotations = None 2593 thrift_struct_annotations = None 2594 __init__ = None 2595 @staticmethod 2596 def isUnion(): 2597 return False 2598 2599 def read(self, iprot): 2600 if (isinstance(iprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 2601 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0) 2602 return 2603 if (isinstance(iprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(iprot, THeaderProtocol.THeaderProtocolAccelerate) and iprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastproto is not None: 2604 fastproto.decode(self, iprot.trans, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2) 2605 return 2606 iprot.readStructBegin() 2607 while True: 2608 (fname, ftype, fid) = iprot.readFieldBegin() 2609 if ftype == TType.STOP: 2610 break 2611 if fid == 1: 2612 if ftype == TType.I32: 2613 self.__field = iprot.readI32() 2614 else: 2615 iprot.skip(ftype) 2616 else: 2617 iprot.skip(ftype) 2618 iprot.readFieldEnd() 2619 iprot.readStructEnd() 2620 2621 def write(self, oprot): 2622 if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 2623 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0)) 2624 return 2625 if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None: 2626 oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2)) 2627 return 2628 oprot.writeStructBegin('StructWithDoubleUnderscores') 2629 if self.__field != None: 2630 oprot.writeFieldBegin('__field', TType.I32, 1) 2631 oprot.writeI32(self.__field) 2632 oprot.writeFieldEnd() 2633 oprot.writeFieldStop() 2634 oprot.writeStructEnd() 2635 2636 def __repr__(self): 2637 L = [] 2638 padding = ' ' * 4 2639 if getattr(self, "__field", None) is not None: 2640 value = pprint.pformat(getattr(self, "__field", None), indent=0) 2641 value = padding.join(value.splitlines(True)) 2642 L.append(' __field=%s' % (value)) 2643 return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '') 2644 2645 def __eq__(self, other): 2646 if not isinstance(other, self.__class__): 2647 return False 2648 2649 return self.__dict__ == other.__dict__ 2650 2651 def __ne__(self, other): 2652 return not (self == other) 2653 2654 # Override the __hash__ function for Python3 - t10434117 2655 __hash__ = object.__hash__ 2656 2657TBinary = UnimplementedTypedef() 2658IntTypedef = UnimplementedTypedef() 2659UintTypedef = IntTypedef 2660all_structs.append(decorated_struct) 2661decorated_struct.thrift_spec = ( 2662 None, # 0 2663 (1, TType.STRING, 'field', True, None, 2, ), # 1 2664) 2665 2666decorated_struct.thrift_struct_annotations = { 2667 "cpp.declare_equal_to": "1", 2668 "cpp.declare_hash": "1", 2669} 2670decorated_struct.thrift_field_annotations = { 2671} 2672 2673def decorated_struct__init__(self, field=None,): 2674 self.field = field 2675 2676decorated_struct.__init__ = decorated_struct__init__ 2677 2678def decorated_struct__setstate__(self, state): 2679 state.setdefault('field', None) 2680 self.__dict__ = state 2681 2682decorated_struct.__getstate__ = lambda self: self.__dict__.copy() 2683decorated_struct.__setstate__ = decorated_struct__setstate__ 2684 2685all_structs.append(ContainerStruct) 2686ContainerStruct.thrift_spec = ( 2687 None, # 0 2688 None, # 1 2689 (2, TType.LIST, 'fieldB', (TType.I32,None), None, 2, ), # 2 2690 (3, TType.LIST, 'fieldC', (TType.I32,None), None, 2, ), # 3 2691 (4, TType.LIST, 'fieldD', (TType.I32,None), None, 2, ), # 4 2692 (5, TType.LIST, 'fieldE', (TType.I32,None), None, 2, ), # 5 2693 (6, TType.SET, 'fieldF', (TType.I32,None), None, 2, ), # 6 2694 (7, TType.MAP, 'fieldG', (TType.I32,None,TType.STRING,True), None, 2, ), # 7 2695 (8, TType.MAP, 'fieldH', (TType.I32,None,TType.STRING,True), None, 2, ), # 8 2696 None, # 9 2697 None, # 10 2698 None, # 11 2699 (12, TType.LIST, 'fieldA', (TType.I32,None), None, 2, ), # 12 2700) 2701 2702ContainerStruct.thrift_struct_annotations = { 2703} 2704ContainerStruct.thrift_field_annotations = { 2705} 2706 2707def ContainerStruct__init__(self, fieldA=None, fieldB=None, fieldC=None, fieldD=None, fieldE=None, fieldF=None, fieldG=None, fieldH=None,): 2708 self.fieldA = fieldA 2709 self.fieldB = fieldB 2710 self.fieldC = fieldC 2711 self.fieldD = fieldD 2712 self.fieldE = fieldE 2713 self.fieldF = fieldF 2714 self.fieldG = fieldG 2715 self.fieldH = fieldH 2716 2717ContainerStruct.__init__ = ContainerStruct__init__ 2718 2719def ContainerStruct__setstate__(self, state): 2720 state.setdefault('fieldA', None) 2721 state.setdefault('fieldB', None) 2722 state.setdefault('fieldC', None) 2723 state.setdefault('fieldD', None) 2724 state.setdefault('fieldE', None) 2725 state.setdefault('fieldF', None) 2726 state.setdefault('fieldG', None) 2727 state.setdefault('fieldH', None) 2728 self.__dict__ = state 2729 2730ContainerStruct.__getstate__ = lambda self: self.__dict__.copy() 2731ContainerStruct.__setstate__ = ContainerStruct__setstate__ 2732 2733all_structs.append(CppTypeStruct) 2734CppTypeStruct.thrift_spec = ( 2735 None, # 0 2736 (1, TType.LIST, 'fieldA', (TType.I32,None), None, 2, ), # 1 2737) 2738 2739CppTypeStruct.thrift_struct_annotations = { 2740} 2741CppTypeStruct.thrift_field_annotations = { 2742} 2743 2744def CppTypeStruct__init__(self, fieldA=None,): 2745 self.fieldA = fieldA 2746 2747CppTypeStruct.__init__ = CppTypeStruct__init__ 2748 2749def CppTypeStruct__setstate__(self, state): 2750 state.setdefault('fieldA', None) 2751 self.__dict__ = state 2752 2753CppTypeStruct.__getstate__ = lambda self: self.__dict__.copy() 2754CppTypeStruct.__setstate__ = CppTypeStruct__setstate__ 2755 2756all_structs.append(VirtualStruct) 2757VirtualStruct.thrift_spec = ( 2758 None, # 0 2759 (1, TType.I64, 'MyIntField', None, None, 2, ), # 1 2760) 2761 2762VirtualStruct.thrift_struct_annotations = { 2763 "cpp.virtual": "1", 2764} 2765VirtualStruct.thrift_field_annotations = { 2766} 2767 2768def VirtualStruct__init__(self, MyIntField=None,): 2769 self.MyIntField = MyIntField 2770 2771VirtualStruct.__init__ = VirtualStruct__init__ 2772 2773def VirtualStruct__setstate__(self, state): 2774 state.setdefault('MyIntField', None) 2775 self.__dict__ = state 2776 2777VirtualStruct.__getstate__ = lambda self: self.__dict__.copy() 2778VirtualStruct.__setstate__ = VirtualStruct__setstate__ 2779 2780all_structs.append(MyStructWithForwardRefEnum) 2781MyStructWithForwardRefEnum.thrift_spec = ( 2782 None, # 0 2783 (1, TType.I32, 'a', MyForwardRefEnum, 12, 2, ), # 1 2784 (2, TType.I32, 'b', MyForwardRefEnum, 12, 2, ), # 2 2785) 2786 2787MyStructWithForwardRefEnum.thrift_struct_annotations = { 2788} 2789MyStructWithForwardRefEnum.thrift_field_annotations = { 2790} 2791 2792def MyStructWithForwardRefEnum__init__(self, a=MyStructWithForwardRefEnum.thrift_spec[1][4], b=MyStructWithForwardRefEnum.thrift_spec[2][4],): 2793 if a is self.thrift_spec[1][4]: 2794 a = 12 2795 self.a = a 2796 if b is self.thrift_spec[2][4]: 2797 b = 12 2798 self.b = b 2799 2800MyStructWithForwardRefEnum.__init__ = MyStructWithForwardRefEnum__init__ 2801 2802def MyStructWithForwardRefEnum__setstate__(self, state): 2803 state.setdefault('a', 12) 2804 state.setdefault('b', 12) 2805 self.__dict__ = state 2806 2807MyStructWithForwardRefEnum.__getstate__ = lambda self: self.__dict__.copy() 2808MyStructWithForwardRefEnum.__setstate__ = MyStructWithForwardRefEnum__setstate__ 2809 2810all_structs.append(TrivialNumeric) 2811TrivialNumeric.thrift_spec = ( 2812 None, # 0 2813 (1, TType.I32, 'a', None, None, 2, ), # 1 2814 (2, TType.BOOL, 'b', None, None, 2, ), # 2 2815) 2816 2817TrivialNumeric.thrift_struct_annotations = { 2818} 2819TrivialNumeric.thrift_field_annotations = { 2820} 2821 2822def TrivialNumeric__init__(self, a=None, b=None,): 2823 self.a = a 2824 self.b = b 2825 2826TrivialNumeric.__init__ = TrivialNumeric__init__ 2827 2828def TrivialNumeric__setstate__(self, state): 2829 state.setdefault('a', None) 2830 state.setdefault('b', None) 2831 self.__dict__ = state 2832 2833TrivialNumeric.__getstate__ = lambda self: self.__dict__.copy() 2834TrivialNumeric.__setstate__ = TrivialNumeric__setstate__ 2835 2836all_structs.append(TrivialNestedWithDefault) 2837TrivialNestedWithDefault.thrift_spec = ( 2838 None, # 0 2839 (1, TType.I32, 'z', None, 4, 2, ), # 1 2840 (2, TType.STRUCT, 'n', [TrivialNumeric, TrivialNumeric.thrift_spec, False], TrivialNumeric(**{ 2841 "a" : 3, 2842 "b" : True, 2843 }), 2, ), # 2 2844) 2845 2846TrivialNestedWithDefault.thrift_struct_annotations = { 2847} 2848TrivialNestedWithDefault.thrift_field_annotations = { 2849} 2850 2851def TrivialNestedWithDefault__init__(self, z=TrivialNestedWithDefault.thrift_spec[1][4], n=TrivialNestedWithDefault.thrift_spec[2][4],): 2852 self.z = z 2853 if n is self.thrift_spec[2][4]: 2854 n = TrivialNumeric(**{ 2855 "a" : 3, 2856 "b" : True, 2857 }) 2858 self.n = n 2859 2860TrivialNestedWithDefault.__init__ = TrivialNestedWithDefault__init__ 2861 2862def TrivialNestedWithDefault__setstate__(self, state): 2863 state.setdefault('z', 4) 2864 state.setdefault('n', TrivialNumeric(**{ 2865 "a" : 3, 2866 "b" : True, 2867 })) 2868 self.__dict__ = state 2869 2870TrivialNestedWithDefault.__getstate__ = lambda self: self.__dict__.copy() 2871TrivialNestedWithDefault.__setstate__ = TrivialNestedWithDefault__setstate__ 2872 2873all_structs.append(ComplexString) 2874ComplexString.thrift_spec = ( 2875 None, # 0 2876 (1, TType.STRING, 'a', True, None, 2, ), # 1 2877 (2, TType.MAP, 'b', (TType.STRING,True,TType.I32,None), None, 2, ), # 2 2878) 2879 2880ComplexString.thrift_struct_annotations = { 2881} 2882ComplexString.thrift_field_annotations = { 2883} 2884 2885def ComplexString__init__(self, a=None, b=None,): 2886 self.a = a 2887 self.b = b 2888 2889ComplexString.__init__ = ComplexString__init__ 2890 2891def ComplexString__setstate__(self, state): 2892 state.setdefault('a', None) 2893 state.setdefault('b', None) 2894 self.__dict__ = state 2895 2896ComplexString.__getstate__ = lambda self: self.__dict__.copy() 2897ComplexString.__setstate__ = ComplexString__setstate__ 2898 2899all_structs.append(ComplexNestedWithDefault) 2900ComplexNestedWithDefault.thrift_spec = ( 2901 None, # 0 2902 (1, TType.STRING, 'z', True, "4", 2, ), # 1 2903 (2, TType.STRUCT, 'n', [ComplexString, ComplexString.thrift_spec, False], ComplexString(**{ 2904 "a" : "3", 2905 "b" : { 2906 "a" : 3, 2907 }, 2908 }), 2, ), # 2 2909) 2910 2911ComplexNestedWithDefault.thrift_struct_annotations = { 2912} 2913ComplexNestedWithDefault.thrift_field_annotations = { 2914} 2915 2916def ComplexNestedWithDefault__init__(self, z=ComplexNestedWithDefault.thrift_spec[1][4], n=ComplexNestedWithDefault.thrift_spec[2][4],): 2917 self.z = z 2918 if n is self.thrift_spec[2][4]: 2919 n = ComplexString(**{ 2920 "a" : "3", 2921 "b" : { 2922 "a" : 3, 2923 }, 2924 }) 2925 self.n = n 2926 2927ComplexNestedWithDefault.__init__ = ComplexNestedWithDefault__init__ 2928 2929def ComplexNestedWithDefault__setstate__(self, state): 2930 state.setdefault('z', "4") 2931 state.setdefault('n', ComplexString(**{ 2932 "a" : "3", 2933 "b" : { 2934 "a" : 3, 2935 }, 2936 })) 2937 self.__dict__ = state 2938 2939ComplexNestedWithDefault.__getstate__ = lambda self: self.__dict__.copy() 2940ComplexNestedWithDefault.__setstate__ = ComplexNestedWithDefault__setstate__ 2941 2942all_structs.append(MinPadding) 2943MinPadding.thrift_spec = ( 2944 None, # 0 2945 (1, TType.BYTE, 'small', None, None, 0, ), # 1 2946 (2, TType.I64, 'big', None, None, 0, ), # 2 2947 (3, TType.I16, 'medium', None, None, 0, ), # 3 2948 (4, TType.I32, 'biggish', None, None, 0, ), # 4 2949 (5, TType.BYTE, 'tiny', None, None, 0, ), # 5 2950) 2951 2952MinPadding.thrift_struct_annotations = { 2953 "cpp.minimize_padding": "1", 2954} 2955MinPadding.thrift_field_annotations = { 2956} 2957 2958def MinPadding__init__(self, small=None, big=None, medium=None, biggish=None, tiny=None,): 2959 self.small = small 2960 self.big = big 2961 self.medium = medium 2962 self.biggish = biggish 2963 self.tiny = tiny 2964 2965MinPadding.__init__ = MinPadding__init__ 2966 2967def MinPadding__setstate__(self, state): 2968 state.setdefault('small', None) 2969 state.setdefault('big', None) 2970 state.setdefault('medium', None) 2971 state.setdefault('biggish', None) 2972 state.setdefault('tiny', None) 2973 self.__dict__ = state 2974 2975MinPadding.__getstate__ = lambda self: self.__dict__.copy() 2976MinPadding.__setstate__ = MinPadding__setstate__ 2977 2978all_structs.append(MyStruct) 2979MyStruct.thrift_spec = ( 2980 None, # 0 2981 (1, TType.I64, 'MyIntField', None, None, 2, ), # 1 2982 (2, TType.STRING, 'MyStringField', True, None, 2, ), # 2 2983 (3, TType.I64, 'majorVer', None, None, 2, ), # 3 2984 (4, TType.STRUCT, 'data', [MyDataItem, MyDataItem.thrift_spec, False], None, 2, ), # 4 2985) 2986 2987MyStruct.thrift_struct_annotations = { 2988 "cpp.noncomparable": "1", 2989} 2990MyStruct.thrift_field_annotations = { 2991} 2992 2993def MyStruct__init__(self, MyIntField=None, MyStringField=None, majorVer=None, data=None,): 2994 self.MyIntField = MyIntField 2995 self.MyStringField = MyStringField 2996 self.majorVer = majorVer 2997 self.data = data 2998 2999MyStruct.__init__ = MyStruct__init__ 3000 3001def MyStruct__setstate__(self, state): 3002 state.setdefault('MyIntField', None) 3003 state.setdefault('MyStringField', None) 3004 state.setdefault('majorVer', None) 3005 state.setdefault('data', None) 3006 self.__dict__ = state 3007 3008MyStruct.__getstate__ = lambda self: self.__dict__.copy() 3009MyStruct.__setstate__ = MyStruct__setstate__ 3010 3011all_structs.append(MyDataItem) 3012MyDataItem.thrift_spec = ( 3013) 3014 3015MyDataItem.thrift_struct_annotations = { 3016 "cpp.noncomparable": "1", 3017} 3018MyDataItem.thrift_field_annotations = { 3019} 3020 3021all_structs.append(Renaming) 3022Renaming.thrift_spec = ( 3023 None, # 0 3024 (1, TType.I64, 'foo', None, None, 2, ), # 1 3025) 3026 3027Renaming.thrift_struct_annotations = { 3028} 3029Renaming.thrift_field_annotations = { 3030 1: { 3031 "cpp.name": "bar", 3032 }, 3033} 3034 3035def Renaming__init__(self, foo=None,): 3036 self.foo = foo 3037 3038Renaming.__init__ = Renaming__init__ 3039 3040def Renaming__setstate__(self, state): 3041 state.setdefault('foo', None) 3042 self.__dict__ = state 3043 3044Renaming.__getstate__ = lambda self: self.__dict__.copy() 3045Renaming.__setstate__ = Renaming__setstate__ 3046 3047all_structs.append(AnnotatedTypes) 3048AnnotatedTypes.thrift_spec = ( 3049 None, # 0 3050 (1, TType.STRING, 'binary_field', False, None, 2, ), # 1 3051 (2, TType.LIST, 'list_field', (TType.MAP,(TType.I32,None,TType.STRING,True)), None, 2, ), # 2 3052) 3053 3054AnnotatedTypes.thrift_struct_annotations = { 3055} 3056AnnotatedTypes.thrift_field_annotations = { 3057} 3058 3059def AnnotatedTypes__init__(self, binary_field=None, list_field=None,): 3060 self.binary_field = binary_field 3061 self.list_field = list_field 3062 3063AnnotatedTypes.__init__ = AnnotatedTypes__init__ 3064 3065def AnnotatedTypes__setstate__(self, state): 3066 state.setdefault('binary_field', None) 3067 state.setdefault('list_field', None) 3068 self.__dict__ = state 3069 3070AnnotatedTypes.__getstate__ = lambda self: self.__dict__.copy() 3071AnnotatedTypes.__setstate__ = AnnotatedTypes__setstate__ 3072 3073all_structs.append(ForwardUsageRoot) 3074ForwardUsageRoot.thrift_spec = ( 3075 None, # 0 3076 (1, TType.STRUCT, 'ForwardUsageStruct', [ForwardUsageStruct, ForwardUsageStruct.thrift_spec, False], None, 1, ), # 1 3077 (2, TType.STRUCT, 'ForwardUsageByRef', [ForwardUsageByRef, ForwardUsageByRef.thrift_spec, False], None, 1, ), # 2 3078) 3079 3080ForwardUsageRoot.thrift_struct_annotations = { 3081} 3082ForwardUsageRoot.thrift_field_annotations = { 3083 2: { 3084 "cpp.ref": "true", 3085 }, 3086} 3087 3088def ForwardUsageRoot__init__(self, ForwardUsageStruct=None, ForwardUsageByRef=None,): 3089 self.ForwardUsageStruct = ForwardUsageStruct 3090 self.ForwardUsageByRef = ForwardUsageByRef 3091 3092ForwardUsageRoot.__init__ = ForwardUsageRoot__init__ 3093 3094def ForwardUsageRoot__setstate__(self, state): 3095 state.setdefault('ForwardUsageStruct', None) 3096 state.setdefault('ForwardUsageByRef', None) 3097 self.__dict__ = state 3098 3099ForwardUsageRoot.__getstate__ = lambda self: self.__dict__.copy() 3100ForwardUsageRoot.__setstate__ = ForwardUsageRoot__setstate__ 3101 3102all_structs.append(ForwardUsageStruct) 3103ForwardUsageStruct.thrift_spec = ( 3104 None, # 0 3105 (1, TType.STRUCT, 'foo', [ForwardUsageRoot, ForwardUsageRoot.thrift_spec, False], None, 1, ), # 1 3106) 3107 3108ForwardUsageStruct.thrift_struct_annotations = { 3109} 3110ForwardUsageStruct.thrift_field_annotations = { 3111} 3112 3113def ForwardUsageStruct__init__(self, foo=None,): 3114 self.foo = foo 3115 3116ForwardUsageStruct.__init__ = ForwardUsageStruct__init__ 3117 3118def ForwardUsageStruct__setstate__(self, state): 3119 state.setdefault('foo', None) 3120 self.__dict__ = state 3121 3122ForwardUsageStruct.__getstate__ = lambda self: self.__dict__.copy() 3123ForwardUsageStruct.__setstate__ = ForwardUsageStruct__setstate__ 3124 3125all_structs.append(ForwardUsageByRef) 3126ForwardUsageByRef.thrift_spec = ( 3127 None, # 0 3128 (1, TType.STRUCT, 'foo', [ForwardUsageRoot, ForwardUsageRoot.thrift_spec, False], None, 1, ), # 1 3129) 3130 3131ForwardUsageByRef.thrift_struct_annotations = { 3132} 3133ForwardUsageByRef.thrift_field_annotations = { 3134} 3135 3136def ForwardUsageByRef__init__(self, foo=None,): 3137 self.foo = foo 3138 3139ForwardUsageByRef.__init__ = ForwardUsageByRef__init__ 3140 3141def ForwardUsageByRef__setstate__(self, state): 3142 state.setdefault('foo', None) 3143 self.__dict__ = state 3144 3145ForwardUsageByRef.__getstate__ = lambda self: self.__dict__.copy() 3146ForwardUsageByRef.__setstate__ = ForwardUsageByRef__setstate__ 3147 3148all_structs.append(NoexceptMoveEmpty) 3149NoexceptMoveEmpty.thrift_spec = ( 3150) 3151 3152NoexceptMoveEmpty.thrift_struct_annotations = { 3153} 3154NoexceptMoveEmpty.thrift_field_annotations = { 3155} 3156 3157all_structs.append(NoexceptMoveSimpleStruct) 3158NoexceptMoveSimpleStruct.thrift_spec = ( 3159 None, # 0 3160 (1, TType.I64, 'boolField', None, None, 2, ), # 1 3161) 3162 3163NoexceptMoveSimpleStruct.thrift_struct_annotations = { 3164} 3165NoexceptMoveSimpleStruct.thrift_field_annotations = { 3166} 3167 3168def NoexceptMoveSimpleStruct__init__(self, boolField=None,): 3169 self.boolField = boolField 3170 3171NoexceptMoveSimpleStruct.__init__ = NoexceptMoveSimpleStruct__init__ 3172 3173def NoexceptMoveSimpleStruct__setstate__(self, state): 3174 state.setdefault('boolField', None) 3175 self.__dict__ = state 3176 3177NoexceptMoveSimpleStruct.__getstate__ = lambda self: self.__dict__.copy() 3178NoexceptMoveSimpleStruct.__setstate__ = NoexceptMoveSimpleStruct__setstate__ 3179 3180all_structs.append(NoexceptMoveComplexStruct) 3181NoexceptMoveComplexStruct.thrift_spec = ( 3182 None, # 0 3183 (1, TType.BOOL, 'MyBoolField', None, None, 2, ), # 1 3184 (2, TType.I64, 'MyIntField', None, 12, 2, ), # 2 3185 (3, TType.STRING, 'MyStringField', True, "test", 2, ), # 3 3186 (4, TType.STRING, 'MyStringField2', True, None, 2, ), # 4 3187 (5, TType.STRING, 'MyBinaryField', False, None, 2, ), # 5 3188 (6, TType.STRING, 'MyBinaryField2', False, None, 1, ), # 6 3189 (7, TType.STRING, 'MyBinaryField3', False, None, 0, ), # 7 3190 (8, TType.LIST, 'MyBinaryListField4', (TType.STRING,False), None, 2, ), # 8 3191 (9, TType.MAP, 'MyMapEnumAndInt', (TType.I32,MyEnumA,TType.STRING,True), { 3192 1 : "fieldA", 3193 4 : "fieldC", 3194 }, 2, ), # 9 3195) 3196 3197NoexceptMoveComplexStruct.thrift_struct_annotations = { 3198} 3199NoexceptMoveComplexStruct.thrift_field_annotations = { 3200} 3201 3202def NoexceptMoveComplexStruct__init__(self, MyBoolField=None, MyIntField=NoexceptMoveComplexStruct.thrift_spec[2][4], MyStringField=NoexceptMoveComplexStruct.thrift_spec[3][4], MyStringField2=None, MyBinaryField=None, MyBinaryField2=None, MyBinaryField3=None, MyBinaryListField4=None, MyMapEnumAndInt=NoexceptMoveComplexStruct.thrift_spec[9][4],): 3203 self.MyBoolField = MyBoolField 3204 self.MyIntField = MyIntField 3205 self.MyStringField = MyStringField 3206 self.MyStringField2 = MyStringField2 3207 self.MyBinaryField = MyBinaryField 3208 self.MyBinaryField2 = MyBinaryField2 3209 self.MyBinaryField3 = MyBinaryField3 3210 self.MyBinaryListField4 = MyBinaryListField4 3211 if MyMapEnumAndInt is self.thrift_spec[9][4]: 3212 MyMapEnumAndInt = { 3213 1 : "fieldA", 3214 4 : "fieldC", 3215 } 3216 self.MyMapEnumAndInt = MyMapEnumAndInt 3217 3218NoexceptMoveComplexStruct.__init__ = NoexceptMoveComplexStruct__init__ 3219 3220def NoexceptMoveComplexStruct__setstate__(self, state): 3221 state.setdefault('MyBoolField', None) 3222 state.setdefault('MyIntField', 12) 3223 state.setdefault('MyStringField', "test") 3224 state.setdefault('MyStringField2', None) 3225 state.setdefault('MyBinaryField', None) 3226 state.setdefault('MyBinaryField2', None) 3227 state.setdefault('MyBinaryField3', None) 3228 state.setdefault('MyBinaryListField4', None) 3229 state.setdefault('MyMapEnumAndInt', { 3230 1 : "fieldA", 3231 4 : "fieldC", 3232 }) 3233 self.__dict__ = state 3234 3235NoexceptMoveComplexStruct.__getstate__ = lambda self: self.__dict__.copy() 3236NoexceptMoveComplexStruct.__setstate__ = NoexceptMoveComplexStruct__setstate__ 3237 3238all_structs.append(NoExceptMoveUnion) 3239NoExceptMoveUnion.thrift_spec = ( 3240 None, # 0 3241 (1, TType.STRING, 'string_field', True, None, 2, ), # 1 3242 (2, TType.I32, 'i32_field', None, None, 2, ), # 2 3243) 3244 3245NoExceptMoveUnion.thrift_struct_annotations = { 3246} 3247NoExceptMoveUnion.thrift_field_annotations = { 3248} 3249 3250def NoExceptMoveUnion__init__(self, string_field=None, i32_field=None,): 3251 self.field = 0 3252 self.value = None 3253 if string_field is not None: 3254 assert self.field == 0 and self.value is None 3255 self.field = 1 3256 self.value = string_field 3257 if i32_field is not None: 3258 assert self.field == 0 and self.value is None 3259 self.field = 2 3260 self.value = i32_field 3261 3262NoExceptMoveUnion.__init__ = NoExceptMoveUnion__init__ 3263 3264all_structs.append(AllocatorAware) 3265AllocatorAware.thrift_spec = ( 3266 None, # 0 3267 (1, TType.LIST, 'aa_list', (TType.I32,None), None, 2, ), # 1 3268 (2, TType.SET, 'aa_set', (TType.I32,None), None, 2, ), # 2 3269 (3, TType.MAP, 'aa_map', (TType.I32,None,TType.I32,None), None, 2, ), # 3 3270 (4, TType.STRING, 'aa_string', True, None, 2, ), # 4 3271 (5, TType.I32, 'not_a_container', None, None, 2, ), # 5 3272) 3273 3274AllocatorAware.thrift_struct_annotations = { 3275 "cpp.allocator": "some_allocator", 3276} 3277AllocatorAware.thrift_field_annotations = { 3278} 3279 3280def AllocatorAware__init__(self, aa_list=None, aa_set=None, aa_map=None, aa_string=None, not_a_container=None,): 3281 self.aa_list = aa_list 3282 self.aa_set = aa_set 3283 self.aa_map = aa_map 3284 self.aa_string = aa_string 3285 self.not_a_container = not_a_container 3286 3287AllocatorAware.__init__ = AllocatorAware__init__ 3288 3289def AllocatorAware__setstate__(self, state): 3290 state.setdefault('aa_list', None) 3291 state.setdefault('aa_set', None) 3292 state.setdefault('aa_map', None) 3293 state.setdefault('aa_string', None) 3294 state.setdefault('not_a_container', None) 3295 self.__dict__ = state 3296 3297AllocatorAware.__getstate__ = lambda self: self.__dict__.copy() 3298AllocatorAware.__setstate__ = AllocatorAware__setstate__ 3299 3300all_structs.append(AllocatorAware2) 3301AllocatorAware2.thrift_spec = ( 3302 None, # 0 3303 (1, TType.I32, 'not_a_container', None, None, 2, ), # 1 3304) 3305 3306AllocatorAware2.thrift_struct_annotations = { 3307 "cpp.allocator": "some_allocator", 3308} 3309AllocatorAware2.thrift_field_annotations = { 3310} 3311 3312def AllocatorAware2__init__(self, not_a_container=None,): 3313 self.not_a_container = not_a_container 3314 3315AllocatorAware2.__init__ = AllocatorAware2__init__ 3316 3317def AllocatorAware2__setstate__(self, state): 3318 state.setdefault('not_a_container', None) 3319 self.__dict__ = state 3320 3321AllocatorAware2.__getstate__ = lambda self: self.__dict__.copy() 3322AllocatorAware2.__setstate__ = AllocatorAware2__setstate__ 3323 3324all_structs.append(TypedefStruct) 3325TypedefStruct.thrift_spec = ( 3326 None, # 0 3327 (1, TType.I32, 'i32_field', None, None, 2, ), # 1 3328 (2, TType.I32, 'IntTypedef_field', None, None, 2, ), # 2 3329 (3, TType.I32, 'UintTypedef_field', None, None, 2, ), # 3 3330) 3331 3332TypedefStruct.thrift_struct_annotations = { 3333} 3334TypedefStruct.thrift_field_annotations = { 3335} 3336 3337def TypedefStruct__init__(self, i32_field=None, IntTypedef_field=None, UintTypedef_field=None,): 3338 self.i32_field = i32_field 3339 self.IntTypedef_field = IntTypedef_field 3340 self.UintTypedef_field = UintTypedef_field 3341 3342TypedefStruct.__init__ = TypedefStruct__init__ 3343 3344def TypedefStruct__setstate__(self, state): 3345 state.setdefault('i32_field', None) 3346 state.setdefault('IntTypedef_field', None) 3347 state.setdefault('UintTypedef_field', None) 3348 self.__dict__ = state 3349 3350TypedefStruct.__getstate__ = lambda self: self.__dict__.copy() 3351TypedefStruct.__setstate__ = TypedefStruct__setstate__ 3352 3353all_structs.append(StructWithDoubleUnderscores) 3354StructWithDoubleUnderscores.thrift_spec = ( 3355 None, # 0 3356 (1, TType.I32, '__field', None, None, 2, ), # 1 3357) 3358 3359StructWithDoubleUnderscores.thrift_struct_annotations = { 3360} 3361StructWithDoubleUnderscores.thrift_field_annotations = { 3362} 3363 3364def StructWithDoubleUnderscores__init__(self, __field=None,): 3365 self.__field = __field 3366 3367StructWithDoubleUnderscores.__init__ = StructWithDoubleUnderscores__init__ 3368 3369def StructWithDoubleUnderscores__setstate__(self, state): 3370 state.setdefault('__field', None) 3371 self.__dict__ = state 3372 3373StructWithDoubleUnderscores.__getstate__ = lambda self: self.__dict__.copy() 3374StructWithDoubleUnderscores.__setstate__ = StructWithDoubleUnderscores__setstate__ 3375 3376fix_spec(all_structs) 3377del all_structs 3378