| 3491 | |
| 3492 | @functools.total_ordering |
| 3493 | class AccountMessage(object): |
| 3494 | __slots__ = "body", |
| 3495 | |
| 3496 | def __init__(self, body=None): |
| 3497 | if body is None: |
| 3498 | body = Account() |
| 3499 | self.body = body |
| 3500 | |
| 3501 | # Struct shallow copy |
| 3502 | def copy(self, other): |
| 3503 | self.body = other.body |
| 3504 | return self |
| 3505 | |
| 3506 | # Struct deep clone |
| 3507 | def clone(self): |
| 3508 | # Serialize the struct to the FBE stream |
| 3509 | writer = AccountMessageModel(fbe.WriteBuffer()) |
| 3510 | writer.serialize(self) |
| 3511 | |
| 3512 | # Deserialize the struct from the FBE stream |
| 3513 | reader = AccountMessageModel(fbe.ReadBuffer()) |
| 3514 | reader.attach_buffer(writer.buffer) |
| 3515 | return reader.deserialize()[0] |
| 3516 | |
| 3517 | def __eq__(self, other): |
| 3518 | if not isinstance(self, other.__class__): |
| 3519 | return NotImplemented |
| 3520 | return True |
| 3521 | |
| 3522 | def __lt__(self, other): |
| 3523 | if not isinstance(self, other.__class__): |
| 3524 | return NotImplemented |
| 3525 | return False |
| 3526 | |
| 3527 | @property |
| 3528 | def __key__(self): |
| 3529 | return () |
| 3530 | |
| 3531 | def __hash__(self): |
| 3532 | return hash(self.__key__) |
| 3533 | |
| 3534 | def __format__(self, format_spec): |
| 3535 | return self.__str__() |
| 3536 | |
| 3537 | def __str__(self): |
| 3538 | sb = list() |
| 3539 | sb.append("AccountMessage(") |
| 3540 | sb.append("body=") |
| 3541 | sb.append(str(self.body)) |
| 3542 | sb.append(")") |
| 3543 | return "".join(sb) |
| 3544 | |
| 3545 | # Get struct JSON value |
| 3546 | def to_json(self): |
| 3547 | return json.dumps(self.__to_json__(), cls=fbe.JSONEncoder, separators=(',', ':')) |
| 3548 | |
| 3549 | def __to_json__(self): |
| 3550 | result = dict() |
no outgoing calls
no test coverage detected