Qore SwaggerDataProvider Module Reference  1.2.3
SwaggerRequestDataProvider.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
26 namespace SwaggerDataProvider {
29 
30 public:
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 
74 protected:
75  *hash<string, AbstractDataField> getRecordTypeImpl(*hash<auto> search_options);
76 public:
77 
78 
79 protected:
80  *hash<string, AbstractDataField> getRecordTypeIntern();
81 public:
82 
83 
85 protected:
86  *AbstractDataProviderType getRequestTypeImpl();
87 public:
88 
89 
91 protected:
92  *AbstractDataProviderType getResponseTypeImpl();
93 public:
94 
95 
97 protected:
98  *hash<string, AbstractDataProviderType> getErrorResponseTypesImpl();
99 public:
100 
101 
103 
109 protected:
110  AbstractDataProviderType getErrorResponseTypeImpl(string error_code);
111 public:
112 
113 
115 protected:
116  AbstractDataProviderType getResponseTypeIntern(ResponseObject response, string label);
117 public:
118 
119 
121 protected:
122  *ResponseObject getSuccessResponse();
123 public:
124 
125 
127 
132 protected:
133  auto doRequestImpl(auto req, *hash<auto> request_options);
134 public:
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 
176 protected:
177  hash<auto> doRequestIntern(auto req, *hash<auto> options);
178 public:
179 
180 
182  string getUriValue(auto v);
183 
184 
186 protected:
187  string getUriPath();
188 public:
189 
190 
192 protected:
194 public:
195 
196 
198 protected:
199  hash<DataProviderInfo> getStaticInfoImpl();
200 public:
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.
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
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
string getUriPath()
Returns the URI path to use in requests.
*AbstractDataProviderType getRequestTypeImpl()
Returns the description of a successful request message, if any.
hash< DataProviderInfo > getInfo()
Returns data provider info.
OperationObject op
The operation object.
Definition: SwaggerRequestDataProvider.qc.dox.h:47
*RestClient rest
The REST client object for API calls.
Definition: SwaggerRequestDataProvider.qc.dox.h:35
*string getDesc()
Returns the data provider description.
*hash< string, AbstractDataProviderType > getErrorResponseTypesImpl()
Returns a hash of error responses, if any.
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
RestClient getRestClient()
Returns a REST client for HTTP operations.
*hash< string, AbstractDataField > getRecordTypeImpl(*hash< auto > search_options)
Returns the description of the record type, if any.
*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
hash< auto > doRequestIntern(auto req, *hash< auto > options)
Makes a REST request and returns the response.
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