MCPcopy Index your code
hub / github.com/O365/python-o365 / get_versions

Method get_versions

O365/drive.py:797–817  ·  view source on GitHub ↗

Returns a list of available versions for this item :return: list of versions :rtype: list[DriveItemVersion]

(self)

Source from the content-addressed store, hash-verified

795 return CopyOperation(parent=self.drive, item_id=item_id, target=target_drive)
796
797 def get_versions(self):
798 """ Returns a list of available versions for this item
799
800 :return: list of versions
801 :rtype: list[DriveItemVersion]
802 """
803
804 if not self.object_id:
805 return []
806 url = self.build_url(
807 self._endpoints.get('versions').format(id=self.object_id))
808
809 response = self.con.get(url)
810 if not response:
811 return []
812
813 data = response.json()
814
815 # Everything received from cloud must be passed as self._cloud_data_key
816 return [DriveItemVersion(parent=self, **{self._cloud_data_key: item})
817 for item in data.get('value', [])]
818
819 def get_version(self, version_id):
820 """ Returns a version for specified id

Callers

nothing calls this directly

Calls 4

DriveItemVersionClass · 0.85
build_urlMethod · 0.80
jsonMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected