Mcloud API provides developer to easily access login user's cloud contents stored on mcloud, such as musics, movie, docs, images, and so on.
More...
|
| Client (int request_timeout=10) |
| Constructs a Mcloud Client object with request_timeout seconds. Meanwhile client launches sync-up manager to deal with task download and upload by default. More...
|
|
| Client (const Client &)=delete |
|
Client & | operator= (const Client &)=delete |
|
virtual | ~Client () |
|
void | set_access_token (const std::string &access_token) |
| Set access_token to authenticate all mcloud API calls with the bearer HTTP authorization scheme. The access token can be fetched through ubuntu sso services. More...
|
|
bool | refresh_token (const std::string &refresh_token) |
| Retrieves and refreshes access token by using refresh_token. The refresh token can be fetched through ubuntu sso services. More...
|
|
DiskInfo | disk_info () |
| Returns login user's clcoud storage info. More...
|
|
std::string | cloud_root_folder_id () |
| Returns root folder id on mlcoud for third-party app to use, such as mcloud-lib. More...
|
|
ResourceList | cloud_content_list (int start_index, int count, CloudContent::Type content_type=CloudContent::Type::All, const std::string &folder_id=std::string()) |
| Returns a cloud item list under one specific folder folder_id with a given type content_type. if folder_id is empty, returns contents under root folder of cloud. content_type is CloudContent::Type::All by default. The fetched content count is 200 at most per call. start_index indicates the first index of the requested content list on mcloud. count indicates the maximum number of content items per call. More...
|
|
CloudContent::Ptr | content_info (const std::string &content_id) |
| Returns a cloud content object if a content content_id exists on mcloud. otherwise return nullptr. More...
|
|
CloudFolder::Ptr | create_folder (const std::string &folder_name, const std::string &folder_id) |
| Returns a cloud folder object if a folder with folder_name is created under a given folder_id folder. otherwise return nullptr. More...
|
|
Client::ResourceList | look_up (const std::string &name, const std::string &folder_id, CloudResource::Property property=CloudResource::Property::Content) |
| Returns a cloud item list if there are available items that matches with name under a given folder_id folder. property holds the property of cloud item, it can be content(default) or folder. More...
|
|
OutlinkList | create_folder_extranet_link (const Stringlist &folder_ids) |
| Creates folders extranet link object with a given folder_ids. More...
|
|
OutlinkList | create_content_extranet_link (const Stringlist &content_ids) |
| Creates a content_extranet link object with a given content_ids. More...
|
|
Client::Stringlist | copy_folders (const Stringlist &folder_ids, const std::string &_folder_id) |
| Returns folder id list if folders folder_ids are copies to another folder with a given folder_id on mcloud. More...
|
|
Client::Stringlist | copy_contents (const Stringlist &contents_ids, const std::string &folder_id) |
| Returns content id list if contents content_ids are copies to another folder with a given folder_id on mcloud. More...
|
|
bool | move_items (const Stringlist &folder_ids, const Stringlist &content_ids, const std::string &folder_id) |
| Returns true if folders with a given folder_ids and contents with a given content_ids are successfully moved to new folder with a given folder_id. More...
|
|
bool | update_folder (const std::string &folder_id, const std::string &new_folder_name) |
| Returns true if folder folder_id are updated with new_folder_name, otherwise return false. More...
|
|
bool | delete_contents (const Stringlist &content_ids) |
| Returns true if contents content_ids are deleted, otherwise return false. More...
|
|
bool | exist_on_cloud (const std::string &file_path, const std::string &folder_id=std::string()) |
| Returns true if a local file file_path exists in folder with folder_id on cloud, otherwise return false. Searches root folder if folder_id is empty();. More...
|
|
SyncManager::Ptr | syncmanager () const |
| Returns a sync-up manager running on the background. sync-up manager scheduled tasks. More...
|
|
Mcloud API provides developer to easily access login user's cloud contents stored on mcloud, such as musics, movie, docs, images, and so on.
The API enable developers to
-
retrieve authorized user cloud content list.
-
create, delete, move and update cloud resources.
-
query content infomation.
-
create an extranet link to share.
-
upload a local content to mcloud.
-
download a content from mcloud.
Also sync up manager will be running on the background when client is constructed. It handles over local content upload and cloud item download.
- See also
- syncmanager.
- Note
- Mcloud API covers cloud resourece access and content sync-up between local and cloud. It does not take responsibility of account authentication. So before using mcloud APIs, developers need to call
- See also
- set_access_token to manually set a valid access_token or
-
refresh_token to fetch access token, which is used to call mcloud APIs internally to pass through authentication.
Definition at line 66 of file client.h.