How to use the onedrivesdk.ItemReference function in onedrivesdk

To help you get started, we’ve selected a few onedrivesdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xybu / onedrived-dev / onedrived / od_tasks / move_item.py View on Github external
def _get_new_item(self):
        item = Item()
        if self.new_parent_relpath != self.parent_relpath:
            ref = ItemReference()
            # Refer to https://dev.onedrive.com/items/move.htm for Move API request.
            ref.path = '/drives/' + self.repo.drive.id + '/root:'
            if self.new_parent_relpath != '':
                ref.path += self.new_parent_relpath
            item.parent_reference = ref
        if self.new_name != self.item_name:
            item.name = self.new_name
        return item
github epam / OneDrive-L / onedrive_service / src / onedrive_service / util.py View on Github external
def _init_item_to_update(self, item_id=None, item_path=None,
                             parent_id=None, parent_path=None):
        """
        Init parent reference and item
        :param item_id:
        :param item_path:
        :param parent_id:
        :param parent_path:
        :return: tuple
        """
        ref = onedrivesdk.ItemReference()
        ref.id = parent_id
        ref.path = self._get_full_path(parent_path)

        return self.client.item(id=item_id, path=item_path), ref