OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ | 5 #ifndef GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ |
6 #define GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ | 6 #define GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "google_apis/drive/drive_switches.h" | 13 #include "google_apis/drive/drive_switches.h" |
14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
15 | 15 |
16 namespace google_apis { | 16 namespace google_apis { |
17 | 17 |
| 18 // This enum class is used to express a corpora parameter configuration for |
| 19 // Files:list. |
| 20 enum class FilesListCorpora { |
| 21 // 'default': The user's subscribed items. |
| 22 DEFAULT, |
| 23 // 'teamDrives': A Team Drive. |
| 24 TEAM_DRIVE, |
| 25 // 'default,allTeamDrives': All Team Drives and the user's subscribed items. |
| 26 ALL_TEAM_DRIVES |
| 27 }; |
| 28 |
18 // This class is used to generate URLs for communicating with drive api | 29 // This class is used to generate URLs for communicating with drive api |
19 // servers for production, and a local server for testing. | 30 // servers for production, and a local server for testing. |
20 class DriveApiUrlGenerator { | 31 class DriveApiUrlGenerator { |
21 public: | 32 public: |
22 // |base_url| is the path to the target drive api server. | 33 // |base_url| is the path to the target drive api server. |
23 // Note that this is an injecting point for a testing server. | 34 // Note that this is an injecting point for a testing server. |
24 DriveApiUrlGenerator(const GURL& base_url, | 35 DriveApiUrlGenerator(const GURL& base_url, |
25 const GURL& base_thumbnail_url, | 36 const GURL& base_thumbnail_url, |
26 TeamDrivesIntegrationStatus team_drives_integration); | 37 TeamDrivesIntegrationStatus team_drives_integration); |
27 DriveApiUrlGenerator(const DriveApiUrlGenerator& src); | 38 DriveApiUrlGenerator(const DriveApiUrlGenerator& src); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 bool set_modified_date, | 72 bool set_modified_date, |
62 bool update_viewed_date) const; | 73 bool update_viewed_date) const; |
63 | 74 |
64 // Returns a URL to copy a resource specified by |file_id|. | 75 // Returns a URL to copy a resource specified by |file_id|. |
65 GURL GetFilesCopyUrl(const std::string& file_id, | 76 GURL GetFilesCopyUrl(const std::string& file_id, |
66 const std::string& visibility) const; | 77 const std::string& visibility) const; |
67 | 78 |
68 // Returns a URL to fetch file list. | 79 // Returns a URL to fetch file list. |
69 GURL GetFilesListUrl(int max_results, | 80 GURL GetFilesListUrl(int max_results, |
70 const std::string& page_token, | 81 const std::string& page_token, |
| 82 FilesListCorpora corpora, |
| 83 const std::string& team_drive_id, |
71 const std::string& q) const; | 84 const std::string& q) const; |
72 | 85 |
73 // Returns a URL to delete a resource with the given |file_id|. | 86 // Returns a URL to delete a resource with the given |file_id|. |
74 GURL GetFilesDeleteUrl(const std::string& file_id) const; | 87 GURL GetFilesDeleteUrl(const std::string& file_id) const; |
75 | 88 |
76 // Returns a URL to trash a resource with the given |file_id|. | 89 // Returns a URL to trash a resource with the given |file_id|. |
77 GURL GetFilesTrashUrl(const std::string& file_id) const; | 90 GURL GetFilesTrashUrl(const std::string& file_id) const; |
78 | 91 |
79 // Returns a URL to invoke "TeamDrives: list" method. | 92 // Returns a URL to invoke "TeamDrives: list" method. |
80 GURL GetTeamDriveListUrl(int max_results, | 93 GURL GetTeamDriveListUrl(int max_results, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 const GURL base_download_url_; | 148 const GURL base_download_url_; |
136 const GURL base_thumbnail_url_; | 149 const GURL base_thumbnail_url_; |
137 const bool enable_team_drives_; | 150 const bool enable_team_drives_; |
138 | 151 |
139 // This class is copyable hence no DISALLOW_COPY_AND_ASSIGN here. | 152 // This class is copyable hence no DISALLOW_COPY_AND_ASSIGN here. |
140 }; | 153 }; |
141 | 154 |
142 } // namespace google_apis | 155 } // namespace google_apis |
143 | 156 |
144 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ | 157 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_ |
OLD | NEW |