Class: SCIMMY.Types.Attribute
SCIM Attribute Type
Description
Summary:
- Defines a SCIM schema attribute, and is used to ensure a given resource's value conforms to the attribute definition.
Usage
Constructs an instance of a full SCIM attribute definition
new SCIMMY.Types.Attribute(type, name, configopt, subAttributesopt)
Parameters:
Name | Type | Description |
---|---|---|
type
|
String |
the data type of the attribute |
name
|
String |
the actual name of the attribute |
configopt
|
~AttributeConfig|Object |
additional config defining the attribute's characteristics |
subAttributesopt
|
SCIMMY.Types.Attribute[] |
if the attribute is complex, the sub-attributes of the attribute |
Properties:
Name | Type | Description |
---|---|---|
type
|
String |
the data type of the attribute |
name
|
String |
the actual name of the attribute |
config
|
~AttributeConfig |
additional config defining the attribute's characteristics |
subAttributesopt
|
SCIMMY.Types.Attribute[] |
if the attribute is complex, the sub-attributes of the attribute |
Methods
truncate(subAttributes) → {SCIMMY.Types.Attribute}
Remove a subAttribute from a complex attribute definition
Parameters:
Name | Type | Description |
---|---|---|
subAttributes
|
String|SCIMMY.Types.Attribute |
the child attributes to remove from the complex attribute definition |
Returns:
this attribute instance for chaining
toJSON() → {~AttributeDefinition}
Parse this Attribute instance into a valid SCIM attribute definition object
Returns:
an object representing a valid SCIM attribute definition
coerce(source, directionopt, isComplexMultiValueopt) → {String, String[], Number, Boolean, Object, Object[]}
Coerce a given value by making sure it conforms to attribute's characteristics
Parameters:
Name | Type | Default | Description |
---|---|---|---|
source
|
any|any[] |
value to coerce and confirm conformity with attribute's characteristics |
|
directionopt
|
String | both |
whether to check for inbound, outbound, or bidirectional attributes |
isComplexMultiValueopt
|
Boolean | false |
indicates whether a coercion is for a single complex value in a collection of complex values |
Returns:
the coerced value, conforming to attribute's characteristics
Type Definitions
AttributeConfig
- Type:
- {Object}
Properties:
Name | Type | Default | Description |
---|---|---|---|
multiValuedopt
|
Boolean | false |
does the attribute expect a collection of values |
descriptionopt
|
String | "" |
a human-readable description of the attribute |
requiredopt
|
Boolean | false |
whether the attribute is required for the type instance to be valid |
canonicalValuesopt
|
Boolean|String[] | false |
values the attribute's contents must be set to |
caseExactopt
|
Boolean | false |
whether the attribute's contents is case-sensitive |
mutableopt
|
Boolean|String | true |
whether the attribute's contents is modifiable |
returnedopt
|
Boolean|String | true |
whether the attribute is returned in a response |
referenceTypesopt
|
Boolean|String[] | false |
list of referenced types if attribute type is reference |
uniquenessopt
|
String|Boolean | "none" |
the attribute's uniqueness characteristic |
directionopt
|
String | "both" |
whether the attribute should be present for inbound, outbound, or bidirectional requests |
shadowopt
|
Boolean | false |
whether the attribute should be hidden from schemas presented by the resource type endpoint |
AttributeDefinition
- Type:
- {Object}
Properties:
Name | Type | Description |
---|---|---|
name
|
String |
the attribute's name |
type
|
String |
the attribute's data type |
referenceTypesopt
|
String[] |
specifies a SCIM resourceType that a reference attribute may refer to |
multiValued
|
Boolean |
boolean value indicating an attribute's plurality |
description
|
String |
a human-readable description of the attribute |
required
|
Boolean |
boolean value indicating whether the attribute is required |
subAttributesopt
|
~AttributeDefinition[] |
defines the sub-attributes of a complex attribute |
caseExactopt
|
Boolean |
boolean value indicating whether a string attribute is case-sensitive |
canonicalValuesopt
|
String[] |
collection of canonical values |
mutability
|
String |
indicates whether an attribute is modifiable |
returned
|
String |
indicates when an attribute is returned in a response |
uniquenessopt
|
String |
indicates how unique a value must be |
Constants
(inner) ValidAttributeTypes: String[]
Collection of valid attribute type characteristic's values
- Values:
["string","complex","boolean","binary","decimal","integer","dateTime","reference"]
- Type:
- {String[]}
(inner) ValidMutabilityValues: String[]
Collection of valid attribute mutability characteristic's values
- Values:
["readOnly","readWrite","immutable","writeOnly"]
- Type:
- {String[]}
(inner) ValidReturnedValues: String[]
Collection of valid attribute returned characteristic's values
- Values:
["always","never","default","request"]
- Type:
- {String[]}
(inner) ValidUniquenessValues: String[]
Collection of valid attribute uniqueness characteristic's values
- Values:
["none","server","global"]
- Type:
- {String[]}