Class: SCIMMY.Resources.User
SCIM User Resource
Description
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)
- Extends:
- SCIMMY.Types.Resource
Parameters:
Name | Type | Default | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
idopt
|
String |
the ID of the requested resource |
|||||||||||||||||||||||||
configopt
|
Object | {} |
the parameters of the resource instance request Properties
|
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
|
Members
(static) endpoint: String
Retrieves a resource's endpoint relative to the service provider's base URL
- Type:
- {String}
- Implements:
- SCIMMY.Types.Resource.endpoint
(static) schema: SCIMMY.Types.Schema
Retrieves a resource's core schema
- Type:
- {SCIMMY.Types.Schema}
- Implements:
- SCIMMY.Types.Resource.schema
Methods
(static) basepath(pathopt) → {SCIMMY.Types.Resource, String}
Sets or retrieves the base path for resolution of a resource's location
- Implements:
- SCIMMY.Types.Resource.basepath
Parameters:
Name | Type | Description |
---|---|---|
pathopt
|
String |
the path to use as the base of a resource's location |
Returns:
this resource type class for chaining if path is a string, or the resource's basepath
(static) ingress(handler) → {SCIMMY.Types.Resource}
Sets the method to be called to consume a resource on create
- Implements:
- SCIMMY.Types.Resource.ingress
Parameters:
Name | Type | Description |
---|---|---|
handler
|
~IngressHandler |
function to invoke to consume a resource on create |
Returns:
this resource type class for chaining
(static) egress(handler) → {SCIMMY.Types.Resource}
Sets the method to be called to retrieve a resource on read
- Implements:
- SCIMMY.Types.Resource.egress
Parameters:
Name | Type | Description |
---|---|---|
handler
|
~EgressHandler |
function to invoke to retrieve a resource on read |
Returns:
this resource type class for chaining
(static) degress(handler) → {SCIMMY.Types.Resource}
Sets the method to be called to dispose of a resource on delete
- Implements:
- SCIMMY.Types.Resource.degress
Parameters:
Name | Type | Description |
---|---|---|
handler
|
~DegressHandler |
function to invoke to dispose of a resource on delete |
Returns:
this resource type class for chaining
(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.
- Implements:
- SCIMMY.Types.Resource#read
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
- Implements:
- SCIMMY.Types.Resource#write
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.
- Implements:
- SCIMMY.Types.Resource#patch
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
- Implements:
- SCIMMY.Types.Resource#dispose
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();