107 const OAuth2BaseUrl =
"https://login.microsoftonline.com/";
110 const OAuth2AuthUriPathSuffix =
"/oauth2/v2.0/authorize";
113 const OAuth2TokenUriPathSuffix =
"/oauth2/v2.0/token";
116 const DefaultApiVersion =
"9.2";
119 const RequestUriPathPrefix =
"/api/data/v";
122 const DefaultBusinessCentralBaseUri =
"https://api.businesscentral.dynamics.com/";
125 const DefaultDynamicsPingMethod =
"GET";
128 const DefaultDynamicsPingPath =
"{api_uri_path}/systemusers?$top=1&$select=identityid";
131 const DefaultDynamicsPingHeaders = {
132 "Accept": MimeTypeJson,
136 const ApiProfiles = {
143 "ping_method": DefaultDynamicsPingMethod,
144 "ping_path": DefaultDynamicsPingPath,
145 "ping_headers": DefaultDynamicsPingHeaders,
147 "dynamics-business-central": {
148 "url": DefaultBusinessCentralBaseUri,
211 hash<auto>
sendAndDecodeResponse(*data body,
string m,
string path, hash<auto> hdr, *reference<hash<auto>> info, *softbool decode_errors);
237 "cls": Class::forName(
"CdsRestConnection"),
239 "api": <ConnectionOptionInfo>{
241 "desc":
"the API version for CDS",
244 "api_profile": <ConnectionOptionInfo>{
246 "desc":
"the API profile according to the CDS API in use; this option will set the REST "
247 "options if they are not already set (`oauth2_scopes`, `ping_body`, `ping_headers`, and "
248 "`ping_method`); valid "
250 "- `none`: no options configured (default)\n"
251 "- `dynamics`: set options for the Dynamics 365 API",
252 "default_value":
"none",
255 "desc":
"No options are set",
259 "desc":
"Set REST client options for the Dynamics 365 API",
270 "client_id": RestConnection::ConnectionScheme.options.oauth2_client_id + <ConnectionOptionInfo>{
271 "desc":
"the Microsoft Common Data Service OAuth2 client ID",
273 "client_secret": RestConnection::ConnectionScheme.options.oauth2_client_secret + <ConnectionOptionInfo>{
274 "desc":
"the Microsoft Common Data Service OAuth2 client secret",
277 "data": RestConnection::ConnectionScheme.options.
"data" + <ConnectionOptionInfo>{
278 "default_value":
"json",
280 "oauth2_auth_url": RestConnection::ConnectionScheme.options.oauth2_auth_url + <ConnectionOptionInfo>{
281 "default_value":
"auto",
283 "oauth2_grant_type": RestConnection::ConnectionScheme.options.oauth2_grant_type + <ConnectionOptionInfo>{
284 "default_value":
"authorization_code",
286 "oauth2_token_url": RestConnection::ConnectionScheme.options.oauth2_token_url + <ConnectionOptionInfo>{
287 "default_value":
"auto",
289 "tenant": <ConnectionOptionInfo>{
291 "desc":
"the tenant ID",
294 "required_options":
"client_id,client_secret,tenant",
303 "oauth2_auto_refresh":
"oauth2_auto_refresh",
304 "oauth2_auth_args":
"oauth2_auth_args",
305 "oauth2_auth_url":
"oauth2_auth_url",
306 "client_id":
"oauth2_client_id",
307 "client_secret":
"oauth2_client_secret",
308 "oauth2_redirect_url":
"oauth2_redirect_url",
309 "oauth2_refresh_token":
"oauth2_refresh_token",
310 "oauth2_scopes":
"oauth2_scopes",
311 "oauth2_token_url":
"oauth2_token_url",
312 "password":
"password",
313 "username":
"username",
333 constructor(
string name,
string description,
string url, hash<auto> attributes = {}, hash<auto> options = {})
string getApi()
returns the CDS REST API version currently in use
const DefaultApiVersion
Default API version.
Definition: CdsRestClient.qm.dox.h:116
constructor(hash< auto > opts, *softbool do_not_connect)
creates the object with the given options
hash< auto > sendAndDecodeResponse(*data body, string m, string path, hash< auto > hdr, *reference< hash< auto > > info, *softbool decode_errors)
sends the outgoing HTTP message and recodes the response to data
static string getString(hash< auto > opts, string key)
gets a string option
static hash< auto > getOptions(hash< auto > opts)
returns options for the CdsRestClient::CdsRestClient::constructor()
static raiseError(string fmt)
throws an exception due to an error
class for Microsoft Common Data Service REST connections; returns CdsRestClient objects
Definition: CdsRestClient.qm.dox.h:232
string getAuthorizationCodeRequest(hash< AuthCodeInfo > info=< AuthCodeInfo >{})
Returns a URI for an authorization code request.
string getAuthUrl(*bool allow_relative)
Returns the OAuth2 auth URL or throws an exception if not set.
setChildCapabilities()
Sets child data provider capabilities.
DataProvider::AbstractDataProvider getDataProvider()
returns a data provider object for this connection
hash< ConnectionSchemeInfo > getConnectionSchemeInfoImpl()
Returns the ConnectionSchemeInfo hash for this object.
const OAuth2StandardToCdsOptionMap
Maps standard option names to CDS REST option names.
Definition: CdsRestClient.qm.dox.h:317
const ConnectionScheme
Connection entry info.
Definition: CdsRestClient.qm.dox.h:236
const OAuth2Options
Maps CDS REST options to standard options.
Definition: CdsRestClient.qm.dox.h:302
const OAuth2AuthRequestOptions
options required to support the OAuth2 authorization code grant flow
Definition: CdsRestClient.qm.dox.h:298
constructor(string name, string description, string url, hash< auto > attributes={}, hash< auto > options={})
creates the CdsRestConnection object
const OAuth2DifferentOptionMap
Different OAuth2 option map; standard name => extern name.
Definition: CdsRestClient.qm.dox.h:320
bool hasDataProvider()
returns True as this connection returns a data provider with the getDataProvider() method
hash< auto > getOAuth2Options()
Returns OAuth2 options in a standard format.
CdsRestClient getImpl(bool connect=True, *hash< auto > rtopts)
returns a CdsRestClient object
static hash< auto > getOptions(string url, hash< auto > orig_opts)
returns options for GoogleRestConnection::constructor()
checkAuthCodeFeature()
Sets the auth code feature if supported.
string getOAuth2OptionName(string opt)
Returns the OAuth2 option name for this connection.
string getTokenUrl(*bool allow_relative)
Returns the OAuth2 token URL or throws an exception if not set.
string getType()
returns "cdsrest"
the CdsRestClient namespace contains all the objects in the CdsRestClient module
Definition: CdsRestClient.qm.dox.h:90