| 595 | |
| 596 | |
| 597 | class MutationResult(Result): |
| 598 | def __init__(self, |
| 599 | orig, # type: pycbc_result |
| 600 | key=None, # type: Optional[str] |
| 601 | ): |
| 602 | super().__init__(orig, key=key) |
| 603 | self._raw_mutation_token = self._orig.raw_result.get('token', None) |
| 604 | self._mutation_token = None |
| 605 | |
| 606 | def mutation_token(self) -> Optional[MutationToken]: |
| 607 | """Get the operation's mutation token, if it exists. |
| 608 | |
| 609 | Returns: |
| 610 | Optional[:class:`.MutationToken`]: The operation's mutation token. |
| 611 | """ |
| 612 | if self._raw_mutation_token is not None and self._mutation_token is None: |
| 613 | self._mutation_token = MutationToken(self._raw_mutation_token) |
| 614 | return self._mutation_token |
| 615 | |
| 616 | def __repr__(self): |
| 617 | return "MutationResult:{}".format(self._orig) |
| 618 | |
| 619 | |
| 620 | class MultiMutationResult: |