30 #ifndef GOOGLE_WEBFONTS_API_WEBFONT_H_ 31 #define GOOGLE_WEBFONTS_API_WEBFONT_H_ 34 #include "googleapis/base/macros.h" 35 #include "googleapis/client/data/jsoncpp_data.h" 36 #include "googleapis/client/util/date_time.h" 37 #include "googleapis/strings/stringpiece.h" 51 class Webfont :
public client::JsonCppData {
65 explicit Webfont(
const Json::Value& storage);
72 explicit Webfont(Json::Value* storage);
85 return StringPiece(
"google_webfonts_api::Webfont");
94 return Storage().isMember(
"category");
101 MutableStorage()->removeMember(
"category");
109 const Json::Value& v = Storage(
"category");
110 if (v == Json::Value::null)
return StringPiece(
"");
111 return StringPiece(v.asCString());
122 *MutableStorage(
"category") = value.data();
131 return Storage().isMember(
"family");
138 MutableStorage()->removeMember(
"family");
146 const Json::Value& v = Storage(
"family");
147 if (v == Json::Value::null)
return StringPiece(
"");
148 return StringPiece(v.asCString());
159 *MutableStorage(
"family") = value.data();
168 return Storage().isMember(
"files");
175 MutableStorage()->removeMember(
"files");
182 const client::JsonCppAssociativeArray<string >
get_files()
const {
183 const Json::Value& storage = Storage(
"files");
184 return client::JsonValueToCppValueHelper<client::JsonCppAssociativeArray<string > >(storage);
196 Json::Value* storage = MutableStorage(
"files");
197 return client::JsonValueToMutableCppValueHelper<client::JsonCppAssociativeArray<string > >(storage);
206 return Storage().isMember(
"kind");
213 MutableStorage()->removeMember(
"kind");
221 const Json::Value& v = Storage(
"kind");
222 if (v == Json::Value::null)
return StringPiece(
"");
223 return StringPiece(v.asCString());
234 *MutableStorage(
"kind") = value.data();
243 return Storage().isMember(
"lastModified");
250 MutableStorage()->removeMember(
"lastModified");
258 const Json::Value& storage = Storage(
"lastModified");
259 return client::JsonValueToCppValueHelper<client::Date >(storage);
270 client::SetJsonValueFromCppValueHelper<client::Date >(
271 value, MutableStorage(
"lastModified"));
280 return Storage().isMember(
"subsets");
287 MutableStorage()->removeMember(
"subsets");
295 const Json::Value& storage = Storage(
"subsets");
296 return client::JsonValueToCppValueHelper<client::JsonCppArray<string > >(storage);
307 Json::Value* storage = MutableStorage(
"subsets");
308 return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<string > >(storage);
317 return Storage().isMember(
"variants");
324 MutableStorage()->removeMember(
"variants");
332 const Json::Value& storage = Storage(
"variants");
333 return client::JsonValueToCppValueHelper<client::JsonCppArray<string > >(storage);
345 Json::Value* storage = MutableStorage(
"variants");
346 return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<string > >(storage);
355 return Storage().isMember(
"version");
362 MutableStorage()->removeMember(
"version");
370 const Json::Value& v = Storage(
"version");
371 if (v == Json::Value::null)
return StringPiece(
"");
372 return StringPiece(v.asCString());
383 *MutableStorage(
"version") = value.data();
387 void operator=(
const Webfont&);
390 #endif // GOOGLE_WEBFONTS_API_WEBFONT_H_ const StringPiece get_category() const
Definition: webfont.h:108
const StringPiece GetTypeName() const
Definition: webfont.h:84
void set_last_modified(client::Date value)
Definition: webfont.h:269
void clear_version()
Definition: webfont.h:361
const StringPiece get_version() const
Definition: webfont.h:369
Definition: webfont.cc:41
void clear_family()
Definition: webfont.h:137
client::JsonCppArray< string > mutable_subsets()
Definition: webfont.h:306
void clear_variants()
Definition: webfont.h:323
bool has_last_modified() const
Definition: webfont.h:242
bool has_subsets() const
Definition: webfont.h:279
const StringPiece get_kind() const
Definition: webfont.h:220
void clear_kind()
Definition: webfont.h:212
bool has_family() const
Definition: webfont.h:130
client::Date get_last_modified() const
Definition: webfont.h:257
void clear_files()
Definition: webfont.h:174
bool has_category() const
Definition: webfont.h:93
bool has_kind() const
Definition: webfont.h:205
const client::JsonCppAssociativeArray< string > get_files() const
Definition: webfont.h:182
void set_version(const StringPiece &value)
Definition: webfont.h:382
const client::JsonCppArray< string > get_subsets() const
Definition: webfont.h:294
client::JsonCppArray< string > mutable_variants()
Definition: webfont.h:344
void set_kind(const StringPiece &value)
Definition: webfont.h:233
void clear_subsets()
Definition: webfont.h:286
void set_category(const StringPiece &value)
Definition: webfont.h:121
const StringPiece get_family() const
Definition: webfont.h:145
bool has_files() const
Definition: webfont.h:167
void clear_last_modified()
Definition: webfont.h:249
bool has_variants() const
Definition: webfont.h:316
client::JsonCppAssociativeArray< string > mutable_files()
Definition: webfont.h:195
void set_family(const StringPiece &value)
Definition: webfont.h:158
const client::JsonCppArray< string > get_variants() const
Definition: webfont.h:331
void clear_category()
Definition: webfont.h:100
bool has_version() const
Definition: webfont.h:354