def drive(self):
     """Retrieve the properties and relationships of a Drive resource."""
     if self.is_property_available('drive'):
         return self.properties['drive']
     else:
         return Drive(self.context, ResourcePath("drive",
                                                 self.resourcePath))
Ejemplo n.º 2
0
 def drive(self):
     """The default drive (document library) for this site."""
     if self.is_property_available('drive'):
         return self.properties['drive']
     else:
         return Drive(self.context, ResourcePath("drive",
                                                 self.resourcePath))
Ejemplo n.º 3
0
 def drive(self):
     """Only present on document libraries. Allows access to the list as a drive resource with driveItems."""
     if self.is_property_available('drive'):
         return self.properties['drive']
     else:
         from office365.onedrive.drive import Drive
         return Drive(self.context, ResourcePath("drive", self.resourcePath))
Ejemplo n.º 4
0
    def __getitem__(self, key):
        """

        :param key: key is used to address a Drive resource by either an index in collection
        or by drive id
        :type key: int or str
        """
        if type(key) == int:
            return super(DriveCollection, self).__getitem__(key)
        return Drive(self.context, ResourcePath(key, self.resource_path))
Ejemplo n.º 5
0
 def drive(self):
     """Retrieve the properties and relationships of a Drive resource."""
     return self.properties.get(
         'drive',
         Drive(self.context, ResourcePath("drive", self.resource_path)))
Ejemplo n.º 6
0
 def get_by_id(self, drive_id):
     """Retrieve Drive by unique identifier"""
     return Drive(
         self.context,
         ResourcePathEntity(self.context, self.resource_path, drive_id))
Ejemplo n.º 7
0
 def get_by_id(self, url):
     """Retrieve DriveItem by url"""
     return Drive(self.context,
                  ResourcePathEntity(self.context, self.resourcePath, url))
Ejemplo n.º 8
0
 def drive(self):
     """Only present on document libraries. Allows access to the list as a drive resource with driveItems."""
     from office365.onedrive.drive import Drive
     return self.properties.get(
         'drive',
         Drive(self.context, ResourcePath("drive", self.resource_path)))