30 #ifndef GOOGLE_BOOKS_API_BOOKSHELF_H_ 31 #define GOOGLE_BOOKS_API_BOOKSHELF_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/client/util/date_time.h" 38 #include "googleapis/strings/stringpiece.h" 66 explicit Bookshelf(
const Json::Value& storage);
86 return StringPiece(
"google_books_api::Bookshelf");
95 return Storage().isMember(
"access");
102 MutableStorage()->removeMember(
"access");
110 const Json::Value& v = Storage(
"access");
111 if (v == Json::Value::null)
return StringPiece(
"");
112 return StringPiece(v.asCString());
123 *MutableStorage(
"access") = value.data();
132 return Storage().isMember(
"created");
139 MutableStorage()->removeMember(
"created");
147 const Json::Value& storage = Storage(
"created");
148 return client::JsonValueToCppValueHelper<client::DateTime >(storage);
160 client::SetJsonValueFromCppValueHelper<client::DateTime >(
161 value, MutableStorage(
"created"));
170 return Storage().isMember(
"description");
177 MutableStorage()->removeMember(
"description");
185 const Json::Value& v = Storage(
"description");
186 if (v == Json::Value::null)
return StringPiece(
"");
187 return StringPiece(v.asCString());
198 *MutableStorage(
"description") = value.data();
207 return Storage().isMember(
"id");
214 MutableStorage()->removeMember(
"id");
222 const Json::Value& storage = Storage(
"id");
223 return client::JsonValueToCppValueHelper<int32 >(storage);
234 client::SetJsonValueFromCppValueHelper<int32 >(
235 value, MutableStorage(
"id"));
244 return Storage().isMember(
"kind");
251 MutableStorage()->removeMember(
"kind");
259 const Json::Value& v = Storage(
"kind");
260 if (v == Json::Value::null)
return StringPiece(
"");
261 return StringPiece(v.asCString());
272 *MutableStorage(
"kind") = value.data();
281 return Storage().isMember(
"selfLink");
288 MutableStorage()->removeMember(
"selfLink");
296 const Json::Value& v = Storage(
"selfLink");
297 if (v == Json::Value::null)
return StringPiece(
"");
298 return StringPiece(v.asCString());
309 *MutableStorage(
"selfLink") = value.data();
318 return Storage().isMember(
"title");
325 MutableStorage()->removeMember(
"title");
333 const Json::Value& v = Storage(
"title");
334 if (v == Json::Value::null)
return StringPiece(
"");
335 return StringPiece(v.asCString());
346 *MutableStorage(
"title") = value.data();
355 return Storage().isMember(
"updated");
362 MutableStorage()->removeMember(
"updated");
370 const Json::Value& storage = Storage(
"updated");
371 return client::JsonValueToCppValueHelper<client::DateTime >(storage);
383 client::SetJsonValueFromCppValueHelper<client::DateTime >(
384 value, MutableStorage(
"updated"));
393 return Storage().isMember(
"volumeCount");
400 MutableStorage()->removeMember(
"volumeCount");
408 const Json::Value& storage = Storage(
"volumeCount");
409 return client::JsonValueToCppValueHelper<int32 >(storage);
420 client::SetJsonValueFromCppValueHelper<int32 >(
421 value, MutableStorage(
"volumeCount"));
430 return Storage().isMember(
"volumesLastUpdated");
437 MutableStorage()->removeMember(
"volumesLastUpdated");
445 const Json::Value& storage = Storage(
"volumesLastUpdated");
446 return client::JsonValueToCppValueHelper<client::DateTime >(storage);
458 client::SetJsonValueFromCppValueHelper<client::DateTime >(
459 value, MutableStorage(
"volumesLastUpdated"));
466 #endif // GOOGLE_BOOKS_API_BOOKSHELF_H_ void set_created(client::DateTime value)
Definition: bookshelf.h:159
bool has_updated() const
Definition: bookshelf.h:354
bool has_volumes_last_updated() const
Definition: bookshelf.h:429
const StringPiece get_title() const
Definition: bookshelf.h:332
client::DateTime get_updated() const
Definition: bookshelf.h:369
void set_volumes_last_updated(client::DateTime value)
Definition: bookshelf.h:457
void clear_volumes_last_updated()
Definition: bookshelf.h:436
void set_updated(client::DateTime value)
Definition: bookshelf.h:382
void clear_self_link()
Definition: bookshelf.h:287
const StringPiece get_description() const
Definition: bookshelf.h:184
void set_description(const StringPiece &value)
Definition: bookshelf.h:197
bool has_description() const
Definition: bookshelf.h:169
void set_title(const StringPiece &value)
Definition: bookshelf.h:345
void clear_access()
Definition: bookshelf.h:101
const StringPiece GetTypeName() const
Definition: bookshelf.h:85
void clear_kind()
Definition: bookshelf.h:250
const StringPiece get_kind() const
Definition: bookshelf.h:258
void set_volume_count(int32 value)
Definition: bookshelf.h:419
Definition: bookshelf.h:52
client::DateTime get_created() const
Definition: bookshelf.h:146
bool has_id() const
Definition: bookshelf.h:206
void clear_description()
Definition: bookshelf.h:176
void set_access(const StringPiece &value)
Definition: bookshelf.h:122
void set_self_link(const StringPiece &value)
Definition: bookshelf.h:308
const StringPiece get_self_link() const
Definition: bookshelf.h:295
void set_id(int32 value)
Definition: bookshelf.h:233
void clear_volume_count()
Definition: bookshelf.h:399
bool has_self_link() const
Definition: bookshelf.h:280
Definition: annotation.h:42
const StringPiece get_access() const
Definition: bookshelf.h:109
void clear_created()
Definition: bookshelf.h:138
void clear_title()
Definition: bookshelf.h:324
void clear_updated()
Definition: bookshelf.h:361
client::DateTime get_volumes_last_updated() const
Definition: bookshelf.h:444
int32 get_id() const
Definition: bookshelf.h:221
Definition: annotation.cc:44
bool has_created() const
Definition: bookshelf.h:131
bool has_kind() const
Definition: bookshelf.h:243
void clear_id()
Definition: bookshelf.h:213
bool has_access() const
Definition: bookshelf.h:94
bool has_volume_count() const
Definition: bookshelf.h:392
bool has_title() const
Definition: bookshelf.h:317
void set_kind(const StringPiece &value)
Definition: bookshelf.h:271
int32 get_volume_count() const
Definition: bookshelf.h:407