Qore SwaggerDataProvider Module Reference 1.3
Loading...
Searching...
No Matches
SwaggerDataProvider.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
29
30public:
32 string uri_path = "/";
33
36
38 const ProviderInfo = <DataProviderInfo>{
39 "type": "SwaggerDataProvider",
40 "supports_read": False,
41 "supports_create": False,
42 "supports_update": False,
43 "supports_upsert": False,
44 "supports_delete": False,
45 "supports_native_search": False,
46 "supports_bulk_create": False,
47 "supports_bulk_upsert": False,
48 "supports_children": True,
49 "constructor_options": ConstructorOptions,
50 "search_options": NOTHING,
51 "create_options": NOTHING,
52 "upsert_options": NOTHING,
53 "transaction_management": False,
54 "supports_schema": True,
55 "schema_type": "swagger",
56 "children_can_support_apis": True,
57 "children_can_support_records": False,
58 "children_can_support_observers": False,
59 };
60
62 const ConstructorOptions = {
63 "lax_parsing": <DataProviderOptionInfo>{
64 "type": AbstractDataProviderTypeMap."bool",
65 "desc": "If `True` then common errors in Swagger schemas will be ignored; some Swagger schemas with "
66 "errors will be able to be used",
67 },
68 "restclient": <DataProviderOptionInfo>{
69 "type": AbstractDataProviderType::get(new Type("RestClient"), NOTHING, {
70 DTT_ClientOnly: True,
71 }),
72 "desc": "the RestClient object",
73 },
74 "restclient_options": <DataProviderOptionInfo>{
75 "type": AbstractDataProviderType::get(AutoHashType, NOTHING, {
76 DTT_ClientOnly: True,
77 }),
78 "desc": "options to the RestClient constructor; only used if a RestClient object is created for a "
79 "call",
80 },
81 "schema": <DataProviderOptionInfo>{
82 "type": (
83 AbstractDataProviderType::get(StringType, NOTHING, {
84 DTT_FromFile: True,
85 DTT_FromLocation: True,
86 }),
87 AbstractDataProviderType::get(new Type("SwaggerSchema")),
88 ),
89 "desc": "the Swagger schema object or source URL",
90 "required": True,
91 },
92 "url": <DataProviderOptionInfo>{
93 "type": AbstractDataProviderType::get(StringType, NOTHING, {
94 DTT_ClientOnly: True,
95 }),
96 "desc": "the URL to the REST server; overrides any URL in the schema or in any RestClient object "
97 "passed as an option",
98 },
99 };
100
102 const HttpMethods = {
103 "GET": True,
104 "PUT": True,
105 "PATCH": True,
106 "POST": True,
107 "DELETE": True,
108 };
109
110protected:
112 hash<auto> path_tree;
113
114public:
115
117protected:
118 constructor(hash<auto> path_tree, string uri_path, SwaggerSchema schema, *RestClient rest) ;
119public:
120
121
123 constructor(SwaggerSchema schema, *RestClient rest) ;
124
125
127 constructor(*hash<auto> options);
128
129
131 string getName();
132
133
135 *string getDesc();
136
137
139protected:
140 setSchema(SwaggerSchema schema);
141public:
142
143
145protected:
147public:
148
149
150protected:
151 setupTree();
152public:
153
154
156
158protected:
160public:
161
162
164
168protected:
169 *AbstractDataProvider getChildProviderImpl(string name);
170public:
171
172
174protected:
175 AbstractDataProvider getChildIntern(string name, *string real_name);
176public:
177
178
180protected:
181 hash<DataProviderInfo> getStaticInfoImpl();
182public:
183
184
186protected:
188public:
189
190};
191}; // end namespace swagger
The Swagger data provider common base class.
Definition: SwaggerDataProviderCommon.qc.dox.h:28
string getName()
Returns the data provider name.
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
setSchema(SwaggerSchema schema)
Sets the schema and display name.
*list< string > getChildProviderNamesImpl()
Returns a list of child data provider names, if any.
checkRestClient(RestClient rest)
Checks the REST client.
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:35
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.
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:112
Qore SwaggerDataProvider module definition.
Definition: SwaggerDataProvider.qc.dox.h:26