OLD | NEW |
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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 static void RegisterJSONConverter( | 404 static void RegisterJSONConverter( |
405 base::JSONValueConverter<TeamDriveResource>* converter); | 405 base::JSONValueConverter<TeamDriveResource>* converter); |
406 | 406 |
407 // Creates Team Drive resource from parsed JSON. | 407 // Creates Team Drive resource from parsed JSON. |
408 static std::unique_ptr<TeamDriveResource> | 408 static std::unique_ptr<TeamDriveResource> |
409 CreateFrom(const base::Value& value); | 409 CreateFrom(const base::Value& value); |
410 | 410 |
411 // The ID of this Team Drive. The ID is the same as the top-level folder for | 411 // The ID of this Team Drive. The ID is the same as the top-level folder for |
412 // this Team Drive. | 412 // this Team Drive. |
413 const std::string& id() const { return id_; } | 413 const std::string& id() const { return id_; } |
| 414 void set_id(const std::string& id) { id_ = id; } |
414 // The name of this Team Drive. | 415 // The name of this Team Drive. |
415 const std::string& name() const { return name_; } | 416 const std::string& name() const { return name_; } |
| 417 void set_name(const std::string& name) { name_ = name; } |
416 // Capabilities the current user has on this Team Drive. | 418 // Capabilities the current user has on this Team Drive. |
417 const TeamDriveCapabilities& capabilities() const { return capabilities_; } | 419 const TeamDriveCapabilities& capabilities() const { return capabilities_; } |
418 | 420 |
419 private: | 421 private: |
420 friend class DriveAPIParserTest; | 422 friend class DriveAPIParserTest; |
421 FRIEND_TEST_ALL_PREFIXES(DriveAPIParserTest, TeamDriveResourceParser); | 423 FRIEND_TEST_ALL_PREFIXES(DriveAPIParserTest, TeamDriveResourceParser); |
422 | 424 |
423 // Parses and initializes data members from content of |value|. | 425 // Parses and initializes data members from content of |value|. |
424 // Return false if parsing fails. | 426 // Return false if parsing fails. |
425 bool Parse(const base::Value& value); | 427 bool Parse(const base::Value& value); |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 void set_file_id(const std::string& file_id) { | 870 void set_file_id(const std::string& file_id) { |
869 file_id_ = file_id; | 871 file_id_ = file_id; |
870 } | 872 } |
871 void set_deleted(bool deleted) { | 873 void set_deleted(bool deleted) { |
872 deleted_ = deleted; | 874 deleted_ = deleted; |
873 } | 875 } |
874 void set_file(std::unique_ptr<FileResource> file) { file_ = std::move(file); } | 876 void set_file(std::unique_ptr<FileResource> file) { file_ = std::move(file); } |
875 void set_team_drive(std::unique_ptr<TeamDriveResource> team_drive) { | 877 void set_team_drive(std::unique_ptr<TeamDriveResource> team_drive) { |
876 team_drive_ = std::move(team_drive); | 878 team_drive_ = std::move(team_drive); |
877 } | 879 } |
| 880 void set_team_drive_id(const std::string& team_drive_id) { |
| 881 team_drive_id_ = team_drive_id; |
| 882 } |
878 void set_modification_date(const base::Time& modification_date) { | 883 void set_modification_date(const base::Time& modification_date) { |
879 modification_date_ = modification_date; | 884 modification_date_ = modification_date; |
880 } | 885 } |
881 | 886 |
882 private: | 887 private: |
883 friend class base::internal::RepeatedMessageConverter<ChangeResource>; | 888 friend class base::internal::RepeatedMessageConverter<ChangeResource>; |
884 friend class ChangeList; | 889 friend class ChangeList; |
885 | 890 |
886 // Parses and initializes data members from content of |value|. | 891 // Parses and initializes data members from content of |value|. |
887 // Return false if parsing fails. | 892 // Return false if parsing fails. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 GURL next_link_; | 960 GURL next_link_; |
956 int64_t largest_change_id_; | 961 int64_t largest_change_id_; |
957 std::vector<std::unique_ptr<ChangeResource>> items_; | 962 std::vector<std::unique_ptr<ChangeResource>> items_; |
958 | 963 |
959 DISALLOW_COPY_AND_ASSIGN(ChangeList); | 964 DISALLOW_COPY_AND_ASSIGN(ChangeList); |
960 }; | 965 }; |
961 | 966 |
962 } // namespace google_apis | 967 } // namespace google_apis |
963 | 968 |
964 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ | 969 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ |
OLD | NEW |