$darkmode
Qore SwaggerDataProvider Module Reference 1.2.3
SwaggerRequestDataProvider.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
26namespace SwaggerDataProvider {
29
30public:
32 SwaggerSchema schema;
33
36
38 string uri_path;
39
42
44 PathItemObject pio;
45
47 OperationObject op;
48
51
53 *hash<string, AbstractDataField> record_type;
54
56 constructor(SwaggerSchema schema, *RestClient rest, string uri_path, PathItemObject pio, OperationObject op);
57
58
60 string getName();
61
62
64 *string getDesc();
65
66
68 hash<DataProviderInfo> getInfo();
69
70
72
74protected:
75 *hash<string, AbstractDataField> getRecordTypeImpl(*hash<auto> search_options);
76public:
77
78
79protected:
80 *hash<string, AbstractDataField> getRecordTypeIntern();
81public:
82
83
85protected:
86 *AbstractDataProviderType getRequestTypeImpl();
87public:
88
89
91protected:
92 *AbstractDataProviderType getResponseTypeImpl();
93public:
94
95
97protected:
98 *hash<string, AbstractDataProviderType> getErrorResponseTypesImpl();
99public:
100
101
103
109protected:
110 AbstractDataProviderType getErrorResponseTypeImpl(string error_code);
111public:
112
113
115protected:
116 AbstractDataProviderType getResponseTypeIntern(ResponseObject response, string label);
117public:
118
119
121protected:
123public:
124
125
127
132protected:
133 auto doRequestImpl(auto req, *hash<auto> request_options);
134public:
135
136
138
146 private AbstractDataProviderRecordIterator requestSearchRecordsImpl(auto req,
147 *hash<DataProviderExpression> where_cond, *hash<auto> search_options) {
148 hash<auto> resp = doRequestIntern(req, search_options);
149 // return an iterator for the result
150 AbstractIterator i;
151 switch (resp.body.typeCode());
152
153 return new DefaultRecordIterator(i, where_cond, NOTHING, record_type);
154 }
155
157
165 private AbstractDataProviderRecordIterator requestSearchRecordsImpl(auto req, *hash<auto> where_cond,
166 *hash<auto> search_options) {
167 hash<auto> resp = doRequestIntern(req, search_options);
168 // return an iterator for the result
169 AbstractIterator i;
170 switch (resp.body.typeCode());
171
172 return new DefaultRecordIterator(i, where_cond, NOTHING, record_type);
173 }
174
176protected:
177 hash<auto> doRequestIntern(auto req, *hash<auto> options);
178public:
179
180
182 string getUriValue(auto v);
183
184
186protected:
187 string getUriPath();
188public:
189
190
192protected:
194public:
195
196
198protected:
199 hash<DataProviderInfo> getStaticInfoImpl();
200public:
201
202};
203};
The Swagger data provider base class.
Definition: SwaggerDataProviderBase.qc.dox.h:28
The Swagger data provider class.
Definition: SwaggerRequestDataProvider.qc.dox.h:28
AbstractDataProviderType getErrorResponseTypeImpl(string error_code)
Returns the type for the given error code.
auto doRequestImpl(auto req, *hash< auto > request_options)
Makes a request and returned the response.
private AbstractDataProviderRecordIterator requestSearchRecordsImpl(auto req, *hash< DataProviderExpression > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options.
Definition: SwaggerRequestDataProvider.qc.dox.h:146
AbstractDataProviderType getResponseTypeIntern(ResponseObject response, string label)
Returns a data provider type object for a Swagger response.
string uri_path
The current URI path.
Definition: SwaggerRequestDataProvider.qc.dox.h:38
PathItemObject pio
The path item object for the operation.
Definition: SwaggerRequestDataProvider.qc.dox.h:44
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
string getUriPath()
Returns the URI path to use in requests.
*AbstractDataProviderType getRequestTypeImpl()
Returns the description of a successful request message, if any.
hash< auto > doRequestIntern(auto req, *hash< auto > options)
Makes a REST request and returns the response.
OperationObject op
The operation object.
Definition: SwaggerRequestDataProvider.qc.dox.h:47
*hash< string, AbstractDataField > getRecordTypeImpl(*hash< auto > search_options)
Returns the description of the record type, if any.
*RestClient rest
The REST client object for API calls.
Definition: SwaggerRequestDataProvider.qc.dox.h:35
*hash< string, AbstractDataProviderType > getErrorResponseTypesImpl()
Returns a hash of error responses, if any.
*string getDesc()
Returns the data provider description.
string getName()
Returns the data provider name.
SwaggerSchema schema
The Swagger schema.
Definition: SwaggerRequestDataProvider.qc.dox.h:32
constructor(SwaggerSchema schema, *RestClient rest, string uri_path, PathItemObject pio, OperationObject op)
Creates the object from the arguments.
*AbstractDataProviderType getResponseTypeImpl()
Returns the description of a successful response message, if any.
string success_response
The success response code, if any.
Definition: SwaggerRequestDataProvider.qc.dox.h:50
hash< DataProviderInfo > getInfo()
Returns data provider info.
RestClient getRestClient()
Returns a REST client for HTTP operations.
*ResponseObject getSuccessResponse()
Returns the schema for the first successful response message found.
*hash< string, AbstractDataField > record_type
If the request supports a list of hashes in the response and therefore the record API.
Definition: SwaggerRequestDataProvider.qc.dox.h:53
string getUriValue(auto v)
Returns the value for the given query argument.
private AbstractDataProviderRecordIterator requestSearchRecordsImpl(auto req, *hash< auto > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options.
Definition: SwaggerRequestDataProvider.qc.dox.h:165
bool resolve_uri
The URI needs dynamic resolution.
Definition: SwaggerRequestDataProvider.qc.dox.h:41
const NOTHING
Qore SwaggerDataProvider module definition.
Definition: SwaggerDataProvider.qc.dox.h:26