30 #ifndef GOOGLE_BOOKS_API_NOTIFICATION_H_ 31 #define GOOGLE_BOOKS_API_NOTIFICATION_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" 85 return StringPiece(
"google_books_api::Notification");
94 return Storage().isMember(
"body");
101 MutableStorage()->removeMember(
"body");
109 const Json::Value& v = Storage(
"body");
110 if (v == Json::Value::null)
return StringPiece(
"");
111 return StringPiece(v.asCString());
119 *MutableStorage(
"body") = value.data();
128 return Storage().isMember(
"crmExperimentIds");
135 MutableStorage()->removeMember(
"crmExperimentIds");
144 const Json::Value& storage = Storage(
"crmExperimentIds");
145 return client::JsonValueToCppValueHelper<client::JsonCppArray<int64 > >(storage);
157 Json::Value* storage = MutableStorage(
"crmExperimentIds");
158 return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<int64 > >(storage);
167 return Storage().isMember(
"doc_id");
174 MutableStorage()->removeMember(
"doc_id");
182 const Json::Value& v = Storage(
"doc_id");
183 if (v == Json::Value::null)
return StringPiece(
"");
184 return StringPiece(v.asCString());
192 *MutableStorage(
"doc_id") = value.data();
201 return Storage().isMember(
"doc_type");
208 MutableStorage()->removeMember(
"doc_type");
216 const Json::Value& v = Storage(
"doc_type");
217 if (v == Json::Value::null)
return StringPiece(
"");
218 return StringPiece(v.asCString());
226 *MutableStorage(
"doc_type") = value.data();
236 return Storage().isMember(
"dont_show_notification");
243 MutableStorage()->removeMember(
"dont_show_notification");
251 const Json::Value& storage = Storage(
"dont_show_notification");
252 return client::JsonValueToCppValueHelper<bool >(storage);
260 client::SetJsonValueFromCppValueHelper<bool >(
261 value, MutableStorage(
"dont_show_notification"));
270 return Storage().isMember(
"iconUrl");
277 MutableStorage()->removeMember(
"iconUrl");
285 const Json::Value& v = Storage(
"iconUrl");
286 if (v == Json::Value::null)
return StringPiece(
"");
287 return StringPiece(v.asCString());
295 *MutableStorage(
"iconUrl") = value.data();
304 return Storage().isMember(
"is_document_mature");
311 MutableStorage()->removeMember(
"is_document_mature");
319 const Json::Value& storage = Storage(
"is_document_mature");
320 return client::JsonValueToCppValueHelper<bool >(storage);
328 client::SetJsonValueFromCppValueHelper<bool >(
329 value, MutableStorage(
"is_document_mature"));
338 return Storage().isMember(
"kind");
345 MutableStorage()->removeMember(
"kind");
353 const Json::Value& v = Storage(
"kind");
354 if (v == Json::Value::null)
return StringPiece(
"");
355 return StringPiece(v.asCString());
366 *MutableStorage(
"kind") = value.data();
375 return Storage().isMember(
"notificationGroup");
382 MutableStorage()->removeMember(
"notificationGroup");
390 const Json::Value& v = Storage(
"notificationGroup");
391 if (v == Json::Value::null)
return StringPiece(
"");
392 return StringPiece(v.asCString());
400 *MutableStorage(
"notificationGroup") = value.data();
409 return Storage().isMember(
"notification_type");
416 MutableStorage()->removeMember(
"notification_type");
424 const Json::Value& v = Storage(
"notification_type");
425 if (v == Json::Value::null)
return StringPiece(
"");
426 return StringPiece(v.asCString());
434 *MutableStorage(
"notification_type") = value.data();
443 return Storage().isMember(
"pcampaign_id");
450 MutableStorage()->removeMember(
"pcampaign_id");
458 const Json::Value& v = Storage(
"pcampaign_id");
459 if (v == Json::Value::null)
return StringPiece(
"");
460 return StringPiece(v.asCString());
468 *MutableStorage(
"pcampaign_id") = value.data();
477 return Storage().isMember(
"reason");
484 MutableStorage()->removeMember(
"reason");
492 const Json::Value& v = Storage(
"reason");
493 if (v == Json::Value::null)
return StringPiece(
"");
494 return StringPiece(v.asCString());
502 *MutableStorage(
"reason") = value.data();
513 return Storage().isMember(
"show_notification_settings_action");
520 MutableStorage()->removeMember(
"show_notification_settings_action");
529 const Json::Value& storage = Storage(
"show_notification_settings_action");
530 return client::JsonValueToCppValueHelper<bool >(storage);
538 client::SetJsonValueFromCppValueHelper<bool >(
539 value, MutableStorage(
"show_notification_settings_action"));
548 return Storage().isMember(
"targetUrl");
555 MutableStorage()->removeMember(
"targetUrl");
563 const Json::Value& v = Storage(
"targetUrl");
564 if (v == Json::Value::null)
return StringPiece(
"");
565 return StringPiece(v.asCString());
573 *MutableStorage(
"targetUrl") = value.data();
582 return Storage().isMember(
"timeToExpireMs");
589 MutableStorage()->removeMember(
"timeToExpireMs");
597 const Json::Value& storage = Storage(
"timeToExpireMs");
598 return client::JsonValueToCppValueHelper<int64 >(storage);
606 client::SetJsonValueFromCppValueHelper<int64 >(
607 value, MutableStorage(
"timeToExpireMs"));
616 return Storage().isMember(
"title");
623 MutableStorage()->removeMember(
"title");
631 const Json::Value& v = Storage(
"title");
632 if (v == Json::Value::null)
return StringPiece(
"");
633 return StringPiece(v.asCString());
641 *MutableStorage(
"title") = value.data();
648 #endif // GOOGLE_BOOKS_API_NOTIFICATION_H_ void clear_is_document_mature()
Definition: notification.h:310
bool has_crm_experiment_ids() const
Definition: notification.h:127
void clear_pcampaign_id()
Definition: notification.h:449
const StringPiece get_reason() const
Definition: notification.h:491
bool has_body() const
Definition: notification.h:93
bool has_is_document_mature() const
Definition: notification.h:303
void clear_title()
Definition: notification.h:622
void clear_reason()
Definition: notification.h:483
bool has_notification_group() const
Definition: notification.h:374
void set_notification_type(const StringPiece &value)
Definition: notification.h:433
void set_show_notification_settings_action(bool value)
Definition: notification.h:537
void clear_show_notification_settings_action()
Definition: notification.h:519
bool get_show_notification_settings_action() const
Definition: notification.h:528
const StringPiece get_target_url() const
Definition: notification.h:562
const StringPiece get_doc_id() const
Definition: notification.h:181
void clear_notification_group()
Definition: notification.h:381
void set_icon_url(const StringPiece &value)
Definition: notification.h:294
const StringPiece get_kind() const
Definition: notification.h:352
void set_kind(const StringPiece &value)
Definition: notification.h:365
const StringPiece GetTypeName() const
Definition: notification.h:84
void set_title(const StringPiece &value)
Definition: notification.h:640
bool has_doc_type() const
Definition: notification.h:200
void set_notification_group(const StringPiece &value)
Definition: notification.h:399
void clear_dont_show_notification()
Definition: notification.h:242
bool has_time_to_expire_ms() const
Definition: notification.h:581
void clear_time_to_expire_ms()
Definition: notification.h:588
void set_dont_show_notification(bool value)
Definition: notification.h:259
void set_body(const StringPiece &value)
Definition: notification.h:118
const StringPiece get_doc_type() const
Definition: notification.h:215
bool get_dont_show_notification() const
Definition: notification.h:250
void clear_doc_type()
Definition: notification.h:207
bool has_notification_type() const
Definition: notification.h:408
void clear_kind()
Definition: notification.h:344
bool has_pcampaign_id() const
Definition: notification.h:442
Definition: annotation.h:42
void clear_target_url()
Definition: notification.h:554
const StringPiece get_body() const
Definition: notification.h:108
void set_pcampaign_id(const StringPiece &value)
Definition: notification.h:467
void set_time_to_expire_ms(int64 value)
Definition: notification.h:605
void clear_notification_type()
Definition: notification.h:415
const StringPiece get_notification_type() const
Definition: notification.h:423
int64 get_time_to_expire_ms() const
Definition: notification.h:596
void set_doc_id(const StringPiece &value)
Definition: notification.h:191
bool has_reason() const
Definition: notification.h:476
Definition: annotation.cc:44
bool has_title() const
Definition: notification.h:615
const client::JsonCppArray< int64 > get_crm_experiment_ids() const
Definition: notification.h:143
bool has_target_url() const
Definition: notification.h:547
bool has_icon_url() const
Definition: notification.h:269
const StringPiece get_icon_url() const
Definition: notification.h:284
const StringPiece get_pcampaign_id() const
Definition: notification.h:457
void set_reason(const StringPiece &value)
Definition: notification.h:501
void clear_body()
Definition: notification.h:100
bool has_doc_id() const
Definition: notification.h:166
const StringPiece get_title() const
Definition: notification.h:630
void clear_doc_id()
Definition: notification.h:173
void clear_icon_url()
Definition: notification.h:276
bool has_kind() const
Definition: notification.h:337
Definition: notification.h:51
void clear_crm_experiment_ids()
Definition: notification.h:134
bool has_dont_show_notification() const
Definition: notification.h:235
bool has_show_notification_settings_action() const
Definition: notification.h:512
void set_target_url(const StringPiece &value)
Definition: notification.h:572
client::JsonCppArray< int64 > mutable_crmExperimentIds()
Definition: notification.h:156
void set_doc_type(const StringPiece &value)
Definition: notification.h:225
const StringPiece get_notification_group() const
Definition: notification.h:389
void set_is_document_mature(bool value)
Definition: notification.h:327
bool get_is_document_mature() const
Definition: notification.h:318