Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: google_apis/drive/drive_api_url_generator.h

Issue 2894513003: Fetch files shared in Team Drives by specifying allTeamDrives corpora. (Closed)
Patch Set: Rename parameter variables to scope Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: google_apis/drive/drive_api_url_generator.h
diff --git a/google_apis/drive/drive_api_url_generator.h b/google_apis/drive/drive_api_url_generator.h
index 089912744a28fea4d0e3831d2e213d6e995bb00d..43d2418e12a27601f85998c716d0808340b0906e 100644
--- a/google_apis/drive/drive_api_url_generator.h
+++ b/google_apis/drive/drive_api_url_generator.h
@@ -15,6 +15,27 @@
namespace google_apis {
+// A class to specify team_drive_id and corpora parameters for Files:list.
+class FilesListScope {
hashimoto 2017/05/26 09:09:19 Sorry, I couldn't understand why this needs to be
yamaguchi 2017/05/29 08:38:21 I think it can. - corpora : enum - team_drive_id :
hashimoto 2017/05/30 08:34:57 IMO the Drive API is already too complicated (it's
yamaguchi 2017/05/31 08:21:30 Thanks. Changed to use 2 args instead of a new cla
+ public:
+ static FilesListScope kAllTeamDrives;
+ static FilesListScope kDefault;
+ static FilesListScope CreateForTeamDrive(const std::string& team_drive_id);
+
+ const std::string& GetCorpusParam() const;
+ const std::string& GetTeamDriveId() const { return team_drive_id_; }
+
+ private:
+ static std::string kDefaultAndAllTeamDrivesCorpus_;
+ static std::string kTeamDriveCorpus_;
+ static std::string kDefaultCorpus_;
+
+ FilesListScope(bool all_team_drives, std::string team_drive_id)
+ : all_team_drives_(all_team_drives), team_drive_id_(team_drive_id) {}
+ bool all_team_drives_;
+ std::string team_drive_id_;
+};
+
// This class is used to generate URLs for communicating with drive api
// servers for production, and a local server for testing.
class DriveApiUrlGenerator {
@@ -68,6 +89,7 @@ class DriveApiUrlGenerator {
// Returns a URL to fetch file list.
GURL GetFilesListUrl(int max_results,
const std::string& page_token,
+ const FilesListScope& scope,
const std::string& q) const;
// Returns a URL to delete a resource with the given |file_id|.

Powered by Google App Engine
This is Rietveld 408576698