Qore MewsRestClient Module Reference 1.0
Loading...
Searching...
No Matches
MewsRestClient.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* MewsRestClient.qm Copyright (C) 2020 - 2024 Qore Technologies, s.r.o.
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23*/
24
25// minimum qore version
26
27// require type definitions everywhere
28
29// enable all warnings
30
31// don't use "$" for vars, members, and methods, assume local variable scope
32
33// do not ignore argument errors
34
35
36
81namespace MewsRestClient {
83
92
93public:
95 const DefaultUriPathPrefix = "api/connector/v1";
96
98 const DefaultClient = sprintf("Qore %s", Qore::VersionString);
99
100protected:
103
106
108 string client = DefaultClient;
109
110public:
111
113
125 constructor(hash<auto> opts, *softbool do_not_connect) ;
126
127
129
153 hash<auto> doMewsRequest(string path, *hash<auto> body, *reference<hash<auto>> info, *hash<auto> hdr);
154
155
157 auto preprocessRequestBody(auto body);
158
159
161protected:
162 checkLogin(*reference<hash<auto>> info);
163public:
164
165
167protected:
168 static hash<auto> getOptions(hash<auto> opts);
169public:
170
171};
172
174
182
183public:
186
187
189 const DefaultMewsPingBody= "auto";
190
193
196
197
199 const DefaultMewsPingPath = "configuration/get";
200
202 const ConnectionScheme = ...;
203
204
206
223 constructor(hash<auto> config, *hash<auto> attr) ;
224
225
227 string getType();
228
229
231
233 *string getAppName();
234
235
237
242
243
245
249 DataProvider::AbstractDataProvider getDataProvider(*hash<auto> constructor_options);
250
251
253
258 Qore::AbstractPollOperation startPollConnect(*Logger::LoggerInterface logger);
259
260
262protected:
263 *string getPingPath();
264public:
265
266
267protected:
268 auto getPingBody();
269public:
270
271
273protected:
275public:
276
277
279
284protected:
285 MewsRestClient getImpl(bool connect = True, *hash<auto> rtopts);
286public:
287
288
290protected:
291 hash<ConnectionSchemeInfo> getConnectionSchemeInfoImpl();
292public:
293
294};
295};
string access_token
Mews access token.
Definition MewsRestClient.qm.dox.h:105
constructor(hash< auto > opts, *softbool do_not_connect)
creates the object with the given options
checkLogin(*reference< hash< auto > > info)
Checks if a login is necessary; if so, then the login is performed.
auto preprocessRequestBody(auto body)
Adds authorization keys to the request body.
static hash< auto > getOptions(hash< auto > opts)
returns options for MewsRestClient::MewsRestClient::constructor()
hash< auto > doMewsRequest(string path, *hash< auto > body, *reference< hash< auto > > info, *hash< auto > hdr)
Makes a POST request to the server with the required tokens and returns the response.
string client_token
Mews client token.
Definition MewsRestClient.qm.dox.h:102
Class for Mews REST connections; returns MewsRestClient objects.
Definition MewsRestClient.qm.dox.h:181
DataProvider::AbstractDataProvider getDataProvider(*hash< auto > constructor_options)
returns a data provider object for this connection
string getType()
returns "mewsrest"
*string getAppName()
Returns the data provider application name this connection serves, if any.
MewsRestClient getImpl(bool connect=True, *hash< auto > rtopts)
returns a MewsRestClient object
const DefaultMewsPingHeaders
Default Mews ping headers.
Definition MewsRestClient.qm.dox.h:195
const DefaultMewsPingBody
Default Mews ping body.
Definition MewsRestClient.qm.dox.h:189
constructor(hash< auto > config, *hash< auto > attr)
creates the MewsRestConnection object
bool hasDataProvider()
returns True as this connection returns a data provider with the getDataProvider() method
hash< ConnectionSchemeInfo > getConnectionSchemeInfoImpl()
Returns the ConnectionSchemeInfo hash for this object.
const MewsUnsupportedRestOptions
REST options not supported by this class.
Definition MewsRestClient.qm.dox.h:185
const ConnectionScheme
Connection entry info.
Definition MewsRestClient.qm.dox.h:202
*string getPingPath()
Returns the ping path from the ping_path option.
const DefaultMewsPingPath
Defualt Mews ping path.
Definition MewsRestClient.qm.dox.h:199
Qore::AbstractPollOperation startPollConnect(*Logger::LoggerInterface logger)
Called to start a non-blocking polling ping operation on the remote REST server.
const DefaultMewsPingMethod
Default Mews ping method.
Definition MewsRestClient.qm.dox.h:192
setChildCapabilities()
Sets child data provider capabilities.
const VersionString
the MewsRestClient namespace contains all the objects in the MewsRestClient module
Definition MewsRestClient.qm.dox.h:81