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

Class DownloadError

dropbox/files.py:1690–1753  ·  view source on GitHub ↗

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. :ivar files.DownloadError.unsupported_file: This file type cannot be downloaded directly; use

Source from the content-addressed store, hash-verified

1688DownloadArg_validator = bv.Struct(DownloadArg)
1689
1690class DownloadError(bb.Union):
1691 """
1692 This class acts as a tagged union. Only one of the ``is_*`` methods will
1693 return true. To get the associated value of a tag (if one exists), use the
1694 corresponding ``get_*`` method.
1695
1696 :ivar files.DownloadError.unsupported_file: This file type cannot be
1697 downloaded directly; use
1698 :meth:`dropbox.dropbox_client.Dropbox.files_export` instead.
1699 """
1700
1701 _catch_all = 'other'
1702 # Attribute is overwritten below the class definition
1703 unsupported_file = None
1704 # Attribute is overwritten below the class definition
1705 other = None
1706
1707 @classmethod
1708 def path(cls, val):
1709 """
1710 Create an instance of this class set to the ``path`` tag with value
1711 ``val``.
1712
1713 :param LookupError val:
1714 :rtype: DownloadError
1715 """
1716 return cls('path', val)
1717
1718 def is_path(self):
1719 """
1720 Check if the union tag is ``path``.
1721
1722 :rtype: bool
1723 """
1724 return self._tag == 'path'
1725
1726 def is_unsupported_file(self):
1727 """
1728 Check if the union tag is ``unsupported_file``.
1729
1730 :rtype: bool
1731 """
1732 return self._tag == 'unsupported_file'
1733
1734 def is_other(self):
1735 """
1736 Check if the union tag is ``other``.
1737
1738 :rtype: bool
1739 """
1740 return self._tag == 'other'
1741
1742 def get_path(self):
1743 """
1744 Only call this if :meth:`is_path` is true.
1745
1746 :rtype: LookupError
1747 """

Callers 1

files.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected