30 #ifndef GOOGLE_BOOKS_API_ANNOTATION_H_ 31 #define GOOGLE_BOOKS_API_ANNOTATION_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" 40 #include "google/books_api/books_annotations_range.h" 95 return StringPiece(
"google_books_api::AnnotationClientVersionRanges");
104 return Storage().isMember(
"cfiRange");
111 MutableStorage()->removeMember(
"cfiRange");
136 return Storage().isMember(
"contentVersion");
143 MutableStorage()->removeMember(
"contentVersion");
151 const Json::Value& v = Storage(
"contentVersion");
152 if (v == Json::Value::null)
return StringPiece(
"");
153 return StringPiece(v.asCString());
164 *MutableStorage(
"contentVersion") = value.data();
173 return Storage().isMember(
"gbImageRange");
180 MutableStorage()->removeMember(
"gbImageRange");
206 return Storage().isMember(
"gbTextRange");
213 MutableStorage()->removeMember(
"gbTextRange");
238 return Storage().isMember(
"imageCfiRange");
245 MutableStorage()->removeMember(
"imageCfiRange");
307 return StringPiece(
"google_books_api::AnnotationCurrentVersionRanges");
316 return Storage().isMember(
"cfiRange");
323 MutableStorage()->removeMember(
"cfiRange");
348 return Storage().isMember(
"contentVersion");
355 MutableStorage()->removeMember(
"contentVersion");
363 const Json::Value& v = Storage(
"contentVersion");
364 if (v == Json::Value::null)
return StringPiece(
"");
365 return StringPiece(v.asCString());
376 *MutableStorage(
"contentVersion") = value.data();
385 return Storage().isMember(
"gbImageRange");
392 MutableStorage()->removeMember(
"gbImageRange");
418 return Storage().isMember(
"gbTextRange");
425 MutableStorage()->removeMember(
"gbTextRange");
450 return Storage().isMember(
"imageCfiRange");
457 MutableStorage()->removeMember(
"imageCfiRange");
519 return StringPiece(
"google_books_api::AnnotationLayerSummary");
529 return Storage().isMember(
"allowedCharacterCount");
536 MutableStorage()->removeMember(
"allowedCharacterCount");
544 const Json::Value& storage = Storage(
"allowedCharacterCount");
545 return client::JsonValueToCppValueHelper<int32 >(storage);
557 client::SetJsonValueFromCppValueHelper<int32 >(
558 value, MutableStorage(
"allowedCharacterCount"));
567 return Storage().isMember(
"limitType");
574 MutableStorage()->removeMember(
"limitType");
582 const Json::Value& v = Storage(
"limitType");
583 if (v == Json::Value::null)
return StringPiece(
"");
584 return StringPiece(v.asCString());
596 *MutableStorage(
"limitType") = value.data();
607 return Storage().isMember(
"remainingCharacterCount");
614 MutableStorage()->removeMember(
"remainingCharacterCount");
622 const Json::Value& storage = Storage(
"remainingCharacterCount");
623 return client::JsonValueToCppValueHelper<int32 >(storage);
635 client::SetJsonValueFromCppValueHelper<int32 >(
636 value, MutableStorage(
"remainingCharacterCount"));
654 explicit Annotation(
const Json::Value& storage);
674 return StringPiece(
"google_books_api::Annotation");
683 return Storage().isMember(
"afterSelectedText");
690 MutableStorage()->removeMember(
"afterSelectedText");
698 const Json::Value& v = Storage(
"afterSelectedText");
699 if (v == Json::Value::null)
return StringPiece(
"");
700 return StringPiece(v.asCString());
712 *MutableStorage(
"afterSelectedText") = value.data();
721 return Storage().isMember(
"beforeSelectedText");
728 MutableStorage()->removeMember(
"beforeSelectedText");
736 const Json::Value& v = Storage(
"beforeSelectedText");
737 if (v == Json::Value::null)
return StringPiece(
"");
738 return StringPiece(v.asCString());
750 *MutableStorage(
"beforeSelectedText") = value.data();
759 return Storage().isMember(
"clientVersionRanges");
766 MutableStorage()->removeMember(
"clientVersionRanges");
775 const Json::Value& storage = Storage(
"clientVersionRanges");
776 return client::JsonValueToCppValueHelper<AnnotationClientVersionRanges >(storage);
788 Json::Value* storage = MutableStorage(
"clientVersionRanges");
789 return client::JsonValueToMutableCppValueHelper<AnnotationClientVersionRanges >(storage);
798 return Storage().isMember(
"created");
805 MutableStorage()->removeMember(
"created");
813 const Json::Value& storage = Storage(
"created");
814 return client::JsonValueToCppValueHelper<client::DateTime >(storage);
825 client::SetJsonValueFromCppValueHelper<client::DateTime >(
826 value, MutableStorage(
"created"));
835 return Storage().isMember(
"currentVersionRanges");
842 MutableStorage()->removeMember(
"currentVersionRanges");
851 const Json::Value& storage = Storage(
"currentVersionRanges");
852 return client::JsonValueToCppValueHelper<AnnotationCurrentVersionRanges >(storage);
864 Json::Value* storage = MutableStorage(
"currentVersionRanges");
865 return client::JsonValueToMutableCppValueHelper<AnnotationCurrentVersionRanges >(storage);
874 return Storage().isMember(
"data");
881 MutableStorage()->removeMember(
"data");
889 const Json::Value& v = Storage(
"data");
890 if (v == Json::Value::null)
return StringPiece(
"");
891 return StringPiece(v.asCString());
902 *MutableStorage(
"data") = value.data();
911 return Storage().isMember(
"deleted");
918 MutableStorage()->removeMember(
"deleted");
926 const Json::Value& storage = Storage(
"deleted");
927 return client::JsonValueToCppValueHelper<bool >(storage);
938 client::SetJsonValueFromCppValueHelper<bool >(
939 value, MutableStorage(
"deleted"));
948 return Storage().isMember(
"highlightStyle");
955 MutableStorage()->removeMember(
"highlightStyle");
963 const Json::Value& v = Storage(
"highlightStyle");
964 if (v == Json::Value::null)
return StringPiece(
"");
965 return StringPiece(v.asCString());
976 *MutableStorage(
"highlightStyle") = value.data();
985 return Storage().isMember(
"id");
992 MutableStorage()->removeMember(
"id");
1000 const Json::Value& v = Storage(
"id");
1001 if (v == Json::Value::null)
return StringPiece(
"");
1002 return StringPiece(v.asCString());
1013 *MutableStorage(
"id") = value.data();
1022 return Storage().isMember(
"kind");
1029 MutableStorage()->removeMember(
"kind");
1037 const Json::Value& v = Storage(
"kind");
1038 if (v == Json::Value::null)
return StringPiece(
"");
1039 return StringPiece(v.asCString());
1050 *MutableStorage(
"kind") = value.data();
1059 return Storage().isMember(
"layerId");
1066 MutableStorage()->removeMember(
"layerId");
1074 const Json::Value& v = Storage(
"layerId");
1075 if (v == Json::Value::null)
return StringPiece(
"");
1076 return StringPiece(v.asCString());
1087 *MutableStorage(
"layerId") = value.data();
1096 return Storage().isMember(
"layerSummary");
1103 MutableStorage()->removeMember(
"layerSummary");
1111 const Json::Value& storage = Storage(
"layerSummary");
1112 return client::JsonValueToCppValueHelper<AnnotationLayerSummary >(storage);
1121 Json::Value* storage = MutableStorage(
"layerSummary");
1122 return client::JsonValueToMutableCppValueHelper<AnnotationLayerSummary >(storage);
1131 return Storage().isMember(
"pageIds");
1138 MutableStorage()->removeMember(
"pageIds");
1146 const Json::Value& storage = Storage(
"pageIds");
1147 return client::JsonValueToCppValueHelper<client::JsonCppArray<string > >(storage);
1158 Json::Value* storage = MutableStorage(
"pageIds");
1159 return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<string > >(storage);
1168 return Storage().isMember(
"selectedText");
1175 MutableStorage()->removeMember(
"selectedText");
1183 const Json::Value& v = Storage(
"selectedText");
1184 if (v == Json::Value::null)
return StringPiece(
"");
1185 return StringPiece(v.asCString());
1196 *MutableStorage(
"selectedText") = value.data();
1205 return Storage().isMember(
"selfLink");
1212 MutableStorage()->removeMember(
"selfLink");
1220 const Json::Value& v = Storage(
"selfLink");
1221 if (v == Json::Value::null)
return StringPiece(
"");
1222 return StringPiece(v.asCString());
1233 *MutableStorage(
"selfLink") = value.data();
1242 return Storage().isMember(
"updated");
1249 MutableStorage()->removeMember(
"updated");
1257 const Json::Value& storage = Storage(
"updated");
1258 return client::JsonValueToCppValueHelper<client::DateTime >(storage);
1269 client::SetJsonValueFromCppValueHelper<client::DateTime >(
1270 value, MutableStorage(
"updated"));
1279 return Storage().isMember(
"volumeId");
1286 MutableStorage()->removeMember(
"volumeId");
1294 const Json::Value& v = Storage(
"volumeId");
1295 if (v == Json::Value::null)
return StringPiece(
"");
1296 return StringPiece(v.asCString());
1307 *MutableStorage(
"volumeId") = value.data();
1314 #endif // GOOGLE_BOOKS_API_ANNOTATION_H_ bool has_after_selected_text() const
Definition: annotation.h:682
const AnnotationLayerSummary get_layer_summary() const
Definition: annotation.h:1110
const StringPiece get_before_selected_text() const
Definition: annotation.h:735
void clear_highlight_style()
Definition: annotation.h:954
bool has_gb_image_range() const
Definition: annotation.h:384
bool has_page_ids() const
Definition: annotation.h:1130
Definition: annotation.h:54
const StringPiece get_kind() const
Definition: annotation.h:1036
void clear_gb_text_range()
Definition: annotation.h:424
void set_content_version(const StringPiece &value)
Definition: annotation.h:163
bool has_content_version() const
Definition: annotation.h:135
void clear_image_cfi_range()
Definition: annotation.h:244
bool has_client_version_ranges() const
Definition: annotation.h:758
const StringPiece get_after_selected_text() const
Definition: annotation.h:697
bool has_gb_text_range() const
Definition: annotation.h:417
bool has_limit_type() const
Definition: annotation.h:566
bool has_image_cfi_range() const
Definition: annotation.h:449
const AnnotationCurrentVersionRanges get_current_version_ranges() const
Definition: annotation.h:850
const StringPiece get_self_link() const
Definition: annotation.h:1219
void set_after_selected_text(const StringPiece &value)
Definition: annotation.h:711
bool has_cfi_range() const
Definition: annotation.h:103
bool has_layer_summary() const
Definition: annotation.h:1095
void clear_id()
Definition: annotation.h:991
void clear_gb_image_range()
Definition: annotation.h:179
void clear_self_link()
Definition: annotation.h:1211
void clear_limit_type()
Definition: annotation.h:573
AnnotationCurrentVersionRanges mutable_currentVersionRanges()
Definition: annotation.h:863
const StringPiece get_layer_id() const
Definition: annotation.h:1073
client::DateTime get_updated() const
Definition: annotation.h:1256
void clear_before_selected_text()
Definition: annotation.h:727
void clear_allowed_character_count()
Definition: annotation.h:535
bool has_self_link() const
Definition: annotation.h:1204
bool has_volume_id() const
Definition: annotation.h:1278
const AnnotationClientVersionRanges get_client_version_ranges() const
Definition: annotation.h:774
void clear_content_version()
Definition: annotation.h:354
bool has_deleted() const
Definition: annotation.h:910
void set_volume_id(const StringPiece &value)
Definition: annotation.h:1306
bool has_selected_text() const
Definition: annotation.h:1167
Definition: annotation.h:273
Definition: books_annotations_range.h:50
bool has_cfi_range() const
Definition: annotation.h:315
bool has_created() const
Definition: annotation.h:797
void set_data(const StringPiece &value)
Definition: annotation.h:901
void clear_volume_id()
Definition: annotation.h:1285
void set_id(const StringPiece &value)
Definition: annotation.h:1012
void clear_layer_id()
Definition: annotation.h:1065
const StringPiece get_selected_text() const
Definition: annotation.h:1182
void set_created(client::DateTime value)
Definition: annotation.h:824
void clear_cfi_range()
Definition: annotation.h:322
const StringPiece get_data() const
Definition: annotation.h:888
bool has_data() const
Definition: annotation.h:873
const StringPiece GetTypeName() const
Definition: annotation.h:306
void clear_layer_summary()
Definition: annotation.h:1102
const StringPiece GetTypeName() const
Definition: annotation.h:518
void clear_client_version_ranges()
Definition: annotation.h:765
AnnotationClientVersionRanges mutable_clientVersionRanges()
Definition: annotation.h:787
void clear_page_ids()
Definition: annotation.h:1137
void clear_gb_text_range()
Definition: annotation.h:212
bool has_gb_image_range() const
Definition: annotation.h:172
void set_self_link(const StringPiece &value)
Definition: annotation.h:1232
void set_selected_text(const StringPiece &value)
Definition: annotation.h:1195
void set_kind(const StringPiece &value)
Definition: annotation.h:1049
bool has_allowed_character_count() const
Definition: annotation.h:528
const StringPiece get_content_version() const
Definition: annotation.h:150
void clear_after_selected_text()
Definition: annotation.h:689
Definition: annotation.h:42
void clear_deleted()
Definition: annotation.h:917
void set_layer_id(const StringPiece &value)
Definition: annotation.h:1086
client::DateTime get_created() const
Definition: annotation.h:812
const StringPiece GetTypeName() const
Definition: annotation.h:94
void clear_updated()
Definition: annotation.h:1248
void clear_current_version_ranges()
Definition: annotation.h:841
void set_limit_type(const StringPiece &value)
Definition: annotation.h:595
void set_allowed_character_count(int32 value)
Definition: annotation.h:556
bool has_image_cfi_range() const
Definition: annotation.h:237
bool has_id() const
Definition: annotation.h:984
void clear_image_cfi_range()
Definition: annotation.h:456
void clear_created()
Definition: annotation.h:804
int32 get_allowed_character_count() const
Definition: annotation.h:543
const StringPiece get_highlight_style() const
Definition: annotation.h:962
AnnotationLayerSummary mutable_layerSummary()
Definition: annotation.h:1120
bool has_layer_id() const
Definition: annotation.h:1058
bool has_current_version_ranges() const
Definition: annotation.h:834
Definition: annotation.cc:44
void set_content_version(const StringPiece &value)
Definition: annotation.h:375
bool has_updated() const
Definition: annotation.h:1241
void clear_remaining_character_count()
Definition: annotation.h:613
void clear_data()
Definition: annotation.h:880
void set_updated(client::DateTime value)
Definition: annotation.h:1268
const StringPiece get_limit_type() const
Definition: annotation.h:581
bool has_remaining_character_count() const
Definition: annotation.h:606
const StringPiece get_id() const
Definition: annotation.h:999
bool get_deleted() const
Definition: annotation.h:925
bool has_gb_text_range() const
Definition: annotation.h:205
const StringPiece get_volume_id() const
Definition: annotation.h:1293
bool has_kind() const
Definition: annotation.h:1021
const StringPiece GetTypeName() const
Definition: annotation.h:673
bool has_highlight_style() const
Definition: annotation.h:947
void set_deleted(bool value)
Definition: annotation.h:937
void set_before_selected_text(const StringPiece &value)
Definition: annotation.h:749
const client::JsonCppArray< string > get_page_ids() const
Definition: annotation.h:1145
void set_highlight_style(const StringPiece &value)
Definition: annotation.h:975
client::JsonCppArray< string > mutable_pageIds()
Definition: annotation.h:1157
void clear_gb_image_range()
Definition: annotation.h:391
void clear_selected_text()
Definition: annotation.h:1174
const StringPiece get_content_version() const
Definition: annotation.h:362
void clear_kind()
Definition: annotation.h:1028
bool has_before_selected_text() const
Definition: annotation.h:720
void clear_content_version()
Definition: annotation.h:142
int32 get_remaining_character_count() const
Definition: annotation.h:621
Definition: annotation.h:485
void clear_cfi_range()
Definition: annotation.h:110
void set_remaining_character_count(int32 value)
Definition: annotation.h:634
bool has_content_version() const
Definition: annotation.h:347
Definition: annotation.h:61