register_graph_class {AzureGraph} | R Documentation |
Extensible registry of Microsoft Graph classes that AzureGraph supports
Description
Extensible registry of Microsoft Graph classes that AzureGraph supports
Usage
register_graph_class(name, R6_generator, check_function)
Arguments
name |
The name of the Graph class, eg "user", "servicePrincipal", etc. |
R6_generator |
An R6 class generator corresponding to this Graph class. |
check_function |
A boolean function that checks if a list of properties is for an object of this class. |
Details
As written, AzureGraph knows about a subset of all the object classes contained in Microsoft Graph. These are mostly the classes originating from Azure Active Directory: users, groups, app registrations, service principals and registered devices.
You can extend AzureGraph by writing your own R6 class that inherits from ms_object
. If so, you should also register your class by calling register_graph_class
and providing the generator object, along with a check function. The latter should accept a list of object properties (as obtained from the Graph REST API), and return TRUE/FALSE based on whether the object is of your class.
Value
An invisible vector of registered class names.
Examples
## Not run:
# built-in 'az_user' class, for an AAD user object
register_graph_class("user", az_user,
function(props) !is.null(props$userPrincipalName))
## End(Not run)