Qore SwaggerDataProvider Module Reference  1.2.2
SwaggerDataProvider.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
28 class SwaggerDataProvider : public AbstractDataProvider {
29 
30 public:
32  SwaggerSchema schema;
33 
36 
38  string uri_path = "/";
39 
41  string display_name;
42 
44  const ProviderInfo = <DataProviderInfo>{
45  "type": "SwaggerDataProvider",
46  "supports_read": False,
47  "supports_create": False,
48  "supports_update": False,
49  "supports_upsert": False,
50  "supports_delete": False,
51  "supports_native_search": False,
52  "supports_bulk_create": False,
53  "supports_bulk_upsert": False,
54  "supports_children": True,
55  "constructor_options": ConstructorOptions,
56  "search_options": NOTHING,
57  "create_options": NOTHING,
58  "upsert_options": NOTHING,
59  "transaction_management": False,
60  "supports_schema": True,
61  "schema_type": "swagger",
62  };
63 
65  const ConstructorOptions = {
66  "schema": <DataProviderOptionInfo>{
67  "type": (
68  AbstractDataProviderType::get(StringType, NOTHING, {
69  DTT_FromFile: True,
70  DTT_FromLocation: True,
71  }),
72  AbstractDataProviderType::get(new Type("SwaggerSchema")),
73  ),
74  "desc": "the Swagger schema object or source URL",
75  "required": True,
76  },
77  "restclient": <DataProviderOptionInfo>{
78  "type": AbstractDataProviderType::get(new Type("RestClient"), NOTHING, {
79  DTT_ClientOnly: True,
80  }),
81  "desc": "the RestClient object",
82  },
83  "url": <DataProviderOptionInfo>{
84  "type": AbstractDataProviderType::get(StringType, NOTHING, {
85  DTT_ClientOnly: True,
86  }),
87  "desc": "the URL to the REST server; overrides any URL in the schema or in any RestClient object "
88  "passed as an option",
89  },
90  "restclient_options": <DataProviderOptionInfo>{
91  "type": AbstractDataProviderType::get(AutoHashType, NOTHING, {
92  DTT_ClientOnly: True,
93  }),
94  "desc": "options to the RestClient constructor; only used if a RestClient object is created for a "
95  "call",
96  },
97  };
98 
100  const HttpMethods = {
101  "GET": True,
102  "PUT": True,
103  "PATCH": True,
104  "POST": True,
105  "DELETE": True,
106  };
107 
108 protected:
110  hash<auto> path_tree;
111 
112 public:
113 
115 protected:
116  constructor(hash<auto> path_tree, string uri_path, SwaggerSchema schema, *RestClient rest);
117 public:
118 
119 
121  constructor(SwaggerSchema schema, *RestClient rest);
122 
123 
125  constructor(*hash<auto> options);
126 
127 
129  string getName();
130 
131 
133  *string getDesc();
134 
135 
137 protected:
139 public:
140 
141 
142 protected:
143  setupTree();
144 public:
145 
146 
148 
150 protected:
151  *list<string> getChildProviderNamesImpl();
152 public:
153 
154 
156 
160 protected:
161  *AbstractDataProvider getChildProviderImpl(string name);
162 public:
163 
164 
166 protected:
167  AbstractDataProvider getChildIntern(string name, *string real_name);
168 public:
169 
170 
172 protected:
173  hash<DataProviderInfo> getStaticInfoImpl();
174 public:
175 
176 
178 protected:
180 public:
181 
182 };
183 }; // end namespace swagger
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
string getName()
Returns the data provider name.
checkRestClient(RestClient rest)
Checks the REST client.
SwaggerSchema schema
The Swagger schema.
Definition: SwaggerDataProvider.qc.dox.h:32
*list< string > getChildProviderNamesImpl()
Returns a list of child data provider names, if any.
constructor(*hash< auto > options)
Creates the object from constructor options.
AbstractDataProvider getChildIntern(string name, *string real_name)
Returns the child provider for the given path component.
string display_name
The value to returns as the name of the object.
Definition: SwaggerDataProvider.qc.dox.h:41
constructor(SwaggerSchema schema, *RestClient rest)
Creates the object from the arguments.
object getSchemaObjectImpl()
Returns the schema supporting this data provider.
*AbstractDataProvider getChildProviderImpl(string name)
Returns the given child provider or NOTHING if the given child is unknown.
*RestClient rest
The REST client object for API calls.
Definition: SwaggerDataProvider.qc.dox.h:35
constructor(hash< auto > path_tree, string uri_path, SwaggerSchema schema, *RestClient rest)
Private constructor; used when traversing the tree.
*string getDesc()
Returns the data provider description.
hash< auto > path_tree
hash of valid paths
Definition: SwaggerDataProvider.qc.dox.h:110
const True
const False
const NOTHING
Qore SwaggerDataProvider module definition.
Definition: SwaggerDataProvider.qc.dox.h:26