EnumItem 枚举值
1. 结构声明
- TS Declaration
- JSON Schema
class EnumItem extends BaseNode {
value: string;
label: StaticString;
}
{
"type": "object",
"properties": {
"composedBy": {
"type": "array",
"items": {
"type": "string"
}
},
"changedTime": {
"$ref": "#/definitions/long"
},
"value": {
"type": "string"
},
"label": {
"$ref": "#/definitions/StaticString"
}
},
"required": [
"value",
"label"
],
"additionalProperties": false
}
2. 节点示例
(1) 带描述的示例
AST 如下:
- JSON
- YAML
{
"concept": "EnumItem",
"value": "Listing",
"label": {
"concept": "StaticString",
"value": "上架"
}
}
concept: EnumItem
value: Listing
label:
concept: StaticString
value: 上架
对应的代码如下:
- 文本化 NASL
- Natural TS
@(label = '上架')
case Listing
'Listing' = '上架'