Example #1
0
 def drive_item(self):
     """For document libraries, the driveItem relationship exposes the listItem as a driveItem."""
     from office365.onedrive.driveitems.driveItem import DriveItem
     return self.properties.get(
         'driveItem',
         DriveItem(self.context,
                   ResourcePath("driveItem", self.resource_path)))
Example #2
0
 def drive_item(self):
     """Used to access the underlying driveItem
     """
     return self.properties.get(
         'driveItem',
         DriveItem(self.context,
                   ResourcePath("driveItem", self.resource_path)))
Example #3
0
 def root(self):
     """Used to access the underlying driveItem.
     Deprecated -- use driveItem instead.
     """
     return self.properties.get(
         'root',
         DriveItem(self.context, RootResourcePath(self.resource_path)))
Example #4
0
 def return_type(self):
     if self._return_type is None:
         self._return_type = DriveItem(
             self.context,
             ResourcePathUrl(self.file_name,
                             self._binding_type.resource_path))
     return self._return_type
Example #5
0
    def root(self):
        """The root folder of the drive.

        :rtype: DriveItem
        """
        return self.get_property(
            'root',
            DriveItem(self.context, RootResourcePath(self.resource_path)))
def create_upload_content_query(folder_item, name, content=None):
    """

    :param office365.onedrive.driveItem.DriveItem folder_item: Folder (container)
    :param str name: a file name
    :param str content: a file content
    """
    from office365.onedrive.driveitems.driveItem import DriveItem
    file_item = DriveItem(folder_item.context, ResourcePathUrl(name, folder_item.resource_path))
    qry = ServiceOperationQuery(file_item, "content", None, content, None, file_item)

    def _modify_query(request):
        """
        :type request: office365.runtime.http.request_options.RequestOptions
        """
        request.method = HttpMethod.Put
    folder_item.context.before_execute(_modify_query)
    return qry
Example #7
0
 def files_folder(self):
     """Get the metadata for the location where the files of a channel are stored."""
     return self.properties.get('filesFolder',
                                DriveItem(self.context, ResourcePath("filesFolder", self.resource_path)))
 def root(self):
     """The root folder of the drive."""
     return self.properties.get(
         'root', DriveItem(self.context, RootPath(self.resource_path)))
Example #9
0
 def binding_type(self):
     return DriveItem(
         self.context,
         ResourcePathUrl(self.file_name, self._binding_type.resource_path))