msgraph.graph.graph
Microsoft Graph object
License:
BSL-1.0.
- struct
Graph
; -
- this(string tenantId, string clientId, string[] requireScope, string clientSecret = null);
this(string tenantId, string clientId, string accessToken, string refreshToken, string[] requireScope);
this(AuthInfo authInfo);
voidsetup
(string tenantId, string clientId, string[] requireScope, string clientSecret = null);
voidsetup
(string tenantId, string clientId, string accessToken, string refreshToken, string[] requireScope);
voidsetup
(AuthInfo info); - Setup Microsoft GraphParameters:
string clientId Client ID (from Asure Active Directory) string tenantId Tenant ID (from Asure Active Directory) string clientSecret Client secret (from Asure Active Directory, provisioned client secret). This is set only for server application. AuthInfo authInfo Detail information for authrization. - void
authorize
(string code); - void
updateTokens
(); - const string
accessToken
(); - const SysTime
accessTokenExpires
(); - const bool
isAccessTokenExpired
(); - const string
refreshToken
(); - alias
Method
= std.net.curl.HTTP.Method
; - enum
Endpoint
: string; -
v1_0
v1
beta
- struct
HttpResult
; -
- HTTP.StatusLine
statusLine
; - string[string]
responseHeaders
; - immutable(ubyte)[]
responseBody
;
- inout ref inout(HTTP)
handle
() return; - void
setProxy
(string proxy);
voidsetProxy
(string proxy, ushort port, CurlProxy proxyType = CurlProxy.http);
voidsetProxy
(string proxy, string authUser, string authPass, CurlAuth authType = CurlAuth.basic);
voidsetProxy
(string proxy, ushort port, string authUser, string authPass, CurlProxy proxyType = CurlProxy.http, CurlAuth authType = CurlAuth.basic); - Set proxy settingsParameters:
string proxy Hostname or URL ushort port Port number CurlProxy proxyType Type of proxy string authUser User name for proxy string authPass Password for proxy CurlAuth authType Auth type of proxy - void
setCert
(in char[] cafile, in char[] clientCertFile = null, in char[] privateKeyFile = null, in char[] privateKeyPassword = null); - Certification settingsParameters:
char[] cafile PEM file of trusted CA. char[] clientCertFile PEM file of client cert file if required. char[] privateKeyFile PEM file of client private key file if required. char[] privateKeyPassword Password of private key file if required. - HttpResult
request
(Method method, Endpoint endpoint, in char[] resource, in char[] query, in ubyte[] contents = null, string contentType = null); - HTTP Request for Microsoft Graph API call
- HttpResult
get
(in char[] resource, in char[] query);
HttpResultget
(string resource, string[string] query);
HttpResultget
(string resource); - GET Request
- HttpResult
post
(in char[] resource, in ubyte[] contents, string contentType = "application/octet-stream");
HttpResultpost
(in char[] resource, in char[] contents, string contentType = "application/x-www-form-urlencoded");
HttpResultpost
(in char[] resource, JSONValue params);
HttpResultpost
(in char[] resource, string[string] params); - POST Request
- HttpResult
put
(in char[] resource, in ubyte[] contents, string contentType = "application/octet-stream");
HttpResultput
(in char[] resource, in char[] contents, string contentType = "application/x-www-form-urlencoded");
HttpResultput
(in char[] resource, JSONValue params);
HttpResultput
(in char[] resource, string[string] params); - PUT Request
- HttpResult
patch
(in char[] resource, in ubyte[] contents, string contentType = "application/octet-stream");
HttpResultpatch
(in char[] resource, in char[] contents, string contentType = "application/x-www-form-urlencoded");
HttpResultpatch
(in char[] resource, JSONValue params);
HttpResultpatch
(in char[] resource, string[string] params); - PATCH Request
- HttpResult
del
(in char[] resource); - DELETE Request
- bool
setupWithAdHocServer
(ref Graph g, AuthInfo authInfo, Duration dur = 30.seconds);