This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method.
| 780 | InviteeInfoWithPermissionLevel_validator = bv.Struct(InviteeInfoWithPermissionLevel) |
| 781 | |
| 782 | class ListDocsCursorError(bb.Union): |
| 783 | """ |
| 784 | This class acts as a tagged union. Only one of the ``is_*`` methods will |
| 785 | return true. To get the associated value of a tag (if one exists), use the |
| 786 | corresponding ``get_*`` method. |
| 787 | """ |
| 788 | |
| 789 | _catch_all = 'other' |
| 790 | # Attribute is overwritten below the class definition |
| 791 | other = None |
| 792 | |
| 793 | @classmethod |
| 794 | def cursor_error(cls, val): |
| 795 | """ |
| 796 | Create an instance of this class set to the ``cursor_error`` tag with |
| 797 | value ``val``. |
| 798 | |
| 799 | :param PaperApiCursorError val: |
| 800 | :rtype: ListDocsCursorError |
| 801 | """ |
| 802 | return cls('cursor_error', val) |
| 803 | |
| 804 | def is_cursor_error(self): |
| 805 | """ |
| 806 | Check if the union tag is ``cursor_error``. |
| 807 | |
| 808 | :rtype: bool |
| 809 | """ |
| 810 | return self._tag == 'cursor_error' |
| 811 | |
| 812 | def is_other(self): |
| 813 | """ |
| 814 | Check if the union tag is ``other``. |
| 815 | |
| 816 | :rtype: bool |
| 817 | """ |
| 818 | return self._tag == 'other' |
| 819 | |
| 820 | def get_cursor_error(self): |
| 821 | """ |
| 822 | Only call this if :meth:`is_cursor_error` is true. |
| 823 | |
| 824 | :rtype: PaperApiCursorError |
| 825 | """ |
| 826 | if not self.is_cursor_error(): |
| 827 | raise AttributeError("tag 'cursor_error' not set") |
| 828 | return self._value |
| 829 | |
| 830 | def _process_custom_annotations(self, annotation_type, field_path, processor): |
| 831 | super(ListDocsCursorError, self)._process_custom_annotations(annotation_type, field_path, processor) |
| 832 | |
| 833 | ListDocsCursorError_validator = bv.Union(ListDocsCursorError) |
| 834 |