Qore ServiceNowRestClient Module Reference 1.2
Loading...
Searching...
No Matches
ServiceNowRestClient::ServiceNowRestConnection Class Reference

Class for ServiceNow REST connections; returns ServiceNowRestClient objects. More...

#include <ServiceNowRestClient.qm.dox.h>

Inheritance diagram for ServiceNowRestClient::ServiceNowRestConnection:
[legend]

Public Member Methods

 constructor (string name, string description, string url, hash< auto > attributes={}, hash< auto > options={})
 creates the ServiceNowRestConnection object More...
 
DataProvider::AbstractDataProvider getDataProvider ()
 returns a data provider object for this connection More...
 
string getOAuth2OptionName (string opt)
 Returns the OAuth2 option name for this connection. More...
 
hash< auto > getOAuth2Options ()
 Returns OAuth2 options in a standard format. More...
 
string getType ()
 returns "snrest"
 
bool hasDataProvider ()
 returns True as this connection returns a data provider with the getDataProvider() method More...
 
Qore::AbstractPollOperation startPollConnect ()
 Called to start a non-blocking polling ping operation on the ServiceNow REST server. More...
 

Public Attributes

const ConnectionScheme
 Connection entry info.
 
const DefaultServiceNowPingHeaders
 Default ServiceNow ping headers.
 
const DefaultServiceNowPingMethod = "GET"
 Default ServiceNow ping method.
 
const DefaultServiceNowPingPath = ...
 Default ServiceNow ping path (from the API root)
 
const OAuth2AuthRequestOptions = ...
 options required to support the OAuth2 authorization code grant flow
 
const OAuth2DifferentOptionMap = map {$1.value: $1.key}
 Different OAuth2 option map; standard name => extern name.
 
const OAuth2Options
 Maps ServiceNow REST options to standard options.
 
const OAuth2StandardToServiceNowOptionMap = map {$1.value: $1.key}
 Maps standard option names to ServiceNow REST option names.
 

Private Member Methods

 checkAuthCodeFeature ()
 Sets the auth code feature if supported.
 
hash< ConnectionSchemeInfo > getConnectionSchemeInfoImpl ()
 Returns the ConnectionSchemeInfo hash for this object.
 
ServiceNowRestClient getImpl (bool connect=True, *hash< auto > rtopts)
 returns a ServiceNowRestClient object More...
 
 setChildCapabilities ()
 Sets child data provider capabilities.
 

Detailed Description

Class for ServiceNow REST connections; returns ServiceNowRestClient objects.

In addition to all options supported by RestClientConnection, this connection class supports the following options:

  • "api": the API version for ServiceNow
  • "client_id": (optional) the ServiceNow OAuth2 client ID (mapped to the oauth2_client_id option)
  • "client_secret": (optional) the ServiceNow OAuth2 client secret (mapped to the oauth2_client_secret option)
See also
ServiceNowRestClient::ServiceNowRestClient::constructor() for more information on the above options

Member Function Documentation

◆ constructor()

ServiceNowRestClient::ServiceNowRestConnection::constructor ( string  name,
string  description,
string  url,
hash< auto >  attributes = {},
hash< auto >  options = {} 
)

creates the ServiceNowRestConnection object

Parameters
namethe name of the connection
descriptionconnection description
urlconnection URL (potentially with password info)
attributesvarious attributes. See below
optionsconnection options

See ConnectionProvider::AbstractConnection::constructor() for attributes and options reference.

Exceptions
CONNECTION-OPTION-ERRORmissing or invalid connection option

◆ getDataProvider()

DataProvider::AbstractDataProvider ServiceNowRestClient::ServiceNowRestConnection::getDataProvider ( )

returns a data provider object for this connection

Returns
a data provider object for this connection

◆ getImpl()

ServiceNowRestClient ServiceNowRestClient::ServiceNowRestConnection::getImpl ( bool  connect = True,
*hash< auto >  rtopts 
)
privatevirtual

returns a ServiceNowRestClient object

Parameters
connectif True, then the connection is returned already connected
rtoptsthis connection type does not accept any runtime options, so this parameter is ignored
Returns
a ServiceNowRestClient object

Reimplemented from RestClient::RestConnection.

◆ getOAuth2OptionName()

string ServiceNowRestClient::ServiceNowRestConnection::getOAuth2OptionName ( string  opt)

Returns the OAuth2 option name for this connection.

Since
ServiceNowRestClient 2.0

◆ getOAuth2Options()

hash< auto > ServiceNowRestClient::ServiceNowRestConnection::getOAuth2Options ( )

Returns OAuth2 options in a standard format.

Since
ServiceNowRestClient 2.0

◆ hasDataProvider()

bool ServiceNowRestClient::ServiceNowRestConnection::hasDataProvider ( )

returns True as this connection returns a data provider with the getDataProvider() method

Returns
True as this connection returns a data provider with the getDataProvider() method
See also
getDataProvider()

◆ startPollConnect()

Qore::AbstractPollOperation ServiceNowRestClient::ServiceNowRestConnection::startPollConnect ( )

Called to start a non-blocking polling ping operation on the ServiceNow REST server.

Returns
a socket poll operation object that will allow the connection goal to be reached with polling
See also
supportsPollingApi()