Index: google_apis/drive/drive_api_parser.cc |
diff --git a/google_apis/drive/drive_api_parser.cc b/google_apis/drive/drive_api_parser.cc |
index 3e8975d1e4a2e7055a2897ede3b4aacd50038cca..d402687f2ee1444f7c98b1cf63ba19f0316bce20 100644 |
--- a/google_apis/drive/drive_api_parser.cc |
+++ b/google_apis/drive/drive_api_parser.cc |
@@ -211,6 +211,11 @@ const char kTeamDriveId[] = "teamDriveId"; |
// https://developers.google.com/drive/v2/reference/changes/list |
const char kChangeListKind[] = "drive#changeList"; |
+// Changes StartPageToken |
+// https://developers.google.com/drive/v2/reference/changes/getStartPageToken |
+const char kStartPageTokenKind[] = "drive#startPageToken"; |
+const char kStartPageToken[] = "startPageToken"; |
+ |
// Maps category name to enum ChangeType. |
struct ChangeTypeMap { |
ChangeResource::ChangeType type; |
@@ -783,6 +788,45 @@ bool ChangeResource::GetType(const base::StringPiece& type_name, |
} |
//////////////////////////////////////////////////////////////////////////////// |
+// StartPageToken implementation |
+ |
+StartPageToken::StartPageToken() {} |
+ |
+StartPageToken::~StartPageToken() {} |
+ |
+// static |
+void StartPageToken::RegisterJSONConverter( |
+ base::JSONValueConverter<StartPageToken>* converter) { |
+ converter->RegisterStringField(kStartPageToken, |
+ &StartPageToken::start_page_token_); |
+} |
+ |
+// static |
+bool StartPageToken::HasStartPageTokenKind(const base::Value& value) { |
+ return IsResourceKindExpected(value, kStartPageTokenKind); |
+} |
+ |
+// static |
+std::unique_ptr<StartPageToken> StartPageToken::CreateFrom( |
+ const base::Value& value) { |
+ std::unique_ptr<StartPageToken> resource(new StartPageToken()); |
+ if (!HasStartPageTokenKind(value) || !resource->Parse(value)) { |
+ LOG(ERROR) << "Unable to create: Invalid StartPageToken JSON!"; |
+ return std::unique_ptr<StartPageToken>(); |
+ } |
+ return resource; |
+} |
+ |
+bool StartPageToken::Parse(const base::Value& value) { |
+ base::JSONValueConverter<StartPageToken> converter; |
+ if (!converter.Convert(value, this)) { |
+ LOG(ERROR) << "Unable to parse: Invalid StartPageToken"; |
+ return false; |
+ } |
+ return true; |
+} |
+ |
+//////////////////////////////////////////////////////////////////////////////// |
// ChangeList implementation |
ChangeList::ChangeList() : largest_change_id_(0) {} |