public function updateDriveItem($driveItemId, $properties = [], $temp = false)
    {
        $message = sprintf(
            '%s() is deprecated and will be removed in version 3;'
                . ' use Krizalys\Onedrive\Proxy\DriveItemProxy::rename()'
                . ' instead',
            __METHOD__
        );

        @trigger_error($message, E_USER_DEPRECATED);
        $drive = $this->getMyDrive();

        $item = $driveItemId !== null ?
            $this->getDriveItemById($drive->id, $driveItemId)
            : $drive->getRoot();

        $options = (array) $properties;

        if (array_key_exists('name', $options)) {
            $name = $options['name'];
            unset($options['name']);
        } else {
            $name = $item->name;
        }

        $item    = $item->rename($name, $options);
        $options = $this->buildOptions($item, ['parent_id' => $driveItemId]);

        return new Folder($this, $item->id, $options);
    }