Skip to content

Commit 077e948

Browse files
filter empty ids (#304)
1 parent 4e217af commit 077e948

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

gen/definitions/network_profile_for_site_assignments.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ attributes:
2020
- model_name: items
2121
type: Set
2222
mandatory: true
23+
max_elements_in_root_list: 10000
2324
response_data_path: response
2425
description: List of sites where the network profile is assigned
2526
attributes:

internal/provider/model_catalystcenter_network_profile_for_sites_assignments.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ func (data *NetworkProfileForSitesAssignments) fromBody(ctx context.Context, res
100100

101101
// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
102102
func (data *NetworkProfileForSitesAssignments) updateFromBody(ctx context.Context, res gjson.Result) {
103+
var final []NetworkProfileForSitesAssignmentsItems
103104
for i := range data.Items {
104105
keys := [...]string{"id"}
105106
keyValues := [...]string{data.Items[i].Id.ValueString()}
@@ -128,7 +129,11 @@ func (data *NetworkProfileForSitesAssignments) updateFromBody(ctx context.Contex
128129
} else {
129130
data.Items[i].Id = types.StringNull()
130131
}
132+
if data.Items[i].Id != types.StringNull() {
133+
final = append(final, data.Items[i])
134+
}
131135
}
136+
data.Items = final
132137
}
133138

134139
// End of section. //template:end updateFromBody

0 commit comments

Comments
 (0)