30 #ifndef GOOGLE_GAMES_API_SNAPSHOT_H_ 31 #define GOOGLE_GAMES_API_SNAPSHOT_H_ 34 #include "googleapis/base/integral_types.h" 35 #include "googleapis/base/macros.h" 36 #include "googleapis/client/data/jsoncpp_data.h" 37 #include "googleapis/strings/stringpiece.h" 39 #include "google/games_api/snapshot_image.h" 67 explicit Snapshot(
const Json::Value& storage);
74 explicit Snapshot(Json::Value* storage);
87 return StringPiece(
"google_games_api::Snapshot");
96 return Storage().isMember(
"coverImage");
103 MutableStorage()->removeMember(
"coverImage");
128 return Storage().isMember(
"description");
135 MutableStorage()->removeMember(
"description");
143 const Json::Value& v = Storage(
"description");
144 if (v == Json::Value::null)
return StringPiece(
"");
145 return StringPiece(v.asCString());
156 *MutableStorage(
"description") = value.data();
165 return Storage().isMember(
"driveId");
172 MutableStorage()->removeMember(
"driveId");
180 const Json::Value& v = Storage(
"driveId");
181 if (v == Json::Value::null)
return StringPiece(
"");
182 return StringPiece(v.asCString());
195 *MutableStorage(
"driveId") = value.data();
204 return Storage().isMember(
"durationMillis");
211 MutableStorage()->removeMember(
"durationMillis");
219 const Json::Value& storage = Storage(
"durationMillis");
220 return client::JsonValueToCppValueHelper<int64 >(storage);
231 client::SetJsonValueFromCppValueHelper<int64 >(
232 value, MutableStorage(
"durationMillis"));
241 return Storage().isMember(
"id");
248 MutableStorage()->removeMember(
"id");
256 const Json::Value& v = Storage(
"id");
257 if (v == Json::Value::null)
return StringPiece(
"");
258 return StringPiece(v.asCString());
269 *MutableStorage(
"id") = value.data();
278 return Storage().isMember(
"kind");
285 MutableStorage()->removeMember(
"kind");
293 const Json::Value& v = Storage(
"kind");
294 if (v == Json::Value::null)
return StringPiece(
"");
295 return StringPiece(v.asCString());
307 *MutableStorage(
"kind") = value.data();
316 return Storage().isMember(
"lastModifiedMillis");
323 MutableStorage()->removeMember(
"lastModifiedMillis");
331 const Json::Value& storage = Storage(
"lastModifiedMillis");
332 return client::JsonValueToCppValueHelper<int64 >(storage);
344 client::SetJsonValueFromCppValueHelper<int64 >(
345 value, MutableStorage(
"lastModifiedMillis"));
354 return Storage().isMember(
"progressValue");
361 MutableStorage()->removeMember(
"progressValue");
369 const Json::Value& storage = Storage(
"progressValue");
370 return client::JsonValueToCppValueHelper<int64 >(storage);
382 client::SetJsonValueFromCppValueHelper<int64 >(
383 value, MutableStorage(
"progressValue"));
392 return Storage().isMember(
"title");
399 MutableStorage()->removeMember(
"title");
407 const Json::Value& v = Storage(
"title");
408 if (v == Json::Value::null)
return StringPiece(
"");
409 return StringPiece(v.asCString());
420 *MutableStorage(
"title") = value.data();
429 return Storage().isMember(
"type");
436 MutableStorage()->removeMember(
"type");
444 const Json::Value& v = Storage(
"type");
445 if (v == Json::Value::null)
return StringPiece(
"");
446 return StringPiece(v.asCString());
459 *MutableStorage(
"type") = value.data();
468 return Storage().isMember(
"uniqueName");
475 MutableStorage()->removeMember(
"uniqueName");
483 const Json::Value& v = Storage(
"uniqueName");
484 if (v == Json::Value::null)
return StringPiece(
"");
485 return StringPiece(v.asCString());
496 *MutableStorage(
"uniqueName") = value.data();
503 #endif // GOOGLE_GAMES_API_SNAPSHOT_H_ int64 get_last_modified_millis() const
Definition: snapshot.h:330
const StringPiece get_unique_name() const
Definition: snapshot.h:482
void clear_progress_value()
Definition: snapshot.h:360
bool has_unique_name() const
Definition: snapshot.h:467
void clear_duration_millis()
Definition: snapshot.h:210
void clear_cover_image()
Definition: snapshot.h:102
const StringPiece get_id() const
Definition: snapshot.h:255
const StringPiece get_type() const
Definition: snapshot.h:443
void clear_type()
Definition: snapshot.h:435
void clear_unique_name()
Definition: snapshot.h:474
void set_description(const StringPiece &value)
Definition: snapshot.h:155
void set_unique_name(const StringPiece &value)
Definition: snapshot.h:495
int64 get_progress_value() const
Definition: snapshot.h:368
bool has_cover_image() const
Definition: snapshot.h:95
void set_duration_millis(int64 value)
Definition: snapshot.h:230
void clear_id()
Definition: snapshot.h:247
bool has_description() const
Definition: snapshot.h:127
bool has_type() const
Definition: snapshot.h:428
void set_kind(const StringPiece &value)
Definition: snapshot.h:306
bool has_title() const
Definition: snapshot.h:391
void set_type(const StringPiece &value)
Definition: snapshot.h:458
void set_drive_id(const StringPiece &value)
Definition: snapshot.h:194
Definition: achievement_definition.cc:41
Definition: snapshot.h:53
Definition: achievement_definition.h:39
void clear_drive_id()
Definition: snapshot.h:171
void set_last_modified_millis(int64 value)
Definition: snapshot.h:343
bool has_id() const
Definition: snapshot.h:240
const StringPiece GetTypeName() const
Definition: snapshot.h:86
void clear_description()
Definition: snapshot.h:134
bool has_drive_id() const
Definition: snapshot.h:164
void set_progress_value(int64 value)
Definition: snapshot.h:381
void clear_kind()
Definition: snapshot.h:284
const StringPiece get_drive_id() const
Definition: snapshot.h:179
const StringPiece get_title() const
Definition: snapshot.h:406
Definition: snapshot_image.h:51
const StringPiece get_description() const
Definition: snapshot.h:142
void clear_last_modified_millis()
Definition: snapshot.h:322
void set_id(const StringPiece &value)
Definition: snapshot.h:268
void set_title(const StringPiece &value)
Definition: snapshot.h:419
const StringPiece get_kind() const
Definition: snapshot.h:292
bool has_kind() const
Definition: snapshot.h:277
bool has_progress_value() const
Definition: snapshot.h:353
int64 get_duration_millis() const
Definition: snapshot.h:218
void clear_title()
Definition: snapshot.h:398
bool has_duration_millis() const
Definition: snapshot.h:203
bool has_last_modified_millis() const
Definition: snapshot.h:315