From 709f1099edbf903c9f2dc1a0e271a117eb1dcc7e Mon Sep 17 00:00:00 2001 From: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com> Date: Wed, 19 Jul 2023 12:54:41 +0200 Subject: [PATCH] Prevent empty mobile block on client resource --- internal/auth0/client/resource.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/internal/auth0/client/resource.go b/internal/auth0/client/resource.go index 2619865d2..901c713bf 100644 --- a/internal/auth0/client/resource.go +++ b/internal/auth0/client/resource.go @@ -255,11 +255,12 @@ func NewResource() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "android": { - Type: schema.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - Description: "Configuration settings for Android native apps.", + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + Description: "Configuration settings for Android native apps.", + AtLeastOneOf: []string{"mobile.0.ios"}, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "app_package_name": { @@ -283,11 +284,12 @@ func NewResource() *schema.Resource { }, }, "ios": { - Type: schema.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - Description: "Configuration settings for i0S native apps.", + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + Description: "Configuration settings for i0S native apps.", + AtLeastOneOf: []string{"mobile.0.android"}, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "team_id": {