Skip to content

Commit

Permalink
Make children TypeSet instead of TypeList
Browse files Browse the repository at this point in the history
  • Loading branch information
vladhanzha committed Dec 22, 2024
1 parent c57b1eb commit 62aa2ed
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cloudconnexa/resource_access_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func resourceAccessGroup() *schema.Resource {
},
"description": {
Type: schema.TypeString,
Required: true,
Optional: true,
Description: "The Access group description.",
},
"source": {
Expand Down Expand Up @@ -88,7 +88,7 @@ func resourceSource() *schema.Resource {
Description: "ID of the entity assigned to access group source.",
},
"children": {
Type: schema.TypeList,
Type: schema.TypeSet,
Optional: true,
Description: "ID of child entities assigned to access group source.",
Elem: &schema.Schema{
Expand Down Expand Up @@ -119,7 +119,7 @@ func resourceDestination() *schema.Resource {
Description: "ID of the entity assigned to access group destination.",
},
"children": {
Type: schema.TypeList,
Type: schema.TypeSet,
Optional: true,
Description: "ID of child entities assigned to access group destination.",
Elem: &schema.Schema{
Expand Down Expand Up @@ -249,7 +249,7 @@ func resourceDataToAccessGroup(data *schema.ResourceData) *cloudconnexa.AccessGr
AllCovered: convertedSource["all_covered"].(bool),
Parent: convertedSource["parent"].(string),
}
for _, child := range convertedSource["children"].([]interface{}) {
for _, child := range convertedSource["children"].(*schema.Set).List() {
newSource.Children = append(newSource.Children, child.(string))
}
request.Source = append(request.Source, newSource)
Expand All @@ -264,7 +264,7 @@ func resourceDataToAccessGroup(data *schema.ResourceData) *cloudconnexa.AccessGr
AllCovered: mappedDestination["all_covered"].(bool),
Parent: mappedDestination["parent"].(string),
}
for _, child := range mappedDestination["children"].([]interface{}) {
for _, child := range mappedDestination["children"].(*schema.Set).List() {
newDestination.Children = append(newDestination.Children, child.(string))
}
request.Destination = append(request.Destination, newDestination)
Expand Down

0 comments on commit 62aa2ed

Please sign in to comment.