CLOUD: #define all OAuth2/API-related URLs

This commit is contained in:
Alexander Tkachev 2016-07-22 20:54:02 +06:00
parent f3959e1401
commit d57e0c89b5
15 changed files with 161 additions and 68 deletions

View file

@ -33,6 +33,9 @@
namespace Cloud {
namespace GoogleDrive {
#define GOOGLEDRIVE_API_FILES "https://www.googleapis.com/drive/v3/files?spaces=drive&fields=files%28id,mimeType,modifiedTime,name,size%29,nextPageToken&orderBy=folder,name"
//files(id,mimeType,modifiedTime,name,size),nextPageToken
GoogleDriveListDirectoryByIdRequest::GoogleDriveListDirectoryByIdRequest(GoogleDriveStorage *storage, Common::String id, Storage::ListDirectoryCallback cb, Networking::ErrorCallback ecb):
Networking::Request(nullptr, ecb), _requestedId(id), _storage(storage), _listDirectoryCallback(cb),
_workingRequest(nullptr), _ignoreCallback(false) {
@ -57,8 +60,7 @@ void GoogleDriveListDirectoryByIdRequest::start() {
}
void GoogleDriveListDirectoryByIdRequest::makeRequest(Common::String pageToken) {
Common::String url = "https://www.googleapis.com/drive/v3/files?spaces=drive&fields=files%28id,mimeType,modifiedTime,name,size%29,nextPageToken&orderBy=folder,name";
//files(id,mimeType,modifiedTime,name,size),nextPageToken
Common::String url = GOOGLEDRIVE_API_FILES;
if (pageToken != "")
url += "&pageToken=" + pageToken;
url += "&q=%27" + _requestedId + "%27+in+parents";