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  "children_can_support_apis": True,
63  "children_can_support_records": False,
64  "children_can_support_observers": False,
65  };
66 
68  const ConstructorOptions = {
69  "schema": <DataProviderOptionInfo>{
70  "type": (
71  AbstractDataProviderType::get(StringType, NOTHING, {
72  DTT_FromFile: True,
73  DTT_FromLocation: True,
74  }),
75  AbstractDataProviderType::get(new Type("SwaggerSchema")),
76  ),
77  "desc": "the Swagger schema object or source URL",
78  "required": True,
79  },
80  "restclient": <DataProviderOptionInfo>{
81  "type": AbstractDataProviderType::get(new Type("RestClient"), NOTHING, {
82  DTT_ClientOnly: True,
83  }),
84  "desc": "the RestClient object",
85  },
86  "url": <DataProviderOptionInfo>{
87  "type": AbstractDataProviderType::get(StringType, NOTHING, {
88  DTT_ClientOnly: True,
89  }),
90  "desc": "the URL to the REST server; overrides any URL in the schema or in any RestClient object "
91  "passed as an option",
92  },
93  "restclient_options": <DataProviderOptionInfo>{
94  "type": AbstractDataProviderType::get(AutoHashType, NOTHING, {
95  DTT_ClientOnly: True,
96  }),
97  "desc": "options to the RestClient constructor; only used if a RestClient object is created for a "
98  "call",
99  },
100  };
101 
103  const HttpMethods = {
104  "GET": True,
105  "PUT": True,
106  "PATCH": True,
107  "POST": True,
108  "DELETE": True,
109  };
110 
111 protected:
113  hash<auto> path_tree;
114 
115 public:
116 
118 protected:
119  constructor(hash<auto> path_tree, string uri_path, SwaggerSchema schema, *RestClient rest);
120 public:
121 
122 
124  constructor(SwaggerSchema schema, *RestClient rest);
125 
126 
128  constructor(*hash<auto> options);
129 
130 
132  string getName();
133 
134 
136  *string getDesc();
137 
138 
140 protected:
142 public:
143 
144 
145 protected:
146  setupTree();
147 public:
148 
149 
151 
153 protected:
154  *list<string> getChildProviderNamesImpl();
155 public:
156 
157 
159 
163 protected:
164  *AbstractDataProvider getChildProviderImpl(string name);
165 public:
166 
167 
169 protected:
170  AbstractDataProvider getChildIntern(string name, *string real_name);
171 public:
172 
173 
175 protected:
176  hash<DataProviderInfo> getStaticInfoImpl();
177 public:
178 
179 
181 protected:
183 public:
184 
185 };
186 }; // 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:113
const True
const False
const NOTHING
Qore SwaggerDataProvider module definition.
Definition: SwaggerDataProvider.qc.dox.h:26