Qore YamlRpcClient Module Reference  1.5
YamlRpcClient.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* YamlRpcClient.qm Copyright 2012 - 2020 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 // requires the binary yaml module
28 
29 // need mime definitions
30 
31 
32 // do not use $ signs in declarations
33 // require type declarations
34 // enable all warnings
35 // do not ignore arg errors in calls, disallow access to all NOOP variants
36 
37 }
38 
158 namespace YamlRpcClient {
160 
168 class YamlRpcClient : public Qore::HTTPClient {
169 
170 public:
172  const Version = "1.0";
173 
175  const DefaultOptions = ...;
176 
177 
179  const VersionString = sprintf("Qore-YAML-RPC-Client/%s", YamlRpcClient::Version);
180 
182  const DefaultHeaders = ...;
183 
184 
185 protected:
186  hash headers;
187  int flags = YAML::None;
188  string path;
189 
190 public:
191 
193 
204  constructor(hash opts = hash(), bool do_not_connect = False) ;
205 
206 
208 
210  constructor(bool do_not_connect = False) ;
211 
212 
214 
218  auto callArgs(string method, auto args);
219 
220 
222 
227  auto callArgsWithInfo(reference<auto> info, string method, auto args);
228 
229 
231 
234  auto call(string method);
235 
236 
238  static string makeRequest(string method, auto arg, int flags = YAML::None);
239 };
240 
242 
251 class YamlRpcConnection : public ConnectionProvider::HttpBasedConnection {
252 
253 public:
254  hash<auto> real_opts;
255 
257  const ConnectionScheme = ...;
258 
259 
261 
269  constructor(string name, string description, string url, hash<auto> attributes = {}, hash<auto> options = {})
270  ;
271 
272 
274  string getType();
275 
276 
278 
283 protected:
284  YamlRpcClient getImpl(bool connect = True, *hash<auto> rtopts);
285 public:
286 
287 
289 protected:
290  hash<ConnectionSchemeInfo> getConnectionSchemeInfoImpl();
291 public:
292 
293 };
294 };
constructor(hash opts=hash(), bool do_not_connect=False)
calls the base class HTTPClient constructor, overrides the "protocols" key to "yamlrpc"
static string makeRequest(string method, auto arg, int flags=YAML::None)
makes a YAML-RPC request string
auto callArgsWithInfo(reference< auto > info, string method, auto args)
makes a call to the YAML-RPC server using the third argument as the list of arguments to send
constructor(bool do_not_connect=False)
simple constructor using default arguments
auto call(string method)
makes a method call to the YAML-RPC server using the remaining arguments after the method name as the...
auto callArgs(string method, auto args)
makes a call to the YAML-RPC server using the second argument as the list of arguments to send
class for YAML-RPC connections; returns YamlRpcClient objects
Definition: YamlRpcClient.qm.dox.h:251
const ConnectionScheme
Connection entry info.
Definition: YamlRpcClient.qm.dox.h:257
YamlRpcClient getImpl(bool connect=True, *hash< auto > rtopts)
returns a YamlRpcClient::YamlRpcClient object
hash< ConnectionSchemeInfo > getConnectionSchemeInfoImpl()
Returns the ConnectionSchemeInfo hash for this object.
string getType()
returns "yamlrpc"
constructor(string name, string description, string url, hash< auto > attributes={}, hash< auto > options={})
creates the YamlRpcConnection object
the YamlRpcClient namespace holds all public definitions in the YamlRpcClient module
Definition: YamlRpcClient.qm.dox.h:158