Skip to content

Commit 5cd04ca

Browse files
authored
Merge pull request Nerzal#315 from yue-wen/main
LGTM thank you for the contribution change type of enum PolicyEnforcementMode from int to string
2 parents 227e200 + c99afa5 commit 5cd04ca

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

models.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -476,13 +476,13 @@ type AdapterConfiguration struct {
476476
}
477477

478478
// PolicyEnforcementMode is an enum type for PolicyEnforcementMode of ResourceServerRepresentation
479-
type PolicyEnforcementMode int
479+
type PolicyEnforcementMode string
480480

481481
// PolicyEnforcementMode values
482-
const (
483-
ENFORCING PolicyEnforcementMode = iota
484-
PERMISSIVE
485-
DISABLED
482+
var (
483+
ENFORCING = PolicyEnforcementModeP("ENFORCING")
484+
PERMISSIVE = PolicyEnforcementModeP("PERMISSIVE")
485+
DISABLED = PolicyEnforcementModeP("DISABLED")
486486
)
487487

488488
// Logic is an enum type for policy logic

utils.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,16 @@ func DecisionStrategyP(value DecisionStrategy) *DecisionStrategy {
122122
return &value
123123
}
124124

125-
// LogicP returns a pointer for a LogicP value
125+
// LogicP returns a pointer for a Logic value
126126
func LogicP(value Logic) *Logic {
127127
return &value
128128
}
129129

130+
// PolicyEnforcementModeP returns a pointer for a PolicyEnforcementMode value
131+
func PolicyEnforcementModeP(value PolicyEnforcementMode) *PolicyEnforcementMode {
132+
return &value
133+
}
134+
130135
// PStringSlice converts a pointer to []string or returns ampty slice if nill value
131136
func PStringSlice(value *[]string) []string {
132137
if value == nil {

0 commit comments

Comments
 (0)