Qore SwaggerDataProvider Module Reference 1.3
Loading...
Searching...
No Matches
SwaggerDataProvider.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
28class SwaggerDataProvider : public AbstractDataProvider {
29
30public:
32 SwaggerSchema schema;
33
36
38 string uri_path = "/";
39
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 "children_can_support_apis": True,
63 "children_can_support_records": False,
64 "children_can_support_observers": False,
65 };
66
68 const ConstructorOptions = {
69 "lax_parsing": <DataProviderOptionInfo>{
70 "type": AbstractDataProviderTypeMap."bool",
71 "desc": "If `True` then common errors in Swagger schemas will be ignored; some Swagger schemas with "
72 "errors will be able to be used",
73 },
74 "restclient": <DataProviderOptionInfo>{
75 "type": AbstractDataProviderType::get(new Type("RestClient"), NOTHING, {
76 DTT_ClientOnly: True,
77 }),
78 "desc": "the RestClient object",
79 },
80 "restclient_options": <DataProviderOptionInfo>{
81 "type": AbstractDataProviderType::get(AutoHashType, NOTHING, {
82 DTT_ClientOnly: True,
83 }),
84 "desc": "options to the RestClient constructor; only used if a RestClient object is created for a "
85 "call",
86 },
87 "schema": <DataProviderOptionInfo>{
88 "type": (
89 AbstractDataProviderType::get(StringType, NOTHING, {
90 DTT_FromFile: True,
91 DTT_FromLocation: True,
92 }),
93 AbstractDataProviderType::get(new Type("SwaggerSchema")),
94 ),
95 "desc": "the Swagger schema object or source URL",
96 "required": True,
97 },
98 "url": <DataProviderOptionInfo>{
99 "type": AbstractDataProviderType::get(StringType, NOTHING, {
100 DTT_ClientOnly: True,
101 }),
102 "desc": "the URL to the REST server; overrides any URL in the schema or in any RestClient object "
103 "passed as an option",
104 },
105 };
106
108 const HttpMethods = {
109 "GET": True,
110 "PUT": True,
111 "PATCH": True,
112 "POST": True,
113 "DELETE": True,
114 };
115
116protected:
118 hash<auto> path_tree;
119
120public:
121
123protected:
124 constructor(hash<auto> path_tree, string uri_path, SwaggerSchema schema, *RestClient rest);
125public:
126
127
129 constructor(SwaggerSchema schema, *RestClient rest);
130
131
133 constructor(*hash<auto> options);
134
135
137 string getName();
138
139
141 *string getDesc();
142
143
145protected:
146 setSchema(SwaggerSchema schema);
147public:
148
149
151protected:
153public:
154
155
156protected:
157 setupTree();
158public:
159
160
162
164protected:
166public:
167
168
170
174protected:
175 *AbstractDataProvider getChildProviderImpl(string name);
176public:
177
178
180protected:
181 AbstractDataProvider getChildIntern(string name, *string real_name);
182public:
183
184
186protected:
187 hash<DataProviderInfo> getStaticInfoImpl();
188public:
189
190
192protected:
194public:
195
196};
197}; // end namespace swagger
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.
SwaggerSchema schema
The Swagger schema.
Definition: SwaggerDataProvider.qc.dox.h:32
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:118
Qore SwaggerDataProvider module definition.
Definition: SwaggerDataProvider.qc.dox.h:26