Qore NetSuiteRestClient Module Reference 1.0
Loading...
Searching...
No Matches
NetSuiteRestClient.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* NetSuiteRestClient.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
83
92
93public:
95 const DefaultUrl = "https://{{account_id}}.suitetalk.api.netsuite.com/services/rest/record";
96
98 const DefaultAuthUrl = "https://{{account_id}}.netsuite.com/app/login/oauth2/authorize.nl";
99
101 const DefaultGrantType = "authorization_code";
102
104 const DefaultTokenUrl = "https://{{account_id}}.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/token";
105
107 const DefaultLogoutUrl = "https://{{account_id}}.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/logout";
108
110 const DefaultOAuth2Scopes = ("rest_webservices",);
111
113 const DefaultOptions = ...;
114
115
117 const DefaultNetSuitePingMethod= "GET";
118
120 const DefaultNetSuitePingHeaders = ...;
121
122
123protected:
126
129
130public:
131
133
146 constructor(hash<auto> opts, *softbool do_not_connect) ;
147
148
150protected:
151 checkLogin(*reference<hash<auto>> info);
152public:
153
154
156
158protected:
159 setOAuth2LoginInfo(hash<auto> h);
160public:
161
162
164
166protected:
167 hash<auto> oauth2Auth(hash<auto> login, *reference<hash<auto>> info, *bool refresh);
168public:
169
170
172
174protected:
175 *hash<auto> getUpdateOptionsAfterLogin(hash<auto> h);
176public:
177
178
180protected:
181 static hash<auto> getOptions(hash<auto> opts);
182public:
183
184};
185
187
196
197public:
199 const DefaultUrl = "netsuite://auto-detected";
200
202 const ConnectionScheme = ...;
203
204
206
223 constructor(hash<auto> config, *hash<auto> attr) ;
224
225
227 string getType();
228
229
231
233 *string getAppName();
234
235
237
239 hash<auto> getOAuth2Options();
240
241
243 /* @param allow_relative if @ref True then a relative URL (path only) can be returned; the default (@ref False)
244 is to return a full URL
245 */
246 string getAuthUrl(*bool allow_relative);
247
248
250 /* @param allow_relative if @ref True then a relative URL (path only) can be returned; the default (@ref False)
251 is to return a full URL
252 */
253 string getTokenUrl(*bool allow_relative);
254
255
257
262
263
265
269 DataProvider::AbstractDataProvider getDataProvider(*hash<auto> constructor_options);
270
271
273protected:
275public:
276
277
279 /* @param opt the URL option name
280 @param allow_relative if @ref True then a relative URL (path only) can be returned; the default (@ref False)
281 is to return a full URL
282 */
283protected:
284 string getUrlOption(string opt, *bool allow_relative);
285public:
286
287
289
294protected:
295 NetSuiteRestClient getImpl(bool connect = True, *hash<auto> rtopts);
296public:
297
298
300protected:
301 hash<ConnectionSchemeInfo> getConnectionSchemeInfoImpl();
302public:
303
304
306
310protected:
311 setRealUrl(*string url);
312public:
313
314};
315};
constructor(hash< auto > opts, *softbool do_not_connect)
creates the object with the given options
hash< auto > oauth2Auth(hash< auto > login, *reference< hash< auto > > info, *bool refresh)
Perform OAuth2 authentication.
string account_id
NetSuite account ID; can be auto-discovered.
Definition NetSuiteRestClient.qm.dox.h:125
checkLogin(*reference< hash< auto > > info)
Checks if a login is necessary; if so, then the login is performed.
string oauth2_logout_url
The OAuth2 logout / token deauthorization URL.
Definition NetSuiteRestClient.qm.dox.h:128
setOAuth2LoginInfo(hash< auto > h)
Sets options from the OAuth2 login response on the local object.
static hash< auto > getOptions(hash< auto > opts)
returns options for NetSuiteRestClient::NetSuiteRestClient::constructor()
*hash< auto > getUpdateOptionsAfterLogin(hash< auto > h)
Returns options to update after an OAuth2 login.
Class for NetSuite REST connections; returns NetSuiteRestClient objects.
Definition NetSuiteRestClient.qm.dox.h:195
NetSuiteRestClient getImpl(bool connect=True, *hash< auto > rtopts)
returns a NetSuiteRestClient object
setRealUrl(*string url)
Called by the constructor to set the real URL.
string getTokenUrl(*bool allow_relative)
Returns the OAuth2 token URL or throws an exception if not set.
hash< ConnectionSchemeInfo > getConnectionSchemeInfoImpl()
Returns the ConnectionSchemeInfo hash for this object.
DataProvider::AbstractDataProvider getDataProvider(*hash< auto > constructor_options)
returns a data provider object for this connection
hash< auto > getOAuth2Options()
Return OAuth2 options.
constructor(hash< auto > config, *hash< auto > attr)
creates the NetSuiteRestConnection object
setChildCapabilities()
Sets child data provider capabilities.
*string getAppName()
Returns the data provider application name this connection serves, if any.
string getUrlOption(string opt, *bool allow_relative)
Returns the value of a URL option or throws an exception if not set.
bool hasDataProvider()
returns True as this connection returns a data provider with the getDataProvider() method
string getAuthUrl(*bool allow_relative)
Returns the OAuth2 authorization URL or throws an exception if not set.
const DefaultUrl
Default URL.
Definition NetSuiteRestClient.qm.dox.h:199
const ConnectionScheme
Connection entry info.
Definition NetSuiteRestClient.qm.dox.h:202
string getType()
returns "netsuite"
the NetSuiteRestClient namespace contains all the objects in the NetSuiteRestClient module
Definition NetSuiteRestClient.qm.dox.h:81