Qore ZeyosRestClient Module Reference 1.1
Loading...
Searching...
No Matches
ZeyosRestClient.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* ZeyosRestClient.qm Copyright (C) 2017 - 2023 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
26
27
28
29}
30
88namespace ZeyosRestClient {
90
99
100public:
101 const RequiredOptions = ...;
102
103
104 const AuthPath = "/auth/v1/login";
105
106private:
107 string username;
108 string password;
109 string identifier;
110 string appsecret;
111 string instance;
112
113 // the token acquired in the login call
114 string token;
115
116public:
117
119
162 constructor(hash<auto> options, *softbool do_not_connect) ;
163
164
165 hash<auto> doRequest(string m, string path, auto body, *reference<hash> info, softbool decode_errors = True, *hash<auto> hdr);
166
167
168 hash<auto> doValidatedRequest(string m, string path, auto body, *reference<hash<auto>> info, softbool decode_errors = True, *hash<auto> hdr);
169
170
172 static hash<auto> getOptions(hash<auto> options);
173
175protected:
176 getToken(*reference<hash> info);
177public:
178
179};
180
182
204
205public:
207 const ConnectionScheme = <ConnectionSchemeInfo>{
208 "cls": Class::forName("ZeyosRestConnection"),
209 "options": RestConnection::ConnectionScheme.options + {
210 "appsecret": <ConnectionOptionInfo>{
211 "type": "string",
212 "desc": "the Zeyos application secret",
213 "sensitive": True,
214 },
215 "identifier": <ConnectionOptionInfo>{
216 "type": "string",
217 "desc": "the Zeyos identifier;if none is provided, a random identifier string is used",
218 },
219 "instance": <ConnectionOptionInfo>{
220 "type": "string",
221 "desc": "the Zeyos instance name (first segment of URI path)",
222 },
223 },
224 "required_options": foldl $1 + "," + $2, ZeyosRestClient::RequiredOptions,
225 };
226
228
238 constructor(string name, string description, string url, hash<auto> attributes = {}, hash<auto> options = {})
239 ;
240
241
243 string getType();
244
245
247 hash<auto> getConstructorOptions(hash<auto> options);
248
249
251
256protected:
257 ZeyosRestClient getImpl(bool connect = True, *hash<auto> rtopts);
258public:
259
260
262protected:
263 hash<ConnectionSchemeInfo> getConnectionSchemeInfoImpl();
264public:
265
266};
267};
getToken(*reference< hash > info)
logs in an sets the token for further communication
static hash< auto > getOptions(hash< auto > options)
returns options for the RestClient::constructor()
constructor(hash< auto > options, *softbool do_not_connect)
creates the object with the given options
class for Zeyos.com REST connections; returns ZeyosRestClient::ZeyosRestClient objects
Definition: ZeyosRestClient.qm.dox.h:203
constructor(string name, string description, string url, hash< auto > attributes={}, hash< auto > options={})
creates the ZeyosRestConnection object
string getType()
returns "zeyosrest"
const ConnectionScheme
Connection entry info.
Definition: ZeyosRestClient.qm.dox.h:207
hash< auto > getConstructorOptions(hash< auto > options)
gets options for the constructor
hash< ConnectionSchemeInfo > getConnectionSchemeInfoImpl()
Returns the ConnectionSchemeInfo hash for this object.
ZeyosRestClient getImpl(bool connect=True, *hash< auto > rtopts)
returns a ZeyosRestClient::ZeyosRestClient object
the ZeyosRestClient namespace contains all the objects in the ZeyosRestClient module
Definition: ZeyosRestClient.qm.dox.h:88