Skip to content

Commit 7865e8a

Browse files
committed
Resolve list import issue
1 parent 3f841c0 commit 7865e8a

File tree

75 files changed

+230
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+230
-230
lines changed

gen/templates/profile_parcels/model.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ func (data *{{camelCase .Name}}) fromBody(ctx context.Context, res gjson.Result)
401401
}
402402
}
403403
{{- else if isNestedListSet .}}
404-
if value := res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}"); value.Exists() {
404+
if value := res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}"); value.Exists() && len(value.Array()) > 0 {
405405
data.{{toGoName .TfName}} = make([]{{$name}}{{toGoName .TfName}}, 0)
406406
value.ForEach(func(k, v gjson.Result) bool {
407407
item := {{$name}}{{toGoName .TfName}}{}
@@ -430,7 +430,7 @@ func (data *{{camelCase .Name}}) fromBody(ctx context.Context, res gjson.Result)
430430
}
431431
}
432432
{{- else if isNestedListSet .}}
433-
if cValue := v.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}"); cValue.Exists() {
433+
if cValue := v.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}"); cValue.Exists() && len(cValue.Array()) > 0 {
434434
item.{{toGoName .TfName}} = make([]{{$name}}{{$cname}}{{toGoName .TfName}}, 0)
435435
cValue.ForEach(func(ck, cv gjson.Result) bool {
436436
cItem := {{$name}}{{$cname}}{{toGoName .TfName}}{}
@@ -458,7 +458,7 @@ func (data *{{camelCase .Name}}) fromBody(ctx context.Context, res gjson.Result)
458458
}
459459
}
460460
{{- else if isNestedListSet .}}
461-
if ccValue := cv.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}"); ccValue.Exists() {
461+
if ccValue := cv.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}"); ccValue.Exists() && len(ccValue.Array()) > 0{
462462
cItem.{{toGoName .TfName}} = make([]{{$name}}{{$cname}}{{$ccname}}{{toGoName .TfName}}, 0)
463463
ccValue.ForEach(func(cck, ccv gjson.Result) bool {
464464
ccItem := {{$name}}{{$cname}}{{$ccname}}{{toGoName .TfName}}{}

internal/provider/model_sdwan_application_priority_qos_policy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func (data *ApplicationPriorityQoS) fromBody(ctx context.Context, res gjson.Resu
148148
data.TargetInterface = helpers.GetStringSet(va.Array())
149149
}
150150
}
151-
if value := res.Get(path + "qosMap.qosSchedulers"); value.Exists() {
151+
if value := res.Get(path + "qosMap.qosSchedulers"); value.Exists() && len(value.Array()) > 0 {
152152
data.QosSchedulers = make([]ApplicationPriorityQoSQosSchedulers, 0)
153153
value.ForEach(func(k, v gjson.Result) bool {
154154
item := ApplicationPriorityQoSQosSchedulers{}

internal/provider/model_sdwan_application_priority_traffic_policy_policy.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ func (data *ApplicationPriorityTrafficPolicy) fromBody(ctx context.Context, res
797797
data.Direction = types.StringValue(va.String())
798798
}
799799
}
800-
if value := res.Get(path + "sequences"); value.Exists() {
800+
if value := res.Get(path + "sequences"); value.Exists() && len(value.Array()) > 0 {
801801
data.Sequences = make([]ApplicationPriorityTrafficPolicySequences, 0)
802802
value.ForEach(func(k, v gjson.Result) bool {
803803
item := ApplicationPriorityTrafficPolicySequences{}
@@ -833,7 +833,7 @@ func (data *ApplicationPriorityTrafficPolicy) fromBody(ctx context.Context, res
833833
item.Protocol = types.StringValue(va.String())
834834
}
835835
}
836-
if cValue := v.Get("match.entries"); cValue.Exists() {
836+
if cValue := v.Get("match.entries"); cValue.Exists() && len(cValue.Array()) > 0 {
837837
item.MatchEntries = make([]ApplicationPriorityTrafficPolicySequencesMatchEntries, 0)
838838
cValue.ForEach(func(ck, cv gjson.Result) bool {
839839
cItem := ApplicationPriorityTrafficPolicySequencesMatchEntries{}
@@ -1041,11 +1041,11 @@ func (data *ApplicationPriorityTrafficPolicy) fromBody(ctx context.Context, res
10411041
return true
10421042
})
10431043
}
1044-
if cValue := v.Get("actions"); cValue.Exists() {
1044+
if cValue := v.Get("actions"); cValue.Exists() && len(cValue.Array()) > 0 {
10451045
item.Actions = make([]ApplicationPriorityTrafficPolicySequencesActions, 0)
10461046
cValue.ForEach(func(ck, cv gjson.Result) bool {
10471047
cItem := ApplicationPriorityTrafficPolicySequencesActions{}
1048-
if ccValue := cv.Get("slaClass"); ccValue.Exists() {
1048+
if ccValue := cv.Get("slaClass"); ccValue.Exists() && len(ccValue.Array()) > 0 {
10491049
cItem.SlaClasses = make([]ApplicationPriorityTrafficPolicySequencesActionsSlaClasses, 0)
10501050
ccValue.ForEach(func(cck, ccv gjson.Result) bool {
10511051
ccItem := ApplicationPriorityTrafficPolicySequencesActionsSlaClasses{}
@@ -1117,7 +1117,7 @@ func (data *ApplicationPriorityTrafficPolicy) fromBody(ctx context.Context, res
11171117
cItem.BackupSlaPreferredColor = helpers.GetStringSet(va.Array())
11181118
}
11191119
}
1120-
if ccValue := cv.Get("set"); ccValue.Exists() {
1120+
if ccValue := cv.Get("set"); ccValue.Exists() && len(ccValue.Array()) > 0 {
11211121
cItem.SetParameters = make([]ApplicationPriorityTrafficPolicySequencesActionsSetParameters, 0)
11221122
ccValue.ForEach(func(cck, ccv gjson.Result) bool {
11231123
ccItem := ApplicationPriorityTrafficPolicySequencesActionsSetParameters{}

internal/provider/model_sdwan_dns_security_policy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func (data *DNSSecurity) fromBody(ctx context.Context, res gjson.Result) {
230230
data.ChildOrgId = types.StringValue(va.String())
231231
}
232232
}
233-
if value := res.Get(path + "targetVpns"); value.Exists() {
233+
if value := res.Get(path + "targetVpns"); value.Exists() && len(value.Array()) > 0 {
234234
data.TargetVpns = make([]DNSSecurityTargetVpns, 0)
235235
value.ForEach(func(k, v gjson.Result) bool {
236236
item := DNSSecurityTargetVpns{}

internal/provider/model_sdwan_other_thousandeyes_feature.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func (data *OtherThousandEyes) fromBody(ctx context.Context, res gjson.Result) {
248248
data.Description = types.StringNull()
249249
}
250250
path := "payload.data."
251-
if value := res.Get(path + "virtualApplication"); value.Exists() {
251+
if value := res.Get(path + "virtualApplication"); value.Exists() && len(value.Array()) > 0 {
252252
data.VirtualApplication = make([]OtherThousandEyesVirtualApplication, 0)
253253
value.ForEach(func(k, v gjson.Result) bool {
254254
item := OtherThousandEyesVirtualApplication{}

internal/provider/model_sdwan_other_ucse_feature.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ func (data *OtherUCSE) fromBody(ctx context.Context, res gjson.Result) {
333333
data.AssignPriority = types.Int64Value(va.Int())
334334
}
335335
}
336-
if value := res.Get(path + "interface"); value.Exists() {
336+
if value := res.Get(path + "interface"); value.Exists() && len(value.Array()) > 0 {
337337
data.Interfaces = make([]OtherUCSEInterfaces, 0)
338338
value.ForEach(func(k, v gjson.Result) bool {
339339
item := OtherUCSEInterfaces{}

internal/provider/model_sdwan_policy_object_app_probe_class.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ func (data *PolicyObjectAppProbeClass) fromBody(ctx context.Context, res gjson.R
119119
data.Description = types.StringNull()
120120
}
121121
path := "payload.data."
122-
if value := res.Get(path + "entries"); value.Exists() {
122+
if value := res.Get(path + "entries"); value.Exists() && len(value.Array()) > 0 {
123123
data.Entries = make([]PolicyObjectAppProbeClassEntries, 0)
124124
value.ForEach(func(k, v gjson.Result) bool {
125125
item := PolicyObjectAppProbeClassEntries{}
126-
if cValue := v.Get("map"); cValue.Exists() {
126+
if cValue := v.Get("map"); cValue.Exists() && len(cValue.Array()) > 0 {
127127
item.Map = make([]PolicyObjectAppProbeClassEntriesMap, 0)
128128
cValue.ForEach(func(ck, cv gjson.Result) bool {
129129
cItem := PolicyObjectAppProbeClassEntriesMap{}

internal/provider/model_sdwan_policy_object_application_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (data *PolicyObjectApplicationList) fromBody(ctx context.Context, res gjson
100100
data.Description = types.StringNull()
101101
}
102102
path := "payload.data."
103-
if value := res.Get(path + "entries"); value.Exists() {
103+
if value := res.Get(path + "entries"); value.Exists() && len(value.Array()) > 0 {
104104
data.Entries = make([]PolicyObjectApplicationListEntries, 0)
105105
value.ForEach(func(k, v gjson.Result) bool {
106106
item := PolicyObjectApplicationListEntries{}

internal/provider/model_sdwan_policy_object_as_path_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func (data *PolicyObjectASPathList) fromBody(ctx context.Context, res gjson.Resu
108108
data.AsPathListId = types.Int64Value(va.Int())
109109
}
110110
}
111-
if value := res.Get(path + "entries"); value.Exists() {
111+
if value := res.Get(path + "entries"); value.Exists() && len(value.Array()) > 0 {
112112
data.Entries = make([]PolicyObjectASPathListEntries, 0)
113113
value.ForEach(func(k, v gjson.Result) bool {
114114
item := PolicyObjectASPathListEntries{}

internal/provider/model_sdwan_policy_object_class_map.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (data *PolicyObjectClassMap) fromBody(ctx context.Context, res gjson.Result
9393
data.Description = types.StringNull()
9494
}
9595
path := "payload.data."
96-
if value := res.Get(path + "entries"); value.Exists() {
96+
if value := res.Get(path + "entries"); value.Exists() && len(value.Array()) > 0 {
9797
data.Entries = make([]PolicyObjectClassMapEntries, 0)
9898
value.ForEach(func(k, v gjson.Result) bool {
9999
item := PolicyObjectClassMapEntries{}

0 commit comments

Comments
 (0)