Class: SCIMMY.Resources.Group
SCIM Group Resource
Description
Summary:
- Handles read/write/patch/dispose operations for SCIM Group resources with specified ingress/egress/degress methods.
- Formats SCIM Group resources for transmission/consumption using the
SCIMMY.Schemas.Group
schema class.
Usage
Instantiate a new SCIM Group resource and parse any supplied parameters
new SCIMMY.Resources.Group(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.Group}
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 group with ID "1234"
await new SCIMMY.Resources.Group("1234").read();
// Retrieve groups with a group name starting with "A"
await new SCIMMY.Resources.Group({filter: 'displayName sw "A"'}).read();
(async) write(instance, ctxopt) → {SCIMMY.Schemas.Group}
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 group with displayName "A Group"
await new SCIMMY.Resources.Group().write({displayName: "A Group"});
// Set members attribute for group with ID "1234"
await new SCIMMY.Resources.Group("1234").write({members: [{value: "5678"}]});
(async) patch(message, ctxopt) → {SCIMMY.Schemas.Group}
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:
// Add member to group with ID "1234" with a patch operation (see SCIMMY.Messages.PatchOp)
await new SCIMMY.Resources.Group("1234").patch({Operations: [{op: "add", path: "members", value: {value: "5678"}}]});
(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 group with ID "1234"
await new SCIMMY.Resources.Group("1234").dispose();