MCPcopy Create free account
hub / github.com/dropbox/dropbox-sdk-python / CreateFolderBatchLaunch

Class CreateFolderBatchLaunch

dropbox/files.py:696–749  ·  view source on GitHub ↗

Result returned by :meth:`dropbox.dropbox_client.Dropbox.files_create_folder_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 (

Source from the content-addressed store, hash-verified

694CreateFolderBatchJobStatus_validator = bv.Union(CreateFolderBatchJobStatus)
695
696class CreateFolderBatchLaunch(async_.LaunchResultBase):
697 """
698 Result returned by
699 :meth:`dropbox.dropbox_client.Dropbox.files_create_folder_batch` that may
700 either launch an asynchronous job or complete synchronously.
701
702 This class acts as a tagged union. Only one of the ``is_*`` methods will
703 return true. To get the associated value of a tag (if one exists), use the
704 corresponding ``get_*`` method.
705 """
706
707 _catch_all = 'other'
708 # Attribute is overwritten below the class definition
709 other = None
710
711 @classmethod
712 def complete(cls, val):
713 """
714 Create an instance of this class set to the ``complete`` tag with value
715 ``val``.
716
717 :param CreateFolderBatchResult val:
718 :rtype: CreateFolderBatchLaunch
719 """
720 return cls('complete', val)
721
722 def is_complete(self):
723 """
724 Check if the union tag is ``complete``.
725
726 :rtype: bool
727 """
728 return self._tag == 'complete'
729
730 def is_other(self):
731 """
732 Check if the union tag is ``other``.
733
734 :rtype: bool
735 """
736 return self._tag == 'other'
737
738 def get_complete(self):
739 """
740 Only call this if :meth:`is_complete` is true.
741
742 :rtype: CreateFolderBatchResult
743 """
744 if not self.is_complete():
745 raise AttributeError("tag 'complete' not set")
746 return self._value
747
748 def _process_custom_annotations(self, annotation_type, field_path, processor):
749 super(CreateFolderBatchLaunch, self)._process_custom_annotations(annotation_type, field_path, processor)
750
751CreateFolderBatchLaunch_validator = bv.Union(CreateFolderBatchLaunch)
752

Callers 1

files.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected