Qore ServiceNowRestClient Module Reference 1.2
Loading...
Searching...
No Matches
ServiceNowRestClient.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* ServiceNowRestClient.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
104
114
115public:
117
120 const OAuth2DefaultGrantType = "none";
121
123 const OAuth2AuthUriPathSuffix = "/oauth_auth.do";
124
126 const OAuth2TokenUriPathSuffix = "/oauth_token.do";
127
129 const DefaultApiVersion = "now";
130
132 const RequestUriPathPrefix = "/api/";
133
135 const DefaultApiKeyHeader = "x-sn-apikey";
136
137private:
138 *string api;
139 *string apikey;
140 string uri_path_pfx;
141
142public:
143
145
201 constructor(hash<auto> opts, *softbool do_not_connect) ;
202
203
205
207 string getApi();
208
209
211protected:
212 hash<auto> sendAndDecodeResponse(*data body, string m, string path, hash<auto> hdr, *reference<hash<auto>> info, *softbool decode_errors, *string assume_content_type, *string shdr, *code signer);
213public:
214
215
217 static hash<auto> getOptions(hash<auto> opts);
218};
219
221
230
231public:
233 const ConnectionScheme = ...;
234
235
238
241
242
245
246
249
250
252 const OAuth2Options = ...;
253
254
256 const OAuth2StandardToServiceNowOptionMap = map {$1.value: $1.key}, OAuth2Options.pairIterator();
257
259 const OAuth2DifferentOptionMap = map {$1.value: $1.key}, OAuth2Options.pairIterator(), $1.key != $1.value;
260
262
272 constructor(string name, string description, string url, hash<auto> attributes = {}, hash<auto> options = {})
273 ;
274
275
277
294 constructor(hash<auto> config, *hash<auto> attr) ;
295
296
298 string getType();
299
300
302
304 *string getAppName();
305
306
308
313
314
316
320 DataProvider::AbstractDataProvider getDataProvider(*hash<auto> constructor_options);
321
322
324
326 string getOAuth2OptionName(string opt);
327
328
330
332 hash<auto> getOAuth2Options();
333
334
336
341 Qore::AbstractPollOperation startPollConnect(*Logger::LoggerInterface logger);
342
343
345protected:
347public:
348
349
351protected:
353public:
354
355
357
362protected:
363 ServiceNowRestClient getImpl(bool connect = True, *hash<auto> rtopts);
364public:
365
366
368protected:
369 hash<ConnectionSchemeInfo> getConnectionSchemeInfoImpl();
370public:
371
372};
373};
constructor(hash< auto > opts, *softbool do_not_connect)
creates the object with the given options
static hash< auto > getOptions(hash< auto > opts)
returns options for ServiceNowRestClient::ServiceNowRestClient::constructor()
string getApi()
returns the ServiceNow REST API version currently in use
hash< auto > sendAndDecodeResponse(*data body, string m, string path, hash< auto > hdr, *reference< hash< auto > > info, *softbool decode_errors, *string assume_content_type, *string shdr, *code signer)
sends the outgoing HTTP message and recodes the response to data
Class for ServiceNow REST connections; returns ServiceNowRestClient objects.
Definition ServiceNowRestClient.qm.dox.h:229
const DefaultServiceNowPingMethod
Default ServiceNow ping method.
Definition ServiceNowRestClient.qm.dox.h:237
const DefaultServiceNowPingPath
Default ServiceNow ping path (from the API root)
Definition ServiceNowRestClient.qm.dox.h:240
Qore::AbstractPollOperation startPollConnect(*Logger::LoggerInterface logger)
Called to start a non-blocking polling ping operation on the ServiceNow REST server.
const OAuth2Options
Maps ServiceNow REST options to standard options.
Definition ServiceNowRestClient.qm.dox.h:252
constructor(string name, string description, string url, hash< auto > attributes={}, hash< auto > options={})
creates the ServiceNowRestConnection object
hash< auto > getOAuth2Options()
Returns OAuth2 options in a standard format.
checkAuthCodeFeature()
Sets the auth code feature if supported.
const DefaultServiceNowPingHeaders
Default ServiceNow ping headers.
Definition ServiceNowRestClient.qm.dox.h:244
constructor(hash< auto > config, *hash< auto > attr)
creates the ServiceNowRestConnection object
DataProvider::AbstractDataProvider getDataProvider(*hash< auto > constructor_options)
returns a data provider object for this connection
string getOAuth2OptionName(string opt)
Returns the OAuth2 option name for this connection.
const OAuth2AuthRequestOptions
options required to support the OAuth2 authorization code grant flow
Definition ServiceNowRestClient.qm.dox.h:248
setChildCapabilities()
Sets child data provider capabilities.
const OAuth2StandardToServiceNowOptionMap
Maps standard option names to ServiceNow REST option names.
Definition ServiceNowRestClient.qm.dox.h:256
ServiceNowRestClient getImpl(bool connect=True, *hash< auto > rtopts)
returns a ServiceNowRestClient object
bool hasDataProvider()
returns True as this connection returns a data provider with the getDataProvider() method
const ConnectionScheme
Connection entry info.
Definition ServiceNowRestClient.qm.dox.h:233
*string getAppName()
Returns the data provider application name this connection serves, if any.
const OAuth2DifferentOptionMap
Different OAuth2 option map; standard name => extern name.
Definition ServiceNowRestClient.qm.dox.h:259
hash< ConnectionSchemeInfo > getConnectionSchemeInfoImpl()
Returns the ConnectionSchemeInfo hash for this object.
the ServiceNowRestClient namespace contains all the objects in the ServiceNowRestClient module
Definition ServiceNowRestClient.qm.dox.h:102