mirror of
https://github.com/zenstackhq/zenstack
synced 2026-05-24 10:08:55 +00:00
655 B
655 B
Enum
Enums are container declarations for grouping constant identifiers. You can use them to express concepts like user roles, product categories, etc.
Syntax
Enum declarations take the following form:
enum [ENUM_NAME] {
[FIELD]*
}
-
[ENUM_NAME]
Name of the enum. Needs to be unique in the entire model. Needs to be a valid identifier matching regular expression
[A-Za-z][a-za-z0-9_]\*. -
[FIELD]
Field identifier. Needs to be unique in the data model. Needs to be a valid identifier matching regular expression
[A-Za-z][a-za-z0-9_]\*.
Example
enum UserRole {
USER
ADMIN
}