From 7d1d56ece61b055be9eb90c2d2d65141649d39c8 Mon Sep 17 00:00:00 2001 From: Brendan Thompson Date: Thu, 11 Apr 2024 09:07:03 +1000 Subject: [PATCH] chore: ensure only one inclusion option is used Signed-off-by: Brendan Thompson --- .../conditional_access_policy_resource.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/services/conditionalaccess/conditional_access_policy_resource.go b/internal/services/conditionalaccess/conditional_access_policy_resource.go index 2d8b29f36..16dd71f81 100644 --- a/internal/services/conditionalaccess/conditional_access_policy_resource.go +++ b/internal/services/conditionalaccess/conditional_access_policy_resource.go @@ -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), @@ -96,7 +96,7 @@ 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), @@ -104,9 +104,10 @@ func conditionalAccessPolicyResource() *pluginsdk.Resource { }, "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": {