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
87namespace ZeyosRestClient {
89
98
99public:
100 const RequiredOptions = ...;
101
102
103 const AuthPath = "/auth/v1/login";
104
105private:
106 string identifier;
107 string appsecret;
108 string instance;
109
110public:
111
113
156 constructor(hash<auto> options, *softbool do_not_connect) ;
157
158
160 static hash<auto> getOptions(hash<auto> options);
161
163protected:
164 checkLogin(*reference<hash<auto>> info);
165public:
166
167
169protected:
170 loginIntern(*reference<hash> info);
171public:
172
173};
174
176
190
191public:
193 const ConnectionScheme = <ConnectionSchemeInfo>{
194 "cls": Class::forName("ZeyosRestConnection"),
195 "options": RestConnection::ConnectionScheme.options + {
196 "appsecret": <ConnectionOptionInfo>{
197 "type": "string",
198 "desc": "the Zeyos application secret",
199 "sensitive": True,
200 },
201 "identifier": <ConnectionOptionInfo>{
202 "type": "string",
203 "desc": "the Zeyos identifier;if none is provided, a random identifier string is used",
204 },
205 "instance": <ConnectionOptionInfo>{
206 "type": "string",
207 "desc": "the Zeyos instance name (first segment of URI path)",
208 },
209 },
210 "required_options": foldl $1 + "," + $2, ZeyosRestClient::RequiredOptions,
211 };
212
214
224 constructor(string name, string description, string url, hash<auto> attributes = {}, hash<auto> options = {})
225 ;
226
227
229 string getType();
230
231
233 hash<auto> getConstructorOptions(hash<auto> options);
234
235
237
242protected:
243 ZeyosRestClient getImpl(bool connect = True, *hash<auto> rtopts);
244public:
245
246
248protected:
249 hash<ConnectionSchemeInfo> getConnectionSchemeInfoImpl();
250public:
251
252};
253};
checkLogin(*reference< hash< auto > > info)
Checks if a login is necessary; if so, then the login is performed.
static hash< auto > getOptions(hash< auto > options)
returns options for the RestClient::constructor()
loginIntern(*reference< hash > info)
logs in an sets the token for further communication
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:189
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:193
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:87