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.
| 866 | CreateFolderBatchResultEntry_validator = bv.Union(CreateFolderBatchResultEntry) |
| 867 | |
| 868 | class CreateFolderEntryError(bb.Union): |
| 869 | """ |
| 870 | This class acts as a tagged union. Only one of the ``is_*`` methods will |
| 871 | return true. To get the associated value of a tag (if one exists), use the |
| 872 | corresponding ``get_*`` method. |
| 873 | """ |
| 874 | |
| 875 | _catch_all = 'other' |
| 876 | # Attribute is overwritten below the class definition |
| 877 | other = None |
| 878 | |
| 879 | @classmethod |
| 880 | def path(cls, val): |
| 881 | """ |
| 882 | Create an instance of this class set to the ``path`` tag with value |
| 883 | ``val``. |
| 884 | |
| 885 | :param WriteError val: |
| 886 | :rtype: CreateFolderEntryError |
| 887 | """ |
| 888 | return cls('path', val) |
| 889 | |
| 890 | def is_path(self): |
| 891 | """ |
| 892 | Check if the union tag is ``path``. |
| 893 | |
| 894 | :rtype: bool |
| 895 | """ |
| 896 | return self._tag == 'path' |
| 897 | |
| 898 | def is_other(self): |
| 899 | """ |
| 900 | Check if the union tag is ``other``. |
| 901 | |
| 902 | :rtype: bool |
| 903 | """ |
| 904 | return self._tag == 'other' |
| 905 | |
| 906 | def get_path(self): |
| 907 | """ |
| 908 | Only call this if :meth:`is_path` is true. |
| 909 | |
| 910 | :rtype: WriteError |
| 911 | """ |
| 912 | if not self.is_path(): |
| 913 | raise AttributeError("tag 'path' not set") |
| 914 | return self._value |
| 915 | |
| 916 | def _process_custom_annotations(self, annotation_type, field_path, processor): |
| 917 | super(CreateFolderEntryError, self)._process_custom_annotations(annotation_type, field_path, processor) |
| 918 | |
| 919 | CreateFolderEntryError_validator = bv.Union(CreateFolderEntryError) |
| 920 |