| 831 | |
| 832 | |
| 833 | class CounterResult(MutationResult): |
| 834 | |
| 835 | # Uncomment and delete previous property when ready to remove cas CounterResult. |
| 836 | # cas = RemoveProperty('cas') |
| 837 | |
| 838 | @property |
| 839 | def cas(self) -> int: |
| 840 | """ |
| 841 | .. warning:: |
| 842 | This property is deprecated and will be removed in a future version. |
| 843 | |
| 844 | int: **DEPRECATED** The CAS of the document. |
| 845 | """ |
| 846 | return self._orig.raw_result.get("cas", 0) |
| 847 | |
| 848 | @property |
| 849 | def content(self) -> Optional[int]: |
| 850 | """ |
| 851 | Optional[int]: The value of the document after the operation completed. |
| 852 | """ |
| 853 | return self._orig.raw_result.get("content", None) |
| 854 | |
| 855 | def __repr__(self): |
| 856 | # Uncomment and delete previous return when ready to remove cas from CounterResult. Or, ideally, |
| 857 | # remove cas from the cxx client's response. |
| 858 | # return "CounterResult:{}".format({k:v for k,v in self._orig.raw_result.items() if k != 'cas'}) |
| 859 | return "CounterResult:{}".format(self._orig.raw_result) |
| 860 | |
| 861 | |
| 862 | class MultiCounterResult: |