Class: SCIMMY.Resources.User

SCIM User Resource

Summary:
  • Handles read/write/patch/dispose operations for SCIM User resources with specified ingress/egress/degress methods.
  • Formats SCIM User resources for transmission/consumption using the SCIMMY.Schemas.User schema class.

Usage

Instantiate a new SCIM User resource and parse any supplied parameters

                    
                        new SCIMMY.Resources.User(idopt, configopt)
                    
                
Parameters:
Name Type Default Description
idopt String

the ID of the requested resource

configopt Object {}

the parameters of the resource instance request

Properties
Name Type Description
filteropt String

the filter to be applied on ingress/egress by implementing resource

excludedAttributesopt String

the comma-separated string list of attributes or filters to exclude on egress

attributesopt String

the comma-separated string list of attributes or filters to include on egress

sortByopt String

the attribute retrieved resources should be sorted by

sortOrderopt String

the direction retrieved resources should be sorted in

startIndexopt Number

offset index that retrieved resources should start from

countopt Number

maximum number of retrieved resources that should be returned in one operation

Properties:
Name Type Description
idopt String

ID of the resource instance being targeted

filteropt SCIMMY.Types.Filter

filter parsed from the supplied config

attributesopt SCIMMY.Types.Filter

attributes or excluded attributes parsed from the supplied config

constraintsopt Object

sort and pagination properties parsed from the supplied config

Properties
Name Type Description
sortByopt String

the attribute retrieved resources should be sorted by

sortOrderopt String

the direction retrieved resources should be sorted in

startIndexopt Number

offset index that retrieved resources should start from

countopt Number

maximum number of retrieved resources that should be returned in one operation

Members

Methods

(async) read(ctxopt) → {SCIMMY.Messages.ListResponse, SCIMMY.Schemas.User}

Calls resource's egress method for data retrieval. Wraps the results in valid SCIM list response or single resource syntax.

Parameters:
Name Type Description
ctxopt *

any additional context information to pass to the egress handler

Returns:
Examples:
// Retrieve user with ID "1234"
await new SCIMMY.Resources.User("1234").read();
// Retrieve users with an email ending in "@example.com"
await new SCIMMY.Resources.User({filter: 'email.value ew "@example.com"'}).read();

(async) write(instance, ctxopt) → {SCIMMY.Schemas.User}

Calls resource's ingress method for consumption after unwrapping the SCIM resource

Parameters:
Name Type Description
instance Object

the raw resource type instance for consumption by ingress method

ctxopt *

any additional context information to pass to the ingress handler

Returns:
Examples:
// Create a new user with userName "someGuy"
await new SCIMMY.Resources.User().write({userName: "someGuy"});
// Set userName attribute to "someGuy" for user with ID "1234"
await new SCIMMY.Resources.User("1234").write({userName: "someGuy"});

(async) patch(message, ctxopt) → {SCIMMY.Schemas.User}

Retrieves resources via egress method, and applies specified patch operations. Emits patched resources for consumption with resource's ingress method.

Parameters:
Name Type Description
message Object

the PatchOp message to apply to the received resource

ctxopt *

any additional context information to pass to the ingress/egress handlers

Returns:
Examples:
// Set userName to "someGuy" for user with ID "1234" with a patch operation (see SCIMMY.Messages.PatchOp)
await new SCIMMY.Resources.User("1234").patch({Operations: [{op: "add", value: {userName: "someGuy"}}]});

(async) dispose(ctxopt)

Calls resource's degress method for disposal of the SCIM resource

Parameters:
Name Type Description
ctxopt *

any additional context information to pass to the degress handler

Examples:
// Delete user with ID "1234"
await new SCIMMY.Resources.User("1234").dispose();