diff --git a/gen/templates/profile_parcels/model.go b/gen/templates/profile_parcels/model.go index d9f7474a..9cf25941 100644 --- a/gen/templates/profile_parcels/model.go +++ b/gen/templates/profile_parcels/model.go @@ -20,34 +20,34 @@ package provider // Section below is generated&owned by "gen/generator.go". //template:begin imports import ( - "context" - "fmt" - "net/url" - "strconv" + "context" + "fmt" + "net/url" + "strconv" - "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-log/tflog" - "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers" - "github.com/tidwall/gjson" - "github.com/tidwall/sjson" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers" + "github.com/tidwall/gjson" + "github.com/tidwall/sjson" ) // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin types {{- $name := camelCase .Name}} type {{camelCase .Name}} struct { - Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version"` - Name types.String `tfsdk:"name"` - Description types.String `tfsdk:"description"` + Id types.String `tfsdk:"id"` + Version types.Int64 `tfsdk:"version"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` {{- range .Attributes}} {{- if not .Value}} {{- if isNestedListSet .}} - {{toGoName .TfName}} []{{$name}}{{toGoName .TfName}} `tfsdk:"{{.TfName}}"` + {{toGoName .TfName}} []{{$name}}{{toGoName .TfName}} `tfsdk:"{{.TfName}}"` {{- else}} - {{toGoName .TfName}} types.{{.Type}} `tfsdk:"{{.TfName}}"` + {{toGoName .TfName}} types.{{.Type}} `tfsdk:"{{.TfName}}"` {{- if .Variable}} - {{toGoName .TfName}}Variable types.String `tfsdk:"{{.TfName}}_variable"` + {{toGoName .TfName}}Variable types.String `tfsdk:"{{.TfName}}_variable"` {{- end}} {{- end}} {{- end}} @@ -62,11 +62,11 @@ type {{$name}}{{toGoName .TfName}} struct { {{- range .Attributes}} {{- if not .Value}} {{- if isNestedListSet .}} - {{toGoName .TfName}} []{{$name}}{{$childName}}{{toGoName .TfName}} `tfsdk:"{{.TfName}}"` + {{toGoName .TfName}} []{{$name}}{{$childName}}{{toGoName .TfName}} `tfsdk:"{{.TfName}}"` {{- else}} - {{toGoName .TfName}} types.{{.Type}} `tfsdk:"{{.TfName}}"` + {{toGoName .TfName}} types.{{.Type}} `tfsdk:"{{.TfName}}"` {{- if .Variable}} - {{toGoName .TfName}}Variable types.String `tfsdk:"{{.TfName}}_variable"` + {{toGoName .TfName}}Variable types.String `tfsdk:"{{.TfName}}_variable"` {{- end}} {{- end}} {{- end}} @@ -88,11 +88,11 @@ type {{$name}}{{$childName}}{{toGoName .TfName}} struct { {{- range .Attributes}} {{- if not .Value}} {{- if isNestedListSet .}} - {{toGoName .TfName}} []{{$name}}{{$childName}}{{$childChildName}}{{toGoName .TfName}} `tfsdk:"{{.TfName}}"` + {{toGoName .TfName}} []{{$name}}{{$childName}}{{$childChildName}}{{toGoName .TfName}} `tfsdk:"{{.TfName}}"` {{- else}} - {{toGoName .TfName}} types.{{.Type}} `tfsdk:"{{.TfName}}"` + {{toGoName .TfName}} types.{{.Type}} `tfsdk:"{{.TfName}}"` {{- if .Variable}} - {{toGoName .TfName}}Variable types.String `tfsdk:"{{.TfName}}_variable"` + {{toGoName .TfName}}Variable types.String `tfsdk:"{{.TfName}}_variable"` {{- end}} {{- end}} {{- end}} @@ -119,9 +119,9 @@ type {{$name}}{{$childName}}{{toGoName .TfName}} struct { type {{$name}}{{$childName}}{{$childChildName}}{{toGoName .TfName}} struct { {{- range .Attributes}} {{- if not .Value}} - {{toGoName .TfName}} types.{{.Type}} `tfsdk:"{{.TfName}}"` + {{toGoName .TfName}} types.{{.Type}} `tfsdk:"{{.TfName}}"` {{- if .Variable}} - {{toGoName .TfName}}Variable types.String `tfsdk:"{{.TfName}}_variable"` + {{toGoName .TfName}}Variable types.String `tfsdk:"{{.TfName}}_variable"` {{- end}} {{- end}} {{- end}} @@ -139,448 +139,457 @@ type {{$name}}{{$childName}}{{$childChildName}}{{toGoName .TfName}} struct { // Section below is generated&owned by "gen/generator.go". //template:begin getModel func (data {{camelCase .Name}}) getModel() string { - return "{{.Model}}" + return "{{.Model}}" } // End of section. //template:end getModel // Section below is generated&owned by "gen/generator.go". //template:begin getPath func (data {{camelCase .Name}}) getPath() string { - {{- if hasReference .Attributes}} - return fmt.Sprintf("{{.RestEndpoint}}"{{range .Attributes}}{{if .Reference}}, url.QueryEscape(data.{{toGoName .TfName}}.Value{{.Type}}()){{end}}{{end}}) - {{- else}} - return "{{.RestEndpoint}}" - {{- end}} + {{- if hasReference .Attributes}} + return fmt.Sprintf("{{.RestEndpoint}}"{{range .Attributes}}{{if .Reference}}, url.QueryEscape(data.{{toGoName .TfName}}.Value{{.Type}}()){{end}}{{end}}) + {{- else}} + return "{{.RestEndpoint}}" + {{- end}} } // End of section. //template:end getPath // Section below is generated&owned by "gen/generator.go". //template:begin toBody func (data {{camelCase .Name}}) toBody(ctx context.Context) string { - body := "" - body, _ = sjson.Set(body, "name", data.Name.ValueString()) - body, _ = sjson.Set(body, "description", data.Description.ValueString()) - path := "data." - {{- range .Attributes}} - {{- if .Value}} - if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { - body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") - body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) - } - {{- else if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference)}} - {{if .Variable}} - if !data.{{toGoName .TfName}}Variable.IsNull() { - if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { - body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "variable") - body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", data.{{toGoName .TfName}}Variable.ValueString()) - } - } else {{end}}{{if and .DefaultValuePresent (not .ExcludeNull)}}if data.{{toGoName .TfName}}.IsNull() { - if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { - body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") - {{if or .DefaultValue .DefaultValueEmptyString}}body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}} - } - } else {{else}}if !data.{{toGoName .TfName}}.IsNull(){{end}} { - body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global") - {{- if isListSet .}} - var values []{{if isStringListSet .}}string{{else if isInt64ListSet .}}int64{{end}} - data.{{toGoName .TfName}}.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", values) - {{- else}} - body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", data.{{toGoName .TfName}}.Value{{.Type}}()) - {{- end}} - } - {{- else if isNestedListSet .}} - if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { - {{if and (not .MinList) (not .ExcludeNull)}}body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", []interface{}{}){{end}} - for _, item := range data.{{toGoName .TfName}} { - itemBody := "" - {{- range .Attributes}} - {{- if .Value}} - if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { - itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) - } - {{- else if or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)}} - {{if .Variable}} - if !item.{{toGoName .TfName}}Variable.IsNull() { - if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { - itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", item.{{toGoName .TfName}}Variable.ValueString()) - } - } else {{end}}{{if and .DefaultValuePresent (not .ExcludeNull)}}if item.{{toGoName .TfName}}.IsNull() { - if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { - itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") - {{if or .DefaultValue .DefaultValueEmptyString}}itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}} - } - } else {{else}}if !item.{{toGoName .TfName}}.IsNull(){{end}} { - itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global") - {{- if isListSet .}} - var values []{{if isStringListSet .}}string{{else if isInt64ListSet .}}int64{{end}} - item.{{toGoName .TfName}}.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", values) - {{- else}} - itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", item.{{toGoName .TfName}}.Value{{.Type}}()) - {{- end}} - } - {{- else if isNestedListSet .}} - if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { - {{if and (not .MinList) (not .ExcludeNull)}}itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", []interface{}{}){{end}} - for _, childItem := range item.{{toGoName .TfName}} { - itemChildBody := "" - {{- range .Attributes}} - {{- if .Value}} - if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { - itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) - } - {{- else if or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)}} - {{if .Variable}} - if !childItem.{{toGoName .TfName}}Variable.IsNull() { - if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { - itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", childItem.{{toGoName .TfName}}Variable.ValueString()) - } - } else {{end}}{{if and .DefaultValuePresent (not .ExcludeNull)}}if childItem.{{toGoName .TfName}}.IsNull() { - if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { - itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") - {{if or .DefaultValue .DefaultValueEmptyString}}itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}} - } - } else {{else}}if !childItem.{{toGoName .TfName}}.IsNull(){{end}} { - itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global") - {{- if isListSet .}} - var values []{{if isStringListSet .}}string{{else if isInt64ListSet .}}int64{{end}} - childItem.{{toGoName .TfName}}.ElementsAs(ctx, &values, false) - itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", values) - {{- else}} - itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", childItem.{{toGoName .TfName}}.Value{{.Type}}()) - {{- end}} - } - {{- else if isNestedListSet .}} - if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && itemChildBody.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && itemChildBody.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { - {{if and (not .MinList) (not .ExcludeNull)}}itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", []interface{}{}){{end}} - for _, childChildItem := range childItem.{{toGoName .TfName}} { - itemChildChildBody := "" - {{- range .Attributes}} - {{- if .Value}} - if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) - } - {{- else if or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)}} - {{if .Variable}} - if !childChildItem.{{toGoName .TfName}}Variable.IsNull() { - if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "variable") - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", childChildItem.{{toGoName .TfName}}Variable.ValueString()) - } - } else {{end}}{{if and .DefaultValuePresent (not .ExcludeNull)}}if childChildItem.{{toGoName .TfName}}.IsNull() { - if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") - {{if or .DefaultValue .DefaultValueEmptyString}}itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}} - } else {{else}}if !childChildItem.{{toGoName .TfName}}.IsNull(){{end}} { - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global") - {{- if isListSet .}} - var values []{{if isStringListSet .}}string{{else if isInt64ListSet .}}int64{{end}} - childChildItem.{{toGoName .TfName}}.ElementsAs(ctx, &values, false) - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", values) - {{- else}} - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", childChildItem.{{toGoName .TfName}}.Value{{.Type}}()) - {{- end}} - } - {{- end}} - {{- end}} - itemChildBody, _ = sjson.SetRaw(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.-1", itemChildChildBody) - } - } - {{- end}} - {{- end}} - itemBody, _ = sjson.SetRaw(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.-1", itemChildBody) - } - } - {{- end}} - {{- end}} - body, _ = sjson.SetRaw(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.-1", itemBody) - } - } - {{- end}} - {{- end}} - return body + body := "" + body, _ = sjson.Set(body, "name", data.Name.ValueString()) + body, _ = sjson.Set(body, "description", data.Description.ValueString()) + path := "data." + {{- range .Attributes}} + {{- if .Value}} + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") + body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) + } + {{- else if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference)}} + {{if .Variable}} + if !data.{{toGoName .TfName}}Variable.IsNull() { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "variable") + body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", data.{{toGoName .TfName}}Variable.ValueString()) + } + } else {{end}}{{if and .DefaultValuePresent (not .ExcludeNull)}}if data.{{toGoName .TfName}}.IsNull() { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") + {{if or .DefaultValue .DefaultValueEmptyString}}body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}} + } + } else {{else}}if !data.{{toGoName .TfName}}.IsNull(){{end}} { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global") + {{- if isListSet .}} + var values []{{if isStringListSet .}}string{{else if isInt64ListSet .}}int64{{end}} + data.{{toGoName .TfName}}.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", values) + {{- else}} + body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", data.{{toGoName .TfName}}.Value{{.Type}}()) + {{- end}} + } + } + {{- else if isNestedListSet .}} + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + {{if and (not .MinList) (not .ExcludeNull)}}body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", []interface{}{}){{end}} + for _, item := range data.{{toGoName .TfName}} { + itemBody := "" + {{- range .Attributes}} + {{- if .Value}} + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) + } + {{- else if or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)}} + {{if .Variable}} + if !item.{{toGoName .TfName}}Variable.IsNull() { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", item.{{toGoName .TfName}}Variable.ValueString()) + } + } else {{end}}{{if and .DefaultValuePresent (not .ExcludeNull)}}if item.{{toGoName .TfName}}.IsNull() { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") + {{if or .DefaultValue .DefaultValueEmptyString}}itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}} + } + } else {{else}}if !item.{{toGoName .TfName}}.IsNull(){{end}} { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global") + {{- if isListSet .}} + var values []{{if isStringListSet .}}string{{else if isInt64ListSet .}}int64{{end}} + item.{{toGoName .TfName}}.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", values) + {{- else}} + itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", item.{{toGoName .TfName}}.Value{{.Type}}()) + {{- end}} + } + } + {{- else if isNestedListSet .}} + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + {{if and (not .MinList) (not .ExcludeNull)}}itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", []interface{}{}){{end}} + for _, childItem := range item.{{toGoName .TfName}} { + itemChildBody := "" + {{- range .Attributes}} + {{- if .Value}} + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) + } + {{- else if or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)}} + {{if .Variable}} + if !childItem.{{toGoName .TfName}}Variable.IsNull() { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", childItem.{{toGoName .TfName}}Variable.ValueString()) + } + } else {{end}}{{if and .DefaultValuePresent (not .ExcludeNull)}}if childItem.{{toGoName .TfName}}.IsNull() { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") + {{if or .DefaultValue .DefaultValueEmptyString}}itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}} + } + } else {{else}}if !childItem.{{toGoName .TfName}}.IsNull(){{end}} { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global") + {{- if isListSet .}} + var values []{{if isStringListSet .}}string{{else if isInt64ListSet .}}int64{{end}} + childItem.{{toGoName .TfName}}.ElementsAs(ctx, &values, false) + itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", values) + {{- else}} + itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", childItem.{{toGoName .TfName}}.Value{{.Type}}()) + {{- end}} + } + } + {{- else if isNestedListSet .}} + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && itemChildBody.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && itemChildBody.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + {{if and (not .MinList) (not .ExcludeNull)}}itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", []interface{}{}){{end}} + for _, childChildItem := range childItem.{{toGoName .TfName}} { + itemChildChildBody := "" + {{- range .Attributes}} + {{- if .Value}} + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) + } + {{- else if or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)}} + {{if .Variable}} + if !childChildItem.{{toGoName .TfName}}Variable.IsNull() { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "variable") + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", childChildItem.{{toGoName .TfName}}Variable.ValueString()) + } + } else {{end}}{{if and .DefaultValuePresent (not .ExcludeNull)}}if childChildItem.{{toGoName .TfName}}.IsNull() { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") + {{if or .DefaultValue .DefaultValueEmptyString}}itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}} + } else {{else}}if !childChildItem.{{toGoName .TfName}}.IsNull(){{end}} { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global") + {{- if isListSet .}} + var values []{{if isStringListSet .}}string{{else if isInt64ListSet .}}int64{{end}} + childChildItem.{{toGoName .TfName}}.ElementsAs(ctx, &values, false) + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", values) + {{- else}} + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", childChildItem.{{toGoName .TfName}}.Value{{.Type}}()) + {{- end}} + } + } + {{- end}} + {{- end}} + itemChildBody, _ = sjson.SetRaw(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.-1", itemChildChildBody) + } + } + {{- end}} + {{- end}} + itemBody, _ = sjson.SetRaw(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.-1", itemChildBody) + } + } + {{- end}} + {{- end}} + body, _ = sjson.SetRaw(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.-1", itemBody) + } + } + {{- end}} + {{- end}} + return body } // End of section. //template:end toBody // Section below is generated&owned by "gen/generator.go". //template:begin fromBody func (data *{{camelCase .Name}}) fromBody(ctx context.Context, res gjson.Result) { - data.Name = types.StringValue(res.Get("payload.name").String()) - if value := res.Get("payload.description"); value.Exists() && value.String() != "" { - data.Description = types.StringValue(value.String()) - } else { - data.Description = types.StringNull() - } - path := "payload.data." - {{- range .Attributes}} - {{- $cname := toGoName .TfName}} - {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} - data.{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) - {{ if .Variable}}data.{{toGoName .TfName}}Variable = types.StringNull(){{end}} - if t := res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { - va := res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value") - {{if .Variable}}if t.String() == "variable" { - data.{{toGoName .TfName}}Variable = types.StringValue(va.String()) - } else{{end}} if t.String() == "global" { - data.{{toGoName .TfName}} = {{if isListSet .}}helpers.Get{{.ElementType}}{{.Type}}(va.Array()){{else}}types.{{.Type}}Value(va.{{getGjsonType .Type}}()){{end}} - } - } - {{- else if isNestedListSet .}} - if value := res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}"); value.Exists() { - data.{{toGoName .TfName}} = make([]{{$name}}{{toGoName .TfName}}, 0) - value.ForEach(func(k, v gjson.Result) bool { - item := {{$name}}{{toGoName .TfName}}{} - {{- range .Attributes}} - {{- $ccname := toGoName .TfName}} - {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} - item.{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) - {{ if .Variable}}item.{{toGoName .TfName}}Variable = types.StringNull(){{end}} - if t := v.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { - va := v.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value") - {{if .Variable}}if t.String() == "variable" { - item.{{toGoName .TfName}}Variable = types.StringValue(va.String()) - } else{{end}} if t.String() == "global" { - item.{{toGoName .TfName}} = {{if isListSet .}}helpers.Get{{.ElementType}}{{.Type}}(va.Array()){{else}}types.{{.Type}}Value(va.{{getGjsonType .Type}}()){{end}} - } - } - {{- else if isNestedListSet .}} - if cValue := v.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}"); cValue.Exists() { - item.{{toGoName .TfName}} = make([]{{$name}}{{$cname}}{{toGoName .TfName}}, 0) - cValue.ForEach(func(ck, cv gjson.Result) bool { - cItem := {{$name}}{{$cname}}{{toGoName .TfName}}{} - {{- range .Attributes}} - {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} - cItem.{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) - {{ if .Variable}}cItem.{{toGoName .TfName}}Variable = types.StringNull(){{end}} - if t := cv.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { - va := cv.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value") - {{if .Variable}}if t.String() == "variable" { - cItem.{{toGoName .TfName}}Variable = types.StringValue(va.String()) - } else{{end}} if t.String() == "global" { - cItem.{{toGoName .TfName}} = {{if isListSet .}}helpers.Get{{.ElementType}}{{.Type}}(va.Array()){{else}}types.{{.Type}}Value(va.{{getGjsonType .Type}}()){{end}} - } - } - {{- else if isNestedListSet .}} - if ccValue := cv.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}"); ccValue.Exists() { - cItem.{{toGoName .TfName}} = make([]{{$name}}{{$cname}}{{$ccname}}{{toGoName .TfName}}, 0) - ccValue.ForEach(func(cck, ccv gjson.Result) bool { - ccItem := {{$name}}{{$cname}}{{$ccname}}{{toGoName .TfName}}{} - {{- range .Attributes}} - {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} - ccItem.{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) - {{ if .Variable}}ccItem.{{toGoName .TfName}}Variable = types.StringNull(){{end}} - if t := ccv.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { - va := ccv.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value") - {{if .Variable}}if t.String() == "variable" { - ccItem.{{toGoName .TfName}}Variable = types.StringValue(va.String()) - } else{{end}} if t.String() == "global" { - ccItem.{{toGoName .TfName}} = {{if isListSet .}}helpers.Get{{.ElementType}}{{.Type}}(va.Array()){{else}}types.{{.Type}}Value(va.{{getGjsonType .Type}}()){{end}} - } - } - {{- end}} - {{- end}} - cItem.{{toGoName .TfName}} = append(cItem.{{toGoName .TfName}}, ccItem) - return true - }) - } - {{- end}} - {{- end}} - item.{{toGoName .TfName}} = append(item.{{toGoName .TfName}}, cItem) - return true - }) - } - {{- end}} - {{- end}} - data.{{toGoName .TfName}} = append(data.{{toGoName .TfName}}, item) - return true - }) - } - {{- end}} - {{- end}} + data.Name = types.StringValue(res.Get("payload.name").String()) + if value := res.Get("payload.description"); value.Exists() && value.String() != "" { + data.Description = types.StringValue(value.String()) + } else { + data.Description = types.StringNull() + } + path := "payload.data." + {{- range .Attributes}} + {{- $cname := toGoName .TfName}} + {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} + data.{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) + {{ if .Variable}}data.{{toGoName .TfName}}Variable = types.StringNull(){{end}} + if t := res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { + va := res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value") + {{if .Variable}}if t.String() == "variable" { + data.{{toGoName .TfName}}Variable = types.StringValue(va.String()) + } else{{end}} if t.String() == "global" { + data.{{toGoName .TfName}} = {{if isListSet .}}helpers.Get{{.ElementType}}{{.Type}}(va.Array()){{else}}types.{{.Type}}Value(va.{{getGjsonType .Type}}()){{end}} + } + } + {{- else if isNestedListSet .}} + if value := res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}"); value.Exists() { + data.{{toGoName .TfName}} = make([]{{$name}}{{toGoName .TfName}}, 0) + value.ForEach(func(k, v gjson.Result) bool { + item := {{$name}}{{toGoName .TfName}}{} + {{- range .Attributes}} + {{- $ccname := toGoName .TfName}} + {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} + item.{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) + {{ if .Variable}}item.{{toGoName .TfName}}Variable = types.StringNull(){{end}} + if t := v.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { + va := v.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value") + {{if .Variable}}if t.String() == "variable" { + item.{{toGoName .TfName}}Variable = types.StringValue(va.String()) + } else{{end}} if t.String() == "global" { + item.{{toGoName .TfName}} = {{if isListSet .}}helpers.Get{{.ElementType}}{{.Type}}(va.Array()){{else}}types.{{.Type}}Value(va.{{getGjsonType .Type}}()){{end}} + } + } + {{- else if isNestedListSet .}} + if cValue := v.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}"); cValue.Exists() { + item.{{toGoName .TfName}} = make([]{{$name}}{{$cname}}{{toGoName .TfName}}, 0) + cValue.ForEach(func(ck, cv gjson.Result) bool { + cItem := {{$name}}{{$cname}}{{toGoName .TfName}}{} + {{- range .Attributes}} + {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} + cItem.{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) + {{ if .Variable}}cItem.{{toGoName .TfName}}Variable = types.StringNull(){{end}} + if t := cv.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { + va := cv.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value") + {{if .Variable}}if t.String() == "variable" { + cItem.{{toGoName .TfName}}Variable = types.StringValue(va.String()) + } else{{end}} if t.String() == "global" { + cItem.{{toGoName .TfName}} = {{if isListSet .}}helpers.Get{{.ElementType}}{{.Type}}(va.Array()){{else}}types.{{.Type}}Value(va.{{getGjsonType .Type}}()){{end}} + } + } + {{- else if isNestedListSet .}} + if ccValue := cv.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}"); ccValue.Exists() { + cItem.{{toGoName .TfName}} = make([]{{$name}}{{$cname}}{{$ccname}}{{toGoName .TfName}}, 0) + ccValue.ForEach(func(cck, ccv gjson.Result) bool { + ccItem := {{$name}}{{$cname}}{{$ccname}}{{toGoName .TfName}}{} + {{- range .Attributes}} + {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} + ccItem.{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) + {{ if .Variable}}ccItem.{{toGoName .TfName}}Variable = types.StringNull(){{end}} + if t := ccv.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { + va := ccv.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value") + {{if .Variable}}if t.String() == "variable" { + ccItem.{{toGoName .TfName}}Variable = types.StringValue(va.String()) + } else{{end}} if t.String() == "global" { + ccItem.{{toGoName .TfName}} = {{if isListSet .}}helpers.Get{{.ElementType}}{{.Type}}(va.Array()){{else}}types.{{.Type}}Value(va.{{getGjsonType .Type}}()){{end}} + } + } + {{- end}} + {{- end}} + cItem.{{toGoName .TfName}} = append(cItem.{{toGoName .TfName}}, ccItem) + return true + }) + } + {{- end}} + {{- end}} + item.{{toGoName .TfName}} = append(item.{{toGoName .TfName}}, cItem) + return true + }) + } + {{- end}} + {{- end}} + data.{{toGoName .TfName}} = append(data.{{toGoName .TfName}}, item) + return true + }) + } + {{- end}} + {{- end}} } // End of section. //template:end fromBody // Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody func (data *{{camelCase .Name}}) updateFromBody(ctx context.Context, res gjson.Result) { - data.Name = types.StringValue(res.Get("payload.name").String()) - if value := res.Get("payload.description"); value.Exists() && value.String() != "" { - data.Description = types.StringValue(value.String()) - } else { - data.Description = types.StringNull() - } - path := "payload.data." - {{- range .Attributes}} - {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} - data.{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) - {{ if .Variable}}data.{{toGoName .TfName}}Variable = types.StringNull(){{end}} - if t := res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { - va := res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value") - {{if .Variable}}if t.String() == "variable" { - data.{{toGoName .TfName}}Variable = types.StringValue(va.String()) - } else{{end}} if t.String() == "global" { - data.{{toGoName .TfName}} = {{if isListSet .}}helpers.Get{{.ElementType}}{{.Type}}(va.Array()){{else}}types.{{.Type}}Value(va.{{getGjsonType .Type}}()){{end}} - } - } - {{- else if isNestedListSet .}} - {{- $list := (toGoName .TfName)}} - for i := range data.{{toGoName .TfName}} { - keys := [...]string{ {{range .Attributes}}{{if .Id}}{{if or (eq .Type "Int64") (eq .Type "Bool") (eq .Type "String")}}"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", {{end}}{{end}}{{end}} } - keyValues := [...]string{ {{range .Attributes}}{{if .Id}}{{if eq .Type "Int64"}}strconv.FormatInt(data.{{$list}}[i].{{toGoName .TfName}}.ValueInt64(), 10), {{else if eq .Type "Bool"}}strconv.FormatBool(data.{{$list}}[i].{{toGoName .TfName}}.ValueBool()), {{else if eq .Type "String"}}data.{{$list}}[i].{{toGoName .TfName}}.Value{{.Type}}(), {{end}}{{end}}{{end}} } - keyValuesVariables := [...]string{ {{range .Attributes}}{{if .Id}}{{if .Variable}}data.{{$list}}[i].{{toGoName .TfName}}Variable.ValueString(), {{else}}"", {{end}}{{end}}{{end}} } + data.Name = types.StringValue(res.Get("payload.name").String()) + if value := res.Get("payload.description"); value.Exists() && value.String() != "" { + data.Description = types.StringValue(value.String()) + } else { + data.Description = types.StringNull() + } + path := "payload.data." + {{- range .Attributes}} + {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} + data.{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) + {{ if .Variable}}data.{{toGoName .TfName}}Variable = types.StringNull(){{end}} + if t := res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { + va := res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value") + {{if .Variable}}if t.String() == "variable" { + data.{{toGoName .TfName}}Variable = types.StringValue(va.String()) + } else{{end}} if t.String() == "global" { + data.{{toGoName .TfName}} = {{if isListSet .}}helpers.Get{{.ElementType}}{{.Type}}(va.Array()){{else}}types.{{.Type}}Value(va.{{getGjsonType .Type}}()){{end}} + } + } + {{- else if isNestedListSet .}} + {{- $list := (toGoName .TfName)}} + for i := range data.{{toGoName .TfName}} { + keys := [...]string{ {{range .Attributes}}{{if .Id}}{{if or (eq .Type "Int64") (eq .Type "Bool") (eq .Type "String")}}"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", {{end}}{{end}}{{end}} } + keyValues := [...]string{ {{range .Attributes}}{{if .Id}}{{if eq .Type "Int64"}}strconv.FormatInt(data.{{$list}}[i].{{toGoName .TfName}}.ValueInt64(), 10), {{else if eq .Type "Bool"}}strconv.FormatBool(data.{{$list}}[i].{{toGoName .TfName}}.ValueBool()), {{else if eq .Type "String"}}data.{{$list}}[i].{{toGoName .TfName}}.Value{{.Type}}(), {{end}}{{end}}{{end}} } + keyValuesVariables := [...]string{ {{range .Attributes}}{{if .Id}}{{if .Variable}}data.{{$list}}[i].{{toGoName .TfName}}Variable.ValueString(), {{else}}"", {{end}}{{end}}{{end}} } - var r gjson.Result - res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}").ForEach( - func(_, v gjson.Result) bool { - found := false - for ik := range keys { - tt := v.Get(keys[ik] + ".optionType").String() - vv := v.Get(keys[ik] + ".value").String() - if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) { - found = true - continue - } - found = false - break - } - if found { - r = v - return false - } - return true - }, - ) + var r gjson.Result + res.Get(path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}").ForEach( + func(_, v gjson.Result) bool { + found := false + for ik := range keys { + tt := v.Get(keys[ik] + ".optionType").String() + vv := v.Get(keys[ik] + ".value").String() + if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) { + found = true + continue + } + found = false + break + } + if found { + r = v + return false + } + return true + }, + ) - {{- range .Attributes}} - {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} - data.{{$list}}[i].{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) - {{ if .Variable}}data.{{$list}}[i].{{toGoName .TfName}}Variable = types.StringNull(){{end}} - if t := r.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { - va := r.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value") - {{if .Variable}}if t.String() == "variable" { - data.{{$list}}[i].{{toGoName .TfName}}Variable = types.StringValue(va.String()) - } else{{end}} if t.String() == "global" { - data.{{$list}}[i].{{toGoName .TfName}} = {{if isListSet .}}helpers.Get{{.ElementType}}{{.Type}}(va.Array()){{else}}types.{{.Type}}Value(va.{{getGjsonType .Type}}()){{end}} - } - } - {{- else if isNestedListSet .}} - {{- $clist := (toGoName .TfName)}} - for ci := range data.{{$list}}[i].{{toGoName .TfName}} { - keys := [...]string{ {{range .Attributes}}{{if .Id}}{{if or (eq .Type "Int64") (eq .Type "Bool") (eq .Type "String")}}"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", {{end}}{{end}}{{end}} } - keyValues := [...]string{ {{range .Attributes}}{{if .Id}}{{if eq .Type "Int64"}}strconv.FormatInt(data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}.ValueInt64(), 10), {{else if eq .Type "Bool"}}strconv.FormatBool(data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}.ValueBool()), {{else if eq .Type "String"}}data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}.Value{{.Type}}(), {{end}}{{end}}{{end}} } - keyValuesVariables := [...]string{ {{range .Attributes}}{{if .Id}}{{if .Variable}}data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}Variable.ValueString(), {{else}}"", {{end}}{{end}}{{end}} } + {{- range .Attributes}} + {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} + data.{{$list}}[i].{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) + {{ if .Variable}}data.{{$list}}[i].{{toGoName .TfName}}Variable = types.StringNull(){{end}} + if t := r.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { + va := r.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value") + {{if .Variable}}if t.String() == "variable" { + data.{{$list}}[i].{{toGoName .TfName}}Variable = types.StringValue(va.String()) + } else{{end}} if t.String() == "global" { + data.{{$list}}[i].{{toGoName .TfName}} = {{if isListSet .}}helpers.Get{{.ElementType}}{{.Type}}(va.Array()){{else}}types.{{.Type}}Value(va.{{getGjsonType .Type}}()){{end}} + } + } + {{- else if isNestedListSet .}} + {{- $clist := (toGoName .TfName)}} + for ci := range data.{{$list}}[i].{{toGoName .TfName}} { + keys := [...]string{ {{range .Attributes}}{{if .Id}}{{if or (eq .Type "Int64") (eq .Type "Bool") (eq .Type "String")}}"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", {{end}}{{end}}{{end}} } + keyValues := [...]string{ {{range .Attributes}}{{if .Id}}{{if eq .Type "Int64"}}strconv.FormatInt(data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}.ValueInt64(), 10), {{else if eq .Type "Bool"}}strconv.FormatBool(data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}.ValueBool()), {{else if eq .Type "String"}}data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}.Value{{.Type}}(), {{end}}{{end}}{{end}} } + keyValuesVariables := [...]string{ {{range .Attributes}}{{if .Id}}{{if .Variable}}data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}Variable.ValueString(), {{else}}"", {{end}}{{end}}{{end}} } - var cr gjson.Result - r.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}").ForEach( - func(_, v gjson.Result) bool { - found := false - for ik := range keys { - tt := v.Get(keys[ik] + ".optionType").String() - vv := v.Get(keys[ik] + ".value").String() - if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) { - found = true - continue - } - found = false - break - } - if found { - cr = v - return false - } - return true - }, - ) + var cr gjson.Result + r.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}").ForEach( + func(_, v gjson.Result) bool { + found := false + for ik := range keys { + tt := v.Get(keys[ik] + ".optionType").String() + vv := v.Get(keys[ik] + ".value").String() + if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) { + found = true + continue + } + found = false + break + } + if found { + cr = v + return false + } + return true + }, + ) - {{- range .Attributes}} - {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} - data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) - {{ if .Variable}}data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}Variable = types.StringNull(){{end}} - if t := cr.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { - va := cr.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value") - {{if .Variable}}if t.String() == "variable" { - data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}Variable = types.StringValue(va.String()) - } else{{end}} if t.String() == "global" { - data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}} = {{if isListSet .}}helpers.Get{{.ElementType}}{{.Type}}(va.Array()){{else}}types.{{.Type}}Value(va.{{getGjsonType .Type}}()){{end}} - } - } - {{- else if isNestedListSet .}} - {{- $cclist := (toGoName .TfName)}} - for cci := range data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}} { - keys := [...]string{ {{range .Attributes}}{{if .Id}}{{if or (eq .Type "Int64") (eq .Type "Bool") (eq .Type "String")}}"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", {{end}}{{end}}{{end}} } - keyValues := [...]string{ {{range .Attributes}}{{if .Id}}{{if eq .Type "Int64"}}strconv.FormatInt(data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}.ValueInt64(), 10), {{else if eq .Type "Bool"}}strconv.FormatBool(data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}.ValueBool()), {{else if eq .Type "String"}}data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}.Value{{.Type}}(), {{end}}{{end}}{{end}} } - keyValuesVariables := [...]string{ {{range .Attributes}}{{if .Id}}{{if .Variable}}data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}Variable.ValueString(), {{else}}"", {{end}}{{end}}{{end}} } + {{- range .Attributes}} + {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} + data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) + {{ if .Variable}}data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}Variable = types.StringNull(){{end}} + if t := cr.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { + va := cr.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value") + {{if .Variable}}if t.String() == "variable" { + data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}}Variable = types.StringValue(va.String()) + } else{{end}} if t.String() == "global" { + data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}} = {{if isListSet .}}helpers.Get{{.ElementType}}{{.Type}}(va.Array()){{else}}types.{{.Type}}Value(va.{{getGjsonType .Type}}()){{end}} + } + } + {{- else if isNestedListSet .}} + {{- $cclist := (toGoName .TfName)}} + for cci := range data.{{$list}}[i].{{$clist}}[ci].{{toGoName .TfName}} { + keys := [...]string{ {{range .Attributes}}{{if .Id}}{{if or (eq .Type "Int64") (eq .Type "Bool") (eq .Type "String")}}"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", {{end}}{{end}}{{end}} } + keyValues := [...]string{ {{range .Attributes}}{{if .Id}}{{if eq .Type "Int64"}}strconv.FormatInt(data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}.ValueInt64(), 10), {{else if eq .Type "Bool"}}strconv.FormatBool(data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}.ValueBool()), {{else if eq .Type "String"}}data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}.Value{{.Type}}(), {{end}}{{end}}{{end}} } + keyValuesVariables := [...]string{ {{range .Attributes}}{{if .Id}}{{if .Variable}}data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}Variable.ValueString(), {{else}}"", {{end}}{{end}}{{end}} } - var ccr gjson.Result - cr.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}").ForEach( - func(_, v gjson.Result) bool { - found := false - for ik := range keys { - tt := v.Get(keys[ik] + ".optionType").String() - vv := v.Get(keys[ik] + ".value").String() - if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) { - found = true - continue - } - found = false - break - } - if found { - ccr = v - return false - } - return true - }, - ) + var ccr gjson.Result + cr.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}").ForEach( + func(_, v gjson.Result) bool { + found := false + for ik := range keys { + tt := v.Get(keys[ik] + ".optionType").String() + vv := v.Get(keys[ik] + ".value").String() + if (tt == "variable" && vv == keyValuesVariables[ik]) || (tt == "global" && vv == keyValues[ik]) { + found = true + continue + } + found = false + break + } + if found { + ccr = v + return false + } + return true + }, + ) - {{- range .Attributes}} - {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} - data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) - {{ if .Variable}}data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}Variable = types.StringNull(){{end}} - if t := ccr.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { - va := ccr.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value") - {{if .Variable}}if t.String() == "variable" { - data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}Variable = types.StringValue(va.String()) - } else{{end}} if t.String() == "global" { - data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}} = {{if isListSet .}}helpers.Get{{.ElementType}}{{.Type}}(va.Array()){{else}}types.{{.Type}}Value(va.{{getGjsonType .Type}}()){{end}} - } - } - {{- end}} - {{- end}} - } - {{- end}} - {{- end}} - } - {{- end}} - {{- end}} - } - {{- end}} - {{- end}} + {{- range .Attributes}} + {{- if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference) (not .WriteOnly) (not .Value)}} + data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}} = types.{{.Type}}Null({{if isListSet .}}types.{{.ElementType}}Type{{end}}) + {{ if .Variable}}data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}Variable = types.StringNull(){{end}} + if t := ccr.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType"); t.Exists() { + va := ccr.Get("{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value") + {{if .Variable}}if t.String() == "variable" { + data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}}Variable = types.StringValue(va.String()) + } else{{end}} if t.String() == "global" { + data.{{$list}}[i].{{$clist}}[ci].{{$cclist}}[cci].{{toGoName .TfName}} = {{if isListSet .}}helpers.Get{{.ElementType}}{{.Type}}(va.Array()){{else}}types.{{.Type}}Value(va.{{getGjsonType .Type}}()){{end}} + } + } + {{- end}} + {{- end}} + } + {{- end}} + {{- end}} + } + {{- end}} + {{- end}} + } + {{- end}} + {{- end}} } // End of section. //template:end updateFromBody // Section below is generated&owned by "gen/generator.go". //template:begin isNull func (data *{{camelCase .Name}}) isNull(ctx context.Context, res gjson.Result) bool { - {{- range .Attributes}} - {{- if not .Value}} - {{- if isNestedListSet .}} - if len(data.{{toGoName .TfName}}) > 0 { - return false - } - {{- else}} - if !data.{{toGoName .TfName}}.IsNull() { - return false - } - {{- if .Variable}} - if !data.{{toGoName .TfName}}Variable.IsNull() { - return false - } - {{- end}} - {{- end}} - {{- end}} - {{- end}} - return true + {{- range .Attributes}} + {{- if not .Value}} + {{- if isNestedListSet .}} + if len(data.{{toGoName .TfName}}) > 0 { + return false + } + {{- else}} + if !data.{{toGoName .TfName}}.IsNull() { + return false + } + {{- if .Variable}} + if !data.{{toGoName .TfName}}Variable.IsNull() { + return false + } + {{- end}} + {{- end}} + {{- end}} + {{- end}} + return true } // End of section. //template:end isNull + diff --git a/internal/provider/model_sdwan_application_priority_qos_policy_profile_parcel.go b/internal/provider/model_sdwan_application_priority_qos_policy_profile_parcel.go index 88dd256d..4a789c9a 100644 --- a/internal/provider/model_sdwan_application_priority_qos_policy_profile_parcel.go +++ b/internal/provider/model_sdwan_application_priority_qos_policy_profile_parcel.go @@ -80,34 +80,46 @@ func (data ApplicationPriorityQoSPolicy) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"target.interfaces.value", data.TargetInterfaceVariable.ValueString()) } } else if !data.TargetInterface.IsNull() { - body, _ = sjson.Set(body, path+"target.interfaces.optionType", "global") - var values []string - data.TargetInterface.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"target.interfaces.value", values) + if true { + body, _ = sjson.Set(body, path+"target.interfaces.optionType", "global") + var values []string + data.TargetInterface.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"target.interfaces.value", values) + } } if true { body, _ = sjson.Set(body, path+"qosMap.qosSchedulers", []interface{}{}) for _, item := range data.QosSchedulers { itemBody := "" if !item.ForwardingClassId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "classMapRef.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "classMapRef.refId.value", item.ForwardingClassId.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "classMapRef.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "classMapRef.refId.value", item.ForwardingClassId.ValueString()) + } } if !item.Drops.IsNull() { - itemBody, _ = sjson.Set(itemBody, "drops.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "drops.value", item.Drops.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "drops.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "drops.value", item.Drops.ValueString()) + } } if !item.Queue.IsNull() { - itemBody, _ = sjson.Set(itemBody, "queue.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "queue.value", item.Queue.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "queue.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "queue.value", item.Queue.ValueString()) + } } if !item.Bandwidth.IsNull() { - itemBody, _ = sjson.Set(itemBody, "bandwidthPercent.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "bandwidthPercent.value", item.Bandwidth.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "bandwidthPercent.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "bandwidthPercent.value", item.Bandwidth.ValueString()) + } } if !item.SchedulingType.IsNull() { - itemBody, _ = sjson.Set(itemBody, "scheduling.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "scheduling.value", item.SchedulingType.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "scheduling.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "scheduling.value", item.SchedulingType.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"qosMap.qosSchedulers.-1", itemBody) } diff --git a/internal/provider/model_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go b/internal/provider/model_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go index cdf8189a..f6bf2317 100644 --- a/internal/provider/model_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go +++ b/internal/provider/model_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go @@ -242,8 +242,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"shutdown.value", true) } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.InterfaceNameVariable.IsNull() { @@ -252,8 +254,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + } } if !data.InterfaceDescriptionVariable.IsNull() { @@ -267,8 +271,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"description.optionType", "global") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "global") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + } } if !data.Ipv4DhcpDistanceVariable.IsNull() { @@ -277,8 +283,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString()) } } else if !data.Ipv4DhcpDistance.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64()) + } } if !data.Ipv4AddressVariable.IsNull() { @@ -287,8 +295,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString()) } } else if !data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { @@ -297,8 +307,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString()) } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString()) + } } if true { @@ -311,8 +323,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) } } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + } } if !item.SubnetMaskVariable.IsNull() { @@ -321,8 +335,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMaskVariable.ValueString()) } } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"intfIpAddress.static.staticIpV4AddressSecondary.-1", itemBody) } @@ -339,14 +355,18 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global") - var values []string - data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"dhcpHelper.value", values) + if true { + body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global") + var values []string + data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"dhcpHelper.value", values) + } } if !data.EnableDhcpv6.IsNull() { - body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool()) + } } if true { @@ -359,8 +379,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) } } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"intfIpV6Address.dynamic.secondaryIpV6Address.-1", itemBody) } @@ -372,8 +394,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString()) } } else if !data.Ipv6Address.IsNull() { - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString()) + } } if true { @@ -386,8 +410,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) } } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"intfIpV6Address.static.secondaryIpV6Address.-1", itemBody) } @@ -403,8 +429,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) } } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + } } if !item.Dhcpv6HelperVpnVariable.IsNull() { @@ -413,8 +441,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Dhcpv6HelperVpnVariable.ValueString()) } } else if !item.Dhcpv6HelperVpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Dhcpv6HelperVpn.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Dhcpv6HelperVpn.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"intfIpV6Address.static.dhcpHelperV6.-1", itemBody) } @@ -425,8 +455,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"nat.value", false) } } else { - body, _ = sjson.Set(body, path+"nat.optionType", "global") - body, _ = sjson.Set(body, path+"nat.value", data.Ipv4Nat.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"nat.optionType", "global") + body, _ = sjson.Set(body, path+"nat.value", data.Ipv4Nat.ValueBool()) + } } if !data.Ipv4NatTypeVariable.IsNull() { @@ -435,8 +467,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.Ipv4NatTypeVariable.ValueString()) } } else if !data.Ipv4NatType.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.Ipv4NatType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.Ipv4NatType.ValueString()) + } } if !data.Ipv4NatRangeStartVariable.IsNull() { @@ -450,8 +484,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.Ipv4NatRangeStart.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.Ipv4NatRangeStart.ValueString()) + } } if !data.Ipv4NatRangeEndVariable.IsNull() { @@ -465,8 +501,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.Ipv4NatRangeEnd.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.Ipv4NatRangeEnd.ValueString()) + } } if !data.Ipv4NatPrefixLengthVariable.IsNull() { @@ -480,8 +518,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.Ipv4NatPrefixLength.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.Ipv4NatPrefixLength.ValueInt64()) + } } if !data.Ipv4NatOverloadVariable.IsNull() { @@ -495,8 +535,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", true) } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.Ipv4NatOverload.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.Ipv4NatOverload.ValueBool()) + } } if !data.Ipv4NatLoopbackVariable.IsNull() { @@ -510,8 +552,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.Ipv4NatLoopback.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.Ipv4NatLoopback.ValueString()) + } } if !data.Ipv4NatUdpTimeoutVariable.IsNull() { @@ -525,8 +569,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", 1) } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.Ipv4NatUdpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.Ipv4NatUdpTimeout.ValueInt64()) + } } if !data.Ipv4NatTcpTimeoutVariable.IsNull() { @@ -540,8 +586,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", 60) } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.Ipv4NatTcpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.Ipv4NatTcpTimeout.ValueInt64()) + } } if true { body, _ = sjson.Set(body, path+"natAttributesIpv4.newStaticNat", []interface{}{}) @@ -554,8 +602,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString()) } } else if !item.SourceIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString()) + } } if !item.TranslateIpVariable.IsNull() { @@ -564,8 +614,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslateIpVariable.ValueString()) } } else if !item.TranslateIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslateIp.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslateIp.ValueString()) + } } if item.Direction.IsNull() { if true { @@ -573,8 +625,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", "inside") } } else { - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.Direction.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.Direction.ValueString()) + } } if !item.SourceVpnVariable.IsNull() { @@ -588,8 +642,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", 0) } } else { - itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"natAttributesIpv4.newStaticNat.-1", itemBody) } @@ -600,12 +656,16 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"natIpv6.value", false) } } else { - body, _ = sjson.Set(body, path+"natIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"natIpv6.value", data.Ipv6Nat.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"natIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"natIpv6.value", data.Ipv6Nat.ValueBool()) + } } if !data.Nat64.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.value", data.Nat64.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.value", data.Nat64.ValueBool()) + } } if !data.AclShapingRateVariable.IsNull() { @@ -619,24 +679,34 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.AclShapingRate.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.AclShapingRate.ValueInt64()) + } } if !data.AclIpv4EgressPolicyId.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.ipv4AclEgress.refId.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.ipv4AclEgress.refId.value", data.AclIpv4EgressPolicyId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.ipv4AclEgress.refId.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.ipv4AclEgress.refId.value", data.AclIpv4EgressPolicyId.ValueString()) + } } if !data.AclIpv4IngressPolicyId.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.ipv4AclIngress.refId.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.ipv4AclIngress.refId.value", data.AclIpv4IngressPolicyId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.ipv4AclIngress.refId.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.ipv4AclIngress.refId.value", data.AclIpv4IngressPolicyId.ValueString()) + } } if !data.AclIpv6EgressPolicyId.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.ipv6AclEgress.refId.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.ipv6AclEgress.refId.value", data.AclIpv6EgressPolicyId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.ipv6AclEgress.refId.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.ipv6AclEgress.refId.value", data.AclIpv6EgressPolicyId.ValueString()) + } } if !data.AclIpv6IngressPolicyId.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.ipv6AclIngress.refId.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.ipv6AclIngress.refId.value", data.AclIpv6IngressPolicyId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.ipv6AclIngress.refId.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.ipv6AclIngress.refId.value", data.AclIpv6IngressPolicyId.ValueString()) + } } if true { body, _ = sjson.Set(body, path+"vrrpIpv6", []interface{}{}) @@ -649,8 +719,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupIdVariable.ValueString()) } } else if !item.GroupId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupId.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupId.ValueInt64()) + } } if !item.PriorityVariable.IsNull() { @@ -664,8 +736,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "priority.value", 100) } } else { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64()) + } } if !item.TimerVariable.IsNull() { @@ -679,8 +753,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "timer.value", 1000) } } else { - itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64()) + } } if item.TrackOmp.IsNull() { if true { @@ -688,8 +764,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool()) + } } if true { itemBody, _ = sjson.Set(itemBody, "ipv6", []interface{}{}) @@ -702,8 +780,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddressVariable.ValueString()) } } else if !childItem.LinkLocalAddress.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddress.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddress.ValueString()) + } } if !childItem.GlobalAddressVariable.IsNull() { @@ -717,8 +797,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddress.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddress.ValueString()) + } } itemBody, _ = sjson.SetRaw(itemBody, "ipv6.-1", itemChildBody) } @@ -737,8 +819,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupIdVariable.ValueString()) } } else if !item.GroupId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupId.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupId.ValueInt64()) + } } if !item.PriorityVariable.IsNull() { @@ -752,8 +836,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "priority.value", 100) } } else { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64()) + } } if !item.TimerVariable.IsNull() { @@ -767,8 +853,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "timer.value", 1000) } } else { - itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64()) + } } if item.TrackOmp.IsNull() { if true { @@ -776,8 +864,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool()) + } } if !item.AddressVariable.IsNull() { @@ -786,8 +876,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) } } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + } } if true { itemBody, _ = sjson.Set(itemBody, "ipAddressSecondary", []interface{}{}) @@ -800,8 +892,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.value", childItem.AddressVariable.ValueString()) } } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.value", childItem.Address.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.value", childItem.Address.ValueString()) + } } if !childItem.SubnetMaskVariable.IsNull() { @@ -810,8 +904,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.value", childItem.SubnetMaskVariable.ValueString()) } } else if !childItem.SubnetMask.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.value", childItem.SubnetMask.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.value", childItem.SubnetMask.ValueString()) + } } itemBody, _ = sjson.SetRaw(itemBody, "ipAddressSecondary.-1", itemChildBody) } @@ -822,8 +918,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", item.TlocPrefixChange.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", item.TlocPrefixChange.ValueBool()) + } } if item.TlocPrefChangeValue.IsNull() { if true { @@ -831,8 +929,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefChangeValue.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefChangeValue.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"vrrp.-1", itemBody) } @@ -853,8 +953,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) + } } if !item.MacAddressVariable.IsNull() { @@ -863,8 +965,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString()) } } else if !item.MacAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody) } @@ -875,8 +979,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.value", false) } } else { - body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.optionType", "global") - body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.value", data.TrustsecEnableSgtPropogation.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.optionType", "global") + body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.value", data.TrustsecEnableSgtPropogation.ValueBool()) + } } if data.TrustsecPropogate.IsNull() { if true { @@ -884,8 +990,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"trustsec.propogate.value", true) } } else { - body, _ = sjson.Set(body, path+"trustsec.propogate.optionType", "global") - body, _ = sjson.Set(body, path+"trustsec.propogate.value", data.TrustsecPropogate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"trustsec.propogate.optionType", "global") + body, _ = sjson.Set(body, path+"trustsec.propogate.value", data.TrustsecPropogate.ValueBool()) + } } if !data.TrustsecSecurityGroupTagVariable.IsNull() { @@ -899,8 +1007,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.optionType", "global") - body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.value", data.TrustsecSecurityGroupTag.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.optionType", "global") + body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.value", data.TrustsecSecurityGroupTag.ValueInt64()) + } } if data.TrustsecEnableEnforcedPropogation.IsNull() { if true { @@ -908,8 +1018,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"trustsec.enableEnforcedPropogation.optionType", "global") - body, _ = sjson.Set(body, path+"trustsec.enableEnforcedPropogation.value", data.TrustsecEnableEnforcedPropogation.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"trustsec.enableEnforcedPropogation.optionType", "global") + body, _ = sjson.Set(body, path+"trustsec.enableEnforcedPropogation.value", data.TrustsecEnableEnforcedPropogation.ValueBool()) + } } if !data.TrustsecEnforcedSecurityGroupTagVariable.IsNull() { @@ -923,8 +1035,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.optionType", "global") - body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.value", data.TrustsecEnforcedSecurityGroupTag.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.optionType", "global") + body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.value", data.TrustsecEnforcedSecurityGroupTag.ValueInt64()) + } } if !data.DuplexVariable.IsNull() { @@ -938,8 +1052,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString()) + } } if !data.MacAddressVariable.IsNull() { @@ -953,8 +1069,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString()) + } } if !data.IpMtuVariable.IsNull() { @@ -968,8 +1086,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500) } } else { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + } } if !data.InterfaceMtuVariable.IsNull() { @@ -983,8 +1103,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500) } } else { - body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64()) + } } if !data.TcpMssVariable.IsNull() { @@ -998,8 +1120,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + } } if !data.SpeedVariable.IsNull() { @@ -1013,8 +1137,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString()) + } } if !data.ArpTimeoutVariable.IsNull() { @@ -1028,8 +1154,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200) } } else { - body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64()) + } } if !data.AutonegotiateVariable.IsNull() { @@ -1043,8 +1171,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool()) + } } if !data.MediaTypeVariable.IsNull() { @@ -1058,8 +1188,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString()) + } } if !data.LoadIntervalVariable.IsNull() { @@ -1073,8 +1205,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advanced.loadInterval.value", 30) } } else { - body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64()) + } } if !data.TrackerVariable.IsNull() { @@ -1088,8 +1222,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString()) + } } if !data.IcmpRedirectDisableVariable.IsNull() { @@ -1103,8 +1239,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true) } } else { - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool()) + } } if !data.XconnectVariable.IsNull() { @@ -1118,8 +1256,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"advanced.xconnect.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.xconnect.value", data.Xconnect.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.xconnect.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.xconnect.value", data.Xconnect.ValueString()) + } } if !data.IpDirectedBroadcastVariable.IsNull() { @@ -1133,8 +1273,10 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false) } } else { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + } } return body } diff --git a/internal/provider/model_sdwan_service_lan_vpn_interface_gre_profile_parcel.go b/internal/provider/model_sdwan_service_lan_vpn_interface_gre_profile_parcel.go index e4e0c4d5..a6359158 100644 --- a/internal/provider/model_sdwan_service_lan_vpn_interface_gre_profile_parcel.go +++ b/internal/provider/model_sdwan_service_lan_vpn_interface_gre_profile_parcel.go @@ -97,8 +97,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceNameVariable.ValueString()) } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"basic.ifName.optionType", "global") - body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.ifName.optionType", "global") + body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceName.ValueString()) + } } if !data.InterfaceDescriptionVariable.IsNull() { @@ -112,8 +114,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"basic.description.optionType", "global") - body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.description.optionType", "global") + body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescription.ValueString()) + } } if !data.Ipv4AddressVariable.IsNull() { @@ -122,8 +126,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4AddressVariable.ValueString()) } } else if !data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"basic.address.address.optionType", "global") - body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.address.address.optionType", "global") + body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { @@ -132,8 +138,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMaskVariable.ValueString()) } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "global") - body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "global") + body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMask.ValueString()) + } } if !data.ShutdownVariable.IsNull() { @@ -147,8 +155,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.shutdown.value", false) } } else { - body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"basic.shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"basic.shutdown.value", data.Shutdown.ValueBool()) + } } if !data.TunnelSourceIpv4AddressVariable.IsNull() { @@ -157,8 +167,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4AddressVariable.ValueString()) } } else if !data.TunnelSourceIpv4Address.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4Address.ValueString()) + } } if !data.TunnelSourceInterfaceVariable.IsNull() { @@ -167,8 +179,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString()) } } else if !data.TunnelSourceInterface.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString()) + } } if !data.TunnelSourceInterfaceLoopbackVariable.IsNull() { @@ -177,8 +191,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopbackVariable.ValueString()) } } else if !data.TunnelSourceInterfaceLoopback.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopback.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopback.ValueString()) + } } if !data.TunnelRouteViaLoopbackVariable.IsNull() { @@ -187,8 +203,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopbackVariable.ValueString()) } } else if !data.TunnelRouteViaLoopback.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopback.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopback.ValueString()) + } } if !data.TunnelDestinationIpv4AddressVariable.IsNull() { @@ -197,8 +215,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4AddressVariable.ValueString()) } } else if !data.TunnelDestinationIpv4Address.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4Address.ValueString()) + } } if !data.IpMtuVariable.IsNull() { @@ -212,8 +232,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.mtu.value", 1500) } } else { - body, _ = sjson.Set(body, path+"basic.mtu.optionType", "global") - body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.mtu.optionType", "global") + body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtu.ValueInt64()) + } } if !data.TcpMssVariable.IsNull() { @@ -227,8 +249,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMss.ValueInt64()) + } } if !data.ClearDontFragmentVariable.IsNull() { @@ -242,8 +266,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", false) } } else { - body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "global") - body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragment.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "global") + body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragment.ValueBool()) + } } if !data.ApplicationTunnelTypeVariable.IsNull() { @@ -252,8 +278,10 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelTypeVariable.ValueString()) } } else if !data.ApplicationTunnelType.IsNull() { - body, _ = sjson.Set(body, path+"advanced.application.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.application.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelType.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go b/internal/provider/model_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go index 5ebb4dbd..33637e43 100644 --- a/internal/provider/model_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go +++ b/internal/provider/model_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go @@ -128,8 +128,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceNameVariable.ValueString()) } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"ifName.optionType", "global") - body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ifName.optionType", "global") + body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceName.ValueString()) + } } if !data.ShutdownVariable.IsNull() { @@ -143,8 +145,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"shutdown.value", true) } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.InterfaceDescriptionVariable.IsNull() { @@ -158,8 +162,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"description.optionType", "global") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "global") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + } } if !data.Ipv4AddressVariable.IsNull() { @@ -168,8 +174,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4AddressVariable.ValueString()) } } else if !data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"address.address.optionType", "global") - body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"address.address.optionType", "global") + body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { @@ -178,8 +186,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMaskVariable.ValueString()) } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"address.mask.optionType", "global") - body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"address.mask.optionType", "global") + body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMask.ValueString()) + } } if !data.TunnelSourceIpv4AddressVariable.IsNull() { @@ -188,8 +198,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4AddressVariable.ValueString()) } } else if !data.TunnelSourceIpv4Address.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4Address.ValueString()) + } } if !data.TunnelSourceIpv4SubnetMaskVariable.IsNull() { @@ -198,8 +210,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMaskVariable.ValueString()) } } else if !data.TunnelSourceIpv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMask.ValueString()) + } } if !data.TunnelSourceInterfaceVariable.IsNull() { @@ -208,8 +222,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString()) } } else if !data.TunnelSourceInterface.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString()) + } } if !data.TunnelDestinationIpv4AddressVariable.IsNull() { @@ -218,8 +234,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4AddressVariable.ValueString()) } } else if !data.TunnelDestinationIpv4Address.IsNull() { - body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4Address.ValueString()) + } } if !data.TunnelDestinationIpv4SubnetMaskVariable.IsNull() { @@ -228,8 +246,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMaskVariable.ValueString()) } } else if !data.TunnelDestinationIpv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMask.ValueString()) + } } if !data.ApplicationTunnelTypeVariable.IsNull() { @@ -238,8 +258,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelTypeVariable.ValueString()) } } else if !data.ApplicationTunnelType.IsNull() { - body, _ = sjson.Set(body, path+"application.optionType", "global") - body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"application.optionType", "global") + body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelType.ValueString()) + } } if !data.TcpMssVariable.IsNull() { @@ -253,8 +275,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "global") - body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "global") + body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMss.ValueInt64()) + } } if !data.ClearDontFragmentVariable.IsNull() { @@ -268,8 +292,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"clearDontFragment.value", false) } } else { - body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "global") - body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragment.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "global") + body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragment.ValueBool()) + } } if !data.IpMtuVariable.IsNull() { @@ -283,8 +309,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"mtu.value", 1500) } } else { - body, _ = sjson.Set(body, path+"mtu.optionType", "global") - body, _ = sjson.Set(body, path+"mtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"mtu.optionType", "global") + body, _ = sjson.Set(body, path+"mtu.value", data.IpMtu.ValueInt64()) + } } if !data.DpdIntervalVariable.IsNull() { @@ -298,8 +326,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"dpdInterval.value", 10) } } else { - body, _ = sjson.Set(body, path+"dpdInterval.optionType", "global") - body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"dpdInterval.optionType", "global") + body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdInterval.ValueInt64()) + } } if !data.DpdRetriesVariable.IsNull() { @@ -313,8 +343,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"dpdRetries.value", 3) } } else { - body, _ = sjson.Set(body, path+"dpdRetries.optionType", "global") - body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetries.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"dpdRetries.optionType", "global") + body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetries.ValueInt64()) + } } if !data.IkePresharedKeyVariable.IsNull() { @@ -323,8 +355,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKeyVariable.ValueString()) } } else if !data.IkePresharedKey.IsNull() { - body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "global") - body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKey.ValueString()) + if true { + body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "global") + body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKey.ValueString()) + } } if data.IkeVersion.IsNull() { if true { @@ -332,8 +366,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ikeVersion.value", 1) } } else { - body, _ = sjson.Set(body, path+"ikeVersion.optionType", "global") - body, _ = sjson.Set(body, path+"ikeVersion.value", data.IkeVersion.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ikeVersion.optionType", "global") + body, _ = sjson.Set(body, path+"ikeVersion.value", data.IkeVersion.ValueInt64()) + } } if !data.IkeIntegrityProtocolVariable.IsNull() { @@ -347,8 +383,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ikeMode.value", "main") } } else { - body, _ = sjson.Set(body, path+"ikeMode.optionType", "global") - body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocol.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeMode.optionType", "global") + body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocol.ValueString()) + } } if !data.IkeRekeyIntervalVariable.IsNull() { @@ -362,8 +400,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", 14400) } } else { - body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "global") - body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "global") + body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyInterval.ValueInt64()) + } } if !data.IkeCiphersuiteVariable.IsNull() { @@ -377,8 +417,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ikeCiphersuite.value", "aes256-cbc-sha1") } } else { - body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "global") - body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuite.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "global") + body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuite.ValueString()) + } } if !data.IkeDiffieHellmanGroupVariable.IsNull() { @@ -392,8 +434,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ikeGroup.value", "16") } } else { - body, _ = sjson.Set(body, path+"ikeGroup.optionType", "global") - body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroup.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeGroup.optionType", "global") + body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroup.ValueString()) + } } if !data.IkeIdLocalEndPointVariable.IsNull() { @@ -407,8 +451,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "global") - body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPoint.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "global") + body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPoint.ValueString()) + } } if !data.IkeIdRemoteEndPointVariable.IsNull() { @@ -422,8 +468,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "global") - body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPoint.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "global") + body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPoint.ValueString()) + } } if !data.IpsecRekeyIntervalVariable.IsNull() { @@ -437,8 +485,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", 3600) } } else { - body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "global") - body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "global") + body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyInterval.ValueInt64()) + } } if !data.IpsecReplayWindowVariable.IsNull() { @@ -452,8 +502,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", 512) } } else { - body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "global") - body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindow.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "global") + body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindow.ValueInt64()) + } } if !data.IpsecCiphersuiteVariable.IsNull() { @@ -467,8 +519,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", "aes256-gcm") } } else { - body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "global") - body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuite.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "global") + body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuite.ValueString()) + } } if !data.PerfectForwardSecrecyVariable.IsNull() { @@ -482,8 +536,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", "group-16") } } else { - body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "global") - body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecy.ValueString()) + if true { + body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "global") + body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecy.ValueString()) + } } if !data.TrackerIdVariable.IsNull() { @@ -497,8 +553,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"tracker.optionType", "global") - body, _ = sjson.Set(body, path+"tracker.value", data.TrackerId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tracker.optionType", "global") + body, _ = sjson.Set(body, path+"tracker.value", data.TrackerId.ValueString()) + } } if !data.TunnelRouteViaVariable.IsNull() { @@ -512,8 +570,10 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteVia.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteVia.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_service_lan_vpn_interface_svi_profile_parcel.go b/internal/provider/model_sdwan_service_lan_vpn_interface_svi_profile_parcel.go index e857777f..8b5f8e8d 100644 --- a/internal/provider/model_sdwan_service_lan_vpn_interface_svi_profile_parcel.go +++ b/internal/provider/model_sdwan_service_lan_vpn_interface_svi_profile_parcel.go @@ -186,8 +186,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"shutdown.value", true) } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.InterfaceNameVariable.IsNull() { @@ -196,8 +198,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + } } if !data.InterfaceDescriptionVariable.IsNull() { @@ -211,8 +215,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"description.optionType", "global") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "global") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + } } if !data.InterfaceMtuVariable.IsNull() { @@ -226,8 +232,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ifMtu.value", 1500) } } else { - body, _ = sjson.Set(body, path+"ifMtu.optionType", "global") - body, _ = sjson.Set(body, path+"ifMtu.value", data.InterfaceMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ifMtu.optionType", "global") + body, _ = sjson.Set(body, path+"ifMtu.value", data.InterfaceMtu.ValueInt64()) + } } if !data.IpMtuVariable.IsNull() { @@ -241,8 +249,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ipMtu.value", 1500) } } else { - body, _ = sjson.Set(body, path+"ipMtu.optionType", "global") - body, _ = sjson.Set(body, path+"ipMtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ipMtu.optionType", "global") + body, _ = sjson.Set(body, path+"ipMtu.value", data.IpMtu.ValueInt64()) + } } if !data.Ipv4AddressVariable.IsNull() { @@ -251,8 +261,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.value", data.Ipv4AddressVariable.ValueString()) } } else if !data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.optionType", "global") - body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.optionType", "global") + body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { @@ -261,8 +273,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString()) } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.optionType", "global") - body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.optionType", "global") + body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.value", data.Ipv4SubnetMask.ValueString()) + } } if true { body, _ = sjson.Set(body, path+"ipv4.secondaryAddressV4", []interface{}{}) @@ -275,8 +289,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) } } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + } } if !item.Ipv4SubnetMaskVariable.IsNull() { @@ -285,8 +301,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.Ipv4SubnetMaskVariable.ValueString()) } } else if !item.Ipv4SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.Ipv4SubnetMask.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.Ipv4SubnetMask.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"ipv4.secondaryAddressV4.-1", itemBody) } @@ -303,10 +321,12 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.optionType", "global") - var values []string - data.Ipv4DhcpHelpers.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.value", values) + if true { + body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.optionType", "global") + var values []string + data.Ipv4DhcpHelpers.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.value", values) + } } if !data.Ipv6AddressVariable.IsNull() { @@ -320,8 +340,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"ipv6.addressV6.optionType", "global") - body, _ = sjson.Set(body, path+"ipv6.addressV6.value", data.Ipv6Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipv6.addressV6.optionType", "global") + body, _ = sjson.Set(body, path+"ipv6.addressV6.value", data.Ipv6Address.ValueString()) + } } if true { body, _ = sjson.Set(body, path+"ipv6.secondaryAddressV6", []interface{}{}) @@ -339,8 +361,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"ipv6.secondaryAddressV6.-1", itemBody) } @@ -356,8 +380,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) } } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + } } if !item.VpnVariable.IsNull() { @@ -371,8 +397,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"ipv6.dhcpHelperV6.-1", itemBody) } @@ -388,8 +416,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString()) } } else if !item.IpAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) + } } if !item.MacAddressVariable.IsNull() { @@ -398,8 +428,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString()) } } else if !item.MacAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody) } @@ -415,8 +447,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupIdVariable.ValueString()) } } else if !item.GroupId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupId.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupId.ValueInt64()) + } } if !item.PriorityVariable.IsNull() { @@ -430,8 +464,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "priority.value", 100) } } else { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64()) + } } if !item.TimerVariable.IsNull() { @@ -445,8 +481,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "timer.value", 1000) } } else { - itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64()) + } } if !item.TrackOmpVariable.IsNull() { @@ -460,8 +498,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool()) + } } if !item.PrefixListVariable.IsNull() { @@ -475,8 +515,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "prefixList.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefixList.value", item.PrefixList.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefixList.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefixList.value", item.PrefixList.ValueString()) + } } if !item.AddressVariable.IsNull() { @@ -485,8 +527,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) } } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + } } if true { itemBody, _ = sjson.Set(itemBody, "ipAddressSecondary", []interface{}{}) @@ -499,8 +543,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) } } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } } itemBody, _ = sjson.SetRaw(itemBody, "ipAddressSecondary.-1", itemChildBody) } @@ -511,8 +557,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", item.TlocPrefixChange.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", item.TlocPrefixChange.ValueBool()) + } } if !item.TlocPrefixChangeValueVariable.IsNull() { @@ -521,8 +569,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefixChangeValueVariable.ValueString()) } } else if !item.TlocPrefixChangeValue.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefixChangeValue.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefixChangeValue.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"vrrp.-1", itemBody) } @@ -538,8 +588,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupIdVariable.ValueString()) } } else if !item.GroupId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupId.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupId.ValueInt64()) + } } if !item.PriorityVariable.IsNull() { @@ -553,8 +605,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "priority.value", 100) } } else { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64()) + } } if !item.TimerVariable.IsNull() { @@ -568,8 +622,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "timer.value", 1000) } } else { - itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64()) + } } if !item.TrackOmpVariable.IsNull() { @@ -583,8 +639,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool()) + } } if !item.TrackPrefixListVariable.IsNull() { @@ -598,8 +656,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "trackPrefixList.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackPrefixList.value", item.TrackPrefixList.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "trackPrefixList.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackPrefixList.value", item.TrackPrefixList.ValueString()) + } } if true { itemBody, _ = sjson.Set(itemBody, "ipv6", []interface{}{}) @@ -612,8 +672,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddressVariable.ValueString()) } } else if !childItem.LinkLocalAddress.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddress.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddress.ValueString()) + } } if !childItem.GlobalAddressVariable.IsNull() { @@ -627,8 +689,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddress.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddress.ValueString()) + } } itemBody, _ = sjson.SetRaw(itemBody, "ipv6.-1", itemChildBody) } @@ -644,8 +708,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.PrefixVariable.ValueString()) } } else if !childItem.Prefix.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.Prefix.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.Prefix.ValueString()) + } } itemBody, _ = sjson.SetRaw(itemBody, "ipv6Secondary.-1", itemChildBody) } @@ -665,8 +731,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"dhcpClientV6.value", false) } } else { - body, _ = sjson.Set(body, path+"dhcpClientV6.optionType", "global") - body, _ = sjson.Set(body, path+"dhcpClientV6.value", data.EnableDhcpv6.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"dhcpClientV6.optionType", "global") + body, _ = sjson.Set(body, path+"dhcpClientV6.value", data.EnableDhcpv6.ValueBool()) + } } if !data.TcpMssVariable.IsNull() { @@ -680,8 +748,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + } } if !data.ArpTimeoutVariable.IsNull() { @@ -695,8 +765,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200) } } else { - body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64()) + } } if !data.IpDirectedBroadcastVariable.IsNull() { @@ -710,8 +782,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false) } } else { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + } } if !data.IcmpRedirectDisableVariable.IsNull() { @@ -725,8 +799,10 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true) } } else { - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool()) + } } return body } diff --git a/internal/provider/model_sdwan_service_lan_vpn_profile_parcel.go b/internal/provider/model_sdwan_service_lan_vpn_profile_parcel.go index 015e1241..86cc3e38 100644 --- a/internal/provider/model_sdwan_service_lan_vpn_profile_parcel.go +++ b/internal/provider/model_sdwan_service_lan_vpn_profile_parcel.go @@ -346,8 +346,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"vpnId.value", 0) } } else { - body, _ = sjson.Set(body, path+"vpnId.optionType", "global") - body, _ = sjson.Set(body, path+"vpnId.value", data.Vpn.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"vpnId.optionType", "global") + body, _ = sjson.Set(body, path+"vpnId.value", data.Vpn.ValueInt64()) + } } if !data.ConfigDescriptionVariable.IsNull() { @@ -361,8 +363,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"name.optionType", "global") - body, _ = sjson.Set(body, path+"name.value", data.ConfigDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"name.optionType", "global") + body, _ = sjson.Set(body, path+"name.value", data.ConfigDescription.ValueString()) + } } if !data.OmpAdminDistanceIpv4Variable.IsNull() { @@ -376,8 +380,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"ompAdminDistance.optionType", "global") - body, _ = sjson.Set(body, path+"ompAdminDistance.value", data.OmpAdminDistanceIpv4.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ompAdminDistance.optionType", "global") + body, _ = sjson.Set(body, path+"ompAdminDistance.value", data.OmpAdminDistanceIpv4.ValueInt64()) + } } if !data.OmpAdminDistanceIpv6Variable.IsNull() { @@ -391,8 +397,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", data.OmpAdminDistanceIpv6.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", data.OmpAdminDistanceIpv6.ValueInt64()) + } } if data.EnableSdwanRemoteAccess.IsNull() { if true { @@ -400,8 +408,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"enableSdra.value", false) } } else { - body, _ = sjson.Set(body, path+"enableSdra.optionType", "global") - body, _ = sjson.Set(body, path+"enableSdra.value", data.EnableSdwanRemoteAccess.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"enableSdra.optionType", "global") + body, _ = sjson.Set(body, path+"enableSdra.value", data.EnableSdwanRemoteAccess.ValueBool()) + } } if !data.PrimaryDnsAddressIpv4Variable.IsNull() { @@ -415,8 +425,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString()) + } } if !data.SecondaryDnsAddressIpv4Variable.IsNull() { @@ -425,8 +437,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4Variable.ValueString()) } } else if !data.SecondaryDnsAddressIpv4.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString()) + } } if !data.PrimaryDnsAddressIpv6Variable.IsNull() { @@ -440,8 +454,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString()) + } } if !data.SecondaryDnsAddressIpv6Variable.IsNull() { @@ -450,8 +466,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6Variable.ValueString()) } } else if !data.SecondaryDnsAddressIpv6.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString()) + } } if true { body, _ = sjson.Set(body, path+"newHostMapping", []interface{}{}) @@ -464,8 +482,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostNameVariable.ValueString()) } } else if !item.HostName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString()) + } } if !item.ListOfIpsVariable.IsNull() { @@ -474,10 +494,12 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "listOfIp.value", item.ListOfIpsVariable.ValueString()) } } else if !item.ListOfIps.IsNull() { - itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global") - var values []string - item.ListOfIps.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values) + if true { + itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global") + var values []string + item.ListOfIps.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values) + } } body, _ = sjson.SetRaw(body, path+"newHostMapping.-1", itemBody) } @@ -493,12 +515,16 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.ProtocolVariable.ValueString()) } } else if !item.Protocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.Protocol.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.Protocol.ValueString()) + } } if !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + } } if true { @@ -511,8 +537,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.value", childItem.NetworkAddressVariable.ValueString()) } } else if !childItem.NetworkAddress.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.value", childItem.NetworkAddress.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.value", childItem.NetworkAddress.ValueString()) + } } if !childItem.SubnetMaskVariable.IsNull() { @@ -521,8 +549,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.value", childItem.SubnetMaskVariable.ValueString()) } } else if !childItem.SubnetMask.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.value", childItem.SubnetMask.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.value", childItem.SubnetMask.ValueString()) + } } if childItem.AggregateOnly.IsNull() { if true { @@ -530,8 +560,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", false) } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", childItem.AggregateOnly.ValueBool()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", childItem.AggregateOnly.ValueBool()) + } } if !childItem.RegionVariable.IsNull() { @@ -545,8 +577,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "region.value", "core-and-access") } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "region.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "region.value", childItem.Region.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "region.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "region.value", childItem.Region.ValueString()) + } } itemBody, _ = sjson.SetRaw(itemBody, "prefixList.-1", itemChildBody) } @@ -565,12 +599,16 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.ProtocolVariable.ValueString()) } } else if !item.Protocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.Protocol.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.Protocol.ValueString()) + } } if !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + } } if !item.ProtocolSubTypeVariable.IsNull() { @@ -584,8 +622,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "protocolSubType.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "protocolSubType.value", item.ProtocolSubType.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "protocolSubType.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "protocolSubType.value", item.ProtocolSubType.ValueString()) + } } if true { @@ -598,8 +638,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.PrefixVariable.ValueString()) } } else if !childItem.Prefix.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.Prefix.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.Prefix.ValueString()) + } } if childItem.AggregateOnly.IsNull() { if true { @@ -607,8 +649,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", false) } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", childItem.AggregateOnly.ValueBool()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", childItem.AggregateOnly.ValueBool()) + } } itemBody, _ = sjson.SetRaw(itemBody, "prefixList.-1", itemChildBody) } @@ -627,8 +671,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) } } else if !item.NetworkAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + } } if !item.SubnetMaskVariable.IsNull() { @@ -637,8 +683,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) } } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + } } if true { @@ -651,8 +699,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) } } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } } if !childItem.AdministrativeDistanceVariable.IsNull() { @@ -661,8 +711,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) } } else if !childItem.AdministrativeDistance.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + } } itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody) } @@ -678,8 +730,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) } } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } } if !childItem.AdministrativeDistanceVariable.IsNull() { @@ -688,27 +742,37 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) } } else if !childItem.AdministrativeDistance.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + } } if !childItem.TrackerId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "tracker.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "tracker.refId.value", childItem.TrackerId.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "tracker.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "tracker.refId.value", childItem.TrackerId.ValueString()) + } } itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHopWithTracker.-1", itemChildBody) } } if !item.Null0.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) + } } if !item.GatewayDhcp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.dhcp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.dhcp.value", item.GatewayDhcp.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.dhcp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.dhcp.value", item.GatewayDhcp.ValueBool()) + } } if !item.Vpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.vpn.value", item.Vpn.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.vpn.value", item.Vpn.ValueBool()) + } } body, _ = sjson.SetRaw(body, path+"ipv4Route.-1", itemBody) } @@ -724,8 +788,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.value", item.PrefixVariable.ValueString()) } } else if !item.Prefix.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString()) + } } if true { @@ -738,8 +804,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) } } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } } if !childItem.AdministrativeDistanceVariable.IsNull() { @@ -748,15 +816,19 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) } } else if !childItem.AdministrativeDistance.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + } } itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody) } } if !item.Null0.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) + } } if !item.NatVariable.IsNull() { @@ -765,8 +837,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.NatVariable.ValueString()) } } else if !item.Nat.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"ipv6Route.-1", itemBody) } @@ -782,8 +856,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceTypeVariable.ValueString()) } } else if !item.ServiceType.IsNull() { - itemBody, _ = sjson.Set(itemBody, "serviceType.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceType.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "serviceType.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceType.ValueString()) + } } if !item.Ipv4AddressesVariable.IsNull() { @@ -792,10 +868,12 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.value", item.Ipv4AddressesVariable.ValueString()) } } else if !item.Ipv4Addresses.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.optionType", "global") - var values []string - item.Ipv4Addresses.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.value", values) + if true { + itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.optionType", "global") + var values []string + item.Ipv4Addresses.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.value", values) + } } if !item.TrackingVariable.IsNull() { @@ -809,8 +887,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "tracking.value", true) } } else { - itemBody, _ = sjson.Set(itemBody, "tracking.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tracking.value", item.Tracking.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "tracking.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tracking.value", item.Tracking.ValueBool()) + } } body, _ = sjson.SetRaw(body, path+"service.-1", itemBody) } @@ -826,8 +906,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) } } else if !item.NetworkAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + } } if !item.SubnetMaskVariable.IsNull() { @@ -836,8 +918,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) } } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + } } if !item.ServiceVariable.IsNull() { @@ -851,12 +935,16 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "service.value", "SIG") } } else { - itemBody, _ = sjson.Set(itemBody, "service.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "service.value", item.Service.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "service.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "service.value", item.Service.ValueString()) + } } if !item.Vpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"serviceRoute.-1", itemBody) } @@ -872,8 +960,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) } } else if !item.NetworkAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + } } if !item.SubnetMaskVariable.IsNull() { @@ -882,8 +972,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) } } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + } } if !item.InterfaceVariable.IsNull() { @@ -897,14 +989,18 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "interface.optionType", "global") - var values []string - item.Interface.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "interface.value", values) + if true { + itemBody, _ = sjson.Set(itemBody, "interface.optionType", "global") + var values []string + item.Interface.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "interface.value", values) + } } if !item.Vpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"greRoute.-1", itemBody) } @@ -920,8 +1016,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) } } else if !item.NetworkAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + } } if !item.SubnetMaskVariable.IsNull() { @@ -930,8 +1028,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) } } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + } } if !item.InterfaceVariable.IsNull() { @@ -945,10 +1045,12 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "interface.optionType", "global") - var values []string - item.Interface.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "interface.value", values) + if true { + itemBody, _ = sjson.Set(itemBody, "interface.optionType", "global") + var values []string + item.Interface.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "interface.value", values) + } } body, _ = sjson.SetRaw(body, path+"ipsecRoute.-1", itemBody) } @@ -964,8 +1066,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolNameVariable.ValueString()) } } else if !item.NatPoolName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64()) + } } if !item.PrefixLengthVariable.IsNull() { @@ -974,8 +1078,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefixLength.value", item.PrefixLengthVariable.ValueString()) } } else if !item.PrefixLength.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefixLength.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefixLength.value", item.PrefixLength.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefixLength.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefixLength.value", item.PrefixLength.ValueInt64()) + } } if !item.RangeStartVariable.IsNull() { @@ -984,8 +1090,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "rangeStart.value", item.RangeStartVariable.ValueString()) } } else if !item.RangeStart.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rangeStart.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "rangeStart.value", item.RangeStart.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "rangeStart.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "rangeStart.value", item.RangeStart.ValueString()) + } } if !item.RangeEndVariable.IsNull() { @@ -994,8 +1102,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "rangeEnd.value", item.RangeEndVariable.ValueString()) } } else if !item.RangeEnd.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rangeEnd.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "rangeEnd.value", item.RangeEnd.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "rangeEnd.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "rangeEnd.value", item.RangeEnd.ValueString()) + } } if !item.OverloadVariable.IsNull() { @@ -1009,8 +1119,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "overload.value", true) } } else { - itemBody, _ = sjson.Set(itemBody, "overload.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "overload.value", item.Overload.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "overload.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "overload.value", item.Overload.ValueBool()) + } } if !item.DirectionVariable.IsNull() { @@ -1019,12 +1131,16 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "direction.value", item.DirectionVariable.ValueString()) } } else if !item.Direction.IsNull() { - itemBody, _ = sjson.Set(itemBody, "direction.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "direction.value", item.Direction.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "direction.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "direction.value", item.Direction.ValueString()) + } } if !item.TrackerObjectId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.value", item.TrackerObjectId.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.value", item.TrackerObjectId.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"natPool.-1", itemBody) } @@ -1045,8 +1161,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64()) + } } if !item.SourcePortVariable.IsNull() { @@ -1055,8 +1173,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sourcePort.value", item.SourcePortVariable.ValueString()) } } else if !item.SourcePort.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourcePort.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourcePort.value", item.SourcePort.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourcePort.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourcePort.value", item.SourcePort.ValueInt64()) + } } if !item.TranslatePortVariable.IsNull() { @@ -1065,8 +1185,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "translatePort.value", item.TranslatePortVariable.ValueString()) } } else if !item.TranslatePort.IsNull() { - itemBody, _ = sjson.Set(itemBody, "translatePort.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "translatePort.value", item.TranslatePort.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "translatePort.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "translatePort.value", item.TranslatePort.ValueInt64()) + } } if !item.SourceIpVariable.IsNull() { @@ -1075,8 +1197,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString()) } } else if !item.SourceIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString()) + } } if !item.TranslatedSourceIpVariable.IsNull() { @@ -1085,8 +1209,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIpVariable.ValueString()) } } else if !item.TranslatedSourceIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIp.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIp.ValueString()) + } } if !item.ProtocolVariable.IsNull() { @@ -1095,8 +1221,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString()) } } else if !item.Protocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"natPortForward.-1", itemBody) } @@ -1117,8 +1245,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64()) + } } if !item.SourceIpVariable.IsNull() { @@ -1127,8 +1257,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString()) } } else if !item.SourceIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString()) + } } if !item.TranslatedSourceIpVariable.IsNull() { @@ -1137,8 +1269,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIpVariable.ValueString()) } } else if !item.TranslatedSourceIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIp.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIp.ValueString()) + } } if !item.StaticNatDirectionVariable.IsNull() { @@ -1147,12 +1281,16 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.StaticNatDirectionVariable.ValueString()) } } else if !item.StaticNatDirection.IsNull() { - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.StaticNatDirection.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.StaticNatDirection.ValueString()) + } } if !item.TrackerObjectId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.value", item.TrackerObjectId.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.value", item.TrackerObjectId.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"staticNat.-1", itemBody) } @@ -1168,8 +1306,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.NameVariable.ValueString()) } } else if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Name.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Name.ValueString()) + } } if !item.RangeStartVariable.IsNull() { @@ -1178,8 +1318,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.RangeStartVariable.ValueString()) } } else if !item.RangeStart.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.RangeStart.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.RangeStart.ValueString()) + } } if !item.RangeEndVariable.IsNull() { @@ -1188,8 +1330,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.RangeEndVariable.ValueString()) } } else if !item.RangeEnd.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.RangeEnd.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.RangeEnd.ValueString()) + } } if !item.OverloadVariable.IsNull() { @@ -1203,8 +1347,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.Overload.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.Overload.ValueBool()) + } } body, _ = sjson.SetRaw(body, path+"nat64V4Pool.-1", itemBody) } @@ -1220,12 +1366,16 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocolVariable.ValueString()) } } else if !item.RouteProtocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.ValueString()) + } } if !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + } } if true { itemBody, _ = sjson.Set(itemBody, "redistributeToProtocol", []interface{}{}) @@ -1238,12 +1388,16 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.ProtocolVariable.ValueString()) } } else if !childItem.Protocol.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString()) + } } if !childItem.RedistributionPolicyId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString()) + } } itemBody, _ = sjson.SetRaw(itemBody, "redistributeToProtocol.-1", itemChildBody) } @@ -1262,12 +1416,16 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocolVariable.ValueString()) } } else if !item.RouteProtocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.ValueString()) + } } if !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + } } if true { itemBody, _ = sjson.Set(itemBody, "redistributeToProtocol", []interface{}{}) @@ -1280,12 +1438,16 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.ProtocolVariable.ValueString()) } } else if !childItem.Protocol.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString()) + } } if !childItem.RedistributionPolicyId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString()) + } } itemBody, _ = sjson.SetRaw(itemBody, "redistributeToProtocol.-1", itemChildBody) } @@ -1304,8 +1466,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpnVariable.ValueString()) } } else if !item.SourceVpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64()) + } } if !item.RouteProtocolVariable.IsNull() { @@ -1314,12 +1478,16 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocolVariable.ValueString()) } } else if !item.RouteProtocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.ValueString()) + } } if !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + } } if true { itemBody, _ = sjson.Set(itemBody, "redistributeToProtocol", []interface{}{}) @@ -1332,12 +1500,16 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.ProtocolVariable.ValueString()) } } else if !childItem.Protocol.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString()) + } } if !childItem.RedistributionPolicyId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString()) + } } itemBody, _ = sjson.SetRaw(itemBody, "redistributeToProtocol.-1", itemChildBody) } @@ -1356,8 +1528,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString()) } } else if !item.RouteTarget.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"mplsVpnIpv4RouteTarget.importRtList.-1", itemBody) } @@ -1373,8 +1547,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString()) } } else if !item.RouteTarget.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"mplsVpnIpv4RouteTarget.exportRtList.-1", itemBody) } @@ -1390,8 +1566,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString()) } } else if !item.RouteTarget.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"mplsVpnIpv6RouteTarget.importRtList.-1", itemBody) } @@ -1407,8 +1585,10 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString()) } } else if !item.RouteTarget.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"mplsVpnIpv6RouteTarget.exportRtList.-1", itemBody) } diff --git a/internal/provider/model_sdwan_service_tracker_profile_parcel.go b/internal/provider/model_sdwan_service_tracker_profile_parcel.go index c874d4f8..80383631 100644 --- a/internal/provider/model_sdwan_service_tracker_profile_parcel.go +++ b/internal/provider/model_sdwan_service_tracker_profile_parcel.go @@ -90,8 +90,10 @@ func (data ServiceTracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerNameVariable.ValueString()) } } else if !data.TrackerName.IsNull() { - body, _ = sjson.Set(body, path+"trackerName.optionType", "global") - body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerName.optionType", "global") + body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerName.ValueString()) + } } if !data.EndpointApiUrlVariable.IsNull() { @@ -100,8 +102,10 @@ func (data ServiceTracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrlVariable.ValueString()) } } else if !data.EndpointApiUrl.IsNull() { - body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "global") - body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrl.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "global") + body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrl.ValueString()) + } } if !data.EndpointDnsNameVariable.IsNull() { @@ -110,8 +114,10 @@ func (data ServiceTracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsNameVariable.ValueString()) } } else if !data.EndpointDnsName.IsNull() { - body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "global") - body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "global") + body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsName.ValueString()) + } } if !data.EndpointIpVariable.IsNull() { @@ -120,8 +126,10 @@ func (data ServiceTracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIpVariable.ValueString()) } } else if !data.EndpointIp.IsNull() { - body, _ = sjson.Set(body, path+"endpointIp.optionType", "global") - body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIp.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointIp.optionType", "global") + body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIp.ValueString()) + } } if !data.ProtocolVariable.IsNull() { @@ -130,8 +138,10 @@ func (data ServiceTracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"endpointTcpUdp.protocol.value", data.ProtocolVariable.ValueString()) } } else if !data.Protocol.IsNull() { - body, _ = sjson.Set(body, path+"endpointTcpUdp.protocol.optionType", "global") - body, _ = sjson.Set(body, path+"endpointTcpUdp.protocol.value", data.Protocol.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointTcpUdp.protocol.optionType", "global") + body, _ = sjson.Set(body, path+"endpointTcpUdp.protocol.value", data.Protocol.ValueString()) + } } if !data.PortVariable.IsNull() { @@ -140,8 +150,10 @@ func (data ServiceTracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"endpointTcpUdp.port.value", data.PortVariable.ValueString()) } } else if !data.Port.IsNull() { - body, _ = sjson.Set(body, path+"endpointTcpUdp.port.optionType", "global") - body, _ = sjson.Set(body, path+"endpointTcpUdp.port.value", data.Port.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"endpointTcpUdp.port.optionType", "global") + body, _ = sjson.Set(body, path+"endpointTcpUdp.port.value", data.Port.ValueInt64()) + } } if !data.IntervalVariable.IsNull() { @@ -155,8 +167,10 @@ func (data ServiceTracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"interval.value", 60) } } else { - body, _ = sjson.Set(body, path+"interval.optionType", "global") - body, _ = sjson.Set(body, path+"interval.value", data.Interval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"interval.optionType", "global") + body, _ = sjson.Set(body, path+"interval.value", data.Interval.ValueInt64()) + } } if !data.MultiplierVariable.IsNull() { @@ -170,8 +184,10 @@ func (data ServiceTracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"multiplier.value", 3) } } else { - body, _ = sjson.Set(body, path+"multiplier.optionType", "global") - body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"multiplier.optionType", "global") + body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64()) + } } if !data.ThresholdVariable.IsNull() { @@ -185,8 +201,10 @@ func (data ServiceTracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"threshold.value", 300) } } else { - body, _ = sjson.Set(body, path+"threshold.optionType", "global") - body, _ = sjson.Set(body, path+"threshold.value", data.Threshold.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"threshold.optionType", "global") + body, _ = sjson.Set(body, path+"threshold.value", data.Threshold.ValueInt64()) + } } if !data.EndpointTrackerTypeVariable.IsNull() { @@ -200,8 +218,10 @@ func (data ServiceTracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"endpointTrackerType.value", "static-route") } } else { - body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "global") - body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "global") + body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerType.ValueString()) + } } if !data.TrackerTypeVariable.IsNull() { @@ -215,8 +235,10 @@ func (data ServiceTracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"trackerType.value", "endpoint") } } else { - body, _ = sjson.Set(body, path+"trackerType.optionType", "global") - body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerType.optionType", "global") + body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerType.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_system_aaa_profile_parcel.go b/internal/provider/model_sdwan_system_aaa_profile_parcel.go index 79ccb4f5..86d26702 100644 --- a/internal/provider/model_sdwan_system_aaa_profile_parcel.go +++ b/internal/provider/model_sdwan_system_aaa_profile_parcel.go @@ -167,8 +167,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"authenticationGroup.value", false) } } else { - body, _ = sjson.Set(body, path+"authenticationGroup.optionType", "global") - body, _ = sjson.Set(body, path+"authenticationGroup.value", data.AuthenticationGroup.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"authenticationGroup.optionType", "global") + body, _ = sjson.Set(body, path+"authenticationGroup.value", data.AuthenticationGroup.ValueBool()) + } } if !data.AccountingGroupVariable.IsNull() { @@ -182,14 +184,18 @@ func (data SystemAAA) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"accountingGroup.value", false) } } else { - body, _ = sjson.Set(body, path+"accountingGroup.optionType", "global") - body, _ = sjson.Set(body, path+"accountingGroup.value", data.AccountingGroup.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"accountingGroup.optionType", "global") + body, _ = sjson.Set(body, path+"accountingGroup.value", data.AccountingGroup.ValueBool()) + } } if !data.ServerAuthOrder.IsNull() { - body, _ = sjson.Set(body, path+"serverAuthOrder.optionType", "global") - var values []string - data.ServerAuthOrder.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"serverAuthOrder.value", values) + if true { + body, _ = sjson.Set(body, path+"serverAuthOrder.optionType", "global") + var values []string + data.ServerAuthOrder.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"serverAuthOrder.value", values) + } } if true { @@ -202,8 +208,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "name.value", item.NameVariable.ValueString()) } } else if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + } } if !item.PasswordVariable.IsNull() { @@ -212,8 +220,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "password.value", item.PasswordVariable.ValueString()) } } else if !item.Password.IsNull() { - itemBody, _ = sjson.Set(itemBody, "password.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "password.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString()) + } } if !item.PrivilegeVariable.IsNull() { @@ -227,16 +237,20 @@ func (data SystemAAA) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "privilege.value", "15") } } else { - itemBody, _ = sjson.Set(itemBody, "privilege.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "privilege.value", item.Privilege.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "privilege.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "privilege.value", item.Privilege.ValueString()) + } } if true { itemBody, _ = sjson.Set(itemBody, "pubkeyChain", []interface{}{}) for _, childItem := range item.PublicKeys { itemChildBody := "" if !childItem.KeyString.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "keyString.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "keyString.value", childItem.KeyString.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "keyString.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "keyString.value", childItem.KeyString.ValueString()) + } } if !childItem.KeyTypeVariable.IsNull() { @@ -250,8 +264,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyType.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyType.ValueString()) + } } itemBody, _ = sjson.SetRaw(itemBody, "pubkeyChain.-1", itemChildBody) } @@ -264,8 +280,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { for _, item := range data.RadiusGroups { itemBody := "" if !item.GroupName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "groupName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "groupName.value", item.GroupName.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "groupName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "groupName.value", item.GroupName.ValueString()) + } } if item.Vpn.IsNull() { if true { @@ -273,8 +291,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "vpn.value", 0) } } else { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + } } if !item.SourceInterfaceVariable.IsNull() { @@ -288,16 +308,20 @@ func (data SystemAAA) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + } } if true { itemBody, _ = sjson.Set(itemBody, "server", []interface{}{}) for _, childItem := range item.Servers { itemChildBody := "" if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } } if !childItem.AuthPortVariable.IsNull() { @@ -311,8 +335,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "authPort.value", 1812) } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "authPort.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "authPort.value", childItem.AuthPort.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authPort.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "authPort.value", childItem.AuthPort.ValueInt64()) + } } if !childItem.AcctPortVariable.IsNull() { @@ -326,8 +352,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.value", 1813) } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.value", childItem.AcctPort.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.value", childItem.AcctPort.ValueInt64()) + } } if !childItem.TimeoutVariable.IsNull() { @@ -341,8 +369,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", 5) } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.Timeout.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.Timeout.ValueInt64()) + } } if !childItem.RetransmitVariable.IsNull() { @@ -356,12 +386,16 @@ func (data SystemAAA) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.value", 3) } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.value", childItem.Retransmit.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.value", childItem.Retransmit.ValueInt64()) + } } if !childItem.Key.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "key.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "key.value", childItem.Key.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "key.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "key.value", childItem.Key.ValueString()) + } } if !childItem.SecretKeyVariable.IsNull() { @@ -375,8 +409,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKey.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKey.ValueString()) + } } if childItem.KeyEnum.IsNull() { if true { @@ -384,8 +420,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.value", childItem.KeyEnum.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.value", childItem.KeyEnum.ValueString()) + } } if !childItem.KeyTypeVariable.IsNull() { @@ -399,8 +437,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", "key") } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyType.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyType.ValueString()) + } } itemBody, _ = sjson.SetRaw(itemBody, "server.-1", itemChildBody) } @@ -413,8 +453,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { for _, item := range data.TacacsGroups { itemBody := "" if !item.GroupName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "groupName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "groupName.value", item.GroupName.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "groupName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "groupName.value", item.GroupName.ValueString()) + } } if item.Vpn.IsNull() { if true { @@ -422,8 +464,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "vpn.value", 0) } } else { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + } } if !item.SourceInterfaceVariable.IsNull() { @@ -437,16 +481,20 @@ func (data SystemAAA) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + } } if true { itemBody, _ = sjson.Set(itemBody, "server", []interface{}{}) for _, childItem := range item.Servers { itemChildBody := "" if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } } if !childItem.PortVariable.IsNull() { @@ -460,8 +508,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "port.value", 49) } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "port.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "port.value", childItem.Port.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "port.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "port.value", childItem.Port.ValueInt64()) + } } if !childItem.TimeoutVariable.IsNull() { @@ -475,12 +525,16 @@ func (data SystemAAA) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", 5) } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.Timeout.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.Timeout.ValueInt64()) + } } if !childItem.Key.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "key.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "key.value", childItem.Key.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "key.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "key.value", childItem.Key.ValueString()) + } } if !childItem.SecretKeyVariable.IsNull() { @@ -489,8 +543,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKeyVariable.ValueString()) } } else if !childItem.SecretKey.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKey.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKey.ValueString()) + } } if childItem.KeyEnum.IsNull() { if true { @@ -498,8 +554,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.value", childItem.KeyEnum.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.value", childItem.KeyEnum.ValueString()) + } } itemBody, _ = sjson.SetRaw(itemBody, "server.-1", itemChildBody) } @@ -512,12 +570,16 @@ func (data SystemAAA) toBody(ctx context.Context) string { for _, item := range data.AccountingRules { itemBody := "" if !item.RuleId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ruleId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ruleId.value", item.RuleId.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ruleId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ruleId.value", item.RuleId.ValueString()) + } } if !item.Method.IsNull() { - itemBody, _ = sjson.Set(itemBody, "method.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "method.value", item.Method.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "method.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "method.value", item.Method.ValueString()) + } } if item.Level.IsNull() { if true { @@ -525,8 +587,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "level.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "level.value", item.Level.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "level.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "level.value", item.Level.ValueString()) + } } if !item.StartStopVariable.IsNull() { @@ -540,14 +604,18 @@ func (data SystemAAA) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "startStop.value", true) } } else { - itemBody, _ = sjson.Set(itemBody, "startStop.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "startStop.value", item.StartStop.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "startStop.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "startStop.value", item.StartStop.ValueBool()) + } } if !item.Group.IsNull() { - itemBody, _ = sjson.Set(itemBody, "group.optionType", "global") - var values []string - item.Group.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "group.value", values) + if true { + itemBody, _ = sjson.Set(itemBody, "group.optionType", "global") + var values []string + item.Group.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "group.value", values) + } } body, _ = sjson.SetRaw(body, path+"accountingRule.-1", itemBody) } @@ -564,8 +632,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"authorizationConsole.value", false) } } else { - body, _ = sjson.Set(body, path+"authorizationConsole.optionType", "global") - body, _ = sjson.Set(body, path+"authorizationConsole.value", data.AuthorizationConsole.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"authorizationConsole.optionType", "global") + body, _ = sjson.Set(body, path+"authorizationConsole.value", data.AuthorizationConsole.ValueBool()) + } } if !data.AuthorizationConfigCommandsVariable.IsNull() { @@ -579,30 +649,40 @@ func (data SystemAAA) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"authorizationConfigCommands.value", false) } } else { - body, _ = sjson.Set(body, path+"authorizationConfigCommands.optionType", "global") - body, _ = sjson.Set(body, path+"authorizationConfigCommands.value", data.AuthorizationConfigCommands.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"authorizationConfigCommands.optionType", "global") + body, _ = sjson.Set(body, path+"authorizationConfigCommands.value", data.AuthorizationConfigCommands.ValueBool()) + } } if true { body, _ = sjson.Set(body, path+"authorizationRule", []interface{}{}) for _, item := range data.AuthorizationRules { itemBody := "" if !item.RuleId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ruleId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ruleId.value", item.RuleId.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ruleId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ruleId.value", item.RuleId.ValueString()) + } } if !item.Method.IsNull() { - itemBody, _ = sjson.Set(itemBody, "method.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "method.value", item.Method.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "method.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "method.value", item.Method.ValueString()) + } } if !item.Level.IsNull() { - itemBody, _ = sjson.Set(itemBody, "level.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "level.value", item.Level.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "level.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "level.value", item.Level.ValueString()) + } } if !item.Group.IsNull() { - itemBody, _ = sjson.Set(itemBody, "group.optionType", "global") - var values []string - item.Group.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "group.value", values) + if true { + itemBody, _ = sjson.Set(itemBody, "group.optionType", "global") + var values []string + item.Group.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "group.value", values) + } } if item.IfAuthenticated.IsNull() { if true { @@ -610,8 +690,10 @@ func (data SystemAAA) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.value", item.IfAuthenticated.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.value", item.IfAuthenticated.ValueBool()) + } } body, _ = sjson.SetRaw(body, path+"authorizationRule.-1", itemBody) } diff --git a/internal/provider/model_sdwan_system_banner_profile_parcel.go b/internal/provider/model_sdwan_system_banner_profile_parcel.go index 3a8662ff..ced8a81d 100644 --- a/internal/provider/model_sdwan_system_banner_profile_parcel.go +++ b/internal/provider/model_sdwan_system_banner_profile_parcel.go @@ -77,8 +77,10 @@ func (data SystemBanner) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"login.value", "") } } else { - body, _ = sjson.Set(body, path+"login.optionType", "global") - body, _ = sjson.Set(body, path+"login.value", data.Login.ValueString()) + if true { + body, _ = sjson.Set(body, path+"login.optionType", "global") + body, _ = sjson.Set(body, path+"login.value", data.Login.ValueString()) + } } if !data.MotdVariable.IsNull() { @@ -92,8 +94,10 @@ func (data SystemBanner) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"motd.value", "") } } else { - body, _ = sjson.Set(body, path+"motd.optionType", "global") - body, _ = sjson.Set(body, path+"motd.value", data.Motd.ValueString()) + if true { + body, _ = sjson.Set(body, path+"motd.optionType", "global") + body, _ = sjson.Set(body, path+"motd.value", data.Motd.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_system_basic_profile_parcel.go b/internal/provider/model_sdwan_system_basic_profile_parcel.go index 9883a6b7..c4110fdc 100644 --- a/internal/provider/model_sdwan_system_basic_profile_parcel.go +++ b/internal/provider/model_sdwan_system_basic_profile_parcel.go @@ -147,8 +147,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"clock.timezone.value", "UTC") } } else { - body, _ = sjson.Set(body, path+"clock.timezone.optionType", "global") - body, _ = sjson.Set(body, path+"clock.timezone.value", data.Timezone.ValueString()) + if true { + body, _ = sjson.Set(body, path+"clock.timezone.optionType", "global") + body, _ = sjson.Set(body, path+"clock.timezone.value", data.Timezone.ValueString()) + } } if !data.ConfigDescriptionVariable.IsNull() { @@ -162,8 +164,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"description.optionType", "global") - body, _ = sjson.Set(body, path+"description.value", data.ConfigDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "global") + body, _ = sjson.Set(body, path+"description.value", data.ConfigDescription.ValueString()) + } } if !data.LocationVariable.IsNull() { @@ -177,8 +181,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"location.optionType", "global") - body, _ = sjson.Set(body, path+"location.value", data.Location.ValueString()) + if true { + body, _ = sjson.Set(body, path+"location.optionType", "global") + body, _ = sjson.Set(body, path+"location.value", data.Location.ValueString()) + } } if !data.GpsLongitudeVariable.IsNull() { @@ -192,8 +198,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"gpsLocation.longitude.optionType", "global") - body, _ = sjson.Set(body, path+"gpsLocation.longitude.value", data.GpsLongitude.ValueFloat64()) + if true { + body, _ = sjson.Set(body, path+"gpsLocation.longitude.optionType", "global") + body, _ = sjson.Set(body, path+"gpsLocation.longitude.value", data.GpsLongitude.ValueFloat64()) + } } if !data.GpsLatitudeVariable.IsNull() { @@ -207,8 +215,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"gpsLocation.latitude.optionType", "global") - body, _ = sjson.Set(body, path+"gpsLocation.latitude.value", data.GpsLatitude.ValueFloat64()) + if true { + body, _ = sjson.Set(body, path+"gpsLocation.latitude.optionType", "global") + body, _ = sjson.Set(body, path+"gpsLocation.latitude.value", data.GpsLatitude.ValueFloat64()) + } } if data.GpsGeoFencingEnable.IsNull() { if true { @@ -216,8 +226,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.value", false) } } else { - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.optionType", "global") - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.value", data.GpsGeoFencingEnable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.optionType", "global") + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.value", data.GpsGeoFencingEnable.ValueBool()) + } } if !data.GpsGeoFencingRangeVariable.IsNull() { @@ -231,8 +243,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.value", 100) } } else { - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.optionType", "global") - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.value", data.GpsGeoFencingRange.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.optionType", "global") + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.value", data.GpsGeoFencingRange.ValueInt64()) + } } if data.GpsSmsEnable.IsNull() { if true { @@ -240,8 +254,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.value", false) } } else { - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.optionType", "global") - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.value", data.GpsSmsEnable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.optionType", "global") + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.value", data.GpsSmsEnable.ValueBool()) + } } if true { body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.mobileNumber", []interface{}{}) @@ -254,8 +270,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "number.value", item.NumberVariable.ValueString()) } } else if !item.Number.IsNull() { - itemBody, _ = sjson.Set(itemBody, "number.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "number.value", item.Number.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "number.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "number.value", item.Number.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"gpsLocation.geoFencing.sms.mobileNumber.-1", itemBody) } @@ -272,10 +290,12 @@ func (data SystemBasic) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"deviceGroups.optionType", "global") - var values []string - data.DeviceGroups.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"deviceGroups.value", values) + if true { + body, _ = sjson.Set(body, path+"deviceGroups.optionType", "global") + var values []string + data.DeviceGroups.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"deviceGroups.value", values) + } } if !data.ControllerGroupsVariable.IsNull() { @@ -289,10 +309,12 @@ func (data SystemBasic) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"controllerGroupList.optionType", "global") - var values []int64 - data.ControllerGroups.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"controllerGroupList.value", values) + if true { + body, _ = sjson.Set(body, path+"controllerGroupList.optionType", "global") + var values []int64 + data.ControllerGroups.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"controllerGroupList.value", values) + } } if !data.OverlayIdVariable.IsNull() { @@ -306,8 +328,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"overlayId.value", 1) } } else { - body, _ = sjson.Set(body, path+"overlayId.optionType", "global") - body, _ = sjson.Set(body, path+"overlayId.value", data.OverlayId.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"overlayId.optionType", "global") + body, _ = sjson.Set(body, path+"overlayId.value", data.OverlayId.ValueInt64()) + } } if !data.PortOffsetVariable.IsNull() { @@ -321,8 +345,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"portOffset.value", 0) } } else { - body, _ = sjson.Set(body, path+"portOffset.optionType", "global") - body, _ = sjson.Set(body, path+"portOffset.value", data.PortOffset.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"portOffset.optionType", "global") + body, _ = sjson.Set(body, path+"portOffset.value", data.PortOffset.ValueInt64()) + } } if !data.PortHoppingVariable.IsNull() { @@ -336,8 +362,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"portHop.value", true) } } else { - body, _ = sjson.Set(body, path+"portHop.optionType", "global") - body, _ = sjson.Set(body, path+"portHop.value", data.PortHopping.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"portHop.optionType", "global") + body, _ = sjson.Set(body, path+"portHop.value", data.PortHopping.ValueBool()) + } } if !data.ControlSessionPpsVariable.IsNull() { @@ -351,8 +379,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"controlSessionPps.value", 300) } } else { - body, _ = sjson.Set(body, path+"controlSessionPps.optionType", "global") - body, _ = sjson.Set(body, path+"controlSessionPps.value", data.ControlSessionPps.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"controlSessionPps.optionType", "global") + body, _ = sjson.Set(body, path+"controlSessionPps.value", data.ControlSessionPps.ValueInt64()) + } } if !data.TrackTransportVariable.IsNull() { @@ -366,8 +396,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"trackTransport.value", true) } } else { - body, _ = sjson.Set(body, path+"trackTransport.optionType", "global") - body, _ = sjson.Set(body, path+"trackTransport.value", data.TrackTransport.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"trackTransport.optionType", "global") + body, _ = sjson.Set(body, path+"trackTransport.value", data.TrackTransport.ValueBool()) + } } if !data.TrackInterfaceTagVariable.IsNull() { @@ -381,8 +413,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"trackInterfaceTag.optionType", "global") - body, _ = sjson.Set(body, path+"trackInterfaceTag.value", data.TrackInterfaceTag.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"trackInterfaceTag.optionType", "global") + body, _ = sjson.Set(body, path+"trackInterfaceTag.value", data.TrackInterfaceTag.ValueInt64()) + } } if !data.ConsoleBaudRateVariable.IsNull() { @@ -396,8 +430,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"consoleBaudRate.value", "9600") } } else { - body, _ = sjson.Set(body, path+"consoleBaudRate.optionType", "global") - body, _ = sjson.Set(body, path+"consoleBaudRate.value", data.ConsoleBaudRate.ValueString()) + if true { + body, _ = sjson.Set(body, path+"consoleBaudRate.optionType", "global") + body, _ = sjson.Set(body, path+"consoleBaudRate.value", data.ConsoleBaudRate.ValueString()) + } } if !data.MaxOmpSessionsVariable.IsNull() { @@ -411,8 +447,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"maxOmpSessions.optionType", "global") - body, _ = sjson.Set(body, path+"maxOmpSessions.value", data.MaxOmpSessions.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"maxOmpSessions.optionType", "global") + body, _ = sjson.Set(body, path+"maxOmpSessions.value", data.MaxOmpSessions.ValueInt64()) + } } if !data.MultiTenantVariable.IsNull() { @@ -426,8 +464,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"multiTenant.value", false) } } else { - body, _ = sjson.Set(body, path+"multiTenant.optionType", "global") - body, _ = sjson.Set(body, path+"multiTenant.value", data.MultiTenant.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"multiTenant.optionType", "global") + body, _ = sjson.Set(body, path+"multiTenant.value", data.MultiTenant.ValueBool()) + } } if !data.TrackDefaultGatewayVariable.IsNull() { @@ -441,8 +481,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"trackDefaultGateway.value", true) } } else { - body, _ = sjson.Set(body, path+"trackDefaultGateway.optionType", "global") - body, _ = sjson.Set(body, path+"trackDefaultGateway.value", data.TrackDefaultGateway.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"trackDefaultGateway.optionType", "global") + body, _ = sjson.Set(body, path+"trackDefaultGateway.value", data.TrackDefaultGateway.ValueBool()) + } } if !data.AdminTechOnFailureVariable.IsNull() { @@ -456,8 +498,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"adminTechOnFailure.value", true) } } else { - body, _ = sjson.Set(body, path+"adminTechOnFailure.optionType", "global") - body, _ = sjson.Set(body, path+"adminTechOnFailure.value", data.AdminTechOnFailure.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"adminTechOnFailure.optionType", "global") + body, _ = sjson.Set(body, path+"adminTechOnFailure.value", data.AdminTechOnFailure.ValueBool()) + } } if !data.IdleTimeoutVariable.IsNull() { @@ -471,8 +515,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"idleTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"idleTimeout.value", data.IdleTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"idleTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"idleTimeout.value", data.IdleTimeout.ValueInt64()) + } } if !data.OnDemandEnableVariable.IsNull() { @@ -486,8 +532,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.value", false) } } else { - body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.optionType", "global") - body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.value", data.OnDemandEnable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.optionType", "global") + body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.value", data.OnDemandEnable.ValueBool()) + } } if !data.OnDemandIdleTimeoutVariable.IsNull() { @@ -501,8 +549,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.value", 10) } } else { - body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.value", data.OnDemandIdleTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.value", data.OnDemandIdleTimeout.ValueInt64()) + } } if !data.TransportGatewayVariable.IsNull() { @@ -516,8 +566,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"transportGateway.value", false) } } else { - body, _ = sjson.Set(body, path+"transportGateway.optionType", "global") - body, _ = sjson.Set(body, path+"transportGateway.value", data.TransportGateway.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"transportGateway.optionType", "global") + body, _ = sjson.Set(body, path+"transportGateway.value", data.TransportGateway.ValueBool()) + } } if !data.EnhancedAppAwareRoutingVariable.IsNull() { @@ -531,8 +583,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"epfr.value", "disabled") } } else { - body, _ = sjson.Set(body, path+"epfr.optionType", "global") - body, _ = sjson.Set(body, path+"epfr.value", data.EnhancedAppAwareRouting.ValueString()) + if true { + body, _ = sjson.Set(body, path+"epfr.optionType", "global") + body, _ = sjson.Set(body, path+"epfr.value", data.EnhancedAppAwareRouting.ValueString()) + } } if !data.SiteTypesVariable.IsNull() { @@ -546,10 +600,12 @@ func (data SystemBasic) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"siteType.optionType", "global") - var values []string - data.SiteTypes.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"siteType.value", values) + if true { + body, _ = sjson.Set(body, path+"siteType.optionType", "global") + var values []string + data.SiteTypes.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"siteType.value", values) + } } if !data.AffinityGroupNumberVariable.IsNull() { @@ -563,8 +619,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"affinityGroupNumber.optionType", "global") - body, _ = sjson.Set(body, path+"affinityGroupNumber.value", data.AffinityGroupNumber.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"affinityGroupNumber.optionType", "global") + body, _ = sjson.Set(body, path+"affinityGroupNumber.value", data.AffinityGroupNumber.ValueInt64()) + } } if !data.AffinityGroupPreferencesVariable.IsNull() { @@ -578,10 +636,12 @@ func (data SystemBasic) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"affinityGroupPreference.optionType", "global") - var values []int64 - data.AffinityGroupPreferences.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"affinityGroupPreference.value", values) + if true { + body, _ = sjson.Set(body, path+"affinityGroupPreference.optionType", "global") + var values []int64 + data.AffinityGroupPreferences.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"affinityGroupPreference.value", values) + } } if !data.AffinityPreferenceAutoVariable.IsNull() { @@ -595,8 +655,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"affinityPreferenceAuto.value", false) } } else { - body, _ = sjson.Set(body, path+"affinityPreferenceAuto.optionType", "global") - body, _ = sjson.Set(body, path+"affinityPreferenceAuto.value", data.AffinityPreferenceAuto.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"affinityPreferenceAuto.optionType", "global") + body, _ = sjson.Set(body, path+"affinityPreferenceAuto.value", data.AffinityPreferenceAuto.ValueBool()) + } } if true { body, _ = sjson.Set(body, path+"affinityPerVrf", []interface{}{}) @@ -614,8 +676,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.value", item.AffinityGroupNumber.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.value", item.AffinityGroupNumber.ValueInt64()) + } } if !item.VrfRangeVariable.IsNull() { @@ -629,8 +693,10 @@ func (data SystemBasic) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "vrfRange.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vrfRange.value", item.VrfRange.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "vrfRange.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vrfRange.value", item.VrfRange.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"affinityPerVrf.-1", itemBody) } diff --git a/internal/provider/model_sdwan_system_bfd_profile_parcel.go b/internal/provider/model_sdwan_system_bfd_profile_parcel.go index 7e517486..d0018854 100644 --- a/internal/provider/model_sdwan_system_bfd_profile_parcel.go +++ b/internal/provider/model_sdwan_system_bfd_profile_parcel.go @@ -93,8 +93,10 @@ func (data SystemBFD) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"multiplier.value", 6) } } else { - body, _ = sjson.Set(body, path+"multiplier.optionType", "global") - body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"multiplier.optionType", "global") + body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64()) + } } if !data.PollIntervalVariable.IsNull() { @@ -108,8 +110,10 @@ func (data SystemBFD) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"pollInterval.value", 600000) } } else { - body, _ = sjson.Set(body, path+"pollInterval.optionType", "global") - body, _ = sjson.Set(body, path+"pollInterval.value", data.PollInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"pollInterval.optionType", "global") + body, _ = sjson.Set(body, path+"pollInterval.value", data.PollInterval.ValueInt64()) + } } if !data.DefaultDscpVariable.IsNull() { @@ -123,8 +127,10 @@ func (data SystemBFD) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"defaultDscp.value", 48) } } else { - body, _ = sjson.Set(body, path+"defaultDscp.optionType", "global") - body, _ = sjson.Set(body, path+"defaultDscp.value", data.DefaultDscp.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"defaultDscp.optionType", "global") + body, _ = sjson.Set(body, path+"defaultDscp.value", data.DefaultDscp.ValueInt64()) + } } if true { body, _ = sjson.Set(body, path+"colors", []interface{}{}) @@ -137,8 +143,10 @@ func (data SystemBFD) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "color.value", item.ColorVariable.ValueString()) } } else if !item.Color.IsNull() { - itemBody, _ = sjson.Set(itemBody, "color.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "color.value", item.Color.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "color.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "color.value", item.Color.ValueString()) + } } if !item.HelloIntervalVariable.IsNull() { @@ -152,8 +160,10 @@ func (data SystemBFD) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "helloInterval.value", 1000) } } else { - itemBody, _ = sjson.Set(itemBody, "helloInterval.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "helloInterval.value", item.HelloInterval.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "helloInterval.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "helloInterval.value", item.HelloInterval.ValueInt64()) + } } if !item.MultiplierVariable.IsNull() { @@ -167,8 +177,10 @@ func (data SystemBFD) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "multiplier.value", 7) } } else { - itemBody, _ = sjson.Set(itemBody, "multiplier.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "multiplier.value", item.Multiplier.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "multiplier.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "multiplier.value", item.Multiplier.ValueInt64()) + } } if !item.PmtuDiscoveryVariable.IsNull() { @@ -182,8 +194,10 @@ func (data SystemBFD) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.value", true) } } else { - itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.value", item.PmtuDiscovery.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.value", item.PmtuDiscovery.ValueBool()) + } } if !item.DscpVariable.IsNull() { @@ -197,8 +211,10 @@ func (data SystemBFD) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "dscp.value", 48) } } else { - itemBody, _ = sjson.Set(itemBody, "dscp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "dscp.value", item.Dscp.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "dscp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "dscp.value", item.Dscp.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"colors.-1", itemBody) } diff --git a/internal/provider/model_sdwan_system_flexible_port_speed_profile_parcel.go b/internal/provider/model_sdwan_system_flexible_port_speed_profile_parcel.go index 356803bd..7e11d4fe 100644 --- a/internal/provider/model_sdwan_system_flexible_port_speed_profile_parcel.go +++ b/internal/provider/model_sdwan_system_flexible_port_speed_profile_parcel.go @@ -75,8 +75,10 @@ func (data SystemFlexiblePortSpeed) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"portType.value", "12 ports of 1/10GE + 3 ports 40GE") } } else { - body, _ = sjson.Set(body, path+"portType.optionType", "global") - body, _ = sjson.Set(body, path+"portType.value", data.PortType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"portType.optionType", "global") + body, _ = sjson.Set(body, path+"portType.value", data.PortType.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_system_global_profile_parcel.go b/internal/provider/model_sdwan_system_global_profile_parcel.go index bb5e9697..a46bca6f 100644 --- a/internal/provider/model_sdwan_system_global_profile_parcel.go +++ b/internal/provider/model_sdwan_system_global_profile_parcel.go @@ -119,8 +119,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.value", false) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.value", data.HttpServer.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.value", data.HttpServer.ValueBool()) + } } if !data.HttpsServerVariable.IsNull() { @@ -134,8 +136,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.value", false) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.value", data.HttpsServer.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.value", data.HttpsServer.ValueBool()) + } } if !data.FtpPassiveVariable.IsNull() { @@ -149,8 +153,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.value", false) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.value", data.FtpPassive.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.value", data.FtpPassive.ValueBool()) + } } if !data.DomainLookupVariable.IsNull() { @@ -164,8 +170,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.value", false) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.value", data.DomainLookup.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.value", data.DomainLookup.ValueBool()) + } } if !data.ArpProxyVariable.IsNull() { @@ -179,8 +187,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.value", false) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.value", data.ArpProxy.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.value", data.ArpProxy.ValueBool()) + } } if !data.RshRcpVariable.IsNull() { @@ -194,8 +204,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.value", false) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.value", data.RshRcp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.value", data.RshRcp.ValueBool()) + } } if !data.LineVtyVariable.IsNull() { @@ -209,8 +221,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.value", false) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.value", data.LineVty.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.value", data.LineVty.ValueBool()) + } } if !data.CdpVariable.IsNull() { @@ -224,8 +238,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.value", true) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.value", data.Cdp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.value", data.Cdp.ValueBool()) + } } if !data.LldpVariable.IsNull() { @@ -239,8 +255,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.value", true) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.value", data.Lldp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.value", data.Lldp.ValueBool()) + } } if !data.SourceInterfaceVariable.IsNull() { @@ -254,8 +272,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpSourceIntrf.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpSourceIntrf.value", data.SourceInterface.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpSourceIntrf.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpSourceIntrf.value", data.SourceInterface.ValueString()) + } } if !data.TcpKeepalivesInVariable.IsNull() { @@ -269,8 +289,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.value", true) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.value", data.TcpKeepalivesIn.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.value", data.TcpKeepalivesIn.ValueBool()) + } } if !data.TcpKeepalivesOutVariable.IsNull() { @@ -284,8 +306,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.value", true) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.value", data.TcpKeepalivesOut.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.value", data.TcpKeepalivesOut.ValueBool()) + } } if !data.TcpSmallServersVariable.IsNull() { @@ -299,8 +323,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.value", false) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.value", data.TcpSmallServers.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.value", data.TcpSmallServers.ValueBool()) + } } if !data.UdpSmallServersVariable.IsNull() { @@ -314,8 +340,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.value", false) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.value", data.UdpSmallServers.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.value", data.UdpSmallServers.ValueBool()) + } } if !data.ConsoleLoggingVariable.IsNull() { @@ -329,8 +357,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.value", true) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.value", data.ConsoleLogging.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.value", data.ConsoleLogging.ValueBool()) + } } if !data.IpSourceRoutingVariable.IsNull() { @@ -344,8 +374,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.value", false) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.value", data.IpSourceRouting.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.value", data.IpSourceRouting.ValueBool()) + } } if !data.VtyLineLoggingVariable.IsNull() { @@ -359,8 +391,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.value", false) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.value", data.VtyLineLogging.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.value", data.VtyLineLogging.ValueBool()) + } } if !data.SnmpIfindexPersistVariable.IsNull() { @@ -374,8 +408,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.value", true) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.value", data.SnmpIfindexPersist.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.value", data.SnmpIfindexPersist.ValueBool()) + } } if !data.IgnoreBootpVariable.IsNull() { @@ -389,8 +425,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.value", true) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.value", data.IgnoreBootp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.value", data.IgnoreBootp.ValueBool()) + } } if !data.Nat64UdpTimeoutVariable.IsNull() { @@ -404,8 +442,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.value", 300) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.value", data.Nat64UdpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.value", data.Nat64UdpTimeout.ValueInt64()) + } } if !data.Nat64TcpTimeoutVariable.IsNull() { @@ -419,8 +459,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.value", 3600) } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.value", data.Nat64TcpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.value", data.Nat64TcpTimeout.ValueInt64()) + } } if !data.HttpAuthenticationVariable.IsNull() { @@ -434,8 +476,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsHttpAuthentication.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsHttpAuthentication.value", data.HttpAuthentication.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsHttpAuthentication.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsHttpAuthentication.value", data.HttpAuthentication.ValueString()) + } } if !data.SshVersionVariable.IsNull() { @@ -449,8 +493,10 @@ func (data SystemGlobal) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsSSHVersion.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsSSHVersion.value", data.SshVersion.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsSSHVersion.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsSSHVersion.value", data.SshVersion.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_system_ipv4_device_access_profile_parcel.go b/internal/provider/model_sdwan_system_ipv4_device_access_profile_parcel.go index 2ac7681b..cf42210a 100644 --- a/internal/provider/model_sdwan_system_ipv4_device_access_profile_parcel.go +++ b/internal/provider/model_sdwan_system_ipv4_device_access_profile_parcel.go @@ -85,32 +85,44 @@ func (data SystemIPv4DeviceAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"defaultAction.value", "drop") } } else { - body, _ = sjson.Set(body, path+"defaultAction.optionType", "global") - body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString()) + if true { + body, _ = sjson.Set(body, path+"defaultAction.optionType", "global") + body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString()) + } } if true { body, _ = sjson.Set(body, path+"sequences", []interface{}{}) for _, item := range data.Sequences { itemBody := "" if !item.Id.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sequenceId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sequenceId.value", item.Id.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "sequenceId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sequenceId.value", item.Id.ValueInt64()) + } } if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString()) + } } if !item.BaseAction.IsNull() { - itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "baseAction.value", item.BaseAction.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "baseAction.value", item.BaseAction.ValueString()) + } } if !item.DeviceAccessPort.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.value", item.DeviceAccessPort.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.value", item.DeviceAccessPort.ValueInt64()) + } } if !item.DestinationDataPrefixListId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value", item.DestinationDataPrefixListId.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value", item.DestinationDataPrefixListId.ValueString()) + } } if !item.DestinationIpPrefixListVariable.IsNull() { @@ -119,20 +131,26 @@ func (data SystemIPv4DeviceAccess) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", item.DestinationIpPrefixListVariable.ValueString()) } } else if !item.DestinationIpPrefixList.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "global") - var values []string - item.DestinationIpPrefixList.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", values) + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "global") + var values []string + item.DestinationIpPrefixList.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", values) + } } if !item.SourcePorts.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.optionType", "global") - var values []int64 - item.SourcePorts.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.value", values) + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.optionType", "global") + var values []int64 + item.SourcePorts.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.value", values) + } } if !item.SourceDataPrefixListId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value", item.SourceDataPrefixListId.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value", item.SourceDataPrefixListId.ValueString()) + } } if !item.SourceIpPrefixListVariable.IsNull() { @@ -141,10 +159,12 @@ func (data SystemIPv4DeviceAccess) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", item.SourceIpPrefixListVariable.ValueString()) } } else if !item.SourceIpPrefixList.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "global") - var values []string - item.SourceIpPrefixList.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", values) + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "global") + var values []string + item.SourceIpPrefixList.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", values) + } } body, _ = sjson.SetRaw(body, path+"sequences.-1", itemBody) } diff --git a/internal/provider/model_sdwan_system_ipv6_device_access_profile_parcel.go b/internal/provider/model_sdwan_system_ipv6_device_access_profile_parcel.go index 65f70fce..c8598381 100644 --- a/internal/provider/model_sdwan_system_ipv6_device_access_profile_parcel.go +++ b/internal/provider/model_sdwan_system_ipv6_device_access_profile_parcel.go @@ -85,20 +85,26 @@ func (data SystemIPv6DeviceAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"defaultAction.value", "drop") } } else { - body, _ = sjson.Set(body, path+"defaultAction.optionType", "global") - body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString()) + if true { + body, _ = sjson.Set(body, path+"defaultAction.optionType", "global") + body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString()) + } } if true { body, _ = sjson.Set(body, path+"sequences", []interface{}{}) for _, item := range data.Sequences { itemBody := "" if !item.Id.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sequenceId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sequenceId.value", item.Id.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "sequenceId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sequenceId.value", item.Id.ValueInt64()) + } } if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString()) + } } if item.BaseAction.IsNull() { if true { @@ -106,16 +112,22 @@ func (data SystemIPv6DeviceAccess) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "baseAction.value", "accept") } } else { - itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "baseAction.value", item.BaseAction.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "baseAction.value", item.BaseAction.ValueString()) + } } if !item.DeviceAccessPort.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.value", item.DeviceAccessPort.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.value", item.DeviceAccessPort.ValueInt64()) + } } if !item.DestinationDataPrefixListId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value", item.DestinationDataPrefixListId.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value", item.DestinationDataPrefixListId.ValueString()) + } } if !item.DestinationIpPrefixListVariable.IsNull() { @@ -124,20 +136,26 @@ func (data SystemIPv6DeviceAccess) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", item.DestinationIpPrefixListVariable.ValueString()) } } else if !item.DestinationIpPrefixList.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "global") - var values []string - item.DestinationIpPrefixList.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", values) + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "global") + var values []string + item.DestinationIpPrefixList.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", values) + } } if !item.SourcePorts.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.optionType", "global") - var values []int64 - item.SourcePorts.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.value", values) + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.optionType", "global") + var values []int64 + item.SourcePorts.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.value", values) + } } if !item.SourceDataPrefixListId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value", item.SourceDataPrefixListId.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value", item.SourceDataPrefixListId.ValueString()) + } } if !item.SourceIpPrefixListVariable.IsNull() { @@ -146,10 +164,12 @@ func (data SystemIPv6DeviceAccess) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", item.SourceIpPrefixListVariable.ValueString()) } } else if !item.SourceIpPrefixList.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "global") - var values []string - item.SourceIpPrefixList.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", values) + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "global") + var values []string + item.SourceIpPrefixList.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", values) + } } body, _ = sjson.SetRaw(body, path+"sequences.-1", itemBody) } diff --git a/internal/provider/model_sdwan_system_logging_profile_parcel.go b/internal/provider/model_sdwan_system_logging_profile_parcel.go index 5b2f34c1..225c3617 100644 --- a/internal/provider/model_sdwan_system_logging_profile_parcel.go +++ b/internal/provider/model_sdwan_system_logging_profile_parcel.go @@ -126,8 +126,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"disk.diskEnable.value", true) } } else { - body, _ = sjson.Set(body, path+"disk.diskEnable.optionType", "global") - body, _ = sjson.Set(body, path+"disk.diskEnable.value", data.DiskEnable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"disk.diskEnable.optionType", "global") + body, _ = sjson.Set(body, path+"disk.diskEnable.value", data.DiskEnable.ValueBool()) + } } if !data.DiskFileSizeVariable.IsNull() { @@ -141,8 +143,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"disk.file.diskFileSize.value", 10) } } else { - body, _ = sjson.Set(body, path+"disk.file.diskFileSize.optionType", "global") - body, _ = sjson.Set(body, path+"disk.file.diskFileSize.value", data.DiskFileSize.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"disk.file.diskFileSize.optionType", "global") + body, _ = sjson.Set(body, path+"disk.file.diskFileSize.value", data.DiskFileSize.ValueInt64()) + } } if !data.DiskFileRotateVariable.IsNull() { @@ -156,8 +160,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.value", 10) } } else { - body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.optionType", "global") - body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.value", data.DiskFileRotate.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.optionType", "global") + body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.value", data.DiskFileRotate.ValueInt64()) + } } if true { body, _ = sjson.Set(body, path+"tlsProfile", []interface{}{}) @@ -170,8 +176,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "profile.value", item.ProfileVariable.ValueString()) } } else if !item.Profile.IsNull() { - itemBody, _ = sjson.Set(itemBody, "profile.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "profile.value", item.Profile.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "profile.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "profile.value", item.Profile.ValueString()) + } } if !item.TlsVersionVariable.IsNull() { @@ -185,8 +193,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "tlsVersion.value", "TLSv1.1") } } else { - itemBody, _ = sjson.Set(itemBody, "tlsVersion.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlsVersion.value", item.TlsVersion.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "tlsVersion.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlsVersion.value", item.TlsVersion.ValueString()) + } } if true { itemBody, _ = sjson.Set(itemBody, "authType.optionType", "default") @@ -204,10 +214,12 @@ func (data SystemLogging) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.optionType", "global") - var values []string - item.CipherSuites.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.value", values) + if true { + itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.optionType", "global") + var values []string + item.CipherSuites.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.value", values) + } } body, _ = sjson.SetRaw(body, path+"tlsProfile.-1", itemBody) } @@ -223,8 +235,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpVariable.ValueString()) } } else if !item.HostnameIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIp.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIp.ValueString()) + } } if !item.VpnVariable.IsNull() { @@ -238,8 +252,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "vpn.value", 0) } } else { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + } } if !item.SourceInterfaceVariable.IsNull() { @@ -253,8 +269,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + } } if !item.PriorityVariable.IsNull() { @@ -268,8 +286,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "priority.value", "informational") } } else { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueString()) + } } if !item.TlsEnableVariable.IsNull() { @@ -283,8 +303,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnable.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnable.ValueBool()) + } } if !item.TlsPropertiesCustomProfileVariable.IsNull() { @@ -298,8 +320,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfile.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfile.ValueBool()) + } } if !item.TlsPropertiesProfileVariable.IsNull() { @@ -313,8 +337,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfile.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfile.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"server.-1", itemBody) } @@ -330,8 +356,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpVariable.ValueString()) } } else if !item.HostnameIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIp.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIp.ValueString()) + } } if !item.VpnVariable.IsNull() { @@ -345,8 +373,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "vpn.value", 0) } } else { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + } } if !item.SourceInterfaceVariable.IsNull() { @@ -360,8 +390,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + } } if !item.PriorityVariable.IsNull() { @@ -375,8 +407,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "priority.value", "informational") } } else { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueString()) + } } if !item.TlsEnableVariable.IsNull() { @@ -390,8 +424,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnable.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnable.ValueBool()) + } } if !item.TlsPropertiesCustomProfileVariable.IsNull() { @@ -405,8 +441,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfile.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfile.ValueBool()) + } } if !item.TlsPropertiesProfileVariable.IsNull() { @@ -420,8 +458,10 @@ func (data SystemLogging) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfile.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfile.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"ipv6Server.-1", itemBody) } diff --git a/internal/provider/model_sdwan_system_mrf_profile_parcel.go b/internal/provider/model_sdwan_system_mrf_profile_parcel.go index 141915d4..2f25ea8e 100644 --- a/internal/provider/model_sdwan_system_mrf_profile_parcel.go +++ b/internal/provider/model_sdwan_system_mrf_profile_parcel.go @@ -74,8 +74,10 @@ func (data SystemMRF) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"regionId.optionType", "global") - body, _ = sjson.Set(body, path+"regionId.value", data.RegionId.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"regionId.optionType", "global") + body, _ = sjson.Set(body, path+"regionId.value", data.RegionId.ValueInt64()) + } } if !data.SecondaryRegionIdVariable.IsNull() { @@ -89,8 +91,10 @@ func (data SystemMRF) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"secondaryRegion.optionType", "global") - body, _ = sjson.Set(body, path+"secondaryRegion.value", data.SecondaryRegionId.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"secondaryRegion.optionType", "global") + body, _ = sjson.Set(body, path+"secondaryRegion.value", data.SecondaryRegionId.ValueInt64()) + } } if !data.RoleVariable.IsNull() { @@ -104,8 +108,10 @@ func (data SystemMRF) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"role.optionType", "global") - body, _ = sjson.Set(body, path+"role.value", data.Role.ValueString()) + if true { + body, _ = sjson.Set(body, path+"role.optionType", "global") + body, _ = sjson.Set(body, path+"role.value", data.Role.ValueString()) + } } if data.EnableMigrationToMrf.IsNull() { if true { @@ -113,8 +119,10 @@ func (data SystemMRF) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"enableMrfMigration.optionType", "global") - body, _ = sjson.Set(body, path+"enableMrfMigration.value", data.EnableMigrationToMrf.ValueString()) + if true { + body, _ = sjson.Set(body, path+"enableMrfMigration.optionType", "global") + body, _ = sjson.Set(body, path+"enableMrfMigration.value", data.EnableMigrationToMrf.ValueString()) + } } if data.MigrationBgpCommunity.IsNull() { if true { @@ -122,8 +130,10 @@ func (data SystemMRF) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"migrationBgpCommunity.optionType", "global") - body, _ = sjson.Set(body, path+"migrationBgpCommunity.value", data.MigrationBgpCommunity.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"migrationBgpCommunity.optionType", "global") + body, _ = sjson.Set(body, path+"migrationBgpCommunity.value", data.MigrationBgpCommunity.ValueInt64()) + } } return body } diff --git a/internal/provider/model_sdwan_system_ntp_profile_parcel.go b/internal/provider/model_sdwan_system_ntp_profile_parcel.go index bb86e9e6..e9ef90c7 100644 --- a/internal/provider/model_sdwan_system_ntp_profile_parcel.go +++ b/internal/provider/model_sdwan_system_ntp_profile_parcel.go @@ -106,8 +106,10 @@ func (data SystemNTP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpAddressVariable.ValueString()) } } else if !item.HostnameIpAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpAddress.ValueString()) + } } if !item.AuthenticationKeyVariable.IsNull() { @@ -121,8 +123,10 @@ func (data SystemNTP) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "key.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "key.value", item.AuthenticationKey.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "key.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "key.value", item.AuthenticationKey.ValueInt64()) + } } if !item.VpnVariable.IsNull() { @@ -136,8 +140,10 @@ func (data SystemNTP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "vpn.value", 0) } } else { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + } } if !item.NtpVersionVariable.IsNull() { @@ -151,8 +157,10 @@ func (data SystemNTP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "version.value", 4) } } else { - itemBody, _ = sjson.Set(itemBody, "version.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "version.value", item.NtpVersion.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "version.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "version.value", item.NtpVersion.ValueInt64()) + } } if !item.SourceInterfaceVariable.IsNull() { @@ -166,8 +174,10 @@ func (data SystemNTP) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + } } if !item.PreferThisNtpServerVariable.IsNull() { @@ -181,8 +191,10 @@ func (data SystemNTP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefer.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "prefer.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefer.value", item.PreferThisNtpServer.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefer.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefer.value", item.PreferThisNtpServer.ValueBool()) + } } body, _ = sjson.SetRaw(body, path+"server.-1", itemBody) } @@ -198,8 +210,10 @@ func (data SystemNTP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "keyId.value", item.KeyIdVariable.ValueString()) } } else if !item.KeyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "keyId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "keyId.value", item.KeyId.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "keyId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "keyId.value", item.KeyId.ValueInt64()) + } } if !item.Md5ValueVariable.IsNull() { @@ -208,8 +222,10 @@ func (data SystemNTP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "md5Value.value", item.Md5ValueVariable.ValueString()) } } else if !item.Md5Value.IsNull() { - itemBody, _ = sjson.Set(itemBody, "md5Value.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "md5Value.value", item.Md5Value.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "md5Value.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "md5Value.value", item.Md5Value.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"authentication.authenticationKeys.-1", itemBody) } @@ -226,10 +242,12 @@ func (data SystemNTP) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"authentication.trustedKeys.optionType", "global") - var values []int64 - data.TrustedKeys.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"authentication.trustedKeys.value", values) + if true { + body, _ = sjson.Set(body, path+"authentication.trustedKeys.optionType", "global") + var values []int64 + data.TrustedKeys.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"authentication.trustedKeys.value", values) + } } if !data.AuthoritativeNtpServerVariable.IsNull() { @@ -243,8 +261,10 @@ func (data SystemNTP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"leader.enable.value", false) } } else { - body, _ = sjson.Set(body, path+"leader.enable.optionType", "global") - body, _ = sjson.Set(body, path+"leader.enable.value", data.AuthoritativeNtpServer.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"leader.enable.optionType", "global") + body, _ = sjson.Set(body, path+"leader.enable.value", data.AuthoritativeNtpServer.ValueBool()) + } } if !data.StratumVariable.IsNull() { @@ -258,8 +278,10 @@ func (data SystemNTP) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"leader.stratum.optionType", "global") - body, _ = sjson.Set(body, path+"leader.stratum.value", data.Stratum.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"leader.stratum.optionType", "global") + body, _ = sjson.Set(body, path+"leader.stratum.value", data.Stratum.ValueInt64()) + } } if !data.SourceInterfaceVariable.IsNull() { @@ -273,8 +295,10 @@ func (data SystemNTP) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"leader.source.optionType", "global") - body, _ = sjson.Set(body, path+"leader.source.value", data.SourceInterface.ValueString()) + if true { + body, _ = sjson.Set(body, path+"leader.source.optionType", "global") + body, _ = sjson.Set(body, path+"leader.source.value", data.SourceInterface.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_system_omp_profile_parcel.go b/internal/provider/model_sdwan_system_omp_profile_parcel.go index 7b198e11..f84cdaca 100644 --- a/internal/provider/model_sdwan_system_omp_profile_parcel.go +++ b/internal/provider/model_sdwan_system_omp_profile_parcel.go @@ -132,8 +132,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"gracefulRestart.value", true) } } else { - body, _ = sjson.Set(body, path+"gracefulRestart.optionType", "global") - body, _ = sjson.Set(body, path+"gracefulRestart.value", data.GracefulRestart.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"gracefulRestart.optionType", "global") + body, _ = sjson.Set(body, path+"gracefulRestart.value", data.GracefulRestart.ValueBool()) + } } if !data.OverlayAsVariable.IsNull() { @@ -147,8 +149,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"overlayAs.optionType", "global") - body, _ = sjson.Set(body, path+"overlayAs.value", data.OverlayAs.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"overlayAs.optionType", "global") + body, _ = sjson.Set(body, path+"overlayAs.value", data.OverlayAs.ValueInt64()) + } } if !data.PathsAdvertisedPerPrefixVariable.IsNull() { @@ -162,8 +166,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"sendPathLimit.value", 4) } } else { - body, _ = sjson.Set(body, path+"sendPathLimit.optionType", "global") - body, _ = sjson.Set(body, path+"sendPathLimit.value", data.PathsAdvertisedPerPrefix.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"sendPathLimit.optionType", "global") + body, _ = sjson.Set(body, path+"sendPathLimit.value", data.PathsAdvertisedPerPrefix.ValueInt64()) + } } if !data.EcmpLimitVariable.IsNull() { @@ -177,8 +183,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ecmpLimit.value", 4) } } else { - body, _ = sjson.Set(body, path+"ecmpLimit.optionType", "global") - body, _ = sjson.Set(body, path+"ecmpLimit.value", data.EcmpLimit.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ecmpLimit.optionType", "global") + body, _ = sjson.Set(body, path+"ecmpLimit.value", data.EcmpLimit.ValueInt64()) + } } if !data.ShutdownVariable.IsNull() { @@ -192,8 +200,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"shutdown.value", false) } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.OmpAdminDistanceIpv4Variable.IsNull() { @@ -207,8 +217,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.value", 251) } } else { - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.optionType", "global") - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.value", data.OmpAdminDistanceIpv4.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.optionType", "global") + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.value", data.OmpAdminDistanceIpv4.ValueInt64()) + } } if !data.OmpAdminDistanceIpv6Variable.IsNull() { @@ -222,8 +234,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", 251) } } else { - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", data.OmpAdminDistanceIpv6.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", data.OmpAdminDistanceIpv6.ValueInt64()) + } } if !data.AdvertisementIntervalVariable.IsNull() { @@ -237,8 +251,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advertisementInterval.value", 1) } } else { - body, _ = sjson.Set(body, path+"advertisementInterval.optionType", "global") - body, _ = sjson.Set(body, path+"advertisementInterval.value", data.AdvertisementInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advertisementInterval.optionType", "global") + body, _ = sjson.Set(body, path+"advertisementInterval.value", data.AdvertisementInterval.ValueInt64()) + } } if !data.GracefulRestartTimerVariable.IsNull() { @@ -252,8 +268,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"gracefulRestartTimer.value", 43200) } } else { - body, _ = sjson.Set(body, path+"gracefulRestartTimer.optionType", "global") - body, _ = sjson.Set(body, path+"gracefulRestartTimer.value", data.GracefulRestartTimer.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"gracefulRestartTimer.optionType", "global") + body, _ = sjson.Set(body, path+"gracefulRestartTimer.value", data.GracefulRestartTimer.ValueInt64()) + } } if !data.EorTimerVariable.IsNull() { @@ -267,8 +285,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"eorTimer.value", 300) } } else { - body, _ = sjson.Set(body, path+"eorTimer.optionType", "global") - body, _ = sjson.Set(body, path+"eorTimer.value", data.EorTimer.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"eorTimer.optionType", "global") + body, _ = sjson.Set(body, path+"eorTimer.value", data.EorTimer.ValueInt64()) + } } if !data.HoldtimeVariable.IsNull() { @@ -282,8 +302,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"holdtime.value", 60) } } else { - body, _ = sjson.Set(body, path+"holdtime.optionType", "global") - body, _ = sjson.Set(body, path+"holdtime.value", data.Holdtime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"holdtime.optionType", "global") + body, _ = sjson.Set(body, path+"holdtime.value", data.Holdtime.ValueInt64()) + } } if !data.AdvertiseIpv4BgpVariable.IsNull() { @@ -297,8 +319,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.value", false) } } else { - body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.value", data.AdvertiseIpv4Bgp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.value", data.AdvertiseIpv4Bgp.ValueBool()) + } } if !data.AdvertiseIpv4OspfVariable.IsNull() { @@ -312,8 +336,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.value", false) } } else { - body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.value", data.AdvertiseIpv4Ospf.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.value", data.AdvertiseIpv4Ospf.ValueBool()) + } } if !data.AdvertiseIpv4OspfV3Variable.IsNull() { @@ -327,8 +353,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.value", false) } } else { - body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.value", data.AdvertiseIpv4OspfV3.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.value", data.AdvertiseIpv4OspfV3.ValueBool()) + } } if !data.AdvertiseIpv4ConnectedVariable.IsNull() { @@ -342,8 +370,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advertiseIpv4.connected.value", true) } } else { - body, _ = sjson.Set(body, path+"advertiseIpv4.connected.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv4.connected.value", data.AdvertiseIpv4Connected.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.connected.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv4.connected.value", data.AdvertiseIpv4Connected.ValueBool()) + } } if !data.AdvertiseIpv4StaticVariable.IsNull() { @@ -357,8 +387,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advertiseIpv4.static.value", true) } } else { - body, _ = sjson.Set(body, path+"advertiseIpv4.static.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv4.static.value", data.AdvertiseIpv4Static.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.static.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv4.static.value", data.AdvertiseIpv4Static.ValueBool()) + } } if !data.AdvertiseIpv4EigrpVariable.IsNull() { @@ -372,8 +404,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.value", false) } } else { - body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.value", data.AdvertiseIpv4Eigrp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.value", data.AdvertiseIpv4Eigrp.ValueBool()) + } } if !data.AdvertiseIpv4LispVariable.IsNull() { @@ -387,8 +421,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.value", false) } } else { - body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.value", data.AdvertiseIpv4Lisp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.value", data.AdvertiseIpv4Lisp.ValueBool()) + } } if !data.AdvertiseIpv4IsisVariable.IsNull() { @@ -402,8 +438,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advertiseIpv4.isis.value", false) } } else { - body, _ = sjson.Set(body, path+"advertiseIpv4.isis.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv4.isis.value", data.AdvertiseIpv4Isis.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.isis.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv4.isis.value", data.AdvertiseIpv4Isis.ValueBool()) + } } if !data.AdvertiseIpv6BgpVariable.IsNull() { @@ -417,8 +455,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.value", false) } } else { - body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.value", data.AdvertiseIpv6Bgp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.value", data.AdvertiseIpv6Bgp.ValueBool()) + } } if !data.AdvertiseIpv6OspfVariable.IsNull() { @@ -432,8 +472,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.value", false) } } else { - body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.value", data.AdvertiseIpv6Ospf.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.value", data.AdvertiseIpv6Ospf.ValueBool()) + } } if !data.AdvertiseIpv6ConnectedVariable.IsNull() { @@ -447,8 +489,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advertiseIpv6.connected.value", false) } } else { - body, _ = sjson.Set(body, path+"advertiseIpv6.connected.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv6.connected.value", data.AdvertiseIpv6Connected.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.connected.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv6.connected.value", data.AdvertiseIpv6Connected.ValueBool()) + } } if !data.AdvertiseIpv6StaticVariable.IsNull() { @@ -462,8 +506,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advertiseIpv6.static.value", false) } } else { - body, _ = sjson.Set(body, path+"advertiseIpv6.static.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv6.static.value", data.AdvertiseIpv6Static.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.static.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv6.static.value", data.AdvertiseIpv6Static.ValueBool()) + } } if !data.AdvertiseIpv6EigrpVariable.IsNull() { @@ -477,8 +523,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.value", false) } } else { - body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.value", data.AdvertiseIpv6Eigrp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.value", data.AdvertiseIpv6Eigrp.ValueBool()) + } } if !data.AdvertiseIpv6LispVariable.IsNull() { @@ -492,8 +540,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.value", false) } } else { - body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.value", data.AdvertiseIpv6Lisp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.value", data.AdvertiseIpv6Lisp.ValueBool()) + } } if !data.AdvertiseIpv6IsisVariable.IsNull() { @@ -507,8 +557,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advertiseIpv6.isis.value", false) } } else { - body, _ = sjson.Set(body, path+"advertiseIpv6.isis.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv6.isis.value", data.AdvertiseIpv6Isis.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.isis.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv6.isis.value", data.AdvertiseIpv6Isis.ValueBool()) + } } if !data.IgnoreRegionPathLengthVariable.IsNull() { @@ -522,8 +574,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ignoreRegionPathLength.value", false) } } else { - body, _ = sjson.Set(body, path+"ignoreRegionPathLength.optionType", "global") - body, _ = sjson.Set(body, path+"ignoreRegionPathLength.value", data.IgnoreRegionPathLength.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"ignoreRegionPathLength.optionType", "global") + body, _ = sjson.Set(body, path+"ignoreRegionPathLength.value", data.IgnoreRegionPathLength.ValueBool()) + } } if !data.TransportGatewayVariable.IsNull() { @@ -537,8 +591,10 @@ func (data SystemOMP) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"transportGateway.optionType", "global") - body, _ = sjson.Set(body, path+"transportGateway.value", data.TransportGateway.ValueString()) + if true { + body, _ = sjson.Set(body, path+"transportGateway.optionType", "global") + body, _ = sjson.Set(body, path+"transportGateway.value", data.TransportGateway.ValueString()) + } } if !data.SiteTypesVariable.IsNull() { @@ -552,10 +608,12 @@ func (data SystemOMP) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"siteTypes.optionType", "global") - var values []string - data.SiteTypes.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"siteTypes.value", values) + if true { + body, _ = sjson.Set(body, path+"siteTypes.optionType", "global") + var values []string + data.SiteTypes.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"siteTypes.value", values) + } } return body } diff --git a/internal/provider/model_sdwan_system_performance_monitoring_profile_parcel.go b/internal/provider/model_sdwan_system_performance_monitoring_profile_parcel.go index f6f4eebb..ee861221 100644 --- a/internal/provider/model_sdwan_system_performance_monitoring_profile_parcel.go +++ b/internal/provider/model_sdwan_system_performance_monitoring_profile_parcel.go @@ -74,14 +74,18 @@ func (data SystemPerformanceMonitoring) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"appPerfMonitorConfig.enabled.value", false) } } else { - body, _ = sjson.Set(body, path+"appPerfMonitorConfig.enabled.optionType", "global") - body, _ = sjson.Set(body, path+"appPerfMonitorConfig.enabled.value", data.AppPerfMonitorEnabled.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"appPerfMonitorConfig.enabled.optionType", "global") + body, _ = sjson.Set(body, path+"appPerfMonitorConfig.enabled.value", data.AppPerfMonitorEnabled.ValueBool()) + } } if !data.AppPerfMonitorAppGroup.IsNull() { - body, _ = sjson.Set(body, path+"appPerfMonitorConfig.policyFilters.appGroups.optionType", "global") - var values []string - data.AppPerfMonitorAppGroup.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"appPerfMonitorConfig.policyFilters.appGroups.value", values) + if true { + body, _ = sjson.Set(body, path+"appPerfMonitorConfig.policyFilters.appGroups.optionType", "global") + var values []string + data.AppPerfMonitorAppGroup.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"appPerfMonitorConfig.policyFilters.appGroups.value", values) + } } if data.MonitoringConfigEnabled.IsNull() { if true { @@ -89,12 +93,16 @@ func (data SystemPerformanceMonitoring) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.enabled.value", false) } } else { - body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.enabled.optionType", "global") - body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.enabled.value", data.MonitoringConfigEnabled.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.enabled.optionType", "global") + body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.enabled.value", data.MonitoringConfigEnabled.ValueBool()) + } } if !data.MonitoringConfigInterval.IsNull() { - body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.interval.optionType", "global") - body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.interval.value", data.MonitoringConfigInterval.ValueString()) + if true { + body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.interval.optionType", "global") + body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.interval.value", data.MonitoringConfigInterval.ValueString()) + } } if data.EventDrivenConfigEnabled.IsNull() { if true { @@ -102,14 +110,18 @@ func (data SystemPerformanceMonitoring) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.enabled.value", false) } } else { - body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.enabled.optionType", "global") - body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.enabled.value", data.EventDrivenConfigEnabled.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.enabled.optionType", "global") + body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.enabled.value", data.EventDrivenConfigEnabled.ValueBool()) + } } if !data.EventDrivenEvents.IsNull() { - body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.events.optionType", "global") - var values []string - data.EventDrivenEvents.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.events.value", values) + if true { + body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.events.optionType", "global") + var values []string + data.EventDrivenEvents.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.events.value", values) + } } return body } diff --git a/internal/provider/model_sdwan_system_remote_access_profile_parcel.go b/internal/provider/model_sdwan_system_remote_access_profile_parcel.go index 64981b67..7776969b 100644 --- a/internal/provider/model_sdwan_system_remote_access_profile_parcel.go +++ b/internal/provider/model_sdwan_system_remote_access_profile_parcel.go @@ -107,12 +107,16 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"enableSSLVPN.value", false) } } else { - body, _ = sjson.Set(body, path+"enableSSLVPN.optionType", "global") - body, _ = sjson.Set(body, path+"enableSSLVPN.value", data.ConnectionTypeSsl.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"enableSSLVPN.optionType", "global") + body, _ = sjson.Set(body, path+"enableSSLVPN.value", data.ConnectionTypeSsl.ValueBool()) + } } if !data.AnyConnectEapAuthenticationType.IsNull() { - body, _ = sjson.Set(body, path+"anyConnectEapAuth.optionType", "global") - body, _ = sjson.Set(body, path+"anyConnectEapAuth.value", data.AnyConnectEapAuthenticationType.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"anyConnectEapAuth.optionType", "global") + body, _ = sjson.Set(body, path+"anyConnectEapAuth.value", data.AnyConnectEapAuthenticationType.ValueString()) + } } if !data.Ipv4PoolSizeVariable.IsNull() { @@ -126,8 +130,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ipv4PoolSize.value", 1000) } } else { - body, _ = sjson.Set(body, path+"ipv4PoolSize.optionType", "global") - body, _ = sjson.Set(body, path+"ipv4PoolSize.value", data.Ipv4PoolSize.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ipv4PoolSize.optionType", "global") + body, _ = sjson.Set(body, path+"ipv4PoolSize.value", data.Ipv4PoolSize.ValueInt64()) + } } if !data.Ipv6PoolSizeVariable.IsNull() { @@ -141,8 +147,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ipv6PoolSize.value", 1024) } } else { - body, _ = sjson.Set(body, path+"ipv6PoolSize.optionType", "global") - body, _ = sjson.Set(body, path+"ipv6PoolSize.value", data.Ipv6PoolSize.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ipv6PoolSize.optionType", "global") + body, _ = sjson.Set(body, path+"ipv6PoolSize.value", data.Ipv6PoolSize.ValueInt64()) + } } if !data.EnableCertificateListCheckVariable.IsNull() { @@ -156,8 +164,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"enableCrlCheck.value", false) } } else { - body, _ = sjson.Set(body, path+"enableCrlCheck.optionType", "global") - body, _ = sjson.Set(body, path+"enableCrlCheck.value", data.EnableCertificateListCheck.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"enableCrlCheck.optionType", "global") + body, _ = sjson.Set(body, path+"enableCrlCheck.value", data.EnableCertificateListCheck.ValueBool()) + } } if !data.PskAuthenticationTypeVariable.IsNull() { @@ -171,8 +181,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"pskAuth.pskSelection.optionType", "global") - body, _ = sjson.Set(body, path+"pskAuth.pskSelection.value", data.PskAuthenticationType.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"pskAuth.pskSelection.optionType", "global") + body, _ = sjson.Set(body, path+"pskAuth.pskSelection.value", data.PskAuthenticationType.ValueString()) + } } if !data.PskAuthenticationPreSharedKeyVariable.IsNull() { @@ -181,8 +193,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"pskAuth.preSharedKey.value", data.PskAuthenticationPreSharedKeyVariable.ValueString()) } } else if !data.PskAuthenticationPreSharedKey.IsNull() { - body, _ = sjson.Set(body, path+"pskAuth.preSharedKey.optionType", "global") - body, _ = sjson.Set(body, path+"pskAuth.preSharedKey.value", data.PskAuthenticationPreSharedKey.ValueString()) + if true && data.PskAuthenticationType.ValueString() == "group" { + body, _ = sjson.Set(body, path+"pskAuth.preSharedKey.optionType", "global") + body, _ = sjson.Set(body, path+"pskAuth.preSharedKey.value", data.PskAuthenticationPreSharedKey.ValueString()) + } } if !data.RadiusGroupNameVariable.IsNull() { @@ -191,8 +205,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"radiusGroupName.value", data.RadiusGroupNameVariable.ValueString()) } } else if !data.RadiusGroupName.IsNull() { - body, _ = sjson.Set(body, path+"radiusGroupName.optionType", "global") - body, _ = sjson.Set(body, path+"radiusGroupName.value", data.RadiusGroupName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"radiusGroupName.optionType", "global") + body, _ = sjson.Set(body, path+"radiusGroupName.value", data.RadiusGroupName.ValueString()) + } } if !data.AaaSpecifyNamePolicyNameVariable.IsNull() { @@ -201,8 +217,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.policyName.value", data.AaaSpecifyNamePolicyNameVariable.ValueString()) } } else if !data.AaaSpecifyNamePolicyName.IsNull() { - body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.policyName.optionType", "global") - body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.policyName.value", data.AaaSpecifyNamePolicyName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.policyName.optionType", "global") + body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.policyName.value", data.AaaSpecifyNamePolicyName.ValueString()) + } } if !data.AaaSpecifyNamePolicyPasswordVariable.IsNull() { @@ -211,8 +229,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.password.value", data.AaaSpecifyNamePolicyPasswordVariable.ValueString()) } } else if !data.AaaSpecifyNamePolicyPassword.IsNull() { - body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.password.optionType", "global") - body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.password.value", data.AaaSpecifyNamePolicyPassword.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.password.optionType", "global") + body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.password.value", data.AaaSpecifyNamePolicyPassword.ValueString()) + } } if !data.AaaDeriveNameFromPeerIdentityVariable.IsNull() { @@ -221,8 +241,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameIdentity.value", data.AaaDeriveNameFromPeerIdentityVariable.ValueString()) } } else if !data.AaaDeriveNameFromPeerIdentity.IsNull() { - body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameIdentity.optionType", "global") - body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameIdentity.value", data.AaaDeriveNameFromPeerIdentity.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameIdentity.optionType", "global") + body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameIdentity.value", data.AaaDeriveNameFromPeerIdentity.ValueString()) + } } if !data.AaaDeriveNameFromPeerDomainVariable.IsNull() { @@ -231,8 +253,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameDomain.value", data.AaaDeriveNameFromPeerDomainVariable.ValueString()) } } else if !data.AaaDeriveNameFromPeerDomain.IsNull() { - body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameDomain.optionType", "global") - body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameDomain.value", data.AaaDeriveNameFromPeerDomain.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameDomain.optionType", "global") + body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameDomain.value", data.AaaDeriveNameFromPeerDomain.ValueString()) + } } if !data.AaaEnableAccountingVariable.IsNull() { @@ -246,8 +270,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"enableAccounting.value", true) } } else { - body, _ = sjson.Set(body, path+"enableAccounting.optionType", "global") - body, _ = sjson.Set(body, path+"enableAccounting.value", data.AaaEnableAccounting.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"enableAccounting.optionType", "global") + body, _ = sjson.Set(body, path+"enableAccounting.value", data.AaaEnableAccounting.ValueBool()) + } } if !data.Ikev2LocalIkeIdentityTypeVariable.IsNull() { @@ -261,8 +287,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"localIkev2IdentityType.optionType", "global") - body, _ = sjson.Set(body, path+"localIkev2IdentityType.value", data.Ikev2LocalIkeIdentityType.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"localIkev2IdentityType.optionType", "global") + body, _ = sjson.Set(body, path+"localIkev2IdentityType.value", data.Ikev2LocalIkeIdentityType.ValueString()) + } } if !data.Ikev2LocalIkeIdentityValueVariable.IsNull() { @@ -276,8 +304,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"localIkev2IdentityValue.optionType", "global") - body, _ = sjson.Set(body, path+"localIkev2IdentityValue.value", data.Ikev2LocalIkeIdentityValue.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"localIkev2IdentityValue.optionType", "global") + body, _ = sjson.Set(body, path+"localIkev2IdentityValue.value", data.Ikev2LocalIkeIdentityValue.ValueString()) + } } if !data.Ikev2SecurityAssociationLifetimeVariable.IsNull() { @@ -291,8 +321,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ikev2SaLifetime.value", 86400) } } else { - body, _ = sjson.Set(body, path+"ikev2SaLifetime.optionType", "global") - body, _ = sjson.Set(body, path+"ikev2SaLifetime.value", data.Ikev2SecurityAssociationLifetime.ValueInt64()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"ikev2SaLifetime.optionType", "global") + body, _ = sjson.Set(body, path+"ikev2SaLifetime.value", data.Ikev2SecurityAssociationLifetime.ValueInt64()) + } } if !data.Ikev2AntiDosThresholdVariable.IsNull() { @@ -306,8 +338,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"antiDosThreshold.value", 100) } } else { - body, _ = sjson.Set(body, path+"antiDosThreshold.optionType", "global") - body, _ = sjson.Set(body, path+"antiDosThreshold.value", data.Ikev2AntiDosThreshold.ValueInt64()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"antiDosThreshold.optionType", "global") + body, _ = sjson.Set(body, path+"antiDosThreshold.value", data.Ikev2AntiDosThreshold.ValueInt64()) + } } if !data.IpsecEnableAntiReplayVariable.IsNull() { @@ -321,8 +355,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"enableAntiReplay.value", true) } } else { - body, _ = sjson.Set(body, path+"enableAntiReplay.optionType", "global") - body, _ = sjson.Set(body, path+"enableAntiReplay.value", data.IpsecEnableAntiReplay.ValueBool()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"enableAntiReplay.optionType", "global") + body, _ = sjson.Set(body, path+"enableAntiReplay.value", data.IpsecEnableAntiReplay.ValueBool()) + } } if !data.IpsecAntiReplayWindowSizeVariable.IsNull() { @@ -336,8 +372,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"antiReplayWindowSize.value", 64) } } else { - body, _ = sjson.Set(body, path+"antiReplayWindowSize.optionType", "global") - body, _ = sjson.Set(body, path+"antiReplayWindowSize.value", data.IpsecAntiReplayWindowSize.ValueInt64()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"antiReplayWindowSize.optionType", "global") + body, _ = sjson.Set(body, path+"antiReplayWindowSize.value", data.IpsecAntiReplayWindowSize.ValueInt64()) + } } if !data.IpsecSecurityAssociationLifetimeVariable.IsNull() { @@ -351,8 +389,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ipSecSaLifetime.value", 3600) } } else { - body, _ = sjson.Set(body, path+"ipSecSaLifetime.optionType", "global") - body, _ = sjson.Set(body, path+"ipSecSaLifetime.value", data.IpsecSecurityAssociationLifetime.ValueInt64()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"ipSecSaLifetime.optionType", "global") + body, _ = sjson.Set(body, path+"ipSecSaLifetime.value", data.IpsecSecurityAssociationLifetime.ValueInt64()) + } } if !data.IpsecEnablePerfectFowardSecrecyVariable.IsNull() { @@ -366,8 +406,10 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"enablePFS.value", false) } } else { - body, _ = sjson.Set(body, path+"enablePFS.optionType", "global") - body, _ = sjson.Set(body, path+"enablePFS.value", data.IpsecEnablePerfectFowardSecrecy.ValueBool()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"enablePFS.optionType", "global") + body, _ = sjson.Set(body, path+"enablePFS.value", data.IpsecEnablePerfectFowardSecrecy.ValueBool()) + } } return body } diff --git a/internal/provider/model_sdwan_system_security_profile_parcel.go b/internal/provider/model_sdwan_system_security_profile_parcel.go index 49b5206c..b33895e2 100644 --- a/internal/provider/model_sdwan_system_security_profile_parcel.go +++ b/internal/provider/model_sdwan_system_security_profile_parcel.go @@ -124,8 +124,10 @@ func (data SystemSecurity) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"rekey.value", 86400) } } else { - body, _ = sjson.Set(body, path+"rekey.optionType", "global") - body, _ = sjson.Set(body, path+"rekey.value", data.Rekey.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"rekey.optionType", "global") + body, _ = sjson.Set(body, path+"rekey.value", data.Rekey.ValueInt64()) + } } if !data.AntiReplayWindowVariable.IsNull() { @@ -139,8 +141,10 @@ func (data SystemSecurity) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"replayWindow.value", "512") } } else { - body, _ = sjson.Set(body, path+"replayWindow.optionType", "global") - body, _ = sjson.Set(body, path+"replayWindow.value", data.AntiReplayWindow.ValueString()) + if true { + body, _ = sjson.Set(body, path+"replayWindow.optionType", "global") + body, _ = sjson.Set(body, path+"replayWindow.value", data.AntiReplayWindow.ValueString()) + } } if !data.ExtendedAntiReplayWindowVariable.IsNull() { @@ -154,8 +158,10 @@ func (data SystemSecurity) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"extendedArWindow.value", 256) } } else { - body, _ = sjson.Set(body, path+"extendedArWindow.optionType", "global") - body, _ = sjson.Set(body, path+"extendedArWindow.value", data.ExtendedAntiReplayWindow.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"extendedArWindow.optionType", "global") + body, _ = sjson.Set(body, path+"extendedArWindow.value", data.ExtendedAntiReplayWindow.ValueInt64()) + } } if !data.IpsecPairwiseKeyingVariable.IsNull() { @@ -169,8 +175,10 @@ func (data SystemSecurity) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"pairwiseKeying.value", false) } } else { - body, _ = sjson.Set(body, path+"pairwiseKeying.optionType", "global") - body, _ = sjson.Set(body, path+"pairwiseKeying.value", data.IpsecPairwiseKeying.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"pairwiseKeying.optionType", "global") + body, _ = sjson.Set(body, path+"pairwiseKeying.value", data.IpsecPairwiseKeying.ValueBool()) + } } if !data.IntegrityTypeVariable.IsNull() { @@ -179,22 +187,28 @@ func (data SystemSecurity) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"integrityType.value", data.IntegrityTypeVariable.ValueString()) } } else if !data.IntegrityType.IsNull() { - body, _ = sjson.Set(body, path+"integrityType.optionType", "global") - var values []string - data.IntegrityType.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"integrityType.value", values) + if true { + body, _ = sjson.Set(body, path+"integrityType.optionType", "global") + var values []string + data.IntegrityType.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"integrityType.value", values) + } } if true { body, _ = sjson.Set(body, path+"keychain", []interface{}{}) for _, item := range data.Keychains { itemBody := "" if !item.KeyChainName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.KeyChainName.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.KeyChainName.ValueString()) + } } if !item.KeyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "id.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "id.value", item.KeyId.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "id.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "id.value", item.KeyId.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"keychain.-1", itemBody) } @@ -204,12 +218,16 @@ func (data SystemSecurity) toBody(ctx context.Context) string { for _, item := range data.Keys { itemBody := "" if !item.Id.IsNull() { - itemBody, _ = sjson.Set(itemBody, "id.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "id.value", item.Id.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "id.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "id.value", item.Id.ValueInt64()) + } } if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + } } if !item.SendIdVariable.IsNull() { @@ -218,8 +236,10 @@ func (data SystemSecurity) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sendId.value", item.SendIdVariable.ValueString()) } } else if !item.SendId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendId.value", item.SendId.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "sendId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendId.value", item.SendId.ValueInt64()) + } } if !item.ReceiverIdVariable.IsNull() { @@ -228,8 +248,10 @@ func (data SystemSecurity) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "recvId.value", item.ReceiverIdVariable.ValueString()) } } else if !item.ReceiverId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "recvId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "recvId.value", item.ReceiverId.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "recvId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "recvId.value", item.ReceiverId.ValueInt64()) + } } if !item.IncludeTcpOptionsVariable.IsNull() { @@ -243,8 +265,10 @@ func (data SystemSecurity) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.value", item.IncludeTcpOptions.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.value", item.IncludeTcpOptions.ValueBool()) + } } if !item.AcceptAoMismatchVariable.IsNull() { @@ -258,12 +282,16 @@ func (data SystemSecurity) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.value", item.AcceptAoMismatch.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.value", item.AcceptAoMismatch.ValueBool()) + } } if !item.CryptoAlgorithm.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tcp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tcp.value", item.CryptoAlgorithm.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "tcp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tcp.value", item.CryptoAlgorithm.ValueString()) + } } if !item.KeyStringVariable.IsNull() { @@ -272,8 +300,10 @@ func (data SystemSecurity) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "keyString.value", item.KeyStringVariable.ValueString()) } } else if !item.KeyString.IsNull() { - itemBody, _ = sjson.Set(itemBody, "keyString.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "keyString.value", item.KeyString.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "keyString.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "keyString.value", item.KeyString.ValueString()) + } } if !item.SendLifeTimeLocalVariable.IsNull() { @@ -287,12 +317,16 @@ func (data SystemSecurity) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.value", item.SendLifeTimeLocal.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.value", item.SendLifeTimeLocal.ValueBool()) + } } if !item.SendLifeTimeStartEpoch.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendLifetime.startEpoch.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendLifetime.startEpoch.value", item.SendLifeTimeStartEpoch.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "sendLifetime.startEpoch.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendLifetime.startEpoch.value", item.SendLifeTimeStartEpoch.ValueInt64()) + } } if !item.SendLifeTimeInfiniteVariable.IsNull() { @@ -301,8 +335,10 @@ func (data SystemSecurity) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.value", item.SendLifeTimeInfiniteVariable.ValueString()) } } else if !item.SendLifeTimeInfinite.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.value", item.SendLifeTimeInfinite.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.value", item.SendLifeTimeInfinite.ValueBool()) + } } if !item.SendLifeTimeDurationVariable.IsNull() { @@ -311,12 +347,16 @@ func (data SystemSecurity) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.value", item.SendLifeTimeDurationVariable.ValueString()) } } else if !item.SendLifeTimeDuration.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.value", item.SendLifeTimeDuration.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.value", item.SendLifeTimeDuration.ValueInt64()) + } } if !item.SendLifeTimeExact.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.exact.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.exact.value", item.SendLifeTimeExact.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.exact.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.exact.value", item.SendLifeTimeExact.ValueInt64()) + } } if !item.AcceptLifeTimeLocalVariable.IsNull() { @@ -330,12 +370,16 @@ func (data SystemSecurity) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.value", item.AcceptLifeTimeLocal.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.value", item.AcceptLifeTimeLocal.ValueBool()) + } } if !item.AcceptLifeTimeStartEpoch.IsNull() { - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.startEpoch.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.startEpoch.value", item.AcceptLifeTimeStartEpoch.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.startEpoch.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.startEpoch.value", item.AcceptLifeTimeStartEpoch.ValueInt64()) + } } if !item.AcceptLifeTimeInfiniteVariable.IsNull() { @@ -344,8 +388,10 @@ func (data SystemSecurity) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.value", item.AcceptLifeTimeInfiniteVariable.ValueString()) } } else if !item.AcceptLifeTimeInfinite.IsNull() { - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.value", item.AcceptLifeTimeInfinite.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.value", item.AcceptLifeTimeInfinite.ValueBool()) + } } if !item.AcceptLifeTimeDurationVariable.IsNull() { @@ -354,12 +400,16 @@ func (data SystemSecurity) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.value", item.AcceptLifeTimeDurationVariable.ValueString()) } } else if !item.AcceptLifeTimeDuration.IsNull() { - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.value", item.AcceptLifeTimeDuration.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.value", item.AcceptLifeTimeDuration.ValueInt64()) + } } if !item.AcceptLifeTimeExact.IsNull() { - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.exact.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.exact.value", item.AcceptLifeTimeExact.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.exact.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.exact.value", item.AcceptLifeTimeExact.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"key.-1", itemBody) } diff --git a/internal/provider/model_sdwan_system_snmp_profile_parcel.go b/internal/provider/model_sdwan_system_snmp_profile_parcel.go index b28487ae..f6a53f24 100644 --- a/internal/provider/model_sdwan_system_snmp_profile_parcel.go +++ b/internal/provider/model_sdwan_system_snmp_profile_parcel.go @@ -141,8 +141,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"shutdown.value", false) } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.ContactPersonVariable.IsNull() { @@ -156,8 +158,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"contact.optionType", "global") - body, _ = sjson.Set(body, path+"contact.value", data.ContactPerson.ValueString()) + if true { + body, _ = sjson.Set(body, path+"contact.optionType", "global") + body, _ = sjson.Set(body, path+"contact.value", data.ContactPerson.ValueString()) + } } if !data.LocationOfDeviceVariable.IsNull() { @@ -171,16 +175,20 @@ func (data SystemSNMP) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"location.optionType", "global") - body, _ = sjson.Set(body, path+"location.value", data.LocationOfDevice.ValueString()) + if true { + body, _ = sjson.Set(body, path+"location.optionType", "global") + body, _ = sjson.Set(body, path+"location.value", data.LocationOfDevice.ValueString()) + } } if true { body, _ = sjson.Set(body, path+"view", []interface{}{}) for _, item := range data.Views { itemBody := "" if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + } } if true { itemBody, _ = sjson.Set(itemBody, "oid", []interface{}{}) @@ -193,8 +201,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "id.value", childItem.IdVariable.ValueString()) } } else if !childItem.Id.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "id.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "id.value", childItem.Id.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "id.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "id.value", childItem.Id.ValueString()) + } } if !childItem.ExcludeVariable.IsNull() { @@ -208,8 +218,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "exclude.value", false) } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "exclude.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "exclude.value", childItem.Exclude.ValueBool()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "exclude.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "exclude.value", childItem.Exclude.ValueBool()) + } } itemBody, _ = sjson.SetRaw(itemBody, "oid.-1", itemChildBody) } @@ -222,12 +234,16 @@ func (data SystemSNMP) toBody(ctx context.Context) string { for _, item := range data.Communities { itemBody := "" if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + } } if !item.UserLabel.IsNull() { - itemBody, _ = sjson.Set(itemBody, "userLabel.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "userLabel.value", item.UserLabel.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "userLabel.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "userLabel.value", item.UserLabel.ValueString()) + } } if !item.ViewVariable.IsNull() { @@ -236,8 +252,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "view.value", item.ViewVariable.ValueString()) } } else if !item.View.IsNull() { - itemBody, _ = sjson.Set(itemBody, "view.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "view.value", item.View.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "view.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "view.value", item.View.ValueString()) + } } if !item.AuthorizationVariable.IsNull() { @@ -246,8 +264,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "authorization.value", item.AuthorizationVariable.ValueString()) } } else if !item.Authorization.IsNull() { - itemBody, _ = sjson.Set(itemBody, "authorization.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "authorization.value", item.Authorization.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "authorization.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "authorization.value", item.Authorization.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"community.-1", itemBody) } @@ -257,12 +277,16 @@ func (data SystemSNMP) toBody(ctx context.Context) string { for _, item := range data.Groups { itemBody := "" if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + } } if !item.SecurityLevel.IsNull() { - itemBody, _ = sjson.Set(itemBody, "securityLevel.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "securityLevel.value", item.SecurityLevel.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "securityLevel.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "securityLevel.value", item.SecurityLevel.ValueString()) + } } if !item.ViewVariable.IsNull() { @@ -271,8 +295,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "view.value", item.ViewVariable.ValueString()) } } else if !item.View.IsNull() { - itemBody, _ = sjson.Set(itemBody, "view.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "view.value", item.View.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "view.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "view.value", item.View.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"group.-1", itemBody) } @@ -282,8 +308,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { for _, item := range data.Users { itemBody := "" if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + } } if !item.AuthenticationProtocolVariable.IsNull() { @@ -297,8 +325,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "auth.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "auth.value", item.AuthenticationProtocol.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "auth.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "auth.value", item.AuthenticationProtocol.ValueString()) + } } if !item.AuthenticationPasswordVariable.IsNull() { @@ -312,8 +342,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "authPassword.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "authPassword.value", item.AuthenticationPassword.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "authPassword.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "authPassword.value", item.AuthenticationPassword.ValueString()) + } } if !item.PrivacyProtocolVariable.IsNull() { @@ -327,8 +359,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "priv.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "priv.value", item.PrivacyProtocol.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "priv.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "priv.value", item.PrivacyProtocol.ValueString()) + } } if !item.PrivacyPasswordVariable.IsNull() { @@ -342,8 +376,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "privPassword.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "privPassword.value", item.PrivacyPassword.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "privPassword.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "privPassword.value", item.PrivacyPassword.ValueString()) + } } if !item.GroupVariable.IsNull() { @@ -352,8 +388,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "group.value", item.GroupVariable.ValueString()) } } else if !item.Group.IsNull() { - itemBody, _ = sjson.Set(itemBody, "group.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "group.value", item.Group.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "group.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "group.value", item.Group.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"user.-1", itemBody) } @@ -369,8 +407,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "vpnId.value", item.VpnIdVariable.ValueString()) } } else if !item.VpnId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpnId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpnId.value", item.VpnId.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "vpnId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpnId.value", item.VpnId.ValueInt64()) + } } if !item.IpVariable.IsNull() { @@ -379,8 +419,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "ip.value", item.IpVariable.ValueString()) } } else if !item.Ip.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ip.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ip.value", item.Ip.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ip.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ip.value", item.Ip.ValueString()) + } } if !item.PortVariable.IsNull() { @@ -389,12 +431,16 @@ func (data SystemSNMP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "port.value", item.PortVariable.ValueString()) } } else if !item.Port.IsNull() { - itemBody, _ = sjson.Set(itemBody, "port.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "port.value", item.Port.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "port.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "port.value", item.Port.ValueInt64()) + } } if !item.UserLabel.IsNull() { - itemBody, _ = sjson.Set(itemBody, "userLabel.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "userLabel.value", item.UserLabel.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "userLabel.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "userLabel.value", item.UserLabel.ValueString()) + } } if !item.UserVariable.IsNull() { @@ -403,8 +449,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "user.value", item.UserVariable.ValueString()) } } else if !item.User.IsNull() { - itemBody, _ = sjson.Set(itemBody, "user.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "user.value", item.User.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "user.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "user.value", item.User.ValueString()) + } } if !item.SourceInterfaceVariable.IsNull() { @@ -413,8 +461,10 @@ func (data SystemSNMP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString()) } } else if !item.SourceInterface.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"target.-1", itemBody) } diff --git a/internal/provider/model_sdwan_transport_ipv6_tracker_profile_parcel.go b/internal/provider/model_sdwan_transport_ipv6_tracker_profile_parcel.go index cad48e70..7a0a0241 100644 --- a/internal/provider/model_sdwan_transport_ipv6_tracker_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_ipv6_tracker_profile_parcel.go @@ -86,8 +86,10 @@ func (data TransportIPv6Tracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerNameVariable.ValueString()) } } else if !data.TrackerName.IsNull() { - body, _ = sjson.Set(body, path+"trackerName.optionType", "global") - body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerName.optionType", "global") + body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerName.ValueString()) + } } if !data.EndpointApiUrlVariable.IsNull() { @@ -96,8 +98,10 @@ func (data TransportIPv6Tracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrlVariable.ValueString()) } } else if !data.EndpointApiUrl.IsNull() { - body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "global") - body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrl.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "global") + body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrl.ValueString()) + } } if !data.EndpointDnsNameVariable.IsNull() { @@ -106,8 +110,10 @@ func (data TransportIPv6Tracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsNameVariable.ValueString()) } } else if !data.EndpointDnsName.IsNull() { - body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "global") - body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "global") + body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsName.ValueString()) + } } if !data.EndpointIpVariable.IsNull() { @@ -116,8 +122,10 @@ func (data TransportIPv6Tracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIpVariable.ValueString()) } } else if !data.EndpointIp.IsNull() { - body, _ = sjson.Set(body, path+"endpointIp.optionType", "global") - body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIp.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointIp.optionType", "global") + body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIp.ValueString()) + } } if !data.IntervalVariable.IsNull() { @@ -131,8 +139,10 @@ func (data TransportIPv6Tracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"interval.value", 60) } } else { - body, _ = sjson.Set(body, path+"interval.optionType", "global") - body, _ = sjson.Set(body, path+"interval.value", data.Interval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"interval.optionType", "global") + body, _ = sjson.Set(body, path+"interval.value", data.Interval.ValueInt64()) + } } if !data.MultiplierVariable.IsNull() { @@ -146,8 +156,10 @@ func (data TransportIPv6Tracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"multiplier.value", 3) } } else { - body, _ = sjson.Set(body, path+"multiplier.optionType", "global") - body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"multiplier.optionType", "global") + body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64()) + } } if !data.ThresholdVariable.IsNull() { @@ -161,8 +173,10 @@ func (data TransportIPv6Tracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"threshold.value", 300) } } else { - body, _ = sjson.Set(body, path+"threshold.optionType", "global") - body, _ = sjson.Set(body, path+"threshold.value", data.Threshold.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"threshold.optionType", "global") + body, _ = sjson.Set(body, path+"threshold.value", data.Threshold.ValueInt64()) + } } if !data.EndpointTrackerTypeVariable.IsNull() { @@ -176,8 +190,10 @@ func (data TransportIPv6Tracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"endpointTrackerType.value", "ipv6-interface") } } else { - body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "global") - body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "global") + body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerType.ValueString()) + } } if !data.TrackerTypeVariable.IsNull() { @@ -191,8 +207,10 @@ func (data TransportIPv6Tracker) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"trackerType.value", "endpoint") } } else { - body, _ = sjson.Set(body, path+"trackerType.optionType", "global") - body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerType.optionType", "global") + body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerType.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go b/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go index eeb957f9..5d467d2e 100644 --- a/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go @@ -136,8 +136,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) body, _ = sjson.Set(body, path+"shutdown.value", true) } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.InterfaceNameVariable.IsNull() { @@ -146,8 +148,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + } } if !data.InterfaceDescriptionVariable.IsNull() { @@ -161,8 +165,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) } } else { - body, _ = sjson.Set(body, path+"description.optionType", "global") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "global") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + } } if !data.Ipv4DhcpDistanceVariable.IsNull() { @@ -171,8 +177,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString()) } } else if !data.Ipv4DhcpDistance.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64()) + } } if !data.Ipv4AddressVariable.IsNull() { @@ -181,8 +189,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString()) } } else if !data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { @@ -191,8 +201,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString()) } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString()) + } } if true { @@ -205,8 +217,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) } } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + } } if !item.SubnetMaskVariable.IsNull() { @@ -215,8 +229,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMaskVariable.ValueString()) } } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"intfIpAddress.static.staticIpV4AddressSecondary.-1", itemBody) } @@ -233,10 +249,12 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) } } else { - body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global") - var values []string - data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"dhcpHelper.value", values) + if true { + body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global") + var values []string + data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"dhcpHelper.value", values) + } } if !data.Ipv4IperfServerVariable.IsNull() { @@ -250,8 +268,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) } } else { - body, _ = sjson.Set(body, path+"iperfServer.optionType", "global") - body, _ = sjson.Set(body, path+"iperfServer.value", data.Ipv4IperfServer.ValueString()) + if true { + body, _ = sjson.Set(body, path+"iperfServer.optionType", "global") + body, _ = sjson.Set(body, path+"iperfServer.value", data.Ipv4IperfServer.ValueString()) + } } if !data.Ipv4AutoDetectBandwidthVariable.IsNull() { @@ -265,12 +285,16 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", false) } } else { - body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "global") - body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.Ipv4AutoDetectBandwidth.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "global") + body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.Ipv4AutoDetectBandwidth.ValueBool()) + } } if !data.EnableDhcpv6.IsNull() { - body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool()) + } } if !data.Ipv6AddressVariable.IsNull() { @@ -279,8 +303,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString()) } } else if !data.Ipv6Address.IsNull() { - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString()) + } } if true { body, _ = sjson.Set(body, path+"arp", []interface{}{}) @@ -293,8 +319,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString()) } } else if !item.IpAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) + } } if !item.MacAddressVariable.IsNull() { @@ -303,8 +331,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString()) } } else if !item.MacAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody) } @@ -321,8 +351,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) } } else { - body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString()) + } } if !data.MacAddressVariable.IsNull() { @@ -336,8 +368,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) } } else { - body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString()) + } } if !data.IpMtuVariable.IsNull() { @@ -351,8 +385,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500) } } else { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + } } if !data.InterfaceMtuVariable.IsNull() { @@ -366,8 +402,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500) } } else { - body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64()) + } } if !data.TcpMssVariable.IsNull() { @@ -381,8 +419,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) } } else { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + } } if !data.SpeedVariable.IsNull() { @@ -396,8 +436,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) } } else { - body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString()) + } } if !data.ArpTimeoutVariable.IsNull() { @@ -411,8 +453,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200) } } else { - body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64()) + } } if !data.AutonegotiateVariable.IsNull() { @@ -426,8 +470,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) } } else { - body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool()) + } } if !data.MediaTypeVariable.IsNull() { @@ -441,8 +487,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) } } else { - body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString()) + } } if !data.LoadIntervalVariable.IsNull() { @@ -456,8 +504,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) body, _ = sjson.Set(body, path+"advanced.loadInterval.value", 30) } } else { - body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64()) + } } if !data.IcmpRedirectDisableVariable.IsNull() { @@ -471,8 +521,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true) } } else { - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool()) + } } if !data.IpDirectedBroadcastVariable.IsNull() { @@ -486,8 +538,10 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false) } } else { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_management_vpn_profile_parcel.go b/internal/provider/model_sdwan_transport_management_vpn_profile_parcel.go index d542423d..f3716690 100644 --- a/internal/provider/model_sdwan_transport_management_vpn_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_management_vpn_profile_parcel.go @@ -132,8 +132,10 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"name.optionType", "global") - body, _ = sjson.Set(body, path+"name.value", data.VpnDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"name.optionType", "global") + body, _ = sjson.Set(body, path+"name.value", data.VpnDescription.ValueString()) + } } if !data.PrimaryDnsAddressIpv4Variable.IsNull() { @@ -147,8 +149,10 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString()) + } } if !data.SecondaryDnsAddressIpv4Variable.IsNull() { @@ -162,8 +166,10 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString()) + } } if !data.PrimaryDnsAddressIpv6Variable.IsNull() { @@ -177,8 +183,10 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString()) + } } if !data.SecondaryDnsAddressIpv6Variable.IsNull() { @@ -192,8 +200,10 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString()) + } } if true { body, _ = sjson.Set(body, path+"newHostMapping", []interface{}{}) @@ -206,8 +216,10 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostNameVariable.ValueString()) } } else if !item.HostName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString()) + } } if !item.ListOfIpAddressesVariable.IsNull() { @@ -216,10 +228,12 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "listOfIp.value", item.ListOfIpAddressesVariable.ValueString()) } } else if !item.ListOfIpAddresses.IsNull() { - itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global") - var values []string - item.ListOfIpAddresses.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values) + if true { + itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global") + var values []string + item.ListOfIpAddresses.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values) + } } body, _ = sjson.SetRaw(body, path+"newHostMapping.-1", itemBody) } @@ -235,8 +249,10 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) } } else if !item.NetworkAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + } } if !item.SubnetMaskVariable.IsNull() { @@ -245,8 +261,10 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) } } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + } } if item.Gateway.IsNull() { if true { @@ -254,8 +272,10 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "gateway.value", "nextHop") } } else { - itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "gateway.value", item.Gateway.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "gateway.value", item.Gateway.ValueString()) + } } if true && item.Gateway.ValueString() == "nextHop" { itemBody, _ = sjson.Set(itemBody, "nextHop", []interface{}{}) @@ -268,8 +288,10 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) } } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } } if !childItem.AdministrativeDistanceVariable.IsNull() { @@ -283,8 +305,10 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", 1) } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + } } itemBody, _ = sjson.SetRaw(itemBody, "nextHop.-1", itemChildBody) } @@ -301,8 +325,10 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "distance.value", 1) } } else { - itemBody, _ = sjson.Set(itemBody, "distance.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistance.ValueInt64()) + if true && item.Gateway.ValueString() == "null0" { + itemBody, _ = sjson.Set(itemBody, "distance.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistance.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"ipv4Route.-1", itemBody) } @@ -318,8 +344,10 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.value", item.PrefixVariable.ValueString()) } } else if !item.Prefix.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString()) + } } if true { @@ -332,8 +360,10 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) } } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } } if !childItem.AdministrativeDistanceVariable.IsNull() { @@ -342,15 +372,19 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) } } else if !childItem.AdministrativeDistance.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + } } itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody) } } if !item.Null0.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) + } } if !item.NatVariable.IsNull() { @@ -359,8 +393,10 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.NatVariable.ValueString()) } } else if !item.Nat.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"ipv6Route.-1", itemBody) } diff --git a/internal/provider/model_sdwan_transport_routing_bgp_profile_parcel.go b/internal/provider/model_sdwan_transport_routing_bgp_profile_parcel.go index 5e136be2..26ff0c88 100644 --- a/internal/provider/model_sdwan_transport_routing_bgp_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_routing_bgp_profile_parcel.go @@ -265,8 +265,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"asNum.value", data.AsNumberVariable.ValueString()) } } else if !data.AsNumber.IsNull() { - body, _ = sjson.Set(body, path+"asNum.optionType", "global") - body, _ = sjson.Set(body, path+"asNum.value", data.AsNumber.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"asNum.optionType", "global") + body, _ = sjson.Set(body, path+"asNum.value", data.AsNumber.ValueInt64()) + } } if !data.RouterIdVariable.IsNull() { @@ -280,8 +282,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"routerId.optionType", "global") - body, _ = sjson.Set(body, path+"routerId.value", data.RouterId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"routerId.optionType", "global") + body, _ = sjson.Set(body, path+"routerId.value", data.RouterId.ValueString()) + } } if !data.PropagateAsPathVariable.IsNull() { @@ -295,8 +299,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"propagateAspath.value", false) } } else { - body, _ = sjson.Set(body, path+"propagateAspath.optionType", "global") - body, _ = sjson.Set(body, path+"propagateAspath.value", data.PropagateAsPath.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"propagateAspath.optionType", "global") + body, _ = sjson.Set(body, path+"propagateAspath.value", data.PropagateAsPath.ValueBool()) + } } if !data.PropagateCommunityVariable.IsNull() { @@ -310,8 +316,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"propagateCommunity.value", false) } } else { - body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "global") - body, _ = sjson.Set(body, path+"propagateCommunity.value", data.PropagateCommunity.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "global") + body, _ = sjson.Set(body, path+"propagateCommunity.value", data.PropagateCommunity.ValueBool()) + } } if !data.ExternalRoutesDistanceVariable.IsNull() { @@ -325,8 +333,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"external.value", 20) } } else { - body, _ = sjson.Set(body, path+"external.optionType", "global") - body, _ = sjson.Set(body, path+"external.value", data.ExternalRoutesDistance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"external.optionType", "global") + body, _ = sjson.Set(body, path+"external.value", data.ExternalRoutesDistance.ValueInt64()) + } } if !data.InternalRoutesDistanceVariable.IsNull() { @@ -340,8 +350,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"internal.value", 200) } } else { - body, _ = sjson.Set(body, path+"internal.optionType", "global") - body, _ = sjson.Set(body, path+"internal.value", data.InternalRoutesDistance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"internal.optionType", "global") + body, _ = sjson.Set(body, path+"internal.value", data.InternalRoutesDistance.ValueInt64()) + } } if !data.LocalRoutesDistanceVariable.IsNull() { @@ -355,8 +367,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"local.value", 20) } } else { - body, _ = sjson.Set(body, path+"local.optionType", "global") - body, _ = sjson.Set(body, path+"local.value", data.LocalRoutesDistance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"local.optionType", "global") + body, _ = sjson.Set(body, path+"local.value", data.LocalRoutesDistance.ValueInt64()) + } } if !data.KeepaliveTimeVariable.IsNull() { @@ -370,8 +384,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"keepalive.value", 60) } } else { - body, _ = sjson.Set(body, path+"keepalive.optionType", "global") - body, _ = sjson.Set(body, path+"keepalive.value", data.KeepaliveTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"keepalive.optionType", "global") + body, _ = sjson.Set(body, path+"keepalive.value", data.KeepaliveTime.ValueInt64()) + } } if !data.HoldTimeVariable.IsNull() { @@ -385,8 +401,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"holdtime.value", 180) } } else { - body, _ = sjson.Set(body, path+"holdtime.optionType", "global") - body, _ = sjson.Set(body, path+"holdtime.value", data.HoldTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"holdtime.optionType", "global") + body, _ = sjson.Set(body, path+"holdtime.value", data.HoldTime.ValueInt64()) + } } if !data.AlwaysCompareMedVariable.IsNull() { @@ -400,8 +418,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"alwaysCompare.value", false) } } else { - body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "global") - body, _ = sjson.Set(body, path+"alwaysCompare.value", data.AlwaysCompareMed.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "global") + body, _ = sjson.Set(body, path+"alwaysCompare.value", data.AlwaysCompareMed.ValueBool()) + } } if !data.DeterministicMedVariable.IsNull() { @@ -415,8 +435,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"deterministic.value", false) } } else { - body, _ = sjson.Set(body, path+"deterministic.optionType", "global") - body, _ = sjson.Set(body, path+"deterministic.value", data.DeterministicMed.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"deterministic.optionType", "global") + body, _ = sjson.Set(body, path+"deterministic.value", data.DeterministicMed.ValueBool()) + } } if !data.MissingMedAsWorstVariable.IsNull() { @@ -430,8 +452,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"missingAsWorst.value", false) } } else { - body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "global") - body, _ = sjson.Set(body, path+"missingAsWorst.value", data.MissingMedAsWorst.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "global") + body, _ = sjson.Set(body, path+"missingAsWorst.value", data.MissingMedAsWorst.ValueBool()) + } } if !data.CompareRouterIdVariable.IsNull() { @@ -445,8 +469,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"compareRouterId.value", false) } } else { - body, _ = sjson.Set(body, path+"compareRouterId.optionType", "global") - body, _ = sjson.Set(body, path+"compareRouterId.value", data.CompareRouterId.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"compareRouterId.optionType", "global") + body, _ = sjson.Set(body, path+"compareRouterId.value", data.CompareRouterId.ValueBool()) + } } if !data.MultipathRelaxVariable.IsNull() { @@ -460,8 +486,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"multipathRelax.value", false) } } else { - body, _ = sjson.Set(body, path+"multipathRelax.optionType", "global") - body, _ = sjson.Set(body, path+"multipathRelax.value", data.MultipathRelax.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"multipathRelax.optionType", "global") + body, _ = sjson.Set(body, path+"multipathRelax.value", data.MultipathRelax.ValueBool()) + } } if true { body, _ = sjson.Set(body, path+"neighbor", []interface{}{}) @@ -474,8 +502,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) } } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + } } if !item.DescriptionVariable.IsNull() { @@ -489,8 +519,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "description.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "description.value", item.Description.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "description.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "description.value", item.Description.ValueString()) + } } if !item.ShutdownVariable.IsNull() { @@ -504,8 +536,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "shutdown.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.Shutdown.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.Shutdown.ValueBool()) + } } if !item.RemoteAsVariable.IsNull() { @@ -514,8 +548,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAsVariable.ValueString()) } } else if !item.RemoteAs.IsNull() { - itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAs.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAs.ValueInt64()) + } } if !item.LocalAsVariable.IsNull() { @@ -529,8 +565,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAs.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAs.ValueInt64()) + } } if !item.KeepaliveTimeVariable.IsNull() { @@ -544,8 +582,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "keepalive.value", 60) } } else { - itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTime.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTime.ValueInt64()) + } } if !item.HoldTimeVariable.IsNull() { @@ -559,8 +599,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "holdtime.value", 180) } } else { - itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTime.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTime.ValueInt64()) + } } if !item.UpdateSourceInterfaceVariable.IsNull() { @@ -574,8 +616,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterface.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterface.ValueString()) + } } if !item.NextHopSelfVariable.IsNull() { @@ -589,8 +633,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelf.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelf.ValueBool()) + } } if !item.SendCommunityVariable.IsNull() { @@ -604,8 +650,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", true) } } else { - itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunity.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunity.ValueBool()) + } } if !item.SendExtendedCommunityVariable.IsNull() { @@ -619,8 +667,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", true) } } else { - itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunity.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunity.ValueBool()) + } } if !item.EbgpMultihopVariable.IsNull() { @@ -634,8 +684,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", 1) } } else { - itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihop.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihop.ValueInt64()) + } } if !item.PasswordVariable.IsNull() { @@ -649,8 +701,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "password.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "password.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString()) + } } if item.SendLabel.IsNull() { if true { @@ -658,8 +712,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sendLabel.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "sendLabel.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendLabel.value", item.SendLabel.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "sendLabel.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendLabel.value", item.SendLabel.ValueBool()) + } } if !item.ExplicitNullVariable.IsNull() { @@ -673,8 +729,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.value", item.ExplicitNull.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.value", item.ExplicitNull.ValueBool()) + } } if !item.AsOverrideVariable.IsNull() { @@ -688,8 +746,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "asOverride.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverride.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverride.ValueBool()) + } } if !item.AllowasInNumberVariable.IsNull() { @@ -703,16 +763,20 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumber.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumber.ValueInt64()) + } } if true { itemBody, _ = sjson.Set(itemBody, "addressFamily", []interface{}{}) for _, childItem := range item.AddressFamilies { itemChildBody := "" if !childItem.FamilyType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "familyType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "familyType.value", childItem.FamilyType.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "familyType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "familyType.value", childItem.FamilyType.ValueString()) + } } if !childItem.MaxNumberOfPrefixesVariable.IsNull() { @@ -721,8 +785,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixesVariable.ValueString()) } } else if !childItem.MaxNumberOfPrefixes.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixes.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixes.ValueInt64()) + } } if !childItem.ThresholdVariable.IsNull() { @@ -736,12 +802,16 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", 75) } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.Threshold.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.Threshold.ValueInt64()) + } } if !childItem.PolicyType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.value", childItem.PolicyType.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.value", childItem.PolicyType.ValueString()) + } } if !childItem.RestartIntervalVariable.IsNull() { @@ -750,16 +820,22 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartIntervalVariable.ValueString()) } } else if !childItem.RestartInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartInterval.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartInterval.ValueInt64()) + } } if !childItem.InRoutePolicyId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.value", childItem.InRoutePolicyId.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.value", childItem.InRoutePolicyId.ValueString()) + } } if !childItem.OutRoutePolicyId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.value", childItem.OutRoutePolicyId.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.value", childItem.OutRoutePolicyId.ValueString()) + } } itemBody, _ = sjson.SetRaw(itemBody, "addressFamily.-1", itemChildBody) } @@ -778,8 +854,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) } } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + } } if !item.DescriptionVariable.IsNull() { @@ -793,8 +871,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "description.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "description.value", item.Description.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "description.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "description.value", item.Description.ValueString()) + } } if !item.ShutdownVariable.IsNull() { @@ -808,8 +888,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "shutdown.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.Shutdown.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.Shutdown.ValueBool()) + } } if !item.RemoteAsVariable.IsNull() { @@ -818,8 +900,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAsVariable.ValueString()) } } else if !item.RemoteAs.IsNull() { - itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAs.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAs.ValueInt64()) + } } if !item.LocalAsVariable.IsNull() { @@ -833,8 +917,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAs.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAs.ValueInt64()) + } } if !item.KeepaliveTimeVariable.IsNull() { @@ -848,8 +934,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "keepalive.value", 60) } } else { - itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTime.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTime.ValueInt64()) + } } if !item.HoldTimeVariable.IsNull() { @@ -863,8 +951,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "holdtime.value", 180) } } else { - itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTime.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTime.ValueInt64()) + } } if !item.UpdateSourceInterfaceVariable.IsNull() { @@ -878,8 +968,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterface.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterface.ValueString()) + } } if !item.NextHopSelfVariable.IsNull() { @@ -893,8 +985,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelf.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelf.ValueBool()) + } } if !item.SendCommunityVariable.IsNull() { @@ -908,8 +1002,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", true) } } else { - itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunity.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunity.ValueBool()) + } } if !item.SendExtendedCommunityVariable.IsNull() { @@ -923,8 +1019,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", true) } } else { - itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunity.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunity.ValueBool()) + } } if !item.EbgpMultihopVariable.IsNull() { @@ -938,8 +1036,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", 1) } } else { - itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihop.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihop.ValueInt64()) + } } if !item.PasswordVariable.IsNull() { @@ -953,8 +1053,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "password.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "password.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString()) + } } if !item.AsOverrideVariable.IsNull() { @@ -968,8 +1070,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "asOverride.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverride.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverride.ValueBool()) + } } if !item.AllowasInNumberVariable.IsNull() { @@ -983,16 +1087,20 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { } } else { - itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumber.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumber.ValueInt64()) + } } if true { itemBody, _ = sjson.Set(itemBody, "addressFamily", []interface{}{}) for _, childItem := range item.AddressFamilies { itemChildBody := "" if !childItem.FamilyType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "familyType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "familyType.value", childItem.FamilyType.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "familyType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "familyType.value", childItem.FamilyType.ValueString()) + } } if !childItem.MaxNumberOfPrefixesVariable.IsNull() { @@ -1001,8 +1109,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixesVariable.ValueString()) } } else if !childItem.MaxNumberOfPrefixes.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixes.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixes.ValueInt64()) + } } if !childItem.ThresholdVariable.IsNull() { @@ -1016,12 +1126,16 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", 75) } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.Threshold.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.Threshold.ValueInt64()) + } } if !childItem.PolicyType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.value", childItem.PolicyType.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.value", childItem.PolicyType.ValueString()) + } } if !childItem.RestartIntervalVariable.IsNull() { @@ -1030,16 +1144,22 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartIntervalVariable.ValueString()) } } else if !childItem.RestartInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartInterval.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartInterval.ValueInt64()) + } } if !childItem.InRoutePolicyId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.value", childItem.InRoutePolicyId.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.value", childItem.InRoutePolicyId.ValueString()) + } } if !childItem.OutRoutePolicyId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.value", childItem.OutRoutePolicyId.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.value", childItem.OutRoutePolicyId.ValueString()) + } } itemBody, _ = sjson.SetRaw(itemBody, "addressFamily.-1", itemChildBody) } @@ -1058,8 +1178,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddressVariable.ValueString()) } } else if !item.NetworkAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddress.ValueString()) + } } if !item.SubnetMaskVariable.IsNull() { @@ -1068,8 +1190,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMaskVariable.ValueString()) } } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMask.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMask.ValueString()) + } } if !item.AsSetPathVariable.IsNull() { @@ -1083,8 +1207,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "asSet.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPath.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPath.ValueBool()) + } } if !item.SummaryOnlyVariable.IsNull() { @@ -1098,8 +1224,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnly.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnly.ValueBool()) + } } body, _ = sjson.SetRaw(body, path+"addressFamily.aggregateAddress.-1", itemBody) } @@ -1115,8 +1243,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddressVariable.ValueString()) } } else if !item.NetworkAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddress.ValueString()) + } } if !item.SubnetMaskVariable.IsNull() { @@ -1125,8 +1255,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMaskVariable.ValueString()) } } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMask.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMask.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"addressFamily.network.-1", itemBody) } @@ -1143,8 +1275,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "global") - body, _ = sjson.Set(body, path+"addressFamily.paths.value", data.Ipv4EibgpMaximumPaths.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "global") + body, _ = sjson.Set(body, path+"addressFamily.paths.value", data.Ipv4EibgpMaximumPaths.ValueInt64()) + } } if !data.Ipv4OriginateVariable.IsNull() { @@ -1158,12 +1292,16 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"addressFamily.originate.value", false) } } else { - body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "global") - body, _ = sjson.Set(body, path+"addressFamily.originate.value", data.Ipv4Originate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "global") + body, _ = sjson.Set(body, path+"addressFamily.originate.value", data.Ipv4Originate.ValueBool()) + } } if !data.Ipv4TableMapRoutePolicyId.IsNull() { - body, _ = sjson.Set(body, path+"addressFamily.name.refId.optionType", "global") - body, _ = sjson.Set(body, path+"addressFamily.name.refId.value", data.Ipv4TableMapRoutePolicyId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"addressFamily.name.refId.optionType", "global") + body, _ = sjson.Set(body, path+"addressFamily.name.refId.value", data.Ipv4TableMapRoutePolicyId.ValueString()) + } } if !data.Ipv4TableMapFilterVariable.IsNull() { @@ -1177,8 +1315,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"addressFamily.filter.value", false) } } else { - body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "global") - body, _ = sjson.Set(body, path+"addressFamily.filter.value", data.Ipv4TableMapFilter.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "global") + body, _ = sjson.Set(body, path+"addressFamily.filter.value", data.Ipv4TableMapFilter.ValueBool()) + } } if true { body, _ = sjson.Set(body, path+"addressFamily.redistribute", []interface{}{}) @@ -1191,12 +1331,16 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString()) } } else if !item.Protocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString()) + } } if !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"addressFamily.redistribute.-1", itemBody) } @@ -1212,8 +1356,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.value", item.AggregatePrefixVariable.ValueString()) } } else if !item.AggregatePrefix.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.value", item.AggregatePrefix.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.value", item.AggregatePrefix.ValueString()) + } } if !item.AsSetPathVariable.IsNull() { @@ -1227,8 +1373,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "asSet.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPath.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPath.ValueBool()) + } } if !item.SummaryOnlyVariable.IsNull() { @@ -1242,8 +1390,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnly.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnly.ValueBool()) + } } body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.ipv6AggregateAddress.-1", itemBody) } @@ -1259,8 +1409,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.value", item.NetworkPrefixVariable.ValueString()) } } else if !item.NetworkPrefix.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.value", item.NetworkPrefix.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.value", item.NetworkPrefix.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.ipv6Network.-1", itemBody) } @@ -1277,8 +1429,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "global") - body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.value", data.Ipv6EibgpMaximumPaths.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "global") + body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.value", data.Ipv6EibgpMaximumPaths.ValueInt64()) + } } if !data.Ipv6OriginateVariable.IsNull() { @@ -1292,12 +1446,16 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", false) } } else { - body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "global") - body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", data.Ipv6Originate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "global") + body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", data.Ipv6Originate.ValueBool()) + } } if !data.Ipv6TableMapRoutePolicyId.IsNull() { - body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.refId.optionType", "global") - body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.refId.value", data.Ipv6TableMapRoutePolicyId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.refId.optionType", "global") + body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.refId.value", data.Ipv6TableMapRoutePolicyId.ValueString()) + } } if !data.Ipv6TableMapFilterVariable.IsNull() { @@ -1311,8 +1469,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", false) } } else { - body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "global") - body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", data.Ipv6TableMapFilter.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "global") + body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", data.Ipv6TableMapFilter.ValueBool()) + } } if true { body, _ = sjson.Set(body, path+"ipv6AddressFamily.redistribute", []interface{}{}) @@ -1325,12 +1485,16 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString()) } } else if !item.Protocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString()) + } } if !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.redistribute.-1", itemBody) } @@ -1346,8 +1510,10 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceNameVariable.ValueString()) } } else if !item.InterfaceName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceName.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceName.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"mplsInterface.-1", itemBody) } diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go index b1f5fd09..191f75a4 100644 --- a/internal/provider/model_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go @@ -214,8 +214,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"shutdown.value", true) } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.InterfaceNameVariable.IsNull() { @@ -224,8 +226,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + } } if !data.InterfaceDescriptionVariable.IsNull() { @@ -239,8 +243,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"description.optionType", "global") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "global") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + } } if !data.Ipv4DhcpHelperVariable.IsNull() { @@ -254,10 +260,12 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global") - var values []string - data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"dhcpHelper.value", values) + if true { + body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global") + var values []string + data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"dhcpHelper.value", values) + } } if !data.ServiceProviderVariable.IsNull() { @@ -271,8 +279,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"serviceProvider.optionType", "global") - body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProvider.ValueString()) + if true { + body, _ = sjson.Set(body, path+"serviceProvider.optionType", "global") + body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProvider.ValueString()) + } } if !data.BandwidthUpstreamVariable.IsNull() { @@ -286,8 +296,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstream.ValueInt64()) + } } if !data.BandwidthDownstreamVariable.IsNull() { @@ -301,8 +313,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64()) + } } if data.TunnelInterface.IsNull() { if true { @@ -310,8 +324,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnelInterface.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool()) + } } if !data.PerTunnelQosVariable.IsNull() { @@ -325,8 +341,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool()) + } } if !data.TunnelQosModeVariable.IsNull() { @@ -335,8 +353,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosModeVariable.ValueString()) } } else if !data.TunnelQosMode.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString()) + } } if !data.TunnelBandwidthPercentVariable.IsNull() { @@ -350,8 +370,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", 50) } } else { - body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercent.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercent.ValueInt64()) + } } if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() { @@ -365,8 +387,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString()) + } } if !data.TunnelInterfaceCarrierVariable.IsNull() { @@ -380,8 +404,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.carrier.value", "default") } } else { - body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString()) + } } if !data.TunnelInterfaceColorVariable.IsNull() { @@ -395,8 +421,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.color.value", "mpls") } } else { - body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString()) + } } if !data.TunnelInterfaceHelloIntervalVariable.IsNull() { @@ -410,8 +438,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", 1000) } } else { - body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64()) + } } if !data.TunnelInterfaceHelloToleranceVariable.IsNull() { @@ -425,8 +455,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", 12) } } else { - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64()) + } } if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() { @@ -440,8 +472,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool()) + } } if !data.TunnelInterfaceColorRestrictVariable.IsNull() { @@ -455,8 +489,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.restrict.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrict.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrict.ValueBool()) + } } if !data.TunnelInterfaceGroupsVariable.IsNull() { @@ -470,8 +506,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64()) + } } if !data.TunnelInterfaceBorderVariable.IsNull() { @@ -485,8 +523,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.border.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool()) + } } if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() { @@ -500,8 +540,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64()) + } } if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() { @@ -515,8 +557,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", 5) } } else { - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64()) + } } if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() { @@ -530,8 +574,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool()) + } } if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() { @@ -545,10 +591,12 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global") - var values []int64 - data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values) + if true { + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global") + var values []int64 + data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values) + } } if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() { @@ -562,8 +610,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", 5) } } else { - body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64()) + } } if !data.TunnelInterfacePortHopVariable.IsNull() { @@ -577,8 +627,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.portHop.value", true) } } else { - body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool()) + } } if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() { @@ -592,8 +644,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool()) + } } if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() { @@ -607,8 +661,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64()) + } } if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() { @@ -622,8 +678,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool()) + } } if !data.TunnelInterfaceNetworkBroadcastVariable.IsNull() { @@ -637,8 +695,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcast.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcast.ValueBool()) + } } if !data.TunnelInterfaceAllowAllVariable.IsNull() { @@ -652,8 +712,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.all.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.all.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.all.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool()) + } } if !data.TunnelInterfaceAllowBgpVariable.IsNull() { @@ -667,8 +729,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.bgp.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool()) + } } if !data.TunnelInterfaceAllowDhcpVariable.IsNull() { @@ -682,8 +746,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.dhcp.value", true) } } else { - body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool()) + } } if !data.TunnelInterfaceAllowNtpVariable.IsNull() { @@ -692,8 +758,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtpVariable.ValueString()) } } else if !data.TunnelInterfaceAllowNtp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool()) + } } if !data.TunnelInterfaceAllowSshVariable.IsNull() { @@ -702,8 +770,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSshVariable.ValueString()) } } else if !data.TunnelInterfaceAllowSsh.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSsh.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSsh.ValueBool()) + } } if !data.TunnelInterfaceAllowDnsVariable.IsNull() { @@ -717,8 +787,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.dns.value", true) } } else { - body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool()) + } } if !data.TunnelInterfaceAllowIcmpVariable.IsNull() { @@ -732,8 +804,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.icmp.value", true) } } else { - body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool()) + } } if !data.TunnelInterfaceAllowHttpsVariable.IsNull() { @@ -747,8 +821,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.https.value", true) } } else { - body, _ = sjson.Set(body, path+"allowService.https.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.https.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool()) + } } if !data.TunnelInterfaceAllowOspfVariable.IsNull() { @@ -762,8 +838,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.ospf.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool()) + } } if !data.TunnelInterfaceAllowStunVariable.IsNull() { @@ -777,8 +855,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.stun.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool()) + } } if !data.TunnelInterfaceAllowSnmpVariable.IsNull() { @@ -792,8 +872,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.snmp.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool()) + } } if !data.TunnelInterfaceAllowNetconfVariable.IsNull() { @@ -807,8 +889,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.netconf.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool()) + } } if !data.TunnelInterfaceAllowBfdVariable.IsNull() { @@ -822,16 +906,20 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.bfd.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool()) + } } if true { body, _ = sjson.Set(body, path+"encapsulation", []interface{}{}) for _, item := range data.TunnelInterfaceEncapsulations { itemBody := "" if !item.Encapsulation.IsNull() { - itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString()) + } } if !item.PreferenceVariable.IsNull() { @@ -845,8 +933,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string } } else { - itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64()) + } } if !item.WeightVariable.IsNull() { @@ -860,8 +950,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string itemBody, _ = sjson.Set(itemBody, "weight.value", 1) } } else { - itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"encapsulation.-1", itemBody) } @@ -878,8 +970,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"nat.value", false) } } else { - body, _ = sjson.Set(body, path+"nat.optionType", "global") - body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"nat.optionType", "global") + body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4.ValueBool()) + } } if !data.NatUdpTimeoutVariable.IsNull() { @@ -893,8 +987,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", 1) } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeout.ValueInt64()) + } } if !data.NatTcpTimeoutVariable.IsNull() { @@ -908,12 +1004,16 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", 60) } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeout.ValueInt64()) + } } if !data.QosAdaptive.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.value", data.QosAdaptive.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.value", data.QosAdaptive.ValueBool()) + } } if !data.QosAdaptivePeriodVariable.IsNull() { @@ -922,12 +1022,16 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriodVariable.ValueString()) } } else if !data.QosAdaptivePeriod.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriod.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriod.ValueInt64()) + } } if !data.QosAdaptiveBandwidthUpstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.value", data.QosAdaptiveBandwidthUpstream.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.value", data.QosAdaptiveBandwidthUpstream.ValueBool()) + } } if !data.QosAdaptiveMinUpstreamVariable.IsNull() { @@ -936,8 +1040,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstreamVariable.ValueString()) } } else if !data.QosAdaptiveMinUpstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstream.ValueInt64()) + } } if !data.QosAdaptiveMaxUpstreamVariable.IsNull() { @@ -946,8 +1052,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstreamVariable.ValueString()) } } else if !data.QosAdaptiveMaxUpstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstream.ValueInt64()) + } } if !data.QosAdaptiveDefaultUpstreamVariable.IsNull() { @@ -956,12 +1064,16 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstreamVariable.ValueString()) } } else if !data.QosAdaptiveDefaultUpstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstream.ValueInt64()) + } } if !data.QosAdaptiveBandwidthDownstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.value", data.QosAdaptiveBandwidthDownstream.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.value", data.QosAdaptiveBandwidthDownstream.ValueBool()) + } } if !data.QosAdaptiveMinDownstreamVariable.IsNull() { @@ -970,8 +1082,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstreamVariable.ValueString()) } } else if !data.QosAdaptiveMinDownstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstream.ValueInt64()) + } } if !data.QosAdaptiveMaxDownstreamVariable.IsNull() { @@ -980,8 +1094,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstreamVariable.ValueString()) } } else if !data.QosAdaptiveMaxDownstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstream.ValueInt64()) + } } if !data.QosAdaptiveDefaultDownstreamVariable.IsNull() { @@ -990,8 +1106,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstreamVariable.ValueString()) } } else if !data.QosAdaptiveDefaultDownstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstream.ValueInt64()) + } } if !data.QosShapingRateVariable.IsNull() { @@ -1000,8 +1118,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRateVariable.ValueString()) } } else if !data.QosShapingRate.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64()) + } } if true { body, _ = sjson.Set(body, path+"arp", []interface{}{}) @@ -1019,8 +1139,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string } } else { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) + } } if !item.MacAddressVariable.IsNull() { @@ -1034,8 +1156,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string } } else { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody) } @@ -1052,8 +1176,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500) } } else { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + } } if !data.InterfaceMtuVariable.IsNull() { @@ -1067,8 +1193,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500) } } else { - body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64()) + } } if !data.TcpMssVariable.IsNull() { @@ -1082,8 +1210,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + } } if !data.TlocExtensionVariable.IsNull() { @@ -1097,8 +1227,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString()) + } } if !data.TrackerVariable.IsNull() { @@ -1112,8 +1244,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString()) + } } if !data.IpDirectedBroadcastVariable.IsNull() { @@ -1127,8 +1261,10 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false) } } else { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go index 121768fc..05b7b269 100644 --- a/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go @@ -310,8 +310,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"shutdown.value", true) } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.InterfaceNameVariable.IsNull() { @@ -320,8 +322,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + } } if !data.InterfaceDescriptionVariable.IsNull() { @@ -335,8 +339,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"description.optionType", "global") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "global") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + } } if !data.Ipv4DhcpDistanceVariable.IsNull() { @@ -345,8 +351,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString()) } } else if !data.Ipv4DhcpDistance.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64()) + } } if !data.Ipv4AddressVariable.IsNull() { @@ -355,8 +363,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString()) } } else if !data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { @@ -365,8 +375,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString()) } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString()) + } } if true { @@ -379,8 +391,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) } } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + } } if !item.SubnetMaskVariable.IsNull() { @@ -389,8 +403,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMaskVariable.ValueString()) } } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"intfIpAddress.static.staticIpV4AddressSecondary.-1", itemBody) } @@ -407,14 +423,18 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global") - var values []string - data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"dhcpHelper.value", values) + if true { + body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global") + var values []string + data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"dhcpHelper.value", values) + } } if !data.EnableDhcpv6.IsNull() { - body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool()) + } } if true { @@ -427,8 +447,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) } } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"intfIpV6Address.dynamic.secondaryIpV6Address.-1", itemBody) } @@ -440,8 +462,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString()) } } else if !data.Ipv6Address.IsNull() { - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString()) + } } if true { @@ -454,8 +478,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) } } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"intfIpV6Address.static.secondaryIpV6Address.-1", itemBody) } @@ -472,8 +498,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"iperfServer.optionType", "global") - body, _ = sjson.Set(body, path+"iperfServer.value", data.IperfServer.ValueString()) + if true { + body, _ = sjson.Set(body, path+"iperfServer.optionType", "global") + body, _ = sjson.Set(body, path+"iperfServer.value", data.IperfServer.ValueString()) + } } if !data.BlockNonSourceIpVariable.IsNull() { @@ -487,8 +515,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"blockNonSourceIp.value", false) } } else { - body, _ = sjson.Set(body, path+"blockNonSourceIp.optionType", "global") - body, _ = sjson.Set(body, path+"blockNonSourceIp.value", data.BlockNonSourceIp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"blockNonSourceIp.optionType", "global") + body, _ = sjson.Set(body, path+"blockNonSourceIp.value", data.BlockNonSourceIp.ValueBool()) + } } if !data.ServiceProviderVariable.IsNull() { @@ -502,8 +532,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"serviceProvider.optionType", "global") - body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProvider.ValueString()) + if true { + body, _ = sjson.Set(body, path+"serviceProvider.optionType", "global") + body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProvider.ValueString()) + } } if !data.BandwidthUpstreamVariable.IsNull() { @@ -517,8 +549,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstream.ValueInt64()) + } } if !data.BandwidthDownstreamVariable.IsNull() { @@ -532,8 +566,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64()) + } } if !data.AutoDetectBandwidthVariable.IsNull() { @@ -547,8 +583,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", false) } } else { - body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "global") - body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.AutoDetectBandwidth.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "global") + body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.AutoDetectBandwidth.ValueBool()) + } } if data.TunnelInterface.IsNull() { if true { @@ -556,8 +594,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnelInterface.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool()) + } } if !data.PerTunnelQosVariable.IsNull() { @@ -571,8 +611,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool()) + } } if !data.TunnelQosModeVariable.IsNull() { @@ -581,8 +623,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosModeVariable.ValueString()) } } else if !data.TunnelQosMode.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString()) + } } if !data.TunnelBandwidthPercentVariable.IsNull() { @@ -596,8 +640,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", 50) } } else { - body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercent.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercent.ValueInt64()) + } } if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() { @@ -611,8 +657,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString()) + } } if !data.TunnelInterfaceCarrierVariable.IsNull() { @@ -626,8 +674,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.carrier.value", "default") } } else { - body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString()) + } } if !data.TunnelInterfaceColorVariable.IsNull() { @@ -641,8 +691,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.color.value", "mpls") } } else { - body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString()) + } } if !data.TunnelInterfaceHelloIntervalVariable.IsNull() { @@ -656,8 +708,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", 1000) } } else { - body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64()) + } } if !data.TunnelInterfaceHelloToleranceVariable.IsNull() { @@ -671,8 +725,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", 12) } } else { - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64()) + } } if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() { @@ -686,8 +742,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool()) + } } if !data.TunnelInterfaceGreTunnelDestinationIpVariable.IsNull() { @@ -701,8 +759,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.value", data.TunnelInterfaceGreTunnelDestinationIp.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.value", data.TunnelInterfaceGreTunnelDestinationIp.ValueString()) + } } if !data.TunnelInterfaceColorRestrictVariable.IsNull() { @@ -716,8 +776,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.restrict.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrict.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrict.ValueBool()) + } } if !data.TunnelInterfaceGroupsVariable.IsNull() { @@ -731,8 +793,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64()) + } } if !data.TunnelInterfaceBorderVariable.IsNull() { @@ -746,8 +810,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.border.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool()) + } } if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() { @@ -761,8 +827,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64()) + } } if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() { @@ -776,8 +844,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", 5) } } else { - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64()) + } } if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() { @@ -791,8 +861,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool()) + } } if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() { @@ -806,10 +878,12 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global") - var values []int64 - data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values) + if true { + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global") + var values []int64 + data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values) + } } if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() { @@ -823,8 +897,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", 5) } } else { - body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64()) + } } if !data.TunnelInterfacePortHopVariable.IsNull() { @@ -838,8 +914,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.portHop.value", true) } } else { - body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool()) + } } if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() { @@ -853,8 +931,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool()) + } } if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() { @@ -868,8 +948,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64()) + } } if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() { @@ -883,8 +965,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool()) + } } if !data.TunnelInterfaceCtsSgtPropagationVariable.IsNull() { @@ -898,8 +982,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.value", data.TunnelInterfaceCtsSgtPropagation.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.value", data.TunnelInterfaceCtsSgtPropagation.ValueBool()) + } } if !data.TunnelInterfaceNetworkBroadcastVariable.IsNull() { @@ -913,8 +999,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcast.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcast.ValueBool()) + } } if !data.TunnelInterfaceAllowAllVariable.IsNull() { @@ -928,8 +1016,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.all.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.all.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.all.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool()) + } } if !data.TunnelInterfaceAllowBgpVariable.IsNull() { @@ -943,8 +1033,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.bgp.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool()) + } } if !data.TunnelInterfaceAllowDhcpVariable.IsNull() { @@ -958,8 +1050,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.dhcp.value", true) } } else { - body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool()) + } } if !data.TunnelInterfaceAllowNtpVariable.IsNull() { @@ -968,8 +1062,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtpVariable.ValueString()) } } else if !data.TunnelInterfaceAllowNtp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool()) + } } if !data.TunnelInterfaceAllowSshVariable.IsNull() { @@ -978,8 +1074,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSshVariable.ValueString()) } } else if !data.TunnelInterfaceAllowSsh.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSsh.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSsh.ValueBool()) + } } if !data.TunnelInterfaceAllowDnsVariable.IsNull() { @@ -993,8 +1091,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.dns.value", true) } } else { - body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool()) + } } if !data.TunnelInterfaceAllowIcmpVariable.IsNull() { @@ -1008,8 +1108,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.icmp.value", true) } } else { - body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool()) + } } if !data.TunnelInterfaceAllowHttpsVariable.IsNull() { @@ -1023,8 +1125,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.https.value", true) } } else { - body, _ = sjson.Set(body, path+"allowService.https.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.https.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool()) + } } if !data.TunnelInterfaceAllowOspfVariable.IsNull() { @@ -1038,8 +1142,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.ospf.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool()) + } } if !data.TunnelInterfaceAllowStunVariable.IsNull() { @@ -1053,8 +1159,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.stun.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool()) + } } if !data.TunnelInterfaceAllowSnmpVariable.IsNull() { @@ -1068,8 +1176,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.snmp.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool()) + } } if !data.TunnelInterfaceAllowNetconfVariable.IsNull() { @@ -1083,8 +1193,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.netconf.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool()) + } } if !data.TunnelInterfaceAllowBfdVariable.IsNull() { @@ -1098,16 +1210,20 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"allowService.bfd.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool()) + } } if true { body, _ = sjson.Set(body, path+"encapsulation", []interface{}{}) for _, item := range data.TunnelInterfaceEncapsulations { itemBody := "" if !item.Encapsulation.IsNull() { - itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString()) + } } if !item.PreferenceVariable.IsNull() { @@ -1121,8 +1237,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64()) + } } if !item.WeightVariable.IsNull() { @@ -1136,8 +1254,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string itemBody, _ = sjson.Set(itemBody, "weight.value", 1) } } else { - itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"encapsulation.-1", itemBody) } @@ -1154,8 +1274,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"nat.value", false) } } else { - body, _ = sjson.Set(body, path+"nat.optionType", "global") - body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"nat.optionType", "global") + body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4.ValueBool()) + } } if !data.NatTypeVariable.IsNull() { @@ -1169,8 +1291,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", "interface") } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.NatType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.NatType.ValueString()) + } } if !data.NatRangeStartVariable.IsNull() { @@ -1179,8 +1303,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.NatRangeStartVariable.ValueString()) } } else if !data.NatRangeStart.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.NatRangeStart.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.NatRangeStart.ValueString()) + } } if !data.NatRangeEndVariable.IsNull() { @@ -1189,8 +1315,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.NatRangeEndVariable.ValueString()) } } else if !data.NatRangeEnd.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.NatRangeEnd.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.NatRangeEnd.ValueString()) + } } if !data.NatPrefixLengthVariable.IsNull() { @@ -1199,8 +1327,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.NatPrefixLengthVariable.ValueString()) } } else if !data.NatPrefixLength.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.NatPrefixLength.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.NatPrefixLength.ValueInt64()) + } } if !data.NatOverloadVariable.IsNull() { @@ -1209,8 +1339,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.NatOverloadVariable.ValueString()) } } else if !data.NatOverload.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.NatOverload.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.NatOverload.ValueBool()) + } } if !data.NatLoopbackVariable.IsNull() { @@ -1219,8 +1351,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.NatLoopbackVariable.ValueString()) } } else if !data.NatLoopback.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.NatLoopback.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.NatLoopback.ValueString()) + } } if !data.NatUdpTimeoutVariable.IsNull() { @@ -1234,8 +1368,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", 1) } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeout.ValueInt64()) + } } if !data.NatTcpTimeoutVariable.IsNull() { @@ -1249,8 +1385,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", 60) } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeout.ValueInt64()) + } } if true { body, _ = sjson.Set(body, path+"natAttributesIpv4.newStaticNat", []interface{}{}) @@ -1263,8 +1401,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString()) } } else if !item.SourceIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString()) + } } if !item.TranslatedIpVariable.IsNull() { @@ -1273,8 +1413,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslatedIpVariable.ValueString()) } } else if !item.TranslatedIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslatedIp.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslatedIp.ValueString()) + } } if item.Direction.IsNull() { if true { @@ -1282,8 +1424,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", "inside") } } else { - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.Direction.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.Direction.ValueString()) + } } if !item.SourceVpnVariable.IsNull() { @@ -1297,8 +1441,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", 0) } } else { - itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"natAttributesIpv4.newStaticNat.-1", itemBody) } @@ -1315,16 +1461,22 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"natIpv6.value", false) } } else { - body, _ = sjson.Set(body, path+"natIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"natIpv6.value", data.NatIpv6.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"natIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"natIpv6.value", data.NatIpv6.ValueBool()) + } } if !data.Nat64.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.value", data.Nat64.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.value", data.Nat64.ValueBool()) + } } if !data.Nat66.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv6.nat66.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv6.nat66.value", data.Nat66.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv6.nat66.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv6.nat66.value", data.Nat66.ValueBool()) + } } if true { @@ -1337,8 +1489,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string itemBody, _ = sjson.Set(itemBody, "sourcePrefix.value", item.SourcePrefixVariable.ValueString()) } } else if !item.SourcePrefix.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourcePrefix.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourcePrefix.value", item.SourcePrefix.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourcePrefix.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourcePrefix.value", item.SourcePrefix.ValueString()) + } } if !item.TranslatedSourcePrefixVariable.IsNull() { @@ -1347,8 +1501,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.value", item.TranslatedSourcePrefixVariable.ValueString()) } } else if !item.TranslatedSourcePrefix.IsNull() { - itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.value", item.TranslatedSourcePrefix.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.value", item.TranslatedSourcePrefix.ValueString()) + } } if !item.SourceVpnIdVariable.IsNull() { @@ -1362,15 +1518,19 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - itemBody, _ = sjson.Set(itemBody, "sourceVpnId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceVpnId.value", item.SourceVpnId.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourceVpnId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceVpnId.value", item.SourceVpnId.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"natAttributesIpv6.staticNat66.-1", itemBody) } } if !data.QosAdaptive.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.value", data.QosAdaptive.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.value", data.QosAdaptive.ValueBool()) + } } if !data.QosAdaptivePeriodVariable.IsNull() { @@ -1379,12 +1539,16 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriodVariable.ValueString()) } } else if !data.QosAdaptivePeriod.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriod.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriod.ValueInt64()) + } } if !data.QosAdaptiveBandwidthUpstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.value", data.QosAdaptiveBandwidthUpstream.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.value", data.QosAdaptiveBandwidthUpstream.ValueBool()) + } } if !data.QosAdaptiveMinUpstreamVariable.IsNull() { @@ -1393,8 +1557,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstreamVariable.ValueString()) } } else if !data.QosAdaptiveMinUpstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstream.ValueInt64()) + } } if !data.QosAdaptiveMaxUpstreamVariable.IsNull() { @@ -1403,8 +1569,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstreamVariable.ValueString()) } } else if !data.QosAdaptiveMaxUpstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstream.ValueInt64()) + } } if !data.QosAdaptiveDefaultUpstreamVariable.IsNull() { @@ -1413,12 +1581,16 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstreamVariable.ValueString()) } } else if !data.QosAdaptiveDefaultUpstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstream.ValueInt64()) + } } if !data.QosAdaptiveBandwidthDownstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.value", data.QosAdaptiveBandwidthDownstream.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.value", data.QosAdaptiveBandwidthDownstream.ValueBool()) + } } if !data.QosAdaptiveMinDownstreamVariable.IsNull() { @@ -1427,8 +1599,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstreamVariable.ValueString()) } } else if !data.QosAdaptiveMinDownstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstream.ValueInt64()) + } } if !data.QosAdaptiveMaxDownstreamVariable.IsNull() { @@ -1437,8 +1611,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstreamVariable.ValueString()) } } else if !data.QosAdaptiveMaxDownstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstream.ValueInt64()) + } } if !data.QosAdaptiveDefaultDownstreamVariable.IsNull() { @@ -1447,8 +1623,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstreamVariable.ValueString()) } } else if !data.QosAdaptiveDefaultDownstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstream.ValueInt64()) + } } if !data.QosShapingRateVariable.IsNull() { @@ -1457,8 +1635,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRateVariable.ValueString()) } } else if !data.QosShapingRate.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64()) + } } if true { body, _ = sjson.Set(body, path+"arp", []interface{}{}) @@ -1476,8 +1656,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) + } } if !item.MacAddressVariable.IsNull() { @@ -1491,8 +1673,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody) } @@ -1509,8 +1693,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true) } } else { - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool()) + } } if !data.DuplexVariable.IsNull() { @@ -1524,8 +1710,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString()) + } } if !data.MacAddressVariable.IsNull() { @@ -1539,8 +1727,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString()) + } } if !data.IpMtuVariable.IsNull() { @@ -1554,8 +1744,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500) } } else { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + } } if !data.InterfaceMtuVariable.IsNull() { @@ -1569,8 +1761,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500) } } else { - body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64()) + } } if !data.TcpMssVariable.IsNull() { @@ -1584,8 +1778,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + } } if !data.SpeedVariable.IsNull() { @@ -1599,8 +1795,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString()) + } } if !data.ArpTimeoutVariable.IsNull() { @@ -1614,8 +1812,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200) } } else { - body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64()) + } } if !data.AutonegotiateVariable.IsNull() { @@ -1629,8 +1829,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool()) + } } if !data.MediaTypeVariable.IsNull() { @@ -1644,8 +1846,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString()) + } } if !data.TlocExtensionVariable.IsNull() { @@ -1659,8 +1863,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString()) + } } if !data.GreTunnelSourceIpVariable.IsNull() { @@ -1674,8 +1880,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.value", data.GreTunnelSourceIp.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.value", data.GreTunnelSourceIp.ValueString()) + } } if !data.XconnectVariable.IsNull() { @@ -1689,8 +1897,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.value", data.Xconnect.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.value", data.Xconnect.ValueString()) + } } if !data.LoadIntervalVariable.IsNull() { @@ -1704,8 +1914,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"advanced.loadInterval.value", 30) } } else { - body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64()) + } } if !data.TrackerVariable.IsNull() { @@ -1719,8 +1931,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string } } else { - body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString()) + } } if !data.IpDirectedBroadcastVariable.IsNull() { @@ -1734,8 +1948,10 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false) } } else { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go index 96515493..c3b69c66 100644 --- a/internal/provider/model_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go @@ -97,8 +97,10 @@ func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceNameVariable.ValueString()) } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"basic.ifName.optionType", "global") - body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.ifName.optionType", "global") + body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceName.ValueString()) + } } if !data.InterfaceDescriptionVariable.IsNull() { @@ -112,8 +114,10 @@ func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"basic.description.optionType", "global") - body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.description.optionType", "global") + body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescription.ValueString()) + } } if !data.Ipv4AddressVariable.IsNull() { @@ -122,8 +126,10 @@ func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4AddressVariable.ValueString()) } } else if !data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"basic.address.address.optionType", "global") - body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.address.address.optionType", "global") + body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { @@ -132,8 +138,10 @@ func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMaskVariable.ValueString()) } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "global") - body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "global") + body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMask.ValueString()) + } } if !data.ShutdownVariable.IsNull() { @@ -147,8 +155,10 @@ func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.shutdown.value", false) } } else { - body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"basic.shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"basic.shutdown.value", data.Shutdown.ValueBool()) + } } if !data.TunnelSourceIpv4AddressVariable.IsNull() { @@ -157,8 +167,10 @@ func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4AddressVariable.ValueString()) } } else if !data.TunnelSourceIpv4Address.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4Address.ValueString()) + } } if !data.TunnelSourceInterfaceVariable.IsNull() { @@ -167,8 +179,10 @@ func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString()) } } else if !data.TunnelSourceInterface.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString()) + } } if !data.TunnelSourceInterfaceLoopbackVariable.IsNull() { @@ -177,8 +191,10 @@ func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopbackVariable.ValueString()) } } else if !data.TunnelSourceInterfaceLoopback.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopback.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopback.ValueString()) + } } if !data.TunnelRouteViaLoopbackVariable.IsNull() { @@ -187,8 +203,10 @@ func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopbackVariable.ValueString()) } } else if !data.TunnelRouteViaLoopback.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopback.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopback.ValueString()) + } } if !data.TunnelDestinationIpv4AddressVariable.IsNull() { @@ -197,8 +215,10 @@ func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4AddressVariable.ValueString()) } } else if !data.TunnelDestinationIpv4Address.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4Address.ValueString()) + } } if !data.IpMtuVariable.IsNull() { @@ -212,8 +232,10 @@ func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.mtu.value", 1500) } } else { - body, _ = sjson.Set(body, path+"basic.mtu.optionType", "global") - body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.mtu.optionType", "global") + body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtu.ValueInt64()) + } } if !data.TcpMssVariable.IsNull() { @@ -227,8 +249,10 @@ func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMss.ValueInt64()) + } } if !data.ClearDontFragmentVariable.IsNull() { @@ -242,8 +266,10 @@ func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", false) } } else { - body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "global") - body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragment.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "global") + body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragment.ValueBool()) + } } if !data.ApplicationTunnelTypeVariable.IsNull() { @@ -252,8 +278,10 @@ func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelTypeVariable.ValueString()) } } else if !data.ApplicationTunnelType.IsNull() { - body, _ = sjson.Set(body, path+"advanced.application.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.application.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelType.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go index bed1c6ba..09b05535 100644 --- a/internal/provider/model_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go @@ -128,8 +128,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceNameVariable.ValueString()) } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"ifName.optionType", "global") - body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ifName.optionType", "global") + body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceName.ValueString()) + } } if !data.ShutdownVariable.IsNull() { @@ -143,8 +145,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"shutdown.value", true) } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.InterfaceDescriptionVariable.IsNull() { @@ -158,8 +162,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"description.optionType", "global") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "global") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + } } if !data.Ipv4AddressVariable.IsNull() { @@ -168,8 +174,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4AddressVariable.ValueString()) } } else if !data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"address.address.optionType", "global") - body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"address.address.optionType", "global") + body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { @@ -178,8 +186,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMaskVariable.ValueString()) } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"address.mask.optionType", "global") - body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"address.mask.optionType", "global") + body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMask.ValueString()) + } } if !data.TunnelSourceIpv4AddressVariable.IsNull() { @@ -188,8 +198,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4AddressVariable.ValueString()) } } else if !data.TunnelSourceIpv4Address.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4Address.ValueString()) + } } if !data.TunnelSourceIpv4SubnetMaskVariable.IsNull() { @@ -198,8 +210,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMaskVariable.ValueString()) } } else if !data.TunnelSourceIpv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMask.ValueString()) + } } if !data.TunnelSourceInterfaceVariable.IsNull() { @@ -208,8 +222,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString()) } } else if !data.TunnelSourceInterface.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString()) + } } if !data.TunnelDestinationIpv4AddressVariable.IsNull() { @@ -218,8 +234,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4AddressVariable.ValueString()) } } else if !data.TunnelDestinationIpv4Address.IsNull() { - body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4Address.ValueString()) + } } if !data.TunnelDestinationIpv4SubnetMaskVariable.IsNull() { @@ -228,8 +246,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMaskVariable.ValueString()) } } else if !data.TunnelDestinationIpv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMask.ValueString()) + } } if !data.ApplicationTunnelTypeVariable.IsNull() { @@ -238,8 +258,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelTypeVariable.ValueString()) } } else if !data.ApplicationTunnelType.IsNull() { - body, _ = sjson.Set(body, path+"application.optionType", "global") - body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"application.optionType", "global") + body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelType.ValueString()) + } } if !data.TcpMssVariable.IsNull() { @@ -253,8 +275,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "global") - body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "global") + body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMss.ValueInt64()) + } } if !data.ClearDontFragmentVariable.IsNull() { @@ -268,8 +292,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"clearDontFragment.value", false) } } else { - body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "global") - body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragment.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "global") + body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragment.ValueBool()) + } } if !data.IpMtuVariable.IsNull() { @@ -283,8 +309,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"mtu.value", 1500) } } else { - body, _ = sjson.Set(body, path+"mtu.optionType", "global") - body, _ = sjson.Set(body, path+"mtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"mtu.optionType", "global") + body, _ = sjson.Set(body, path+"mtu.value", data.IpMtu.ValueInt64()) + } } if !data.DpdIntervalVariable.IsNull() { @@ -298,8 +326,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"dpdInterval.value", 10) } } else { - body, _ = sjson.Set(body, path+"dpdInterval.optionType", "global") - body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"dpdInterval.optionType", "global") + body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdInterval.ValueInt64()) + } } if !data.DpdRetriesVariable.IsNull() { @@ -313,8 +343,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"dpdRetries.value", 3) } } else { - body, _ = sjson.Set(body, path+"dpdRetries.optionType", "global") - body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetries.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"dpdRetries.optionType", "global") + body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetries.ValueInt64()) + } } if !data.IkePresharedKeyVariable.IsNull() { @@ -323,8 +355,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKeyVariable.ValueString()) } } else if !data.IkePresharedKey.IsNull() { - body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "global") - body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKey.ValueString()) + if true { + body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "global") + body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKey.ValueString()) + } } if data.IkeVersion.IsNull() { if true { @@ -332,8 +366,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ikeVersion.value", 1) } } else { - body, _ = sjson.Set(body, path+"ikeVersion.optionType", "global") - body, _ = sjson.Set(body, path+"ikeVersion.value", data.IkeVersion.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ikeVersion.optionType", "global") + body, _ = sjson.Set(body, path+"ikeVersion.value", data.IkeVersion.ValueInt64()) + } } if !data.IkeIntegrityProtocolVariable.IsNull() { @@ -347,8 +383,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ikeMode.value", "main") } } else { - body, _ = sjson.Set(body, path+"ikeMode.optionType", "global") - body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocol.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeMode.optionType", "global") + body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocol.ValueString()) + } } if !data.IkeRekeyIntervalVariable.IsNull() { @@ -362,8 +400,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", 14400) } } else { - body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "global") - body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "global") + body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyInterval.ValueInt64()) + } } if !data.IkeCiphersuiteVariable.IsNull() { @@ -377,8 +417,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ikeCiphersuite.value", "aes256-cbc-sha1") } } else { - body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "global") - body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuite.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "global") + body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuite.ValueString()) + } } if !data.IkeDiffieHellmanGroupVariable.IsNull() { @@ -392,8 +434,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ikeGroup.value", "16") } } else { - body, _ = sjson.Set(body, path+"ikeGroup.optionType", "global") - body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroup.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeGroup.optionType", "global") + body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroup.ValueString()) + } } if !data.IkeIdLocalEndPointVariable.IsNull() { @@ -407,8 +451,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "global") - body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPoint.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "global") + body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPoint.ValueString()) + } } if !data.IkeIdRemoteEndPointVariable.IsNull() { @@ -422,8 +468,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "global") - body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPoint.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "global") + body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPoint.ValueString()) + } } if !data.IpsecRekeyIntervalVariable.IsNull() { @@ -437,8 +485,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", 3600) } } else { - body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "global") - body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "global") + body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyInterval.ValueInt64()) + } } if !data.IpsecReplayWindowVariable.IsNull() { @@ -452,8 +502,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", 512) } } else { - body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "global") - body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindow.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "global") + body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindow.ValueInt64()) + } } if !data.IpsecCiphersuiteVariable.IsNull() { @@ -467,8 +519,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", "aes256-gcm") } } else { - body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "global") - body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuite.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "global") + body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuite.ValueString()) + } } if !data.PerfectForwardSecrecyVariable.IsNull() { @@ -482,8 +536,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", "group-16") } } else { - body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "global") - body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecy.ValueString()) + if true { + body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "global") + body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecy.ValueString()) + } } if !data.TrackerIdVariable.IsNull() { @@ -497,8 +553,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"tracker.optionType", "global") - body, _ = sjson.Set(body, path+"tracker.value", data.TrackerId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tracker.optionType", "global") + body, _ = sjson.Set(body, path+"tracker.value", data.TrackerId.ValueString()) + } } if !data.TunnelRouteViaVariable.IsNull() { @@ -512,8 +570,10 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { } } else { - body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteVia.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteVia.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go index e3cecd7f..18a65630 100644 --- a/internal/provider/model_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go @@ -184,8 +184,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"shutdown.value", true) } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.InterfaceNameVariable.IsNull() { @@ -194,8 +196,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + } } if !data.Ipv4AddressVariable.IsNull() { @@ -209,8 +213,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin } } else { - body, _ = sjson.Set(body, path+"addressV4.address.optionType", "global") - body, _ = sjson.Set(body, path+"addressV4.address.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"addressV4.address.optionType", "global") + body, _ = sjson.Set(body, path+"addressV4.address.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { @@ -219,8 +225,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"addressV4.mask.value", data.Ipv4SubnetMaskVariable.ValueString()) } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"addressV4.mask.optionType", "global") - body, _ = sjson.Set(body, path+"addressV4.mask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"addressV4.mask.optionType", "global") + body, _ = sjson.Set(body, path+"addressV4.mask.value", data.Ipv4SubnetMask.ValueString()) + } } if !data.Ipv6AddressVariable.IsNull() { @@ -234,8 +242,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin } } else { - body, _ = sjson.Set(body, path+"addressV6.optionType", "global") - body, _ = sjson.Set(body, path+"addressV6.value", data.Ipv6Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"addressV6.optionType", "global") + body, _ = sjson.Set(body, path+"addressV6.value", data.Ipv6Address.ValueString()) + } } if !data.BandwidthVariable.IsNull() { @@ -249,8 +259,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin } } else { - body, _ = sjson.Set(body, path+"bandwidth.optionType", "global") - body, _ = sjson.Set(body, path+"bandwidth.value", data.Bandwidth.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"bandwidth.optionType", "global") + body, _ = sjson.Set(body, path+"bandwidth.value", data.Bandwidth.ValueInt64()) + } } if !data.BandwidthDownstreamVariable.IsNull() { @@ -264,8 +276,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin } } else { - body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64()) + } } if !data.ClockRateVariable.IsNull() { @@ -279,8 +293,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin } } else { - body, _ = sjson.Set(body, path+"clockRate.optionType", "global") - body, _ = sjson.Set(body, path+"clockRate.value", data.ClockRate.ValueString()) + if true { + body, _ = sjson.Set(body, path+"clockRate.optionType", "global") + body, _ = sjson.Set(body, path+"clockRate.value", data.ClockRate.ValueString()) + } } if !data.EncapsulationVariable.IsNull() { @@ -294,8 +310,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin } } else { - body, _ = sjson.Set(body, path+"encapsulationSerial.optionType", "global") - body, _ = sjson.Set(body, path+"encapsulationSerial.value", data.Encapsulation.ValueString()) + if true { + body, _ = sjson.Set(body, path+"encapsulationSerial.optionType", "global") + body, _ = sjson.Set(body, path+"encapsulationSerial.value", data.Encapsulation.ValueString()) + } } if data.TunnelInterface.IsNull() { if true { @@ -303,8 +321,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnelInterface.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool()) + } } if !data.PerTunnelQosVariable.IsNull() { @@ -318,8 +338,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool()) + } } if !data.PerTunnelQosAggregatorVariable.IsNull() { @@ -333,8 +355,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.value", data.PerTunnelQosAggregator.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.value", data.PerTunnelQosAggregator.ValueBool()) + } } if !data.TunnelQosModeVariable.IsNull() { @@ -343,8 +367,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosModeVariable.ValueString()) } } else if !data.TunnelQosMode.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString()) + } } if !data.TunnelInterfaceColorVariable.IsNull() { @@ -358,8 +384,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.color.value", "default") } } else { - body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString()) + } } if !data.TunnelInterfaceRestrictVariable.IsNull() { @@ -373,8 +401,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.restrict.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceRestrict.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceRestrict.ValueBool()) + } } if !data.TunnelInterfaceGroupsVariable.IsNull() { @@ -388,8 +418,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin } } else { - body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64()) + } } if !data.TunnelInterfaceBorderVariable.IsNull() { @@ -403,8 +435,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.border.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool()) + } } if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() { @@ -418,8 +452,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin } } else { - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64()) + } } if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() { @@ -433,8 +469,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool()) + } } if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() { @@ -448,10 +486,12 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin } } else { - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global") - var values []int64 - data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values) + if true { + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global") + var values []int64 + data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values) + } } if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() { @@ -465,8 +505,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.value", 5) } } else { - body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64()) + } } if !data.TunnelInterfacePortHopVariable.IsNull() { @@ -480,8 +522,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.portHop.value", true) } } else { - body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool()) + } } if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() { @@ -495,8 +539,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool()) + } } if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() { @@ -510,8 +556,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin } } else { - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64()) + } } if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() { @@ -525,8 +573,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool()) + } } if !data.TunnelInterfaceClearNetworkBroadcastVariable.IsNull() { @@ -540,8 +590,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceClearNetworkBroadcast.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceClearNetworkBroadcast.ValueBool()) + } } if !data.TunnelInterfaceCarrierVariable.IsNull() { @@ -555,8 +607,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.carrier.value", "default") } } else { - body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString()) + } } if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() { @@ -570,8 +624,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin } } else { - body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString()) + } } if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() { @@ -585,8 +641,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", false) } } else { - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool()) + } } if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() { @@ -600,8 +658,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", 5) } } else { - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64()) + } } if !data.TunnelInterfaceHelloIntervalVariable.IsNull() { @@ -615,8 +675,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", 1000) } } else { - body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64()) + } } if !data.TunnelInterfaceHelloToleranceVariable.IsNull() { @@ -630,8 +692,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", 12) } } else { - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64()) + } } if !data.TunnelInterfaceAllowAllVariable.IsNull() { @@ -645,8 +709,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"allowService.all.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.all.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.all.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool()) + } } if !data.TunnelInterfaceAllowBgpVariable.IsNull() { @@ -660,8 +726,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"allowService.bgp.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool()) + } } if !data.TunnelInterfaceAllowDhcpVariable.IsNull() { @@ -675,8 +743,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"allowService.dhcp.value", true) } } else { - body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool()) + } } if !data.TunnelInterfaceAllowDnsVariable.IsNull() { @@ -690,8 +760,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"allowService.dns.value", true) } } else { - body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool()) + } } if !data.TunnelInterfaceAllowIcmpVariable.IsNull() { @@ -705,8 +777,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"allowService.icmp.value", true) } } else { - body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool()) + } } if !data.TunnelInterfaceAllowNetconfVariable.IsNull() { @@ -720,8 +794,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"allowService.netconf.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool()) + } } if !data.TunnelInterfaceAllowNtpVariable.IsNull() { @@ -730,8 +806,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtpVariable.ValueString()) } } else if !data.TunnelInterfaceAllowNtp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool()) + } } if !data.TunnelInterfaceAllowOspfVariable.IsNull() { @@ -745,8 +823,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"allowService.ospf.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool()) + } } if !data.TunnelInterfaceAllowSshVariable.IsNull() { @@ -755,8 +835,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"allowService.sshd.value", data.TunnelInterfaceAllowSshVariable.ValueString()) } } else if !data.TunnelInterfaceAllowSsh.IsNull() { - body, _ = sjson.Set(body, path+"allowService.sshd.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.sshd.value", data.TunnelInterfaceAllowSsh.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.sshd.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.sshd.value", data.TunnelInterfaceAllowSsh.ValueBool()) + } } if !data.TunnelInterfaceAllowStunVariable.IsNull() { @@ -770,8 +852,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"allowService.stun.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool()) + } } if !data.TunnelInterfaceAllowHttpsVariable.IsNull() { @@ -785,8 +869,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"allowService.https.value", true) } } else { - body, _ = sjson.Set(body, path+"allowService.https.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.https.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool()) + } } if !data.TunnelInterfaceAllowSnmpVariable.IsNull() { @@ -800,8 +886,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"allowService.snmp.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool()) + } } if !data.TunnelInterfaceAllowBfdVariable.IsNull() { @@ -815,16 +903,20 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"allowService.bfd.value", false) } } else { - body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool()) + } } if true { body, _ = sjson.Set(body, path+"encapsulation", []interface{}{}) for _, item := range data.TunnelInterfaceEncapsulations { itemBody := "" if !item.Encapsulation.IsNull() { - itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString()) + } } if !item.PreferenceVariable.IsNull() { @@ -838,8 +930,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin } } else { - itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64()) + } } if !item.WeightVariable.IsNull() { @@ -853,8 +947,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin itemBody, _ = sjson.Set(itemBody, "weight.value", 1) } } else { - itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"encapsulation.-1", itemBody) } @@ -866,8 +962,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRateVariable.ValueString()) } } else if !data.QosShapingRate.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64()) + } } if !data.TcpMssVariable.IsNull() { @@ -881,8 +979,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin } } else { - body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.value", data.TcpMss.ValueInt64()) + } } if !data.MtuVariable.IsNull() { @@ -896,8 +996,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"advanced.mtu.value", 1500) } } else { - body, _ = sjson.Set(body, path+"advanced.mtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.mtu.value", data.Mtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.mtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.mtu.value", data.Mtu.ValueInt64()) + } } if !data.IpMtuVariable.IsNull() { @@ -911,8 +1013,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500) } } else { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + } } if !data.TlocExtensionVariable.IsNull() { @@ -926,8 +1030,10 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin } } else { - body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_wan_vpn_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_profile_parcel.go index cdeb87ae..5d2bec62 100644 --- a/internal/provider/model_sdwan_transport_wan_vpn_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_wan_vpn_profile_parcel.go @@ -140,8 +140,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"vpnId.value", 0) } } else { - body, _ = sjson.Set(body, path+"vpnId.optionType", "global") - body, _ = sjson.Set(body, path+"vpnId.value", data.Vpn.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"vpnId.optionType", "global") + body, _ = sjson.Set(body, path+"vpnId.value", data.Vpn.ValueInt64()) + } } if !data.EnhanceEcmpKeyingVariable.IsNull() { @@ -155,8 +157,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"enhanceEcmpKeying.value", false) } } else { - body, _ = sjson.Set(body, path+"enhanceEcmpKeying.optionType", "global") - body, _ = sjson.Set(body, path+"enhanceEcmpKeying.value", data.EnhanceEcmpKeying.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"enhanceEcmpKeying.optionType", "global") + body, _ = sjson.Set(body, path+"enhanceEcmpKeying.value", data.EnhanceEcmpKeying.ValueBool()) + } } if !data.PrimaryDnsAddressIpv4Variable.IsNull() { @@ -165,8 +169,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4Variable.ValueString()) } } else if !data.PrimaryDnsAddressIpv4.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString()) + } } if !data.SecondaryDnsAddressIpv4Variable.IsNull() { @@ -175,8 +181,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4Variable.ValueString()) } } else if !data.SecondaryDnsAddressIpv4.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString()) + } } if !data.PrimaryDnsAddressIpv6Variable.IsNull() { @@ -185,8 +193,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6Variable.ValueString()) } } else if !data.PrimaryDnsAddressIpv6.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString()) + } } if !data.SecondaryDnsAddressIpv6Variable.IsNull() { @@ -195,8 +205,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6Variable.ValueString()) } } else if !data.SecondaryDnsAddressIpv6.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString()) + } } if true { body, _ = sjson.Set(body, path+"newHostMapping", []interface{}{}) @@ -209,8 +221,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostNameVariable.ValueString()) } } else if !item.HostName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString()) + } } if !item.ListOfIpAddressesVariable.IsNull() { @@ -219,10 +233,12 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "listOfIp.value", item.ListOfIpAddressesVariable.ValueString()) } } else if !item.ListOfIpAddresses.IsNull() { - itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global") - var values []string - item.ListOfIpAddresses.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values) + if true { + itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global") + var values []string + item.ListOfIpAddresses.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values) + } } body, _ = sjson.SetRaw(body, path+"newHostMapping.-1", itemBody) } @@ -238,8 +254,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) } } else if !item.NetworkAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + } } if !item.SubnetMaskVariable.IsNull() { @@ -248,8 +266,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) } } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + } } if item.Gateway.IsNull() { if true { @@ -257,8 +277,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "gateway.value", "nextHop") } } else { - itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "gateway.value", item.Gateway.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "gateway.value", item.Gateway.ValueString()) + } } if true && item.Gateway.ValueString() == "nextHop" { itemBody, _ = sjson.Set(itemBody, "nextHop", []interface{}{}) @@ -271,8 +293,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) } } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } } if !childItem.AdministrativeDistanceVariable.IsNull() { @@ -286,8 +310,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", 1) } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + } } itemBody, _ = sjson.SetRaw(itemBody, "nextHop.-1", itemChildBody) } @@ -304,8 +330,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "distance.value", 1) } } else { - itemBody, _ = sjson.Set(itemBody, "distance.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistance.ValueInt64()) + if true && item.Gateway.ValueString() == "null0" { + itemBody, _ = sjson.Set(itemBody, "distance.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistance.ValueInt64()) + } } body, _ = sjson.SetRaw(body, path+"ipv4Route.-1", itemBody) } @@ -321,8 +349,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "prefix.value", item.PrefixVariable.ValueString()) } } else if !item.Prefix.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString()) + } } if true { @@ -335,8 +365,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) } } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } } if !childItem.AdministrativeDistanceVariable.IsNull() { @@ -345,15 +377,19 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) } } else if !childItem.AdministrativeDistance.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + } } itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody) } } if !item.Null0.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) + } } if !item.NatVariable.IsNull() { @@ -362,8 +398,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.NatVariable.ValueString()) } } else if !item.Nat.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"ipv6Route.-1", itemBody) } @@ -373,8 +411,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { for _, item := range data.Services { itemBody := "" if !item.ServiceType.IsNull() { - itemBody, _ = sjson.Set(itemBody, "serviceType.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceType.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "serviceType.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceType.ValueString()) + } } body, _ = sjson.SetRaw(body, path+"service.-1", itemBody) } @@ -390,8 +430,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Nat64V4PoolNameVariable.ValueString()) } } else if !item.Nat64V4PoolName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Nat64V4PoolName.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Nat64V4PoolName.ValueString()) + } } if !item.Nat64V4PoolRangeStartVariable.IsNull() { @@ -400,8 +442,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.Nat64V4PoolRangeStartVariable.ValueString()) } } else if !item.Nat64V4PoolRangeStart.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.Nat64V4PoolRangeStart.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.Nat64V4PoolRangeStart.ValueString()) + } } if !item.Nat64V4PoolRangeEndVariable.IsNull() { @@ -410,8 +454,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.Nat64V4PoolRangeEndVariable.ValueString()) } } else if !item.Nat64V4PoolRangeEnd.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.Nat64V4PoolRangeEnd.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.Nat64V4PoolRangeEnd.ValueString()) + } } if !item.Nat64V4PoolOverloadVariable.IsNull() { @@ -425,8 +471,10 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", false) } } else { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.Nat64V4PoolOverload.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.Nat64V4PoolOverload.ValueBool()) + } } body, _ = sjson.SetRaw(body, path+"nat64V4Pool.-1", itemBody) }