discovery  v1
json_schema.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-03-06, 06:51:28 UTC
18 // C++ generator version: 0.1.4
19 
20 // ----------------------------------------------------------------------------
21 // NOTE: This file is generated from Google APIs Discovery Service.
22 // Service:
23 // API Discovery Service (discovery/v1)
24 // Generated from:
25 // Version: v1
26 // Revision: 130
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_DISCOVERY_API_JSON_SCHEMA_H_
31 #define GOOGLE_DISCOVERY_API_JSON_SCHEMA_H_
32 
33 #include <string>
34 #include "googleapis/base/macros.h"
35 #include "googleapis/client/data/jsoncpp_data.h"
36 #include "googleapis/strings/stringpiece.h"
37 
38 #include "google/discovery_api/json_schema.h"
39 
40 namespace Json {
41 class Value;
42 } // namespace Json
43 
44 namespace google_discovery_api {
45 using namespace googleapis;
46 
52 class JsonSchema : public client::JsonCppData {
53  public:
59  class JsonSchemaAnnotations : public client::JsonCppData {
60  public:
66  static JsonSchemaAnnotations* New();
67 
73  explicit JsonSchemaAnnotations(const Json::Value& storage);
74 
80  explicit JsonSchemaAnnotations(Json::Value* storage);
81 
85  virtual ~JsonSchemaAnnotations();
86 
92  const StringPiece GetTypeName() const {
93  return StringPiece("google_discovery_api::JsonSchemaAnnotations");
94  }
95 
101  bool has_required() const {
102  return Storage().isMember("required");
103  }
104 
108  void clear_required() {
109  MutableStorage()->removeMember("required");
110  }
111 
112 
116  const client::JsonCppArray<string > get_required() const {
117  const Json::Value& storage = Storage("required");
118  return client::JsonValueToCppValueHelper<client::JsonCppArray<string > >(storage);
119  }
120 
129  client::JsonCppArray<string > mutable_required() {
130  Json::Value* storage = MutableStorage("required");
131  return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<string > >(storage);
132  }
133 
134  private:
135  void operator=(const JsonSchemaAnnotations&);
136  }; // JsonSchemaAnnotations
144  class JsonSchemaVariant : public client::JsonCppData {
145  public:
151  class JsonSchemaVariantMap : public client::JsonCppData {
152  public:
158  static JsonSchemaVariantMap* New();
159 
165  explicit JsonSchemaVariantMap(const Json::Value& storage);
166 
172  explicit JsonSchemaVariantMap(Json::Value* storage);
173 
177  virtual ~JsonSchemaVariantMap();
178 
184  const StringPiece GetTypeName() const {
185  return StringPiece("google_discovery_api::JsonSchemaVariantMap");
186  }
187 
193  bool has_ref() const {
194  return Storage().isMember("$ref");
195  }
196 
200  void clear_ref() {
201  MutableStorage()->removeMember("$ref");
202  }
203 
204 
208  const StringPiece get_ref() const {
209  const Json::Value& v = Storage("$ref");
210  if (v == Json::Value::null) return StringPiece("");
211  return StringPiece(v.asCString());
212  }
213 
218  void set_ref(const StringPiece& value) {
219  *MutableStorage("$ref") = value.data();
220  }
221 
227  bool has_type_value() const {
228  return Storage().isMember("type_value");
229  }
230 
235  MutableStorage()->removeMember("type_value");
236  }
237 
238 
242  const StringPiece get_type_value() const {
243  const Json::Value& v = Storage("type_value");
244  if (v == Json::Value::null) return StringPiece("");
245  return StringPiece(v.asCString());
246  }
247 
252  void set_type_value(const StringPiece& value) {
253  *MutableStorage("type_value") = value.data();
254  }
255 
256  private:
257  void operator=(const JsonSchemaVariantMap&);
258  }; // JsonSchemaVariantMap
264  static JsonSchemaVariant* New();
265 
271  explicit JsonSchemaVariant(const Json::Value& storage);
272 
278  explicit JsonSchemaVariant(Json::Value* storage);
279 
283  virtual ~JsonSchemaVariant();
284 
290  const StringPiece GetTypeName() const {
291  return StringPiece("google_discovery_api::JsonSchemaVariant");
292  }
293 
299  bool has_discriminant() const {
300  return Storage().isMember("discriminant");
301  }
302 
307  MutableStorage()->removeMember("discriminant");
308  }
309 
310 
314  const StringPiece get_discriminant() const {
315  const Json::Value& v = Storage("discriminant");
316  if (v == Json::Value::null) return StringPiece("");
317  return StringPiece(v.asCString());
318  }
319 
327  void set_discriminant(const StringPiece& value) {
328  *MutableStorage("discriminant") = value.data();
329  }
330 
336  bool has_map() const {
337  return Storage().isMember("map");
338  }
339 
343  void clear_map() {
344  MutableStorage()->removeMember("map");
345  }
346 
347 
351  const client::JsonCppArray<JsonSchemaVariantMap > get_map() const {
352  const Json::Value& storage = Storage("map");
353  return client::JsonValueToCppValueHelper<client::JsonCppArray<JsonSchemaVariantMap > >(storage);
354  }
355 
363  client::JsonCppArray<JsonSchemaVariantMap > mutable_map() {
364  Json::Value* storage = MutableStorage("map");
365  return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<JsonSchemaVariantMap > >(storage);
366  }
367 
368  private:
369  void operator=(const JsonSchemaVariant&);
370  }; // JsonSchemaVariant
376  static JsonSchema* New();
377 
383  explicit JsonSchema(const Json::Value& storage);
384 
390  explicit JsonSchema(Json::Value* storage);
391 
395  virtual ~JsonSchema();
396 
402  const StringPiece GetTypeName() const {
403  return StringPiece("google_discovery_api::JsonSchema");
404  }
405 
411  bool has_ref() const {
412  return Storage().isMember("$ref");
413  }
414 
418  void clear_ref() {
419  MutableStorage()->removeMember("$ref");
420  }
421 
422 
426  const StringPiece get_ref() const {
427  const Json::Value& v = Storage("$ref");
428  if (v == Json::Value::null) return StringPiece("");
429  return StringPiece(v.asCString());
430  }
431 
440  void set_ref(const StringPiece& value) {
441  *MutableStorage("$ref") = value.data();
442  }
443 
450  return Storage().isMember("additionalProperties");
451  }
452 
457  MutableStorage()->removeMember("additionalProperties");
458  }
459 
460 
465  const JsonSchema get_additional_properties() const;
466 
476  JsonSchema mutable_additionalProperties();
477 
483  bool has_annotations() const {
484  return Storage().isMember("annotations");
485  }
486 
491  MutableStorage()->removeMember("annotations");
492  }
493 
494 
499  const Json::Value& storage = Storage("annotations");
500  return client::JsonValueToCppValueHelper<JsonSchemaAnnotations >(storage);
501  }
502 
512  Json::Value* storage = MutableStorage("annotations");
513  return client::JsonValueToMutableCppValueHelper<JsonSchemaAnnotations >(storage);
514  }
515 
521  bool has_default() const {
522  return Storage().isMember("default");
523  }
524 
528  void clear_default() {
529  MutableStorage()->removeMember("default");
530  }
531 
532 
536  const StringPiece get_default() const {
537  const Json::Value& v = Storage("default");
538  if (v == Json::Value::null) return StringPiece("");
539  return StringPiece(v.asCString());
540  }
541 
549  void set_default(const StringPiece& value) {
550  *MutableStorage("default") = value.data();
551  }
552 
558  bool has_description() const {
559  return Storage().isMember("description");
560  }
561 
566  MutableStorage()->removeMember("description");
567  }
568 
569 
573  const StringPiece get_description() const {
574  const Json::Value& v = Storage("description");
575  if (v == Json::Value::null) return StringPiece("");
576  return StringPiece(v.asCString());
577  }
578 
586  void set_description(const StringPiece& value) {
587  *MutableStorage("description") = value.data();
588  }
589 
595  bool has_enum() const {
596  return Storage().isMember("enum");
597  }
598 
602  void clear_enum() {
603  MutableStorage()->removeMember("enum");
604  }
605 
606 
610  const client::JsonCppArray<string > get_enum() const {
611  const Json::Value& storage = Storage("enum");
612  return client::JsonValueToCppValueHelper<client::JsonCppArray<string > >(storage);
613  }
614 
622  client::JsonCppArray<string > mutable_enum() {
623  Json::Value* storage = MutableStorage("enum");
624  return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<string > >(storage);
625  }
626 
632  bool has_enum_descriptions() const {
633  return Storage().isMember("enumDescriptions");
634  }
635 
640  MutableStorage()->removeMember("enumDescriptions");
641  }
642 
643 
648  const client::JsonCppArray<string > get_enum_descriptions() const {
649  const Json::Value& storage = Storage("enumDescriptions");
650  return client::JsonValueToCppValueHelper<client::JsonCppArray<string > >(storage);
651  }
652 
662  client::JsonCppArray<string > mutable_enumDescriptions() {
663  Json::Value* storage = MutableStorage("enumDescriptions");
664  return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<string > >(storage);
665  }
666 
672  bool has_format() const {
673  return Storage().isMember("format");
674  }
675 
679  void clear_format() {
680  MutableStorage()->removeMember("format");
681  }
682 
683 
687  const StringPiece get_format() const {
688  const Json::Value& v = Storage("format");
689  if (v == Json::Value::null) return StringPiece("");
690  return StringPiece(v.asCString());
691  }
692 
702  void set_format(const StringPiece& value) {
703  *MutableStorage("format") = value.data();
704  }
705 
711  bool has_id() const {
712  return Storage().isMember("id");
713  }
714 
718  void clear_id() {
719  MutableStorage()->removeMember("id");
720  }
721 
722 
726  const StringPiece get_id() const {
727  const Json::Value& v = Storage("id");
728  if (v == Json::Value::null) return StringPiece("");
729  return StringPiece(v.asCString());
730  }
731 
739  void set_id(const StringPiece& value) {
740  *MutableStorage("id") = value.data();
741  }
742 
748  bool has_items() const {
749  return Storage().isMember("items");
750  }
751 
755  void clear_items() {
756  MutableStorage()->removeMember("items");
757  }
758 
759 
763  const JsonSchema get_items() const;
764 
773  JsonSchema mutable_items();
774 
780  bool has_location() const {
781  return Storage().isMember("location");
782  }
783 
787  void clear_location() {
788  MutableStorage()->removeMember("location");
789  }
790 
791 
795  const StringPiece get_location() const {
796  const Json::Value& v = Storage("location");
797  if (v == Json::Value::null) return StringPiece("");
798  return StringPiece(v.asCString());
799  }
800 
808  void set_location(const StringPiece& value) {
809  *MutableStorage("location") = value.data();
810  }
811 
817  bool has_maximum() const {
818  return Storage().isMember("maximum");
819  }
820 
824  void clear_maximum() {
825  MutableStorage()->removeMember("maximum");
826  }
827 
828 
832  const StringPiece get_maximum() const {
833  const Json::Value& v = Storage("maximum");
834  if (v == Json::Value::null) return StringPiece("");
835  return StringPiece(v.asCString());
836  }
837 
845  void set_maximum(const StringPiece& value) {
846  *MutableStorage("maximum") = value.data();
847  }
848 
854  bool has_minimum() const {
855  return Storage().isMember("minimum");
856  }
857 
861  void clear_minimum() {
862  MutableStorage()->removeMember("minimum");
863  }
864 
865 
869  const StringPiece get_minimum() const {
870  const Json::Value& v = Storage("minimum");
871  if (v == Json::Value::null) return StringPiece("");
872  return StringPiece(v.asCString());
873  }
874 
882  void set_minimum(const StringPiece& value) {
883  *MutableStorage("minimum") = value.data();
884  }
885 
891  bool has_pattern() const {
892  return Storage().isMember("pattern");
893  }
894 
898  void clear_pattern() {
899  MutableStorage()->removeMember("pattern");
900  }
901 
902 
906  const StringPiece get_pattern() const {
907  const Json::Value& v = Storage("pattern");
908  if (v == Json::Value::null) return StringPiece("");
909  return StringPiece(v.asCString());
910  }
911 
921  void set_pattern(const StringPiece& value) {
922  *MutableStorage("pattern") = value.data();
923  }
924 
930  bool has_properties() const {
931  return Storage().isMember("properties");
932  }
933 
938  MutableStorage()->removeMember("properties");
939  }
940 
941 
945  const client::JsonCppAssociativeArray<JsonSchema > get_properties() const;
946 
956  client::JsonCppAssociativeArray<JsonSchema > mutable_properties();
957 
963  bool has_read_only() const {
964  return Storage().isMember("readOnly");
965  }
966 
971  MutableStorage()->removeMember("readOnly");
972  }
973 
974 
978  bool get_read_only() const {
979  const Json::Value& storage = Storage("readOnly");
980  return client::JsonValueToCppValueHelper<bool >(storage);
981  }
982 
992  void set_read_only(bool value) {
993  client::SetJsonValueFromCppValueHelper<bool >(
994  value, MutableStorage("readOnly"));
995  }
996 
1002  bool has_repeated() const {
1003  return Storage().isMember("repeated");
1004  }
1005 
1010  MutableStorage()->removeMember("repeated");
1011  }
1012 
1013 
1017  bool get_repeated() const {
1018  const Json::Value& storage = Storage("repeated");
1019  return client::JsonValueToCppValueHelper<bool >(storage);
1020  }
1021 
1029  void set_repeated(bool value) {
1030  client::SetJsonValueFromCppValueHelper<bool >(
1031  value, MutableStorage("repeated"));
1032  }
1033 
1039  bool has_required() const {
1040  return Storage().isMember("required");
1041  }
1042 
1047  MutableStorage()->removeMember("required");
1048  }
1049 
1050 
1054  bool get_required() const {
1055  const Json::Value& storage = Storage("required");
1056  return client::JsonValueToCppValueHelper<bool >(storage);
1057  }
1058 
1066  void set_required(bool value) {
1067  client::SetJsonValueFromCppValueHelper<bool >(
1068  value, MutableStorage("required"));
1069  }
1070 
1076  bool has_type() const {
1077  return Storage().isMember("type");
1078  }
1079 
1083  void clear_type() {
1084  MutableStorage()->removeMember("type");
1085  }
1086 
1087 
1091  const StringPiece get_type() const {
1092  const Json::Value& v = Storage("type");
1093  if (v == Json::Value::null) return StringPiece("");
1094  return StringPiece(v.asCString());
1095  }
1096 
1105  void set_type(const StringPiece& value) {
1106  *MutableStorage("type") = value.data();
1107  }
1108 
1114  bool has_variant() const {
1115  return Storage().isMember("variant");
1116  }
1117 
1121  void clear_variant() {
1122  MutableStorage()->removeMember("variant");
1123  }
1124 
1125 
1130  const Json::Value& storage = Storage("variant");
1131  return client::JsonValueToCppValueHelper<JsonSchemaVariant >(storage);
1132  }
1133 
1144  Json::Value* storage = MutableStorage("variant");
1145  return client::JsonValueToMutableCppValueHelper<JsonSchemaVariant >(storage);
1146  }
1147 
1148  private:
1149  void operator=(const JsonSchema&);
1150 }; // JsonSchema
1151 } // namespace google_discovery_api
1152 #endif // GOOGLE_DISCOVERY_API_JSON_SCHEMA_H_
const StringPiece get_ref() const
Definition: json_schema.h:208
bool has_additional_properties() const
Definition: json_schema.h:449
const StringPiece get_ref() const
Definition: json_schema.h:426
const StringPiece get_location() const
Definition: json_schema.h:795
bool get_repeated() const
Definition: json_schema.h:1017
const JsonSchemaVariant get_variant() const
Definition: json_schema.h:1129
bool has_location() const
Definition: json_schema.h:780
void clear_required()
Definition: json_schema.h:108
const StringPiece GetTypeName() const
Definition: json_schema.h:290
const StringPiece get_pattern() const
Definition: json_schema.h:906
void set_read_only(bool value)
Definition: json_schema.h:992
void set_location(const StringPiece &value)
Definition: json_schema.h:808
bool has_variant() const
Definition: json_schema.h:1114
void set_id(const StringPiece &value)
Definition: json_schema.h:739
bool has_pattern() const
Definition: json_schema.h:891
bool has_id() const
Definition: json_schema.h:711
bool has_map() const
Definition: json_schema.h:336
bool has_required() const
Definition: json_schema.h:1039
const StringPiece get_minimum() const
Definition: json_schema.h:869
const StringPiece get_discriminant() const
Definition: json_schema.h:314
void clear_pattern()
Definition: json_schema.h:898
bool has_items() const
Definition: json_schema.h:748
bool has_maximum() const
Definition: json_schema.h:817
void set_type(const StringPiece &value)
Definition: json_schema.h:1105
client::JsonCppArray< string > mutable_enumDescriptions()
Definition: json_schema.h:662
bool get_read_only() const
Definition: json_schema.h:978
void clear_map()
Definition: json_schema.h:343
const StringPiece GetTypeName() const
Definition: json_schema.h:92
const JsonSchemaAnnotations get_annotations() const
Definition: json_schema.h:498
void set_description(const StringPiece &value)
Definition: json_schema.h:586
client::JsonCppArray< string > mutable_required()
Definition: json_schema.h:129
bool has_properties() const
Definition: json_schema.h:930
void clear_repeated()
Definition: json_schema.h:1009
bool has_format() const
Definition: json_schema.h:672
const client::JsonCppArray< string > get_enum() const
Definition: json_schema.h:610
bool has_ref() const
Definition: json_schema.h:411
bool has_description() const
Definition: json_schema.h:558
const client::JsonCppArray< JsonSchemaVariantMap > get_map() const
Definition: json_schema.h:351
bool has_minimum() const
Definition: json_schema.h:854
void set_repeated(bool value)
Definition: json_schema.h:1029
const StringPiece get_description() const
Definition: json_schema.h:573
bool has_read_only() const
Definition: json_schema.h:963
void clear_annotations()
Definition: json_schema.h:490
void set_minimum(const StringPiece &value)
Definition: json_schema.h:882
void clear_default()
Definition: json_schema.h:528
void set_format(const StringPiece &value)
Definition: json_schema.h:702
const client::JsonCppArray< string > get_required() const
Definition: json_schema.h:116
void clear_variant()
Definition: json_schema.h:1121
bool has_default() const
Definition: json_schema.h:521
void clear_format()
Definition: json_schema.h:679
void set_maximum(const StringPiece &value)
Definition: json_schema.h:845
JsonSchemaVariant mutable_variant()
Definition: json_schema.h:1143
bool has_enum() const
Definition: json_schema.h:595
void clear_items()
Definition: json_schema.h:755
void clear_ref()
Definition: json_schema.h:418
Definition: json_schema.h:52
void set_discriminant(const StringPiece &value)
Definition: json_schema.h:327
Definition: directory_list.h:38
void clear_location()
Definition: json_schema.h:787
bool has_discriminant() const
Definition: json_schema.h:299
bool has_enum_descriptions() const
Definition: json_schema.h:632
void clear_read_only()
Definition: json_schema.h:970
Definition: directory_list.cc:40
void clear_properties()
Definition: json_schema.h:937
const StringPiece get_type_value() const
Definition: json_schema.h:242
client::JsonCppArray< JsonSchemaVariantMap > mutable_map()
Definition: json_schema.h:363
const StringPiece get_maximum() const
Definition: json_schema.h:832
const StringPiece get_id() const
Definition: json_schema.h:726
void set_default(const StringPiece &value)
Definition: json_schema.h:549
const client::JsonCppArray< string > get_enum_descriptions() const
Definition: json_schema.h:648
void clear_id()
Definition: json_schema.h:718
bool has_annotations() const
Definition: json_schema.h:483
bool has_required() const
Definition: json_schema.h:101
void set_pattern(const StringPiece &value)
Definition: json_schema.h:921
void clear_type()
Definition: json_schema.h:1083
client::JsonCppArray< string > mutable_enum()
Definition: json_schema.h:622
void set_ref(const StringPiece &value)
Definition: json_schema.h:218
void set_required(bool value)
Definition: json_schema.h:1066
void clear_enum_descriptions()
Definition: json_schema.h:639
void clear_enum()
Definition: json_schema.h:602
void clear_maximum()
Definition: json_schema.h:824
const StringPiece get_default() const
Definition: json_schema.h:536
void set_ref(const StringPiece &value)
Definition: json_schema.h:440
void clear_required()
Definition: json_schema.h:1046
void clear_description()
Definition: json_schema.h:565
void clear_minimum()
Definition: json_schema.h:861
bool get_required() const
Definition: json_schema.h:1054
const StringPiece get_type() const
Definition: json_schema.h:1091
const StringPiece get_format() const
Definition: json_schema.h:687
const StringPiece GetTypeName() const
Definition: json_schema.h:184
void set_type_value(const StringPiece &value)
Definition: json_schema.h:252
const StringPiece GetTypeName() const
Definition: json_schema.h:402
void clear_additional_properties()
Definition: json_schema.h:456
bool has_type() const
Definition: json_schema.h:1076
void clear_discriminant()
Definition: json_schema.h:306
JsonSchemaAnnotations mutable_annotations()
Definition: json_schema.h:511
bool has_repeated() const
Definition: json_schema.h:1002