Qore ServiceNowRestDataProvider Module Reference  1.2
ServiceNowRestDataProvider.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
28 class ServiceNowRestDataProvider : public DataProvider::AbstractDataProvider {
29 
30 public:
32  ServiceNowRestClient::ServiceNowRestClient rest;
33 
35  const ProviderInfo = <DataProviderInfo>{
36  "type": "ServiceNowRestDataProvider",
37  "supports_children": True,
38  "constructor_options": ConstructorOptions,
39  "children_can_support_apis": False,
40  "children_can_support_records": True,
41  "children_can_support_observers": False,
42  };
43 
45  const ConstructorOptions = {
46  "api": <DataProviderOptionInfo>{
47  "type": AbstractDataProviderType::get(StringType),
48  "desc": "the ServiceNow API version to use",
49  },
50  "snrestclient": <DataProviderOptionInfo>{
51  "type": AbstractDataProviderType::get(new Type("ServiceNowRestClient")),
52  "desc": "the ServiceNowRestClient object",
53  },
54  "snrestclient_options": <DataProviderOptionInfo>{
55  "type": AbstractDataProviderType::get(AutoHashType),
56  "desc": "options to the ServiceNowRestClient constructor; only used if a ServiceNowRestClient object "
57  "is created for a call",
58  },
59  "client_id": <DataProviderOptionInfo>{
60  "type": AbstractDataProviderType::get(StringType),
61  "desc": "the client ID (required if 'client_secret' provided)",
62  },
63  "client_secret": <DataProviderOptionInfo>{
64  "type": AbstractDataProviderType::get(StringType),
65  "desc": "the client secret (required if 'client_id' provided)",
66  },
67  "username": <DataProviderOptionInfo>{
68  "type": AbstractDataProviderType::get(StringType),
69  "desc": "the username (required if 'password' provided)",
70  },
71  "password": <DataProviderOptionInfo>{
72  "type": AbstractDataProviderType::get(StringType),
73  "desc": "the password (required if 'username' provided)",
74  },
75  "url": <DataProviderOptionInfo>{
76  "type": AbstractDataProviderType::get(StringType),
77  "desc": "the URL to the ServiceNow server; overrides any URL in the schema or in any RestClient object "
78  "passed as an option",
79  },
80  };
81 
83  const EnvOptions = {
84  "url": "SERVICENOW_URL",
85  "client_id": "SERVICENOW_CLIENT_ID",
86  "client_secret": "SERVICENOW_CLIENT_SECRET",
87  "username": "SERVICENOW_USERNAME",
88  "password": "SERVICENOW_PASSWORD",
89  };
90 
92  constructor(ServiceNowRestClient::ServiceNowRestClient rest);
93 
94 
96  constructor(*hash<auto> options);
97 
98 
100  string getName();
101 
102 
104  string getDesc();
105 
106 
108 protected:
109  hash<DataProvider::DataProviderInfo> getStaticInfoImpl();
110 public:
111 
112 
114 
116 protected:
117  *list<string> getChildProviderNamesImpl();
118 public:
119 
120 
122 
126 protected:
127  *DataProvider::AbstractDataProvider getChildProviderImpl(string name);
128 public:
129 
130 
132 protected:
133  static *hash<auto> getClientOptions(*hash<auto> copts);
134 public:
135 
136 };
137 };
ServiceNowRestClient::ServiceNowRestClient rest
The REST client object for API calls.
Definition: ServiceNowRestDataProvider.qc.dox.h:32
constructor(*hash< auto > options)
Creates the object from constructor options.
string getName()
Returns the data provider name.
string getDesc()
Returns the data provider description.
hash< DataProvider::DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
*DataProvider::AbstractDataProvider getChildProviderImpl(string name)
Returns the given child provider or NOTHING if the given child is unknown.
*list< string > getChildProviderNamesImpl()
Returns a list of child data provider names, if any.
constructor(ServiceNowRestClient::ServiceNowRestClient rest)
Creates the object from the arguments.
static *hash< auto > getClientOptions(*hash< auto > copts)
Returns options for the ServiceNowRestClient.
const True
const False
Qore ServiceNowRestDataProvider module definition.
Definition: ServiceNowRestDataProvider.qc.dox.h:26