30 #ifndef GOOGLE_CUSTOMSEARCH_API_PROMOTION_H_ 31 #define GOOGLE_CUSTOMSEARCH_API_PROMOTION_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" 92 return StringPiece(
"google_customsearch_api::PromotionBodyLines");
101 return Storage().isMember(
"htmlTitle");
108 MutableStorage()->removeMember(
"htmlTitle");
116 const Json::Value& v = Storage(
"htmlTitle");
117 if (v == Json::Value::null)
return StringPiece(
"");
118 return StringPiece(v.asCString());
129 *MutableStorage(
"htmlTitle") = value.data();
138 return Storage().isMember(
"link");
145 MutableStorage()->removeMember(
"link");
153 const Json::Value& v = Storage(
"link");
154 if (v == Json::Value::null)
return StringPiece(
"");
155 return StringPiece(v.asCString());
166 *MutableStorage(
"link") = value.data();
175 return Storage().isMember(
"title");
182 MutableStorage()->removeMember(
"title");
190 const Json::Value& v = Storage(
"title");
191 if (v == Json::Value::null)
return StringPiece(
"");
192 return StringPiece(v.asCString());
203 *MutableStorage(
"title") = value.data();
212 return Storage().isMember(
"url");
219 MutableStorage()->removeMember(
"url");
227 const Json::Value& v = Storage(
"url");
228 if (v == Json::Value::null)
return StringPiece(
"");
229 return StringPiece(v.asCString());
240 *MutableStorage(
"url") = value.data();
285 return StringPiece(
"google_customsearch_api::PromotionImage");
294 return Storage().isMember(
"height");
301 MutableStorage()->removeMember(
"height");
309 const Json::Value& storage = Storage(
"height");
310 return client::JsonValueToCppValueHelper<int32 >(storage);
321 client::SetJsonValueFromCppValueHelper<int32 >(
322 value, MutableStorage(
"height"));
331 return Storage().isMember(
"source");
338 MutableStorage()->removeMember(
"source");
346 const Json::Value& v = Storage(
"source");
347 if (v == Json::Value::null)
return StringPiece(
"");
348 return StringPiece(v.asCString());
359 *MutableStorage(
"source") = value.data();
368 return Storage().isMember(
"width");
375 MutableStorage()->removeMember(
"width");
383 const Json::Value& storage = Storage(
"width");
384 return client::JsonValueToCppValueHelper<int32 >(storage);
395 client::SetJsonValueFromCppValueHelper<int32 >(
396 value, MutableStorage(
"width"));
414 explicit Promotion(
const Json::Value& storage);
421 explicit Promotion(Json::Value* storage);
434 return StringPiece(
"google_customsearch_api::Promotion");
443 return Storage().isMember(
"bodyLines");
450 MutableStorage()->removeMember(
"bodyLines");
458 const Json::Value& storage = Storage(
"bodyLines");
459 return client::JsonValueToCppValueHelper<client::JsonCppArray<PromotionBodyLines > >(storage);
474 Json::Value* storage = MutableStorage(
"bodyLines");
475 return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<PromotionBodyLines > >(storage);
484 return Storage().isMember(
"displayLink");
491 MutableStorage()->removeMember(
"displayLink");
499 const Json::Value& v = Storage(
"displayLink");
500 if (v == Json::Value::null)
return StringPiece(
"");
501 return StringPiece(v.asCString());
512 *MutableStorage(
"displayLink") = value.data();
521 return Storage().isMember(
"htmlTitle");
528 MutableStorage()->removeMember(
"htmlTitle");
536 const Json::Value& v = Storage(
"htmlTitle");
537 if (v == Json::Value::null)
return StringPiece(
"");
538 return StringPiece(v.asCString());
549 *MutableStorage(
"htmlTitle") = value.data();
558 return Storage().isMember(
"image");
565 MutableStorage()->removeMember(
"image");
573 const Json::Value& storage = Storage(
"image");
574 return client::JsonValueToCppValueHelper<PromotionImage >(storage);
585 Json::Value* storage = MutableStorage(
"image");
586 return client::JsonValueToMutableCppValueHelper<PromotionImage >(storage);
595 return Storage().isMember(
"link");
602 MutableStorage()->removeMember(
"link");
610 const Json::Value& v = Storage(
"link");
611 if (v == Json::Value::null)
return StringPiece(
"");
612 return StringPiece(v.asCString());
623 *MutableStorage(
"link") = value.data();
632 return Storage().isMember(
"title");
639 MutableStorage()->removeMember(
"title");
647 const Json::Value& v = Storage(
"title");
648 if (v == Json::Value::null)
return StringPiece(
"");
649 return StringPiece(v.asCString());
660 *MutableStorage(
"title") = value.data();
667 #endif // GOOGLE_CUSTOMSEARCH_API_PROMOTION_H_
void clear_url()
Definition: promotion.h:218
const StringPiece get_html_title() const
Definition: promotion.h:115
Definition: customsearch_service.cc:40
const StringPiece get_title() const
Definition: promotion.h:189
void set_link(const StringPiece &value)
Definition: promotion.h:165
bool has_title() const
Definition: promotion.h:174
const StringPiece get_link() const
Definition: promotion.h:152
void set_html_title(const StringPiece &value)
Definition: promotion.h:128
void clear_html_title()
Definition: promotion.h:107
void clear_title()
Definition: promotion.h:181
Definition: promotion.h:39
bool has_url() const
Definition: promotion.h:211
void set_title(const StringPiece &value)
Definition: promotion.h:202
void set_url(const StringPiece &value)
Definition: promotion.h:239
void clear_link()
Definition: promotion.h:144
bool has_link() const
Definition: promotion.h:137
bool has_html_title() const
Definition: promotion.h:100
const StringPiece get_url() const
Definition: promotion.h:226
const StringPiece GetTypeName() const
Definition: promotion.h:91
Definition: promotion.h:58