@@ -33,6 +33,15 @@ type RelationshipType int
3333// MethodType enumerates the category of evaluation or enforcement method.
3434type MethodType int
3535
36+ // ModeType enumerates whether enforcement/evaluation is manual or automated.
37+ type ModeType int
38+
39+ // Disposition enumerates the possible enforcement outcomes.
40+ type Disposition int
41+
42+ // EnforcementStep is a reference to the code path that performed an enforcement action.
43+ type EnforcementStep string
44+
3645// Severity defines the allowed impact levels for a risk.
3746type Severity int
3847
@@ -112,6 +121,17 @@ const (
112121 MethodGate
113122)
114123
124+ const (
125+ ModeManual ModeType = iota
126+ ModeAutomated
127+ )
128+
129+ const (
130+ DispositionEnforced Disposition = iota
131+ DispositionTolerated
132+ DispositionClear
133+ )
134+
115135const (
116136 SeverityLow Severity = iota
117137 SeverityMedium
@@ -276,6 +296,28 @@ var (
276296 "Gate" : MethodGate ,
277297 }
278298
299+ modeTypeToString = map [ModeType ]string {
300+ ModeManual : "Manual" ,
301+ ModeAutomated : "Automated" ,
302+ }
303+
304+ stringToModeType = map [string ]ModeType {
305+ "Manual" : ModeManual ,
306+ "Automated" : ModeAutomated ,
307+ }
308+
309+ dispositionToString = map [Disposition ]string {
310+ DispositionEnforced : "Enforced" ,
311+ DispositionTolerated : "Tolerated" ,
312+ DispositionClear : "Clear" ,
313+ }
314+
315+ stringToDisposition = map [string ]Disposition {
316+ "Enforced" : DispositionEnforced ,
317+ "Tolerated" : DispositionTolerated ,
318+ "Clear" : DispositionClear ,
319+ }
320+
279321 severityToString = map [Severity ]string {
280322 SeverityLow : "Low" ,
281323 SeverityMedium : "Medium" ,
@@ -598,6 +640,60 @@ func (m *MethodType) UnmarshalJSON(data []byte) error {
598640 return unmarshalJSONEnum (data , stringToMethodType , "MethodType" , m )
599641}
600642
643+ func (m ModeType ) String () string {
644+ if s , ok := modeTypeToString [m ]; ok {
645+ return s
646+ }
647+ return fmt .Sprintf ("ModeType(%d)" , m )
648+ }
649+
650+ // MarshalYAML ensures that ModeType is serialized as a string in YAML
651+ func (m ModeType ) MarshalYAML () (interface {}, error ) {
652+ return marshalYAMLString (m )
653+ }
654+
655+ // MarshalJSON ensures that ModeType is serialized as a string in JSON
656+ func (m ModeType ) MarshalJSON () ([]byte , error ) {
657+ return marshalJSONString (m )
658+ }
659+
660+ // UnmarshalYAML ensures that ModeType can be deserialized from a YAML string
661+ func (m * ModeType ) UnmarshalYAML (data []byte ) error {
662+ return unmarshalYAMLEnum (data , stringToModeType , "ModeType" , m )
663+ }
664+
665+ // UnmarshalJSON ensures that ModeType can be deserialized from a JSON string
666+ func (m * ModeType ) UnmarshalJSON (data []byte ) error {
667+ return unmarshalJSONEnum (data , stringToModeType , "ModeType" , m )
668+ }
669+
670+ func (d Disposition ) String () string {
671+ if s , ok := dispositionToString [d ]; ok {
672+ return s
673+ }
674+ return fmt .Sprintf ("Disposition(%d)" , d )
675+ }
676+
677+ // MarshalYAML ensures that Disposition is serialized as a string in YAML
678+ func (d Disposition ) MarshalYAML () (interface {}, error ) {
679+ return marshalYAMLString (d )
680+ }
681+
682+ // MarshalJSON ensures that Disposition is serialized as a string in JSON
683+ func (d Disposition ) MarshalJSON () ([]byte , error ) {
684+ return marshalJSONString (d )
685+ }
686+
687+ // UnmarshalYAML ensures that Disposition can be deserialized from a YAML string
688+ func (d * Disposition ) UnmarshalYAML (data []byte ) error {
689+ return unmarshalYAMLEnum (data , stringToDisposition , "Disposition" , d )
690+ }
691+
692+ // UnmarshalJSON ensures that Disposition can be deserialized from a JSON string
693+ func (d * Disposition ) UnmarshalJSON (data []byte ) error {
694+ return unmarshalJSONEnum (data , stringToDisposition , "Disposition" , d )
695+ }
696+
601697func (s Severity ) String () string {
602698 if str , ok := severityToString [s ]; ok {
603699 return str
0 commit comments