Content
Attribute supports various content defined by contentType.
For more details about Attribute types and contentType, see Attributes.
Content properties
Each content type must extend, based on the attribute version, either BaseAttributeContentV2 or BaseAttributeContentV3 which are abstracted from AttributeContent.
The content has the following properties defined and inherited from BaseAttributeContentV2:
| Property | Type | Short description | Required |
|---|---|---|---|
reference | string | Reference that can be used for the content value. It is useful especially when the data contains an object, or any other more complex data structure | No |
data | AttributeContent | The value of the content, depending on the contentType from supported AttributeContentType | Yes |
The content has the following properties defined and inherited from BaseAttributeContentV3:
| Property | Type | Short description | Required |
|---|---|---|---|
reference | string | Reference that can be used for the content value. It is useful especially when the data contains an object, or any other more complex data structure | No |
data | AttributeContent | The value of the content, depending on the contentType from supported AttributeContentType | Yes |
contentType | AttributeContentType | The type of the content, must match the content type of attribute definition | Yes |
Supported content types
V2 content classes are deprecated. New implementations should use V3 content classes (e.g., StringAttributeContentV3 instead of StringAttributeContentV2). The V2-only content types SECRET and CREDENTIAL are replaced by RESOURCE OBJECT in V3.
Supported content types are defined in AttributeContentType.
The following content types are available and supported:
AttributeContentType | Class V2 | Class V3 | Data |
|---|---|---|---|
STRING | StringAttributeContentV2 | StringAttributeContentV3 | string |
INTEGER | IntegerAttributeContentV2 | IntegerAttributeContentV3 | integer |
SECRET | SecretAttributeContentV2 | N/A | SecretAttributeContentData |
FILE | FileAttributeContentV2 | FileAttributeContentV3 | FileAttributeContentData |
BOOLEAN | BooleanAttributeContentV2 | BooleanAttributeContentV3 | boolean |
TEXT | TextAttributeContentV2 | TextAttributeContentV3 | string |
CODEBLOCK | CodeBlockAttributeContentV2 | CodeBlockAttributeContentV3 | CodeBlockAttributeContentData |
FLOAT | FloatAttributeContentV2 | FloatAttributeContentV3 | float |
DATE | DateAttributeContentV2 | DateAttributeContentV3 | date |
DATETIME | DateTimeAttributeContentV2 | DateTimeAttributeContentV3 | datetime |
TIME | TimeAttributeContentV2 | TimeAttributeContentV3 | time |
CREDENTIAL | CredentialAttributeContentV2 | N/A | CredentialAttributeContentData |
OBJECT | ObjectAttributeContentV2 | ObjectAttributeContentV3 | object |
RESOURCE OBJECT | N/A | ResourceObjectContent | ResourceObjectContentData |
One Attribute can define only one contentType. Multiple different content types for one Attribute is not supported.
Content type samples
The table below shows the AttributeContentType and the sample for each type and version.
| Content samples | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| v2v3 | ||||||||||||||
| v2v3 | ||||||||||||||
| v2V2-only
| ||||||||||||||
| v2v3
| ||||||||||||||
| v2v3 | ||||||||||||||
| v2V2-only
| ||||||||||||||
| v2v3
| ||||||||||||||
| v2v3 | ||||||||||||||
| v2v3
| ||||||||||||||
| v2v3
| ||||||||||||||
| v2v3
you would send the following content v2v3 | ||||||||||||||
| v2v3
| ||||||||||||||
| v2v3
| ||||||||||||||
| v3
An |
Content model
The following diagram represents the content model inherited from the AttributeContent. Details can be found in the CZERTAINLY Interfaces repository.
Content types highlighted in red (SecretAttributeContentV2, CredentialAttributeContentV2) are V2-only. The type highlighted in green (ResourceObjectContent) is V3-only and replaces the V2 SECRET and CREDENTIAL content types. All other content types exist in both V2 and V3.