Skip to content

Commit

Permalink
Merge pull request #315 from yue-wen/main
Browse files Browse the repository at this point in the history
LGTM thank you for the contribution
change type of enum PolicyEnforcementMode from int to string
  • Loading branch information
Nerzal authored Nov 17, 2021
2 parents 227e200 + c99afa5 commit 5cd04ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 5 additions & 5 deletions models.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,13 @@ type AdapterConfiguration struct {
}

// PolicyEnforcementMode is an enum type for PolicyEnforcementMode of ResourceServerRepresentation
type PolicyEnforcementMode int
type PolicyEnforcementMode string

// PolicyEnforcementMode values
const (
ENFORCING PolicyEnforcementMode = iota
PERMISSIVE
DISABLED
var (
ENFORCING = PolicyEnforcementModeP("ENFORCING")
PERMISSIVE = PolicyEnforcementModeP("PERMISSIVE")
DISABLED = PolicyEnforcementModeP("DISABLED")
)

// Logic is an enum type for policy logic
Expand Down
7 changes: 6 additions & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,16 @@ func DecisionStrategyP(value DecisionStrategy) *DecisionStrategy {
return &value
}

// LogicP returns a pointer for a LogicP value
// LogicP returns a pointer for a Logic value
func LogicP(value Logic) *Logic {
return &value
}

// PolicyEnforcementModeP returns a pointer for a PolicyEnforcementMode value
func PolicyEnforcementModeP(value PolicyEnforcementMode) *PolicyEnforcementMode {
return &value
}

// PStringSlice converts a pointer to []string or returns ampty slice if nill value
func PStringSlice(value *[]string) []string {
if value == nil {
Expand Down

0 comments on commit 5cd04ca

Please sign in to comment.