Result returned by :meth:`dropbox.dropbox_client.Dropbox.files_delete_batch` that may either launch an asynchronous job or complete synchronously. 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 exis
| 1202 | DeleteBatchJobStatus_validator = bv.Union(DeleteBatchJobStatus) |
| 1203 | |
| 1204 | class DeleteBatchLaunch(async_.LaunchResultBase): |
| 1205 | """ |
| 1206 | Result returned by :meth:`dropbox.dropbox_client.Dropbox.files_delete_batch` |
| 1207 | that may either launch an asynchronous job or complete synchronously. |
| 1208 | |
| 1209 | This class acts as a tagged union. Only one of the ``is_*`` methods will |
| 1210 | return true. To get the associated value of a tag (if one exists), use the |
| 1211 | corresponding ``get_*`` method. |
| 1212 | """ |
| 1213 | |
| 1214 | _catch_all = 'other' |
| 1215 | # Attribute is overwritten below the class definition |
| 1216 | other = None |
| 1217 | |
| 1218 | @classmethod |
| 1219 | def complete(cls, val): |
| 1220 | """ |
| 1221 | Create an instance of this class set to the ``complete`` tag with value |
| 1222 | ``val``. |
| 1223 | |
| 1224 | :param DeleteBatchResult val: |
| 1225 | :rtype: DeleteBatchLaunch |
| 1226 | """ |
| 1227 | return cls('complete', val) |
| 1228 | |
| 1229 | def is_complete(self): |
| 1230 | """ |
| 1231 | Check if the union tag is ``complete``. |
| 1232 | |
| 1233 | :rtype: bool |
| 1234 | """ |
| 1235 | return self._tag == 'complete' |
| 1236 | |
| 1237 | def is_other(self): |
| 1238 | """ |
| 1239 | Check if the union tag is ``other``. |
| 1240 | |
| 1241 | :rtype: bool |
| 1242 | """ |
| 1243 | return self._tag == 'other' |
| 1244 | |
| 1245 | def get_complete(self): |
| 1246 | """ |
| 1247 | Only call this if :meth:`is_complete` is true. |
| 1248 | |
| 1249 | :rtype: DeleteBatchResult |
| 1250 | """ |
| 1251 | if not self.is_complete(): |
| 1252 | raise AttributeError("tag 'complete' not set") |
| 1253 | return self._value |
| 1254 | |
| 1255 | def _process_custom_annotations(self, annotation_type, field_path, processor): |
| 1256 | super(DeleteBatchLaunch, self)._process_custom_annotations(annotation_type, field_path, processor) |
| 1257 | |
| 1258 | DeleteBatchLaunch_validator = bv.Union(DeleteBatchLaunch) |
| 1259 |