def root(self): """The root folder of the drive.""" if self.is_property_available("root"): return self.properties['root'] else: return DriveItem(self.context, ResourcePath("root", self.resource_path))
def driveItem(self): """For document libraries, the driveItem relationship exposes the listItem as a driveItem.""" if self.is_property_available('driveItem'): return self.properties['driveItem'] else: from office365.graph.onedrive.driveItem import DriveItem return DriveItem(self.context, ResourcePath("driveItem", self.resource_path))
def get_by_url(self, url): """Retrieve DriveItem by url""" return DriveItem(self.context, ResourcePathUrl(url, self.resource_path))
def get_by_id(self, _id): """Retrieve DriveItem by id""" return DriveItem(self.context, ResourcePath(_id, self.resource_path))
def __init__(self, parent_entity, name, content): return_type = DriveItem( parent_entity.context, ResourcePathUrl(name, parent_entity.resource_path)) super(UploadContentQuery, self).__init__(return_type, "content", None, content, None, return_type)