customsearch  v1
result.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_RESULT_H_
31 #define GOOGLE_CUSTOMSEARCH_API_RESULT_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 Result : public client::JsonCppData {
52  public:
58  class ResultImage : public client::JsonCppData {
59  public:
65  static ResultImage* New();
66 
72  explicit ResultImage(const Json::Value& storage);
73 
79  explicit ResultImage(Json::Value* storage);
80 
84  virtual ~ResultImage();
85 
91  const StringPiece GetTypeName() const {
92  return StringPiece("google_customsearch_api::ResultImage");
93  }
94 
100  bool has_byte_size() const {
101  return Storage().isMember("byteSize");
102  }
103 
108  MutableStorage()->removeMember("byteSize");
109  }
110 
111 
115  int32 get_byte_size() const {
116  const Json::Value& storage = Storage("byteSize");
117  return client::JsonValueToCppValueHelper<int32 >(storage);
118  }
119 
127  void set_byte_size(int32 value) {
128  client::SetJsonValueFromCppValueHelper<int32 >(
129  value, MutableStorage("byteSize"));
130  }
131 
137  bool has_context_link() const {
138  return Storage().isMember("contextLink");
139  }
140 
145  MutableStorage()->removeMember("contextLink");
146  }
147 
148 
152  const StringPiece get_context_link() const {
153  const Json::Value& v = Storage("contextLink");
154  if (v == Json::Value::null) return StringPiece("");
155  return StringPiece(v.asCString());
156  }
157 
165  void set_context_link(const StringPiece& value) {
166  *MutableStorage("contextLink") = value.data();
167  }
168 
174  bool has_height() const {
175  return Storage().isMember("height");
176  }
177 
181  void clear_height() {
182  MutableStorage()->removeMember("height");
183  }
184 
185 
189  int32 get_height() const {
190  const Json::Value& storage = Storage("height");
191  return client::JsonValueToCppValueHelper<int32 >(storage);
192  }
193 
201  void set_height(int32 value) {
202  client::SetJsonValueFromCppValueHelper<int32 >(
203  value, MutableStorage("height"));
204  }
205 
211  bool has_thumbnail_height() const {
212  return Storage().isMember("thumbnailHeight");
213  }
214 
219  MutableStorage()->removeMember("thumbnailHeight");
220  }
221 
222 
226  int32 get_thumbnail_height() const {
227  const Json::Value& storage = Storage("thumbnailHeight");
228  return client::JsonValueToCppValueHelper<int32 >(storage);
229  }
230 
238  void set_thumbnail_height(int32 value) {
239  client::SetJsonValueFromCppValueHelper<int32 >(
240  value, MutableStorage("thumbnailHeight"));
241  }
242 
248  bool has_thumbnail_link() const {
249  return Storage().isMember("thumbnailLink");
250  }
251 
256  MutableStorage()->removeMember("thumbnailLink");
257  }
258 
259 
263  const StringPiece get_thumbnail_link() const {
264  const Json::Value& v = Storage("thumbnailLink");
265  if (v == Json::Value::null) return StringPiece("");
266  return StringPiece(v.asCString());
267  }
268 
276  void set_thumbnail_link(const StringPiece& value) {
277  *MutableStorage("thumbnailLink") = value.data();
278  }
279 
285  bool has_thumbnail_width() const {
286  return Storage().isMember("thumbnailWidth");
287  }
288 
293  MutableStorage()->removeMember("thumbnailWidth");
294  }
295 
296 
300  int32 get_thumbnail_width() const {
301  const Json::Value& storage = Storage("thumbnailWidth");
302  return client::JsonValueToCppValueHelper<int32 >(storage);
303  }
304 
312  void set_thumbnail_width(int32 value) {
313  client::SetJsonValueFromCppValueHelper<int32 >(
314  value, MutableStorage("thumbnailWidth"));
315  }
316 
322  bool has_width() const {
323  return Storage().isMember("width");
324  }
325 
329  void clear_width() {
330  MutableStorage()->removeMember("width");
331  }
332 
333 
337  int32 get_width() const {
338  const Json::Value& storage = Storage("width");
339  return client::JsonValueToCppValueHelper<int32 >(storage);
340  }
341 
349  void set_width(int32 value) {
350  client::SetJsonValueFromCppValueHelper<int32 >(
351  value, MutableStorage("width"));
352  }
353 
354  private:
355  void operator=(const ResultImage&);
356  }; // ResultImage
362  class ResultLabels : public client::JsonCppData {
363  public:
369  static ResultLabels* New();
370 
376  explicit ResultLabels(const Json::Value& storage);
377 
383  explicit ResultLabels(Json::Value* storage);
384 
388  virtual ~ResultLabels();
389 
395  const StringPiece GetTypeName() const {
396  return StringPiece("google_customsearch_api::ResultLabels");
397  }
398 
404  bool has_display_name() const {
405  return Storage().isMember("displayName");
406  }
407 
412  MutableStorage()->removeMember("displayName");
413  }
414 
415 
419  const StringPiece get_display_name() const {
420  const Json::Value& v = Storage("displayName");
421  if (v == Json::Value::null) return StringPiece("");
422  return StringPiece(v.asCString());
423  }
424 
433  void set_display_name(const StringPiece& value) {
434  *MutableStorage("displayName") = value.data();
435  }
436 
442  bool has_label_with_op() const {
443  return Storage().isMember("label_with_op");
444  }
445 
450  MutableStorage()->removeMember("label_with_op");
451  }
452 
453 
457  const StringPiece get_label_with_op() const {
458  const Json::Value& v = Storage("label_with_op");
459  if (v == Json::Value::null) return StringPiece("");
460  return StringPiece(v.asCString());
461  }
462 
470  void set_label_with_op(const StringPiece& value) {
471  *MutableStorage("label_with_op") = value.data();
472  }
473 
479  bool has_name() const {
480  return Storage().isMember("name");
481  }
482 
486  void clear_name() {
487  MutableStorage()->removeMember("name");
488  }
489 
490 
494  const StringPiece get_name() const {
495  const Json::Value& v = Storage("name");
496  if (v == Json::Value::null) return StringPiece("");
497  return StringPiece(v.asCString());
498  }
499 
508  void set_name(const StringPiece& value) {
509  *MutableStorage("name") = value.data();
510  }
511 
512  private:
513  void operator=(const ResultLabels&);
514  }; // ResultLabels
520  static Result* New();
521 
527  explicit Result(const Json::Value& storage);
528 
534  explicit Result(Json::Value* storage);
535 
539  virtual ~Result();
540 
546  const StringPiece GetTypeName() const {
547  return StringPiece("google_customsearch_api::Result");
548  }
549 
555  bool has_cache_id() const {
556  return Storage().isMember("cacheId");
557  }
558 
562  void clear_cache_id() {
563  MutableStorage()->removeMember("cacheId");
564  }
565 
566 
570  const StringPiece get_cache_id() const {
571  const Json::Value& v = Storage("cacheId");
572  if (v == Json::Value::null) return StringPiece("");
573  return StringPiece(v.asCString());
574  }
575 
583  void set_cache_id(const StringPiece& value) {
584  *MutableStorage("cacheId") = value.data();
585  }
586 
592  bool has_display_link() const {
593  return Storage().isMember("displayLink");
594  }
595 
600  MutableStorage()->removeMember("displayLink");
601  }
602 
603 
607  const StringPiece get_display_link() const {
608  const Json::Value& v = Storage("displayLink");
609  if (v == Json::Value::null) return StringPiece("");
610  return StringPiece(v.asCString());
611  }
612 
620  void set_display_link(const StringPiece& value) {
621  *MutableStorage("displayLink") = value.data();
622  }
623 
629  bool has_file_format() const {
630  return Storage().isMember("fileFormat");
631  }
632 
637  MutableStorage()->removeMember("fileFormat");
638  }
639 
640 
644  const StringPiece get_file_format() const {
645  const Json::Value& v = Storage("fileFormat");
646  if (v == Json::Value::null) return StringPiece("");
647  return StringPiece(v.asCString());
648  }
649 
657  void set_file_format(const StringPiece& value) {
658  *MutableStorage("fileFormat") = value.data();
659  }
660 
666  bool has_formatted_url() const {
667  return Storage().isMember("formattedUrl");
668  }
669 
674  MutableStorage()->removeMember("formattedUrl");
675  }
676 
677 
681  const StringPiece get_formatted_url() const {
682  const Json::Value& v = Storage("formattedUrl");
683  if (v == Json::Value::null) return StringPiece("");
684  return StringPiece(v.asCString());
685  }
686 
694  void set_formatted_url(const StringPiece& value) {
695  *MutableStorage("formattedUrl") = value.data();
696  }
697 
703  bool has_html_formatted_url() const {
704  return Storage().isMember("htmlFormattedUrl");
705  }
706 
711  MutableStorage()->removeMember("htmlFormattedUrl");
712  }
713 
714 
718  const StringPiece get_html_formatted_url() const {
719  const Json::Value& v = Storage("htmlFormattedUrl");
720  if (v == Json::Value::null) return StringPiece("");
721  return StringPiece(v.asCString());
722  }
723 
731  void set_html_formatted_url(const StringPiece& value) {
732  *MutableStorage("htmlFormattedUrl") = value.data();
733  }
734 
740  bool has_html_snippet() const {
741  return Storage().isMember("htmlSnippet");
742  }
743 
748  MutableStorage()->removeMember("htmlSnippet");
749  }
750 
751 
755  const StringPiece get_html_snippet() const {
756  const Json::Value& v = Storage("htmlSnippet");
757  if (v == Json::Value::null) return StringPiece("");
758  return StringPiece(v.asCString());
759  }
760 
768  void set_html_snippet(const StringPiece& value) {
769  *MutableStorage("htmlSnippet") = value.data();
770  }
771 
777  bool has_html_title() const {
778  return Storage().isMember("htmlTitle");
779  }
780 
785  MutableStorage()->removeMember("htmlTitle");
786  }
787 
788 
792  const StringPiece get_html_title() const {
793  const Json::Value& v = Storage("htmlTitle");
794  if (v == Json::Value::null) return StringPiece("");
795  return StringPiece(v.asCString());
796  }
797 
805  void set_html_title(const StringPiece& value) {
806  *MutableStorage("htmlTitle") = value.data();
807  }
808 
814  bool has_image() const {
815  return Storage().isMember("image");
816  }
817 
821  void clear_image() {
822  MutableStorage()->removeMember("image");
823  }
824 
825 
829  const ResultImage get_image() const {
830  const Json::Value& storage = Storage("image");
831  return client::JsonValueToCppValueHelper<ResultImage >(storage);
832  }
833 
842  Json::Value* storage = MutableStorage("image");
843  return client::JsonValueToMutableCppValueHelper<ResultImage >(storage);
844  }
845 
851  bool has_kind() const {
852  return Storage().isMember("kind");
853  }
854 
858  void clear_kind() {
859  MutableStorage()->removeMember("kind");
860  }
861 
862 
866  const StringPiece get_kind() const {
867  const Json::Value& v = Storage("kind");
868  if (v == Json::Value::null) return StringPiece("");
869  return StringPiece(v.asCString());
870  }
871 
880  void set_kind(const StringPiece& value) {
881  *MutableStorage("kind") = value.data();
882  }
883 
889  bool has_labels() const {
890  return Storage().isMember("labels");
891  }
892 
896  void clear_labels() {
897  MutableStorage()->removeMember("labels");
898  }
899 
900 
904  const client::JsonCppArray<ResultLabels > get_labels() const {
905  const Json::Value& storage = Storage("labels");
906  return client::JsonValueToCppValueHelper<client::JsonCppArray<ResultLabels > >(storage);
907  }
908 
917  client::JsonCppArray<ResultLabels > mutable_labels() {
918  Json::Value* storage = MutableStorage("labels");
919  return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<ResultLabels > >(storage);
920  }
921 
927  bool has_link() const {
928  return Storage().isMember("link");
929  }
930 
934  void clear_link() {
935  MutableStorage()->removeMember("link");
936  }
937 
938 
942  const StringPiece get_link() const {
943  const Json::Value& v = Storage("link");
944  if (v == Json::Value::null) return StringPiece("");
945  return StringPiece(v.asCString());
946  }
947 
956  void set_link(const StringPiece& value) {
957  *MutableStorage("link") = value.data();
958  }
959 
965  bool has_mime() const {
966  return Storage().isMember("mime");
967  }
968 
972  void clear_mime() {
973  MutableStorage()->removeMember("mime");
974  }
975 
976 
980  const StringPiece get_mime() const {
981  const Json::Value& v = Storage("mime");
982  if (v == Json::Value::null) return StringPiece("");
983  return StringPiece(v.asCString());
984  }
985 
993  void set_mime(const StringPiece& value) {
994  *MutableStorage("mime") = value.data();
995  }
996 
1002  bool has_pagemap() const {
1003  return Storage().isMember("pagemap");
1004  }
1005 
1009  void clear_pagemap() {
1010  MutableStorage()->removeMember("pagemap");
1011  }
1012 
1013 
1017  const client::JsonCppAssociativeArray<client::JsonCppData > get_pagemap() const {
1018  const Json::Value& storage = Storage("pagemap");
1019  return client::JsonValueToCppValueHelper<client::JsonCppAssociativeArray<client::JsonCppData > >(storage);
1020  }
1021 
1032  client::JsonCppAssociativeArray<client::JsonCppData > mutable_pagemap() {
1033  Json::Value* storage = MutableStorage("pagemap");
1034  return client::JsonValueToMutableCppValueHelper<client::JsonCppAssociativeArray<client::JsonCppData > >(storage);
1035  }
1036 
1042  bool has_snippet() const {
1043  return Storage().isMember("snippet");
1044  }
1045 
1049  void clear_snippet() {
1050  MutableStorage()->removeMember("snippet");
1051  }
1052 
1053 
1057  const StringPiece get_snippet() const {
1058  const Json::Value& v = Storage("snippet");
1059  if (v == Json::Value::null) return StringPiece("");
1060  return StringPiece(v.asCString());
1061  }
1062 
1070  void set_snippet(const StringPiece& value) {
1071  *MutableStorage("snippet") = value.data();
1072  }
1073 
1079  bool has_title() const {
1080  return Storage().isMember("title");
1081  }
1082 
1086  void clear_title() {
1087  MutableStorage()->removeMember("title");
1088  }
1089 
1090 
1094  const StringPiece get_title() const {
1095  const Json::Value& v = Storage("title");
1096  if (v == Json::Value::null) return StringPiece("");
1097  return StringPiece(v.asCString());
1098  }
1099 
1107  void set_title(const StringPiece& value) {
1108  *MutableStorage("title") = value.data();
1109  }
1110 
1111  private:
1112  void operator=(const Result&);
1113 }; // Result
1114 } // namespace google_customsearch_api
1115 #endif // GOOGLE_CUSTOMSEARCH_API_RESULT_H_
bool has_height() const
Definition: result.h:174
void clear_html_title()
Definition: result.h:784
int32 get_thumbnail_width() const
Definition: result.h:300
bool has_name() const
Definition: result.h:479
void clear_snippet()
Definition: result.h:1049
void clear_height()
Definition: result.h:181
const StringPiece get_mime() const
Definition: result.h:980
const StringPiece get_snippet() const
Definition: result.h:1057
bool has_file_format() const
Definition: result.h:629
const StringPiece get_html_formatted_url() const
Definition: result.h:718
void set_name(const StringPiece &value)
Definition: result.h:508
int32 get_byte_size() const
Definition: result.h:115
bool has_thumbnail_width() const
Definition: result.h:285
const StringPiece get_link() const
Definition: result.h:942
int32 get_height() const
Definition: result.h:189
void clear_name()
Definition: result.h:486
bool has_image() const
Definition: result.h:814
void clear_image()
Definition: result.h:821
void clear_thumbnail_link()
Definition: result.h:255
const StringPiece get_thumbnail_link() const
Definition: result.h:263
Definition: customsearch_service.cc:40
void set_mime(const StringPiece &value)
Definition: result.h:993
void clear_label_with_op()
Definition: result.h:449
int32 get_width() const
Definition: result.h:337
bool has_thumbnail_height() const
Definition: result.h:211
const StringPiece GetTypeName() const
Definition: result.h:546
bool has_display_link() const
Definition: result.h:592
void clear_context_link()
Definition: result.h:144
const StringPiece get_label_with_op() const
Definition: result.h:457
void set_html_title(const StringPiece &value)
Definition: result.h:805
bool has_kind() const
Definition: result.h:851
void set_width(int32 value)
Definition: result.h:349
bool has_title() const
Definition: result.h:1079
void clear_labels()
Definition: result.h:896
void set_html_snippet(const StringPiece &value)
Definition: result.h:768
const StringPiece get_file_format() const
Definition: result.h:644
client::JsonCppArray< ResultLabels > mutable_labels()
Definition: result.h:917
void set_display_link(const StringPiece &value)
Definition: result.h:620
bool has_display_name() const
Definition: result.h:404
void clear_display_name()
Definition: result.h:411
bool has_snippet() const
Definition: result.h:1042
bool has_html_formatted_url() const
Definition: result.h:703
void clear_kind()
Definition: result.h:858
void clear_display_link()
Definition: result.h:599
const StringPiece get_kind() const
Definition: result.h:866
void set_display_name(const StringPiece &value)
Definition: result.h:433
void clear_formatted_url()
Definition: result.h:673
const StringPiece get_context_link() const
Definition: result.h:152
void clear_link()
Definition: result.h:934
bool has_label_with_op() const
Definition: result.h:442
void clear_mime()
Definition: result.h:972
void clear_html_snippet()
Definition: result.h:747
void clear_html_formatted_url()
Definition: result.h:710
void set_link(const StringPiece &value)
Definition: result.h:956
void set_kind(const StringPiece &value)
Definition: result.h:880
void clear_width()
Definition: result.h:329
const ResultImage get_image() const
Definition: result.h:829
void clear_thumbnail_height()
Definition: result.h:218
Definition: result.h:51
const StringPiece GetTypeName() const
Definition: result.h:395
const client::JsonCppAssociativeArray< client::JsonCppData > get_pagemap() const
Definition: result.h:1017
client::JsonCppAssociativeArray< client::JsonCppData > mutable_pagemap()
Definition: result.h:1032
void set_byte_size(int32 value)
Definition: result.h:127
void clear_cache_id()
Definition: result.h:562
void clear_thumbnail_width()
Definition: result.h:292
bool has_thumbnail_link() const
Definition: result.h:248
Definition: promotion.h:39
const StringPiece get_cache_id() const
Definition: result.h:570
void clear_title()
Definition: result.h:1086
void set_thumbnail_height(int32 value)
Definition: result.h:238
void set_title(const StringPiece &value)
Definition: result.h:1107
bool has_context_link() const
Definition: result.h:137
void set_height(int32 value)
Definition: result.h:201
void set_label_with_op(const StringPiece &value)
Definition: result.h:470
bool has_mime() const
Definition: result.h:965
void set_file_format(const StringPiece &value)
Definition: result.h:657
const StringPiece get_html_snippet() const
Definition: result.h:755
const StringPiece get_name() const
Definition: result.h:494
int32 get_thumbnail_height() const
Definition: result.h:226
bool has_width() const
Definition: result.h:322
void set_cache_id(const StringPiece &value)
Definition: result.h:583
bool has_html_title() const
Definition: result.h:777
void clear_file_format()
Definition: result.h:636
void clear_pagemap()
Definition: result.h:1009
const StringPiece get_html_title() const
Definition: result.h:792
void set_context_link(const StringPiece &value)
Definition: result.h:165
const StringPiece get_display_name() const
Definition: result.h:419
bool has_cache_id() const
Definition: result.h:555
const StringPiece get_formatted_url() const
Definition: result.h:681
const StringPiece GetTypeName() const
Definition: result.h:91
void set_thumbnail_width(int32 value)
Definition: result.h:312
const StringPiece get_display_link() const
Definition: result.h:607
bool has_formatted_url() const
Definition: result.h:666
bool has_pagemap() const
Definition: result.h:1002
void clear_byte_size()
Definition: result.h:107
void set_thumbnail_link(const StringPiece &value)
Definition: result.h:276
bool has_labels() const
Definition: result.h:889
void set_html_formatted_url(const StringPiece &value)
Definition: result.h:731
void set_formatted_url(const StringPiece &value)
Definition: result.h:694
ResultImage mutable_image()
Definition: result.h:841
bool has_byte_size() const
Definition: result.h:100
const client::JsonCppArray< ResultLabels > get_labels() const
Definition: result.h:904
bool has_html_snippet() const
Definition: result.h:740
const StringPiece get_title() const
Definition: result.h:1094
void set_snippet(const StringPiece &value)
Definition: result.h:1070
bool has_link() const
Definition: result.h:927