Class: SCIMMY.Messages.PatchOp
SCIM Patch Operation Message
Description
Summary:
- Parses PatchOp messages, making sure all specified "Operations" are valid and conform with the SCIM protocol.
- Provides a method to atomically apply PatchOp operations to a resource instance, handling any exceptions that occur along the way.
Usage
Instantiate a new SCIM Patch Operation Message with relevant details
new SCIMMY.Messages.PatchOp(request)
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
request
|
Object
|
contents of the patch operation request being performed Properties
|
Properties:
Name | Type | Description |
---|---|---|
Operations
|
~PatchOpOperation[]
|
list of SCIM-compliant patch operations to apply to the given resource |
Methods
(async) apply(resource, finaliseopt) → {SCIMMY.Types.Schema}
Apply patch operations to a resource as defined by the PatchOp instance
Parameters:
Name | Type | Description |
---|---|---|
resource
|
SCIMMY.Types.Schema
|
the schema instance the patch operation will be performed on |
finaliseopt
|
~PatchOpFinaliser
|
method to call when all operations are complete, to feed target back through model |
Returns:
an instance of the resource modified as per the included patch operations
Type Definitions
PatchOpOperation
SCIM PatchOp Operation definition
- Type:
- {Object}
Properties:
Name | Type | Description |
---|---|---|
op
|
~ValidPatchOperations
|
the operation to perform |
pathopt
|
String
|
an attribute path describing the target of the operation |
valueopt
|
*
|
value to add or update |
(async) PatchOpFinaliser(instance) → {Record<String, any>}
Apply final transformations or database operations before determining whether a PatchOp resulted in any actual changes
- Type:
- {function}
Parameters:
Name | Type | Description |
---|---|---|
instance
|
SCIMMY.Types.Schema
|
a patched version of the originally supplied resource schema instance |
Returns:
the resource instance after final transformations have been applied
Constants
(inner) ValidPatchOperations
List of valid SCIM patch operations
- Values:
["add","remove","replace"]