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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | google_apis/drive/drive_api_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PARSER_H_ 5 #ifndef GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_
6 #define GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ 6 #define GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 // Return false if parsing fails. 957 // Return false if parsing fails.
958 bool Parse(const base::Value& value); 958 bool Parse(const base::Value& value);
959 959
960 GURL next_link_; 960 GURL next_link_;
961 int64_t largest_change_id_; 961 int64_t largest_change_id_;
962 std::vector<std::unique_ptr<ChangeResource>> items_; 962 std::vector<std::unique_ptr<ChangeResource>> items_;
963 963
964 DISALLOW_COPY_AND_ASSIGN(ChangeList); 964 DISALLOW_COPY_AND_ASSIGN(ChangeList);
965 }; 965 };
966 966
967 // StartPageToken is the starting pageToken for listing future changes.
968 // https://developers.google.com/drive/v2/reference/changes/getStartPageToken
969 class StartPageToken {
970 public:
971 StartPageToken();
972 ~StartPageToken();
973
974 // Registers the mapping between JSON field names and the members in this
975 // class.
976 static void RegisterJSONConverter(
977 base::JSONValueConverter<StartPageToken>* converter);
978
979 // Returns true if the |value| has kind field for StartPageToken.
980 static bool HasStartPageTokenKind(const base::Value& value);
981
982 // Creates an instance from parsed JSON.
983 static std::unique_ptr<StartPageToken> CreateFrom(const base::Value& value);
984
985 // Returns the starting page token for listing future changes.
986 const std::string& start_page_token() const { return start_page_token_; }
987
988 void set_start_page_token(const std::string& start_page_token) {
989 start_page_token_ = start_page_token;
990 }
991
992 private:
993 friend class DriveAPIParserTest;
994 FRIEND_TEST_ALL_PREFIXES(DriveAPIParserTest, StartPageTokenParser);
995
996 // Parses and initializes data members from content of |value|.
997 // Return false if parsing fails.
998 bool Parse(const base::Value& value);
999
1000 std::string start_page_token_;
1001
1002 DISALLOW_COPY_AND_ASSIGN(StartPageToken);
1003 };
1004
967 } // namespace google_apis 1005 } // namespace google_apis
968 1006
969 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ 1007 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_
OLDNEW
« 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