1#ifndef YANDEX_DISK_CPP_CLIENT_YANDEXDISKCLIENT_H
2#define YANDEX_DISK_CPP_CLIENT_YANDEXDISKCLIENT_H
6#include <nlohmann/json.hpp>
10#include "HttpClient.h"
78 const std::string& disk_dir,
79 const std::string& local_path);
89 const std::string& download_disk_path,
90 const std::string& local_dir);
100 const std::string& disk_path,
101 const std::string& local_path);
111 const std::string& disk_path,
112 const std::string& local_path);
139 const std::string& from_path,
140 const std::string& to_path,
141 bool overwrite =
false
153 const std::string& disk_path,
154 const std::string& new_name,
155 bool overwrite =
false);
162 bool exists(
const std::string& disk_path);
209 const std::string& name,
210 const std::string& start_path =
"/");
215 std::string getUploadUrl(
const std::string& upload_disk_path);
217 std::string getDownloadUrl(
const std::string& download_disk_path);
nlohmann::json getQuotaInfo()
Get disk quota information (total, used, trash).
bool emptyTrash()
Empty the entire Yandex.Disk trash.
std::vector< std::string > findResourcePathByName(const std::string &name, const std::string &start_path="/")
Find all resources on disk by name (recursive).
bool exists(const std::string &disk_path)
Check if a file or directory exists on Yandex.Disk.
YandexDiskClient(const std::string &oauth_token)
Constructor.
bool downloadFile(const std::string &download_disk_path, const std::string &local_dir)
Download a file from Yandex.Disk to local directory.
nlohmann::json getResourceList(const std::string &disk_path="/")
Get list of files and folders at given path.
bool restoreFromTrash(const std::string &trash_path)
Restore a file or directory from trash to its original location.
std::string getPublicDownloadLink(const std::string &disk_path)
Get public download link for a published file or folder.
bool deleteFileOrDir(const std::string &disk_path)
Delete a file or directory from Yandex.Disk.
bool publish(const std::string &path)
Publish a file or folder (make it public).
bool downloadDirectory(const std::string &disk_path, const std::string &local_path)
Recursively download a directory from Yandex.Disk to local path.
bool uploadDirectory(const std::string &disk_path, const std::string &local_path)
Recursively upload a local directory to Yandex.Disk.
bool createDirectory(const std::string &disk_path)
Create a directory on Yandex.Disk.
bool uploadFile(const std::string &disk_dir, const std::string &local_path)
Upload a local file to Yandex.Disk.
std::vector< std::string > findTrashPathByName(const std::string &name)
Find all resources in trash by name.
bool unpublish(const std::string &disk_path)
Unpublish a file or folder (remove public access).
bool renameFileOrDir(const std::string &disk_path, const std::string &new_name, bool overwrite=false)
Rename a file or directory on Yandex.Disk.
nlohmann::json getTrashResourceList(const std::string &trash_path="trash:/")
Get list of files and folders in Yandex.Disk trash.
bool moveFileOrDir(const std::string &from_path, const std::string &to_path, bool overwrite=false)
Move or copy a file or directory on Yandex.Disk.
bool deleteFromTrash(const std::string &trash_path)
Permanently delete a file or directory from trash.
std::string getResourceInfo(const std::string &disk_path)
Get detailed information about a file or folder.