customsearch  v1
promotion.h
1 // Copyright 2010 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 // use this file except in compliance with the License. You may obtain a copy of
5 // the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 // License for the specific language governing permissions and limitations under
13 // the License.
14 
15 // This code was generated by google-apis-code-generator 1.5.1
16 // Build date: 2018-10-08 17:45:39 UTC
17 // on: 2020-04-13, 18:20:31 UTC
18 // C++ generator version: 0.1.4
19 
20 // ----------------------------------------------------------------------------
21 // NOTE: This file is generated from Google APIs Discovery Service.
22 // Service:
23 // Custom Search API (customsearch/v1)
24 // Generated from:
25 // Version: v1
26 // Revision: 83
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_CUSTOMSEARCH_API_PROMOTION_H_
31 #define GOOGLE_CUSTOMSEARCH_API_PROMOTION_H_
32 
33 #include <string>
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"
38 
39 namespace Json {
40 class Value;
41 } // namespace Json
42 
43 namespace google_customsearch_api {
44 using namespace googleapis;
45 
51 class Promotion : public client::JsonCppData {
52  public:
58  class PromotionBodyLines : public client::JsonCppData {
59  public:
65  static PromotionBodyLines* New();
66 
72  explicit PromotionBodyLines(const Json::Value& storage);
73 
79  explicit PromotionBodyLines(Json::Value* storage);
80 
84  virtual ~PromotionBodyLines();
85 
91  const StringPiece GetTypeName() const {
92  return StringPiece("google_customsearch_api::PromotionBodyLines");
93  }
94 
100  bool has_html_title() const {
101  return Storage().isMember("htmlTitle");
102  }
103 
108  MutableStorage()->removeMember("htmlTitle");
109  }
110 
111 
115  const StringPiece get_html_title() const {
116  const Json::Value& v = Storage("htmlTitle");
117  if (v == Json::Value::null) return StringPiece("");
118  return StringPiece(v.asCString());
119  }
120 
128  void set_html_title(const StringPiece& value) {
129  *MutableStorage("htmlTitle") = value.data();
130  }
131 
137  bool has_link() const {
138  return Storage().isMember("link");
139  }
140 
144  void clear_link() {
145  MutableStorage()->removeMember("link");
146  }
147 
148 
152  const StringPiece get_link() const {
153  const Json::Value& v = Storage("link");
154  if (v == Json::Value::null) return StringPiece("");
155  return StringPiece(v.asCString());
156  }
157 
165  void set_link(const StringPiece& value) {
166  *MutableStorage("link") = value.data();
167  }
168 
174  bool has_title() const {
175  return Storage().isMember("title");
176  }
177 
181  void clear_title() {
182  MutableStorage()->removeMember("title");
183  }
184 
185 
189  const StringPiece get_title() const {
190  const Json::Value& v = Storage("title");
191  if (v == Json::Value::null) return StringPiece("");
192  return StringPiece(v.asCString());
193  }
194 
202  void set_title(const StringPiece& value) {
203  *MutableStorage("title") = value.data();
204  }
205 
211  bool has_url() const {
212  return Storage().isMember("url");
213  }
214 
218  void clear_url() {
219  MutableStorage()->removeMember("url");
220  }
221 
222 
226  const StringPiece get_url() const {
227  const Json::Value& v = Storage("url");
228  if (v == Json::Value::null) return StringPiece("");
229  return StringPiece(v.asCString());
230  }
231 
239  void set_url(const StringPiece& value) {
240  *MutableStorage("url") = value.data();
241  }
242 
243  private:
244  void operator=(const PromotionBodyLines&);
245  }; // PromotionBodyLines
251  class PromotionImage : public client::JsonCppData {
252  public:
258  static PromotionImage* New();
259 
265  explicit PromotionImage(const Json::Value& storage);
266 
272  explicit PromotionImage(Json::Value* storage);
273 
277  virtual ~PromotionImage();
278 
284  const StringPiece GetTypeName() const {
285  return StringPiece("google_customsearch_api::PromotionImage");
286  }
287 
293  bool has_height() const {
294  return Storage().isMember("height");
295  }
296 
300  void clear_height() {
301  MutableStorage()->removeMember("height");
302  }
303 
304 
308  int32 get_height() const {
309  const Json::Value& storage = Storage("height");
310  return client::JsonValueToCppValueHelper<int32 >(storage);
311  }
312 
320  void set_height(int32 value) {
321  client::SetJsonValueFromCppValueHelper<int32 >(
322  value, MutableStorage("height"));
323  }
324 
330  bool has_source() const {
331  return Storage().isMember("source");
332  }
333 
337  void clear_source() {
338  MutableStorage()->removeMember("source");
339  }
340 
341 
345  const StringPiece get_source() const {
346  const Json::Value& v = Storage("source");
347  if (v == Json::Value::null) return StringPiece("");
348  return StringPiece(v.asCString());
349  }
350 
358  void set_source(const StringPiece& value) {
359  *MutableStorage("source") = value.data();
360  }
361 
367  bool has_width() const {
368  return Storage().isMember("width");
369  }
370 
374  void clear_width() {
375  MutableStorage()->removeMember("width");
376  }
377 
378 
382  int32 get_width() const {
383  const Json::Value& storage = Storage("width");
384  return client::JsonValueToCppValueHelper<int32 >(storage);
385  }
386 
394  void set_width(int32 value) {
395  client::SetJsonValueFromCppValueHelper<int32 >(
396  value, MutableStorage("width"));
397  }
398 
399  private:
400  void operator=(const PromotionImage&);
401  }; // PromotionImage
407  static Promotion* New();
408 
414  explicit Promotion(const Json::Value& storage);
415 
421  explicit Promotion(Json::Value* storage);
422 
426  virtual ~Promotion();
427 
433  const StringPiece GetTypeName() const {
434  return StringPiece("google_customsearch_api::Promotion");
435  }
436 
442  bool has_body_lines() const {
443  return Storage().isMember("bodyLines");
444  }
445 
450  MutableStorage()->removeMember("bodyLines");
451  }
452 
453 
457  const client::JsonCppArray<PromotionBodyLines > get_body_lines() const {
458  const Json::Value& storage = Storage("bodyLines");
459  return client::JsonValueToCppValueHelper<client::JsonCppArray<PromotionBodyLines > >(storage);
460  }
461 
473  client::JsonCppArray<PromotionBodyLines > mutable_bodyLines() {
474  Json::Value* storage = MutableStorage("bodyLines");
475  return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<PromotionBodyLines > >(storage);
476  }
477 
483  bool has_display_link() const {
484  return Storage().isMember("displayLink");
485  }
486 
491  MutableStorage()->removeMember("displayLink");
492  }
493 
494 
498  const StringPiece get_display_link() const {
499  const Json::Value& v = Storage("displayLink");
500  if (v == Json::Value::null) return StringPiece("");
501  return StringPiece(v.asCString());
502  }
503 
511  void set_display_link(const StringPiece& value) {
512  *MutableStorage("displayLink") = value.data();
513  }
514 
520  bool has_html_title() const {
521  return Storage().isMember("htmlTitle");
522  }
523 
528  MutableStorage()->removeMember("htmlTitle");
529  }
530 
531 
535  const StringPiece get_html_title() const {
536  const Json::Value& v = Storage("htmlTitle");
537  if (v == Json::Value::null) return StringPiece("");
538  return StringPiece(v.asCString());
539  }
540 
548  void set_html_title(const StringPiece& value) {
549  *MutableStorage("htmlTitle") = value.data();
550  }
551 
557  bool has_image() const {
558  return Storage().isMember("image");
559  }
560 
564  void clear_image() {
565  MutableStorage()->removeMember("image");
566  }
567 
568 
572  const PromotionImage get_image() const {
573  const Json::Value& storage = Storage("image");
574  return client::JsonValueToCppValueHelper<PromotionImage >(storage);
575  }
576 
585  Json::Value* storage = MutableStorage("image");
586  return client::JsonValueToMutableCppValueHelper<PromotionImage >(storage);
587  }
588 
594  bool has_link() const {
595  return Storage().isMember("link");
596  }
597 
601  void clear_link() {
602  MutableStorage()->removeMember("link");
603  }
604 
605 
609  const StringPiece get_link() const {
610  const Json::Value& v = Storage("link");
611  if (v == Json::Value::null) return StringPiece("");
612  return StringPiece(v.asCString());
613  }
614 
622  void set_link(const StringPiece& value) {
623  *MutableStorage("link") = value.data();
624  }
625 
631  bool has_title() const {
632  return Storage().isMember("title");
633  }
634 
638  void clear_title() {
639  MutableStorage()->removeMember("title");
640  }
641 
642 
646  const StringPiece get_title() const {
647  const Json::Value& v = Storage("title");
648  if (v == Json::Value::null) return StringPiece("");
649  return StringPiece(v.asCString());
650  }
651 
659  void set_title(const StringPiece& value) {
660  *MutableStorage("title") = value.data();
661  }
662 
663  private:
664  void operator=(const Promotion&);
665 }; // Promotion
666 } // namespace google_customsearch_api
667 #endif // GOOGLE_CUSTOMSEARCH_API_PROMOTION_H_
void clear_body_lines()
Definition: promotion.h:449
Definition: promotion.h:51
void set_height(int32 value)
Definition: promotion.h:320
const StringPiece get_html_title() const
Definition: promotion.h:115
int32 get_width() const
Definition: promotion.h:382
void set_link(const StringPiece &value)
Definition: promotion.h:622
void clear_link()
Definition: promotion.h:601
void clear_height()
Definition: promotion.h:300
bool has_image() const
Definition: promotion.h:557
bool has_body_lines() const
Definition: promotion.h:442
Definition: customsearch_service.cc:40
bool has_source() const
Definition: promotion.h:330
const StringPiece get_title() const
Definition: promotion.h:189
PromotionImage mutable_image()
Definition: promotion.h:584
const StringPiece get_display_link() const
Definition: promotion.h:498
const StringPiece get_link() const
Definition: promotion.h:609
bool has_width() const
Definition: promotion.h:367
void set_source(const StringPiece &value)
Definition: promotion.h:358
bool has_html_title() const
Definition: promotion.h:520
void set_link(const StringPiece &value)
Definition: promotion.h:165
const client::JsonCppArray< PromotionBodyLines > get_body_lines() const
Definition: promotion.h:457
const StringPiece get_html_title() const
Definition: promotion.h:535
bool has_title() const
Definition: promotion.h:174
const StringPiece get_link() const
Definition: promotion.h:152
bool has_display_link() const
Definition: promotion.h:483
void set_html_title(const StringPiece &value)
Definition: promotion.h:128
void clear_html_title()
Definition: promotion.h:107
void clear_source()
Definition: promotion.h:337
const StringPiece get_source() const
Definition: promotion.h:345
client::JsonCppArray< PromotionBodyLines > mutable_bodyLines()
Definition: promotion.h:473
void clear_title()
Definition: promotion.h:181
void clear_width()
Definition: promotion.h:374
void clear_display_link()
Definition: promotion.h:490
Definition: promotion.h:39
const StringPiece get_title() const
Definition: promotion.h:646
bool has_height() const
Definition: promotion.h:293
bool has_link() const
Definition: promotion.h:594
void clear_image()
Definition: promotion.h:564
bool has_url() const
Definition: promotion.h:211
void set_title(const StringPiece &value)
Definition: promotion.h:202
void set_display_link(const StringPiece &value)
Definition: promotion.h:511
void set_url(const StringPiece &value)
Definition: promotion.h:239
void clear_html_title()
Definition: promotion.h:527
const StringPiece GetTypeName() const
Definition: promotion.h:433
void clear_link()
Definition: promotion.h:144
bool has_title() const
Definition: promotion.h:631
int32 get_height() const
Definition: promotion.h:308
void set_width(int32 value)
Definition: promotion.h:394
const PromotionImage get_image() const
Definition: promotion.h:572
const StringPiece GetTypeName() const
Definition: promotion.h:284
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
void clear_title()
Definition: promotion.h:638
void set_title(const StringPiece &value)
Definition: promotion.h:659
void set_html_title(const StringPiece &value)
Definition: promotion.h:548
const StringPiece GetTypeName() const
Definition: promotion.h:91