Skip to content

Commit

Permalink
chore: ensure only one inclusion option is used
Browse files Browse the repository at this point in the history
Signed-off-by: Brendan Thompson <[email protected]>
  • Loading branch information
BrendanThompson committed Apr 10, 2024
1 parent 8cd7c41 commit 7d1d56e
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func conditionalAccessPolicyResource() *pluginsdk.Resource {
"included_applications": {
Type: pluginsdk.TypeList,
Optional: true,
ExactlyOneOf: []string{"conditions.0.applications.0.included_applications", "conditions.0.applications.0.included_user_actions"},
ExactlyOneOf: []string{"conditions.0.applications.0.included_applications", "conditions.0.applications.0.included_user_actions", "conditions.0.applications.0.filter"},
Elem: &pluginsdk.Schema{
Type: pluginsdk.TypeString,
ValidateDiagFunc: validation.ValidateDiag(validation.StringIsNotEmpty),
Expand All @@ -96,17 +96,18 @@ func conditionalAccessPolicyResource() *pluginsdk.Resource {
"included_user_actions": {
Type: pluginsdk.TypeList,
Optional: true,
ExactlyOneOf: []string{"conditions.0.applications.0.included_applications", "conditions.0.applications.0.included_user_actions"},
ExactlyOneOf: []string{"conditions.0.applications.0.included_applications", "conditions.0.applications.0.included_user_actions", "conditions.0.applications.0.filter"},
Elem: &pluginsdk.Schema{
Type: pluginsdk.TypeString,
ValidateDiagFunc: validation.ValidateDiag(validation.StringIsNotEmpty),
},
},

"filter": {
Type: pluginsdk.TypeList,
Optional: true,
MaxItems: 1,
Type: pluginsdk.TypeList,
Optional: true,
ExactlyOneOf: []string{"conditions.0.applications.0.included_applications", "conditions.0.applications.0.included_user_actions", "conditions.0.applications.0.filter"},
MaxItems: 1,
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"mode": {
Expand Down

0 comments on commit 7d1d56e

Please sign in to comment.