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

Unified Diff: google_apis/drive/drive_api_parser.h

Issue 2885323002: Add URL generator / json parser for getting start_page_token of changes. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | google_apis/drive/drive_api_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/drive/drive_api_parser.h
diff --git a/google_apis/drive/drive_api_parser.h b/google_apis/drive/drive_api_parser.h
index 477ccfb4f7fbd1aa8a6ecaeba835008af852d2c4..60b586c659bd9b980897fcc382984f4240ab659a 100644
--- a/google_apis/drive/drive_api_parser.h
+++ b/google_apis/drive/drive_api_parser.h
@@ -964,6 +964,44 @@ class ChangeList {
DISALLOW_COPY_AND_ASSIGN(ChangeList);
};
+// StartPageToken is the starting pageToken for listing future changes.
+// https://developers.google.com/drive/v2/reference/changes/getStartPageToken
+class StartPageToken {
+ public:
+ StartPageToken();
+ ~StartPageToken();
+
+ // Registers the mapping between JSON field names and the members in this
+ // class.
+ static void RegisterJSONConverter(
+ base::JSONValueConverter<StartPageToken>* converter);
+
+ // Returns true if the |value| has kind field for StartPageToken.
+ static bool HasStartPageTokenKind(const base::Value& value);
+
+ // Creates an instance from parsed JSON.
+ static std::unique_ptr<StartPageToken> CreateFrom(const base::Value& value);
+
+ // Returns the starting page token for listing future changes.
+ const std::string& start_page_token() const { return start_page_token_; }
+
+ void set_start_page_token(const std::string& start_page_token) {
+ start_page_token_ = start_page_token;
+ }
+
+ private:
+ friend class DriveAPIParserTest;
+ FRIEND_TEST_ALL_PREFIXES(DriveAPIParserTest, StartPageTokenParser);
+
+ // Parses and initializes data members from content of |value|.
+ // Return false if parsing fails.
+ bool Parse(const base::Value& value);
+
+ std::string start_page_token_;
+
+ DISALLOW_COPY_AND_ASSIGN(StartPageToken);
+};
+
} // namespace google_apis
#endif // GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_
« no previous file with comments | « no previous file | google_apis/drive/drive_api_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698