Result returned by methods that poll for the status of an asynchronous job. Unions that extend this union should add a 'complete' field with a type of the information returned upon job completion. See :class:`PollEmptyResult` for an example. This class acts as a tagged union. O
| 122 | PollArg_validator = bv.Struct(PollArg) |
| 123 | |
| 124 | class PollResultBase(bb.Union): |
| 125 | """ |
| 126 | Result returned by methods that poll for the status of an asynchronous job. |
| 127 | Unions that extend this union should add a 'complete' field with a type of |
| 128 | the information returned upon job completion. See :class:`PollEmptyResult` |
| 129 | for an example. |
| 130 | |
| 131 | This class acts as a tagged union. Only one of the ``is_*`` methods will |
| 132 | return true. To get the associated value of a tag (if one exists), use the |
| 133 | corresponding ``get_*`` method. |
| 134 | |
| 135 | :ivar async.PollResultBase.in_progress: The asynchronous job is still in |
| 136 | progress. |
| 137 | """ |
| 138 | |
| 139 | _catch_all = None |
| 140 | # Attribute is overwritten below the class definition |
| 141 | in_progress = None |
| 142 | |
| 143 | def is_in_progress(self): |
| 144 | """ |
| 145 | Check if the union tag is ``in_progress``. |
| 146 | |
| 147 | :rtype: bool |
| 148 | """ |
| 149 | return self._tag == 'in_progress' |
| 150 | |
| 151 | def _process_custom_annotations(self, annotation_type, field_path, processor): |
| 152 | super(PollResultBase, self)._process_custom_annotations(annotation_type, field_path, processor) |
| 153 | |
| 154 | PollResultBase_validator = bv.Union(PollResultBase) |
| 155 |