From 7d07f20682f79cf2532e79c20cc1fe0e52030399 Mon Sep 17 00:00:00 2001 From: danischm Date: Thu, 29 Aug 2024 08:20:57 +0200 Subject: [PATCH] Fix changelog typo and update generated files --- CHANGELOG.md | 2 +- docs/guides/changelog.md | 22 +- ...wan_service_routing_ospf_profile_parcel.go | 782 +++++++++++------- ...vice_routing_ospfv3_ipv4_profile_parcel.go | 716 ++++++++++------ ...vice_routing_ospfv3_ipv6_profile_parcel.go | 672 +++++++++------ ...odel_sdwan_transport_gps_profile_parcel.go | 102 ++- ...n_transport_routing_ospf_profile_parcel.go | 782 +++++++++++------- ...port_routing_ospfv3_ipv4_profile_parcel.go | 716 ++++++++++------ ...port_routing_ospfv3_ipv6_profile_parcel.go | 672 +++++++++------ templates/guides/changelog.md.tmpl | 22 +- 10 files changed, 2840 insertions(+), 1648 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e839aa3..5553a660 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ - BREAKING CHANGE: Rename `psk_selection` attribute of `sdwan_system_remote_access_profile_parcel` resource to `psk_authentication_type` - BREAKING CHANGE: Rename `aaa_derive_name_identity` attribute of `sdwan_system_remote_access_profile_parcel` resource to `aaa_derive_name_from_peer_identity` - BREAKING CHANGE: Rename `aaa_derive_name_domain` attribute of `sdwan_system_remote_access_profile_parcel` resource to `aaa_derive_name_from_peer_domain` -- BREAKING CHANGE: Removes `any_connect_eap_profile_download_status` and `any_connect_eap_profile_file_name` attributes of `sdwan_system_remote_access_profile_parcel +- BREAKING CHANGE: Removes `any_connect_eap_profile_download_status` and `any_connect_eap_profile_file_name` attributes of `sdwan_system_remote_access_profile_parcel` - Add `sdwan_policy_object_feature_profile` resource and data source - Add `sdwan_policy_object_class_map_profile_parcel` resource and data source - Add `sdwan_policy_object_color_list_profile_parcel` resource and data source diff --git a/docs/guides/changelog.md b/docs/guides/changelog.md index 34e7c1f8..d05c00d1 100644 --- a/docs/guides/changelog.md +++ b/docs/guides/changelog.md @@ -1,12 +1,12 @@ ---- -subcategory: "Guides" -page_title: "Changelog" -description: |- - Changelog ---- - -# Changelog - +--- +subcategory: "Guides" +page_title: "Changelog" +description: |- + Changelog +--- + +# Changelog + ## 0.3.14 (unreleased) - Fix issue when reading deleted `sdwan_cli_config_profile_parcel` resource, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/291) @@ -20,7 +20,7 @@ description: |- - BREAKING CHANGE: Rename `psk_selection` attribute of `sdwan_system_remote_access_profile_parcel` resource to `psk_authentication_type` - BREAKING CHANGE: Rename `aaa_derive_name_identity` attribute of `sdwan_system_remote_access_profile_parcel` resource to `aaa_derive_name_from_peer_identity` - BREAKING CHANGE: Rename `aaa_derive_name_domain` attribute of `sdwan_system_remote_access_profile_parcel` resource to `aaa_derive_name_from_peer_domain` -- BREAKING CHANGE: Removes `any_connect_eap_profile_download_status` and `any_connect_eap_profile_file_name` attributes of `sdwan_system_remote_access_profile_parcel +- BREAKING CHANGE: Removes `any_connect_eap_profile_download_status` and `any_connect_eap_profile_file_name` attributes of `sdwan_system_remote_access_profile_parcel` - Add `sdwan_policy_object_feature_profile` resource and data source - Add `sdwan_policy_object_class_map_profile_parcel` resource and data source - Add `sdwan_policy_object_color_list_profile_parcel` resource and data source @@ -327,4 +327,4 @@ description: |- ## 0.1.0 (July 23, 2021) - Initial Release - + diff --git a/internal/provider/model_sdwan_service_routing_ospf_profile_parcel.go b/internal/provider/model_sdwan_service_routing_ospf_profile_parcel.go index 3453f754..20924e0b 100644 --- a/internal/provider/model_sdwan_service_routing_ospf_profile_parcel.go +++ b/internal/provider/model_sdwan_service_routing_ospf_profile_parcel.go @@ -152,388 +152,592 @@ func (data ServiceRoutingOSPF) toBody(ctx context.Context) string { path := "data." if !data.RouterIdVariable.IsNull() { - body, _ = sjson.Set(body, path+"routerId.optionType", "variable") - body, _ = sjson.Set(body, path+"routerId.value", data.RouterIdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"routerId.optionType", "variable") + body, _ = sjson.Set(body, path+"routerId.value", data.RouterIdVariable.ValueString()) + } } else if data.RouterId.IsNull() { - body, _ = sjson.Set(body, path+"routerId.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"routerId.optionType", "default") + } } 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.ReferenceBandwidthVariable.IsNull() { - body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "variable") - body, _ = sjson.Set(body, path+"referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "variable") + body, _ = sjson.Set(body, path+"referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString()) + } } else if data.ReferenceBandwidth.IsNull() { - body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "default") - body, _ = sjson.Set(body, path+"referenceBandwidth.value", 100) + if true { + body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "default") + body, _ = sjson.Set(body, path+"referenceBandwidth.value", 100) + } } else { - body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "global") - body, _ = sjson.Set(body, path+"referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "global") + body, _ = sjson.Set(body, path+"referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64()) + } } if !data.Rfc1583CompatibleVariable.IsNull() { - body, _ = sjson.Set(body, path+"rfc1583.optionType", "variable") - body, _ = sjson.Set(body, path+"rfc1583.value", data.Rfc1583CompatibleVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"rfc1583.optionType", "variable") + body, _ = sjson.Set(body, path+"rfc1583.value", data.Rfc1583CompatibleVariable.ValueString()) + } } else if data.Rfc1583Compatible.IsNull() { - body, _ = sjson.Set(body, path+"rfc1583.optionType", "default") - body, _ = sjson.Set(body, path+"rfc1583.value", true) + if true { + body, _ = sjson.Set(body, path+"rfc1583.optionType", "default") + body, _ = sjson.Set(body, path+"rfc1583.value", true) + } } else { - body, _ = sjson.Set(body, path+"rfc1583.optionType", "global") - body, _ = sjson.Set(body, path+"rfc1583.value", data.Rfc1583Compatible.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"rfc1583.optionType", "global") + body, _ = sjson.Set(body, path+"rfc1583.value", data.Rfc1583Compatible.ValueBool()) + } } if data.DefaultInformationOriginate.IsNull() { - body, _ = sjson.Set(body, path+"originate.optionType", "default") - body, _ = sjson.Set(body, path+"originate.value", false) + if true { + body, _ = sjson.Set(body, path+"originate.optionType", "default") + body, _ = sjson.Set(body, path+"originate.value", false) + } } else { - body, _ = sjson.Set(body, path+"originate.optionType", "global") - body, _ = sjson.Set(body, path+"originate.value", data.DefaultInformationOriginate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"originate.optionType", "global") + body, _ = sjson.Set(body, path+"originate.value", data.DefaultInformationOriginate.ValueBool()) + } } if !data.DefaultInformationOriginateAlwaysVariable.IsNull() { - body, _ = sjson.Set(body, path+"always.optionType", "variable") - body, _ = sjson.Set(body, path+"always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"always.optionType", "variable") + body, _ = sjson.Set(body, path+"always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString()) + } } else if data.DefaultInformationOriginateAlways.IsNull() { - body, _ = sjson.Set(body, path+"always.optionType", "default") - body, _ = sjson.Set(body, path+"always.value", false) + if true { + body, _ = sjson.Set(body, path+"always.optionType", "default") + body, _ = sjson.Set(body, path+"always.value", false) + } } else { - body, _ = sjson.Set(body, path+"always.optionType", "global") - body, _ = sjson.Set(body, path+"always.value", data.DefaultInformationOriginateAlways.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"always.optionType", "global") + body, _ = sjson.Set(body, path+"always.value", data.DefaultInformationOriginateAlways.ValueBool()) + } } if !data.DefaultInformationOriginateMetricVariable.IsNull() { - body, _ = sjson.Set(body, path+"metric.optionType", "variable") - body, _ = sjson.Set(body, path+"metric.value", data.DefaultInformationOriginateMetricVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"metric.optionType", "variable") + body, _ = sjson.Set(body, path+"metric.value", data.DefaultInformationOriginateMetricVariable.ValueString()) + } } else if data.DefaultInformationOriginateMetric.IsNull() { - body, _ = sjson.Set(body, path+"metric.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"metric.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"metric.optionType", "global") - body, _ = sjson.Set(body, path+"metric.value", data.DefaultInformationOriginateMetric.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"metric.optionType", "global") + body, _ = sjson.Set(body, path+"metric.value", data.DefaultInformationOriginateMetric.ValueInt64()) + } } if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"metricType.optionType", "variable") - body, _ = sjson.Set(body, path+"metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"metricType.optionType", "variable") + body, _ = sjson.Set(body, path+"metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString()) + } } else if data.DefaultInformationOriginateMetricType.IsNull() { - body, _ = sjson.Set(body, path+"metricType.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"metricType.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"metricType.optionType", "global") - body, _ = sjson.Set(body, path+"metricType.value", data.DefaultInformationOriginateMetricType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"metricType.optionType", "global") + body, _ = sjson.Set(body, path+"metricType.value", data.DefaultInformationOriginateMetricType.ValueString()) + } } if !data.DistanceExternalVariable.IsNull() { - body, _ = sjson.Set(body, path+"external.optionType", "variable") - body, _ = sjson.Set(body, path+"external.value", data.DistanceExternalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"external.optionType", "variable") + body, _ = sjson.Set(body, path+"external.value", data.DistanceExternalVariable.ValueString()) + } } else if data.DistanceExternal.IsNull() { - body, _ = sjson.Set(body, path+"external.optionType", "default") - body, _ = sjson.Set(body, path+"external.value", 110) + if true { + body, _ = sjson.Set(body, path+"external.optionType", "default") + body, _ = sjson.Set(body, path+"external.value", 110) + } } else { - body, _ = sjson.Set(body, path+"external.optionType", "global") - body, _ = sjson.Set(body, path+"external.value", data.DistanceExternal.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"external.optionType", "global") + body, _ = sjson.Set(body, path+"external.value", data.DistanceExternal.ValueInt64()) + } } if !data.DistanceInterAreaVariable.IsNull() { - body, _ = sjson.Set(body, path+"interArea.optionType", "variable") - body, _ = sjson.Set(body, path+"interArea.value", data.DistanceInterAreaVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interArea.optionType", "variable") + body, _ = sjson.Set(body, path+"interArea.value", data.DistanceInterAreaVariable.ValueString()) + } } else if data.DistanceInterArea.IsNull() { - body, _ = sjson.Set(body, path+"interArea.optionType", "default") - body, _ = sjson.Set(body, path+"interArea.value", 110) + if true { + body, _ = sjson.Set(body, path+"interArea.optionType", "default") + body, _ = sjson.Set(body, path+"interArea.value", 110) + } } else { - body, _ = sjson.Set(body, path+"interArea.optionType", "global") - body, _ = sjson.Set(body, path+"interArea.value", data.DistanceInterArea.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"interArea.optionType", "global") + body, _ = sjson.Set(body, path+"interArea.value", data.DistanceInterArea.ValueInt64()) + } } if !data.DistanceIntraAreaVariable.IsNull() { - body, _ = sjson.Set(body, path+"intraArea.optionType", "variable") - body, _ = sjson.Set(body, path+"intraArea.value", data.DistanceIntraAreaVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intraArea.optionType", "variable") + body, _ = sjson.Set(body, path+"intraArea.value", data.DistanceIntraAreaVariable.ValueString()) + } } else if data.DistanceIntraArea.IsNull() { - body, _ = sjson.Set(body, path+"intraArea.optionType", "default") - body, _ = sjson.Set(body, path+"intraArea.value", 110) + if true { + body, _ = sjson.Set(body, path+"intraArea.optionType", "default") + body, _ = sjson.Set(body, path+"intraArea.value", 110) + } } else { - body, _ = sjson.Set(body, path+"intraArea.optionType", "global") - body, _ = sjson.Set(body, path+"intraArea.value", data.DistanceIntraArea.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"intraArea.optionType", "global") + body, _ = sjson.Set(body, path+"intraArea.value", data.DistanceIntraArea.ValueInt64()) + } } if !data.SpfCalculationDelayVariable.IsNull() { - body, _ = sjson.Set(body, path+"delay.optionType", "variable") - body, _ = sjson.Set(body, path+"delay.value", data.SpfCalculationDelayVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"delay.optionType", "variable") + body, _ = sjson.Set(body, path+"delay.value", data.SpfCalculationDelayVariable.ValueString()) + } } else if data.SpfCalculationDelay.IsNull() { - body, _ = sjson.Set(body, path+"delay.optionType", "default") - body, _ = sjson.Set(body, path+"delay.value", 200) + if true { + body, _ = sjson.Set(body, path+"delay.optionType", "default") + body, _ = sjson.Set(body, path+"delay.value", 200) + } } else { - body, _ = sjson.Set(body, path+"delay.optionType", "global") - body, _ = sjson.Set(body, path+"delay.value", data.SpfCalculationDelay.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"delay.optionType", "global") + body, _ = sjson.Set(body, path+"delay.value", data.SpfCalculationDelay.ValueInt64()) + } } if !data.SpfInitialHoldTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"initialHold.optionType", "variable") - body, _ = sjson.Set(body, path+"initialHold.value", data.SpfInitialHoldTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"initialHold.optionType", "variable") + body, _ = sjson.Set(body, path+"initialHold.value", data.SpfInitialHoldTimeVariable.ValueString()) + } } else if data.SpfInitialHoldTime.IsNull() { - body, _ = sjson.Set(body, path+"initialHold.optionType", "default") - body, _ = sjson.Set(body, path+"initialHold.value", 1000) + if true { + body, _ = sjson.Set(body, path+"initialHold.optionType", "default") + body, _ = sjson.Set(body, path+"initialHold.value", 1000) + } } else { - body, _ = sjson.Set(body, path+"initialHold.optionType", "global") - body, _ = sjson.Set(body, path+"initialHold.value", data.SpfInitialHoldTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"initialHold.optionType", "global") + body, _ = sjson.Set(body, path+"initialHold.value", data.SpfInitialHoldTime.ValueInt64()) + } } if !data.SpfMaximumHoldTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"maxHold.optionType", "variable") - body, _ = sjson.Set(body, path+"maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"maxHold.optionType", "variable") + body, _ = sjson.Set(body, path+"maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString()) + } } else if data.SpfMaximumHoldTime.IsNull() { - body, _ = sjson.Set(body, path+"maxHold.optionType", "default") - body, _ = sjson.Set(body, path+"maxHold.value", 10000) + if true { + body, _ = sjson.Set(body, path+"maxHold.optionType", "default") + body, _ = sjson.Set(body, path+"maxHold.value", 10000) + } } else { - body, _ = sjson.Set(body, path+"maxHold.optionType", "global") - body, _ = sjson.Set(body, path+"maxHold.value", data.SpfMaximumHoldTime.ValueInt64()) - } - body, _ = sjson.Set(body, path+"redistribute", []interface{}{}) - for _, item := range data.Redistributes { - itemBody := "" - - if !item.ProtocolVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable") - 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 !item.NatDiaVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "dia.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "dia.value", item.NatDiaVariable.ValueString()) - } else if item.NatDia.IsNull() { - itemBody, _ = sjson.Set(itemBody, "dia.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "dia.value", true) - } else { - itemBody, _ = sjson.Set(itemBody, "dia.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "dia.value", item.NatDia.ValueBool()) - } - if !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) - } - body, _ = sjson.SetRaw(body, path+"redistribute.-1", itemBody) - } - body, _ = sjson.Set(body, path+"routerLsa", []interface{}{}) - for _, item := range data.RouterLsas { - itemBody := "" - if !item.Type.IsNull() { - itemBody, _ = sjson.Set(itemBody, "adType.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "adType.value", item.Type.ValueString()) - } - - if !item.TimeVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "time.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "time.value", item.TimeVariable.ValueString()) - } else if !item.Time.IsNull() { - itemBody, _ = sjson.Set(itemBody, "time.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "time.value", item.Time.ValueInt64()) - } - body, _ = sjson.SetRaw(body, path+"routerLsa.-1", itemBody) + if true { + body, _ = sjson.Set(body, path+"maxHold.optionType", "global") + body, _ = sjson.Set(body, path+"maxHold.value", data.SpfMaximumHoldTime.ValueInt64()) + } } - if !data.RoutePolicyId.IsNull() { - body, _ = sjson.Set(body, path+"routePolicy.refId.optionType", "global") - body, _ = sjson.Set(body, path+"routePolicy.refId.value", data.RoutePolicyId.ValueString()) - } - body, _ = sjson.Set(body, path+"area", []interface{}{}) - for _, item := range data.Areas { - itemBody := "" - - if !item.AreaNumberVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "aNum.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "aNum.value", item.AreaNumberVariable.ValueString()) - } else if !item.AreaNumber.IsNull() { - itemBody, _ = sjson.Set(itemBody, "aNum.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "aNum.value", item.AreaNumber.ValueInt64()) - } - if item.AreaType.IsNull() { - itemBody, _ = sjson.Set(itemBody, "aType.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "aType.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "aType.value", item.AreaType.ValueString()) - } - - if !item.NoSummaryVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "noSummary.value", item.NoSummaryVariable.ValueString()) - } else if item.NoSummary.IsNull() { - itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "noSummary.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "noSummary.value", item.NoSummary.ValueBool()) - } - itemBody, _ = sjson.Set(itemBody, "interface", []interface{}{}) - for _, childItem := range item.Interfaces { - itemChildBody := "" - - if !childItem.NameVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "name.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "name.value", childItem.NameVariable.ValueString()) - } else if !childItem.Name.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "name.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "name.value", childItem.Name.ValueString()) - } + if true { + body, _ = sjson.Set(body, path+"redistribute", []interface{}{}) + for _, item := range data.Redistributes { + itemBody := "" - if !childItem.HelloIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString()) - } else if childItem.HelloInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64()) + if !item.ProtocolVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString()) + } + } else if !item.Protocol.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString()) + } } - if !childItem.DeadIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString()) - } else if childItem.DeadInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40) + if !item.NatDiaVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "dia.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "dia.value", item.NatDiaVariable.ValueString()) + } + } else if item.NatDia.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "dia.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "dia.value", true) + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "dia.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "dia.value", item.NatDia.ValueBool()) + } } - - if !childItem.LsaRetransmitIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString()) - } else if childItem.LsaRetransmitInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64()) + if !item.RoutePolicyId.IsNull() { + 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+"redistribute.-1", itemBody) + } + } + if true { + body, _ = sjson.Set(body, path+"routerLsa", []interface{}{}) + for _, item := range data.RouterLsas { + itemBody := "" + if !item.Type.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "adType.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "adType.value", item.Type.ValueString()) + } } - if !childItem.CostVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) - } else if childItem.Cost.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") - - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) + if !item.TimeVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "time.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "time.value", item.TimeVariable.ValueString()) + } + } else if !item.Time.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "time.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "time.value", item.Time.ValueInt64()) + } } + body, _ = sjson.SetRaw(body, path+"routerLsa.-1", itemBody) + } + } + if !data.RoutePolicyId.IsNull() { + if true { + body, _ = sjson.Set(body, path+"routePolicy.refId.optionType", "global") + body, _ = sjson.Set(body, path+"routePolicy.refId.value", data.RoutePolicyId.ValueString()) + } + } + if true { + body, _ = sjson.Set(body, path+"area", []interface{}{}) + for _, item := range data.Areas { + itemBody := "" - if !childItem.DesignatedRouterPriorityVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", childItem.DesignatedRouterPriorityVariable.ValueString()) - } else if childItem.DesignatedRouterPriority.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", 1) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", childItem.DesignatedRouterPriority.ValueInt64()) + if !item.AreaNumberVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "aNum.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "aNum.value", item.AreaNumberVariable.ValueString()) + } + } else if !item.AreaNumber.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "aNum.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "aNum.value", item.AreaNumber.ValueInt64()) + } } + if item.AreaType.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "aType.optionType", "default") - if !childItem.NetworkTypeVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.NetworkTypeVariable.ValueString()) - } else if childItem.NetworkType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "network.value", "broadcast") + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.NetworkType.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "aType.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "aType.value", item.AreaType.ValueString()) + } } - if !childItem.PassiveInterfaceVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString()) - } else if childItem.PassiveInterface.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false) + if !item.NoSummaryVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "noSummary.value", item.NoSummaryVariable.ValueString()) + } + } else if item.NoSummary.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "noSummary.value", false) + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "noSummary.value", item.NoSummary.ValueBool()) + } } + if true { + itemBody, _ = sjson.Set(itemBody, "interface", []interface{}{}) + for _, childItem := range item.Interfaces { + itemChildBody := "" + + if !childItem.NameVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "name.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "name.value", childItem.NameVariable.ValueString()) + } + } else if !childItem.Name.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "name.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "name.value", childItem.Name.ValueString()) + } + } - if !childItem.AuthenticationTypeVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "type.value", childItem.AuthenticationTypeVariable.ValueString()) - } else if childItem.AuthenticationType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "default") + if !childItem.HelloIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString()) + } + } else if childItem.HelloInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64()) + } + } - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "type.value", childItem.AuthenticationType.ValueString()) - } + if !childItem.DeadIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString()) + } + } else if childItem.DeadInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64()) + } + } - if !childItem.MessageDigestKeyIdVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.value", childItem.MessageDigestKeyIdVariable.ValueString()) - } else if childItem.MessageDigestKeyId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "default") + if !childItem.LsaRetransmitIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString()) + } + } else if childItem.LsaRetransmitInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64()) + } + } - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.value", childItem.MessageDigestKeyId.ValueInt64()) - } + if !childItem.CostVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) + } + } else if childItem.Cost.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") - if !childItem.MessageDigestKeyVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "md5.value", childItem.MessageDigestKeyVariable.ValueString()) - } else if childItem.MessageDigestKey.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "default") + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) + } + } - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "md5.value", childItem.MessageDigestKey.ValueString()) - } - itemBody, _ = sjson.SetRaw(itemBody, "interface.-1", itemChildBody) - } - itemBody, _ = sjson.Set(itemBody, "range", []interface{}{}) - for _, childItem := range item.Ranges { - itemChildBody := "" - - if !childItem.IpAddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.value", childItem.IpAddressVariable.ValueString()) - } else if !childItem.IpAddress.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.value", childItem.IpAddress.ValueString()) - } + if !childItem.DesignatedRouterPriorityVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", childItem.DesignatedRouterPriorityVariable.ValueString()) + } + } else if childItem.DesignatedRouterPriority.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", 1) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", childItem.DesignatedRouterPriority.ValueInt64()) + } + } - if !childItem.SubnetMaskVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.value", childItem.SubnetMaskVariable.ValueString()) - } else if !childItem.SubnetMask.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.value", childItem.SubnetMask.ValueString()) - } + if !childItem.NetworkTypeVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.NetworkTypeVariable.ValueString()) + } + } else if childItem.NetworkType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "network.value", "broadcast") + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.NetworkType.ValueString()) + } + } - if !childItem.CostVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) - } else if childItem.Cost.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") + if !childItem.PassiveInterfaceVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString()) + } + } else if childItem.PassiveInterface.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool()) + } + } - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) + if !childItem.AuthenticationTypeVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "type.value", childItem.AuthenticationTypeVariable.ValueString()) + } + } else if childItem.AuthenticationType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "default") + + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "type.value", childItem.AuthenticationType.ValueString()) + } + } + + if !childItem.MessageDigestKeyIdVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.value", childItem.MessageDigestKeyIdVariable.ValueString()) + } + } else if childItem.MessageDigestKeyId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "default") + + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.value", childItem.MessageDigestKeyId.ValueInt64()) + } + } + + if !childItem.MessageDigestKeyVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "md5.value", childItem.MessageDigestKeyVariable.ValueString()) + } + } else if childItem.MessageDigestKey.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "default") + + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "md5.value", childItem.MessageDigestKey.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "interface.-1", itemChildBody) + } } + if true { + itemBody, _ = sjson.Set(itemBody, "range", []interface{}{}) + for _, childItem := range item.Ranges { + itemChildBody := "" + + if !childItem.IpAddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.value", childItem.IpAddressVariable.ValueString()) + } + } else if !childItem.IpAddress.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.value", childItem.IpAddress.ValueString()) + } + } - if !childItem.NoAdvertiseVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString()) - } else if childItem.NoAdvertise.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool()) + if !childItem.SubnetMaskVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.value", childItem.SubnetMaskVariable.ValueString()) + } + } else if !childItem.SubnetMask.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.value", childItem.SubnetMask.ValueString()) + } + } + + if !childItem.CostVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) + } + } else if childItem.Cost.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") + + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) + } + } + + if !childItem.NoAdvertiseVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString()) + } + } else if childItem.NoAdvertise.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "range.-1", itemChildBody) + } } - itemBody, _ = sjson.SetRaw(itemBody, "range.-1", itemChildBody) + body, _ = sjson.SetRaw(body, path+"area.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"area.-1", itemBody) } return body } diff --git a/internal/provider/model_sdwan_service_routing_ospfv3_ipv4_profile_parcel.go b/internal/provider/model_sdwan_service_routing_ospfv3_ipv4_profile_parcel.go index 36dd76d6..84db264f 100644 --- a/internal/provider/model_sdwan_service_routing_ospfv3_ipv4_profile_parcel.go +++ b/internal/provider/model_sdwan_service_routing_ospfv3_ipv4_profile_parcel.go @@ -151,371 +151,563 @@ func (data ServiceRoutingOSPFv3IPv4) toBody(ctx context.Context) string { path := "data." if !data.RouterIdVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.routerId.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterIdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.routerId.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterIdVariable.ValueString()) + } } else if data.RouterId.IsNull() { - body, _ = sjson.Set(body, path+"basic.routerId.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"basic.routerId.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"basic.routerId.optionType", "global") - body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.routerId.optionType", "global") + body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterId.ValueString()) + } } if !data.DistanceVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.distance.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.distance.value", data.DistanceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.distance.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.distance.value", data.DistanceVariable.ValueString()) + } } else if data.Distance.IsNull() { - body, _ = sjson.Set(body, path+"basic.distance.optionType", "default") - body, _ = sjson.Set(body, path+"basic.distance.value", 110) + if true { + body, _ = sjson.Set(body, path+"basic.distance.optionType", "default") + body, _ = sjson.Set(body, path+"basic.distance.value", 110) + } } else { - body, _ = sjson.Set(body, path+"basic.distance.optionType", "global") - body, _ = sjson.Set(body, path+"basic.distance.value", data.Distance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.distance.optionType", "global") + body, _ = sjson.Set(body, path+"basic.distance.value", data.Distance.ValueInt64()) + } } if !data.DistanceExternalVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternalVariable.ValueString()) + } } else if data.DistanceExternal.IsNull() { - body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "default") - body, _ = sjson.Set(body, path+"basic.externalDistance.value", 110) + if true { + body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "default") + body, _ = sjson.Set(body, path+"basic.externalDistance.value", 110) + } } else { - body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "global") - body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternal.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "global") + body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternal.ValueInt64()) + } } if !data.DistanceInterAreaVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterAreaVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterAreaVariable.ValueString()) + } } else if data.DistanceInterArea.IsNull() { - body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "default") - body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", 110) + if true { + body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "default") + body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", 110) + } } else { - body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "global") - body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterArea.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "global") + body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterArea.ValueInt64()) + } } if !data.DistanceIntraAreaVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraAreaVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraAreaVariable.ValueString()) + } } else if data.DistanceIntraArea.IsNull() { - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "default") - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", 110) + if true { + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "default") + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", 110) + } } else { - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "global") - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraArea.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "global") + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraArea.ValueInt64()) + } } if !data.ReferenceBandwidthVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString()) + } } else if data.ReferenceBandwidth.IsNull() { - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", 100) + if true { + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", 100) + } } else { - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64()) + } } if !data.Rfc1583CompatibleVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583CompatibleVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583CompatibleVariable.ValueString()) + } } else if data.Rfc1583Compatible.IsNull() { - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", true) + if true { + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", true) + } } else { - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583Compatible.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583Compatible.ValueBool()) + } } if !data.DefaultInformationOriginate.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.value", data.DefaultInformationOriginate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.value", data.DefaultInformationOriginate.ValueBool()) + } } if !data.DefaultInformationOriginateAlwaysVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString()) + } } else if !data.DefaultInformationOriginateAlways.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlways.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlways.ValueBool()) + } } if !data.DefaultInformationOriginateMetricVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetricVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetricVariable.ValueString()) + } } else if !data.DefaultInformationOriginateMetric.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetric.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetric.ValueInt64()) + } } if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString()) + } } else if !data.DefaultInformationOriginateMetricType.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricType.ValueString()) + } } if !data.SpfCalculationDelayVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelayVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelayVariable.ValueString()) + } } else if data.SpfCalculationDelay.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", 200) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", 200) + } } else { - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelay.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelay.ValueInt64()) + } } if !data.SpfInitialHoldTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTimeVariable.ValueString()) + } } else if data.SpfInitialHoldTime.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", 1000) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", 1000) + } } else { - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTime.ValueInt64()) + } } if !data.SpfMaximumHoldTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString()) + } } else if data.SpfMaximumHoldTime.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", 10000) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", 10000) + } } else { - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTime.ValueInt64()) + } } if !data.RoutePolicyId.IsNull() { - body, _ = sjson.Set(body, path+"advanced.policyName.refId.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.policyName.refId.value", data.RoutePolicyId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.policyName.refId.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.policyName.refId.value", data.RoutePolicyId.ValueString()) + } } if !data.FilterVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.filter.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.filter.value", data.FilterVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.filter.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.filter.value", data.FilterVariable.ValueString()) + } } else if data.Filter.IsNull() { - body, _ = sjson.Set(body, path+"advanced.filter.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.filter.value", false) + if true { + body, _ = sjson.Set(body, path+"advanced.filter.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.filter.value", false) + } } else { - body, _ = sjson.Set(body, path+"advanced.filter.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.filter.value", data.Filter.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.filter.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.filter.value", data.Filter.ValueBool()) + } } - body, _ = sjson.Set(body, path+"redistribute", []interface{}{}) - for _, item := range data.Redistributes { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"redistribute", []interface{}{}) + for _, item := range data.Redistributes { + itemBody := "" - if !item.ProtocolVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable") - 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 !item.ProtocolVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString()) + } + } else if !item.Protocol.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString()) + } + } - if !item.NatDiaVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "natDia.value", item.NatDiaVariable.ValueString()) - } else if item.NatDia.IsNull() { - itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "natDia.value", true) - } else { - itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "natDia.value", item.NatDia.ValueBool()) - } - if !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + if !item.NatDiaVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "natDia.value", item.NatDiaVariable.ValueString()) + } + } else if item.NatDia.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "natDia.value", true) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "natDia.value", item.NatDia.ValueBool()) + } + } + if !item.RoutePolicyId.IsNull() { + 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+"redistribute.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"redistribute.-1", itemBody) } if !data.RouterLsaAction.IsNull() { - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.optionType", "global") - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.value", data.RouterLsaAction.ValueString()) + if true { + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.optionType", "global") + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.value", data.RouterLsaAction.ValueString()) + } } if !data.RouterLsaOnStartupTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "variable") - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "variable") + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTimeVariable.ValueString()) + } } else if !data.RouterLsaOnStartupTime.IsNull() { - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "global") - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "global") + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTime.ValueInt64()) + } } + if true { - for _, item := range data.Areas { - itemBody := "" + for _, item := range data.Areas { + itemBody := "" - if !item.AreaNumberVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumberVariable.ValueString()) - } else if !item.AreaNumber.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumber.ValueInt64()) - } - if !item.AreaType.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.value", item.AreaType.ValueString()) - } + if !item.AreaNumberVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumberVariable.ValueString()) + } + } else if !item.AreaNumber.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumber.ValueInt64()) + } + } + if !item.AreaType.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.value", item.AreaType.ValueString()) + } + } - if !item.NoSummaryVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummaryVariable.ValueString()) - } else if !item.NoSummary.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummary.ValueBool()) - } + if !item.NoSummaryVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummaryVariable.ValueString()) + } + } else if !item.NoSummary.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummary.ValueBool()) + } + } - if !item.AlwaysTranslateVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslateVariable.ValueString()) - } else if !item.AlwaysTranslate.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslate.ValueBool()) - } + if !item.AlwaysTranslateVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslateVariable.ValueString()) + } + } else if !item.AlwaysTranslate.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslate.ValueBool()) + } + } + if true { - for _, childItem := range item.Interfaces { - itemChildBody := "" + for _, childItem := range item.Interfaces { + itemChildBody := "" - if !childItem.NameVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.NameVariable.ValueString()) - } else if !childItem.Name.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.Name.ValueString()) - } + if !childItem.NameVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.NameVariable.ValueString()) + } + } else if !childItem.Name.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.Name.ValueString()) + } + } - if !childItem.HelloIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString()) - } else if childItem.HelloInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64()) - } + if !childItem.HelloIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString()) + } + } else if childItem.HelloInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64()) + } + } - if !childItem.DeadIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString()) - } else if childItem.DeadInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64()) - } + if !childItem.DeadIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString()) + } + } else if childItem.DeadInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64()) + } + } - if !childItem.LsaRetransmitIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString()) - } else if childItem.LsaRetransmitInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64()) - } + if !childItem.LsaRetransmitIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString()) + } + } else if childItem.LsaRetransmitInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64()) + } + } - if !childItem.CostVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) - } else if childItem.Cost.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") + if !childItem.CostVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) + } + } else if childItem.Cost.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) - } + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) + } + } - if !childItem.NetworkTypeVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkTypeVariable.ValueString()) - } else if childItem.NetworkType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "default") + if !childItem.NetworkTypeVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkTypeVariable.ValueString()) + } + } else if childItem.NetworkType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "default") - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkType.ValueString()) - } + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkType.ValueString()) + } + } - if !childItem.PassiveInterfaceVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString()) - } else if childItem.PassiveInterface.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool()) - } - if !childItem.AuthenticationType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.value", childItem.AuthenticationType.ValueString()) - } + if !childItem.PassiveInterfaceVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString()) + } + } else if childItem.PassiveInterface.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool()) + } + } + if !childItem.AuthenticationType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.value", childItem.AuthenticationType.ValueString()) + } + } - if !childItem.AuthenticationSpiVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpiVariable.ValueString()) - } else if !childItem.AuthenticationSpi.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpi.ValueInt64()) - } + if !childItem.AuthenticationSpiVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpiVariable.ValueString()) + } + } else if !childItem.AuthenticationSpi.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpi.ValueInt64()) + } + } - if !childItem.AuthenticationKeyVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKeyVariable.ValueString()) - } else if !childItem.AuthenticationKey.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKey.ValueString()) - } - itemBody, _ = sjson.SetRaw(itemBody, "interfaces.-1", itemChildBody) - } - itemBody, _ = sjson.Set(itemBody, "ranges", []interface{}{}) - for _, childItem := range item.Ranges { - itemChildBody := "" - - if !childItem.IpAddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "network.address.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "network.address.value", childItem.IpAddressVariable.ValueString()) - } else if !childItem.IpAddress.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "network.address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "network.address.value", childItem.IpAddress.ValueString()) + if !childItem.AuthenticationKeyVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKeyVariable.ValueString()) + } + } else if !childItem.AuthenticationKey.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKey.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "interfaces.-1", itemChildBody) + } } + if true { + itemBody, _ = sjson.Set(itemBody, "ranges", []interface{}{}) + for _, childItem := range item.Ranges { + itemChildBody := "" + + if !childItem.IpAddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.address.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "network.address.value", childItem.IpAddressVariable.ValueString()) + } + } else if !childItem.IpAddress.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "network.address.value", childItem.IpAddress.ValueString()) + } + } - if !childItem.SubnetMaskVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.value", childItem.SubnetMaskVariable.ValueString()) - } else if !childItem.SubnetMask.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.value", childItem.SubnetMask.ValueString()) - } + if !childItem.SubnetMaskVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.value", childItem.SubnetMaskVariable.ValueString()) + } + } else if !childItem.SubnetMask.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.value", childItem.SubnetMask.ValueString()) + } + } - if !childItem.CostVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) - } else if childItem.Cost.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") + if !childItem.CostVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) + } + } else if childItem.Cost.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) - } + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) + } + } - if !childItem.NoAdvertiseVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString()) - } else if childItem.NoAdvertise.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool()) + if !childItem.NoAdvertiseVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString()) + } + } else if childItem.NoAdvertise.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "ranges.-1", itemChildBody) + } } - itemBody, _ = sjson.SetRaw(itemBody, "ranges.-1", itemChildBody) + body, _ = sjson.SetRaw(body, path+"area.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"area.-1", itemBody) } return body } diff --git a/internal/provider/model_sdwan_service_routing_ospfv3_ipv6_profile_parcel.go b/internal/provider/model_sdwan_service_routing_ospfv3_ipv6_profile_parcel.go index 3c27df9d..c4b52bdd 100644 --- a/internal/provider/model_sdwan_service_routing_ospfv3_ipv6_profile_parcel.go +++ b/internal/provider/model_sdwan_service_routing_ospfv3_ipv6_profile_parcel.go @@ -147,352 +147,534 @@ func (data ServiceRoutingOSPFv3IPv6) toBody(ctx context.Context) string { path := "data." if !data.RouterIdVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.routerId.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterIdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.routerId.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterIdVariable.ValueString()) + } } else if data.RouterId.IsNull() { - body, _ = sjson.Set(body, path+"basic.routerId.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"basic.routerId.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"basic.routerId.optionType", "global") - body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.routerId.optionType", "global") + body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterId.ValueString()) + } } if !data.DistanceVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.distance.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.distance.value", data.DistanceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.distance.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.distance.value", data.DistanceVariable.ValueString()) + } } else if data.Distance.IsNull() { - body, _ = sjson.Set(body, path+"basic.distance.optionType", "default") - body, _ = sjson.Set(body, path+"basic.distance.value", 110) + if true { + body, _ = sjson.Set(body, path+"basic.distance.optionType", "default") + body, _ = sjson.Set(body, path+"basic.distance.value", 110) + } } else { - body, _ = sjson.Set(body, path+"basic.distance.optionType", "global") - body, _ = sjson.Set(body, path+"basic.distance.value", data.Distance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.distance.optionType", "global") + body, _ = sjson.Set(body, path+"basic.distance.value", data.Distance.ValueInt64()) + } } if !data.DistanceExternalVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternalVariable.ValueString()) + } } else if data.DistanceExternal.IsNull() { - body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "default") - body, _ = sjson.Set(body, path+"basic.externalDistance.value", 110) + if true { + body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "default") + body, _ = sjson.Set(body, path+"basic.externalDistance.value", 110) + } } else { - body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "global") - body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternal.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "global") + body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternal.ValueInt64()) + } } if !data.DistanceInterAreaVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterAreaVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterAreaVariable.ValueString()) + } } else if data.DistanceInterArea.IsNull() { - body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "default") - body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", 110) + if true { + body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "default") + body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", 110) + } } else { - body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "global") - body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterArea.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "global") + body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterArea.ValueInt64()) + } } if !data.DistanceIntraAreaVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraAreaVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraAreaVariable.ValueString()) + } } else if data.DistanceIntraArea.IsNull() { - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "default") - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", 110) + if true { + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "default") + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", 110) + } } else { - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "global") - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraArea.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "global") + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraArea.ValueInt64()) + } } if !data.ReferenceBandwidthVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString()) + } } else if data.ReferenceBandwidth.IsNull() { - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", 100) + if true { + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", 100) + } } else { - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64()) + } } if !data.Rfc1583CompatibleVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583CompatibleVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583CompatibleVariable.ValueString()) + } } else if data.Rfc1583Compatible.IsNull() { - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", true) + if true { + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", true) + } } else { - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583Compatible.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583Compatible.ValueBool()) + } } if !data.DefaultInformationOriginate.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.value", data.DefaultInformationOriginate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.value", data.DefaultInformationOriginate.ValueBool()) + } } if !data.DefaultInformationOriginateAlwaysVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString()) + } } else if !data.DefaultInformationOriginateAlways.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlways.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlways.ValueBool()) + } } if !data.DefaultInformationOriginateMetricVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetricVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetricVariable.ValueString()) + } } else if !data.DefaultInformationOriginateMetric.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetric.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetric.ValueInt64()) + } } if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString()) + } } else if !data.DefaultInformationOriginateMetricType.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricType.ValueString()) + } } if !data.SpfCalculationDelayVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelayVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelayVariable.ValueString()) + } } else if data.SpfCalculationDelay.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", 200) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", 200) + } } else { - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelay.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelay.ValueInt64()) + } } if !data.SpfInitialHoldTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTimeVariable.ValueString()) + } } else if data.SpfInitialHoldTime.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", 1000) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", 1000) + } } else { - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTime.ValueInt64()) + } } if !data.SpfMaximumHoldTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString()) + } } else if data.SpfMaximumHoldTime.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", 10000) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", 10000) + } } else { - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTime.ValueInt64()) + } } if !data.RoutePolicyId.IsNull() { - body, _ = sjson.Set(body, path+"advanced.policyName.refId.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.policyName.refId.value", data.RoutePolicyId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.policyName.refId.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.policyName.refId.value", data.RoutePolicyId.ValueString()) + } } if !data.FilterVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.filter.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.filter.value", data.FilterVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.filter.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.filter.value", data.FilterVariable.ValueString()) + } } else if data.Filter.IsNull() { - body, _ = sjson.Set(body, path+"advanced.filter.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.filter.value", false) + if true { + body, _ = sjson.Set(body, path+"advanced.filter.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.filter.value", false) + } } else { - body, _ = sjson.Set(body, path+"advanced.filter.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.filter.value", data.Filter.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.filter.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.filter.value", data.Filter.ValueBool()) + } } - body, _ = sjson.Set(body, path+"redistribute", []interface{}{}) - for _, item := range data.Redistributes { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"redistribute", []interface{}{}) + for _, item := range data.Redistributes { + itemBody := "" - if !item.ProtocolVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable") - 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 !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + if !item.ProtocolVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString()) + } + } else if !item.Protocol.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString()) + } + } + if !item.RoutePolicyId.IsNull() { + 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+"redistribute.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"redistribute.-1", itemBody) } if !data.RouterLsaAction.IsNull() { - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.optionType", "global") - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.value", data.RouterLsaAction.ValueString()) + if true { + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.optionType", "global") + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.value", data.RouterLsaAction.ValueString()) + } } if !data.RouterLsaOnStartupTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "variable") - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "variable") + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTimeVariable.ValueString()) + } } else if !data.RouterLsaOnStartupTime.IsNull() { - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "global") - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "global") + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTime.ValueInt64()) + } } + if true { - for _, item := range data.Areas { - itemBody := "" + for _, item := range data.Areas { + itemBody := "" - if !item.AreaNumberVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumberVariable.ValueString()) - } else if !item.AreaNumber.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumber.ValueInt64()) - } - if !item.AreaType.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.value", item.AreaType.ValueString()) - } + if !item.AreaNumberVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumberVariable.ValueString()) + } + } else if !item.AreaNumber.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumber.ValueInt64()) + } + } + if !item.AreaType.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.value", item.AreaType.ValueString()) + } + } - if !item.NoSummaryVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummaryVariable.ValueString()) - } else if !item.NoSummary.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummary.ValueBool()) - } + if !item.NoSummaryVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummaryVariable.ValueString()) + } + } else if !item.NoSummary.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummary.ValueBool()) + } + } - if !item.AlwaysTranslateVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslateVariable.ValueString()) - } else if !item.AlwaysTranslate.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslate.ValueBool()) - } + if !item.AlwaysTranslateVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslateVariable.ValueString()) + } + } else if !item.AlwaysTranslate.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslate.ValueBool()) + } + } + if true { - for _, childItem := range item.Interfaces { - itemChildBody := "" + for _, childItem := range item.Interfaces { + itemChildBody := "" - if !childItem.NameVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.NameVariable.ValueString()) - } else if !childItem.Name.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.Name.ValueString()) - } + if !childItem.NameVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.NameVariable.ValueString()) + } + } else if !childItem.Name.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.Name.ValueString()) + } + } - if !childItem.HelloIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString()) - } else if childItem.HelloInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64()) - } + if !childItem.HelloIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString()) + } + } else if childItem.HelloInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64()) + } + } - if !childItem.DeadIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString()) - } else if childItem.DeadInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64()) - } + if !childItem.DeadIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString()) + } + } else if childItem.DeadInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64()) + } + } - if !childItem.LsaRetransmitIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString()) - } else if childItem.LsaRetransmitInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64()) - } + if !childItem.LsaRetransmitIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString()) + } + } else if childItem.LsaRetransmitInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64()) + } + } - if !childItem.CostVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) - } else if childItem.Cost.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") + if !childItem.CostVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) + } + } else if childItem.Cost.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) - } + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) + } + } - if !childItem.NetworkTypeVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkTypeVariable.ValueString()) - } else if childItem.NetworkType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "default") + if !childItem.NetworkTypeVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkTypeVariable.ValueString()) + } + } else if childItem.NetworkType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "default") - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkType.ValueString()) - } + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkType.ValueString()) + } + } - if !childItem.PassiveInterfaceVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString()) - } else if childItem.PassiveInterface.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool()) - } - if !childItem.AuthenticationType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.value", childItem.AuthenticationType.ValueString()) - } + if !childItem.PassiveInterfaceVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString()) + } + } else if childItem.PassiveInterface.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool()) + } + } + if !childItem.AuthenticationType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.value", childItem.AuthenticationType.ValueString()) + } + } - if !childItem.AuthenticationSpiVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpiVariable.ValueString()) - } else if !childItem.AuthenticationSpi.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpi.ValueInt64()) - } + if !childItem.AuthenticationSpiVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpiVariable.ValueString()) + } + } else if !childItem.AuthenticationSpi.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpi.ValueInt64()) + } + } - if !childItem.AuthenticationKeyVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKeyVariable.ValueString()) - } else if !childItem.AuthenticationKey.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKey.ValueString()) - } - itemBody, _ = sjson.SetRaw(itemBody, "interfaces.-1", itemChildBody) - } - itemBody, _ = sjson.Set(itemBody, "ranges", []interface{}{}) - for _, childItem := range item.Ranges { - itemChildBody := "" - - if !childItem.PrefixVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.PrefixVariable.ValueString()) - } else if !childItem.Prefix.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.Prefix.ValueString()) + if !childItem.AuthenticationKeyVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKeyVariable.ValueString()) + } + } else if !childItem.AuthenticationKey.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKey.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "interfaces.-1", itemChildBody) + } } + if true { + itemBody, _ = sjson.Set(itemBody, "ranges", []interface{}{}) + for _, childItem := range item.Ranges { + itemChildBody := "" + + if !childItem.PrefixVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.PrefixVariable.ValueString()) + } + } else if !childItem.Prefix.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.Prefix.ValueString()) + } + } - if !childItem.CostVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) - } else if childItem.Cost.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") + if !childItem.CostVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) + } + } else if childItem.Cost.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) - } + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) + } + } - if !childItem.NoAdvertiseVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString()) - } else if childItem.NoAdvertise.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool()) + if !childItem.NoAdvertiseVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString()) + } + } else if childItem.NoAdvertise.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "ranges.-1", itemChildBody) + } } - itemBody, _ = sjson.SetRaw(itemBody, "ranges.-1", itemChildBody) + body, _ = sjson.SetRaw(body, path+"area.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"area.-1", itemBody) } return body } diff --git a/internal/provider/model_sdwan_transport_gps_profile_parcel.go b/internal/provider/model_sdwan_transport_gps_profile_parcel.go index 5c2aaa04..3bcfbc6b 100644 --- a/internal/provider/model_sdwan_transport_gps_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_gps_profile_parcel.go @@ -75,69 +75,105 @@ func (data TransportGPS) toBody(ctx context.Context) string { path := "data." if !data.GpsEnableVariable.IsNull() { - body, _ = sjson.Set(body, path+"enable.optionType", "variable") - body, _ = sjson.Set(body, path+"enable.value", data.GpsEnableVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"enable.optionType", "variable") + body, _ = sjson.Set(body, path+"enable.value", data.GpsEnableVariable.ValueString()) + } } else if data.GpsEnable.IsNull() { - body, _ = sjson.Set(body, path+"enable.optionType", "default") - body, _ = sjson.Set(body, path+"enable.value", false) + if true { + body, _ = sjson.Set(body, path+"enable.optionType", "default") + body, _ = sjson.Set(body, path+"enable.value", false) + } } else { - body, _ = sjson.Set(body, path+"enable.optionType", "global") - body, _ = sjson.Set(body, path+"enable.value", data.GpsEnable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"enable.optionType", "global") + body, _ = sjson.Set(body, path+"enable.value", data.GpsEnable.ValueBool()) + } } if !data.GpsModeVariable.IsNull() { - body, _ = sjson.Set(body, path+"mode.optionType", "variable") - body, _ = sjson.Set(body, path+"mode.value", data.GpsModeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"mode.optionType", "variable") + body, _ = sjson.Set(body, path+"mode.value", data.GpsModeVariable.ValueString()) + } } else if data.GpsMode.IsNull() { - body, _ = sjson.Set(body, path+"mode.optionType", "default") - body, _ = sjson.Set(body, path+"mode.value", "ms-based") + if true { + body, _ = sjson.Set(body, path+"mode.optionType", "default") + body, _ = sjson.Set(body, path+"mode.value", "ms-based") + } } else { - body, _ = sjson.Set(body, path+"mode.optionType", "global") - body, _ = sjson.Set(body, path+"mode.value", data.GpsMode.ValueString()) + if true { + body, _ = sjson.Set(body, path+"mode.optionType", "global") + body, _ = sjson.Set(body, path+"mode.value", data.GpsMode.ValueString()) + } } if !data.NmeaEnableVariable.IsNull() { - body, _ = sjson.Set(body, path+"nmea.optionType", "variable") - body, _ = sjson.Set(body, path+"nmea.value", data.NmeaEnableVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"nmea.optionType", "variable") + body, _ = sjson.Set(body, path+"nmea.value", data.NmeaEnableVariable.ValueString()) + } } else if data.NmeaEnable.IsNull() { - body, _ = sjson.Set(body, path+"nmea.optionType", "default") - body, _ = sjson.Set(body, path+"nmea.value", false) + if true { + body, _ = sjson.Set(body, path+"nmea.optionType", "default") + body, _ = sjson.Set(body, path+"nmea.value", false) + } } else { - body, _ = sjson.Set(body, path+"nmea.optionType", "global") - body, _ = sjson.Set(body, path+"nmea.value", data.NmeaEnable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"nmea.optionType", "global") + body, _ = sjson.Set(body, path+"nmea.value", data.NmeaEnable.ValueBool()) + } } if !data.NmeaSourceAddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"sourceAddress.optionType", "variable") - body, _ = sjson.Set(body, path+"sourceAddress.value", data.NmeaSourceAddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"sourceAddress.optionType", "variable") + body, _ = sjson.Set(body, path+"sourceAddress.value", data.NmeaSourceAddressVariable.ValueString()) + } } else if data.NmeaSourceAddress.IsNull() { - body, _ = sjson.Set(body, path+"sourceAddress.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"sourceAddress.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"sourceAddress.optionType", "global") - body, _ = sjson.Set(body, path+"sourceAddress.value", data.NmeaSourceAddress.ValueString()) + if true { + body, _ = sjson.Set(body, path+"sourceAddress.optionType", "global") + body, _ = sjson.Set(body, path+"sourceAddress.value", data.NmeaSourceAddress.ValueString()) + } } if !data.NmeaDestinationAddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"destinationAddress.optionType", "variable") - body, _ = sjson.Set(body, path+"destinationAddress.value", data.NmeaDestinationAddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"destinationAddress.optionType", "variable") + body, _ = sjson.Set(body, path+"destinationAddress.value", data.NmeaDestinationAddressVariable.ValueString()) + } } else if data.NmeaDestinationAddress.IsNull() { - body, _ = sjson.Set(body, path+"destinationAddress.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"destinationAddress.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"destinationAddress.optionType", "global") - body, _ = sjson.Set(body, path+"destinationAddress.value", data.NmeaDestinationAddress.ValueString()) + if true { + body, _ = sjson.Set(body, path+"destinationAddress.optionType", "global") + body, _ = sjson.Set(body, path+"destinationAddress.value", data.NmeaDestinationAddress.ValueString()) + } } if !data.NmeaDestinationPortVariable.IsNull() { - body, _ = sjson.Set(body, path+"destinationPort.optionType", "variable") - body, _ = sjson.Set(body, path+"destinationPort.value", data.NmeaDestinationPortVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"destinationPort.optionType", "variable") + body, _ = sjson.Set(body, path+"destinationPort.value", data.NmeaDestinationPortVariable.ValueString()) + } } else if data.NmeaDestinationPort.IsNull() { - body, _ = sjson.Set(body, path+"destinationPort.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"destinationPort.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"destinationPort.optionType", "global") - body, _ = sjson.Set(body, path+"destinationPort.value", data.NmeaDestinationPort.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"destinationPort.optionType", "global") + body, _ = sjson.Set(body, path+"destinationPort.value", data.NmeaDestinationPort.ValueInt64()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_routing_ospf_profile_parcel.go b/internal/provider/model_sdwan_transport_routing_ospf_profile_parcel.go index 80fccd43..4b5b774e 100644 --- a/internal/provider/model_sdwan_transport_routing_ospf_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_routing_ospf_profile_parcel.go @@ -152,388 +152,592 @@ func (data TransportRoutingOSPF) toBody(ctx context.Context) string { path := "data." if !data.RouterIdVariable.IsNull() { - body, _ = sjson.Set(body, path+"routerId.optionType", "variable") - body, _ = sjson.Set(body, path+"routerId.value", data.RouterIdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"routerId.optionType", "variable") + body, _ = sjson.Set(body, path+"routerId.value", data.RouterIdVariable.ValueString()) + } } else if data.RouterId.IsNull() { - body, _ = sjson.Set(body, path+"routerId.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"routerId.optionType", "default") + } } 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.ReferenceBandwidthVariable.IsNull() { - body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "variable") - body, _ = sjson.Set(body, path+"referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "variable") + body, _ = sjson.Set(body, path+"referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString()) + } } else if data.ReferenceBandwidth.IsNull() { - body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "default") - body, _ = sjson.Set(body, path+"referenceBandwidth.value", 100) + if true { + body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "default") + body, _ = sjson.Set(body, path+"referenceBandwidth.value", 100) + } } else { - body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "global") - body, _ = sjson.Set(body, path+"referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"referenceBandwidth.optionType", "global") + body, _ = sjson.Set(body, path+"referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64()) + } } if !data.Rfc1583CompatibleVariable.IsNull() { - body, _ = sjson.Set(body, path+"rfc1583.optionType", "variable") - body, _ = sjson.Set(body, path+"rfc1583.value", data.Rfc1583CompatibleVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"rfc1583.optionType", "variable") + body, _ = sjson.Set(body, path+"rfc1583.value", data.Rfc1583CompatibleVariable.ValueString()) + } } else if data.Rfc1583Compatible.IsNull() { - body, _ = sjson.Set(body, path+"rfc1583.optionType", "default") - body, _ = sjson.Set(body, path+"rfc1583.value", true) + if true { + body, _ = sjson.Set(body, path+"rfc1583.optionType", "default") + body, _ = sjson.Set(body, path+"rfc1583.value", true) + } } else { - body, _ = sjson.Set(body, path+"rfc1583.optionType", "global") - body, _ = sjson.Set(body, path+"rfc1583.value", data.Rfc1583Compatible.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"rfc1583.optionType", "global") + body, _ = sjson.Set(body, path+"rfc1583.value", data.Rfc1583Compatible.ValueBool()) + } } if data.DefaultInformationOriginate.IsNull() { - body, _ = sjson.Set(body, path+"originate.optionType", "default") - body, _ = sjson.Set(body, path+"originate.value", false) + if true { + body, _ = sjson.Set(body, path+"originate.optionType", "default") + body, _ = sjson.Set(body, path+"originate.value", false) + } } else { - body, _ = sjson.Set(body, path+"originate.optionType", "global") - body, _ = sjson.Set(body, path+"originate.value", data.DefaultInformationOriginate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"originate.optionType", "global") + body, _ = sjson.Set(body, path+"originate.value", data.DefaultInformationOriginate.ValueBool()) + } } if !data.DefaultInformationOriginateAlwaysVariable.IsNull() { - body, _ = sjson.Set(body, path+"always.optionType", "variable") - body, _ = sjson.Set(body, path+"always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"always.optionType", "variable") + body, _ = sjson.Set(body, path+"always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString()) + } } else if data.DefaultInformationOriginateAlways.IsNull() { - body, _ = sjson.Set(body, path+"always.optionType", "default") - body, _ = sjson.Set(body, path+"always.value", false) + if true { + body, _ = sjson.Set(body, path+"always.optionType", "default") + body, _ = sjson.Set(body, path+"always.value", false) + } } else { - body, _ = sjson.Set(body, path+"always.optionType", "global") - body, _ = sjson.Set(body, path+"always.value", data.DefaultInformationOriginateAlways.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"always.optionType", "global") + body, _ = sjson.Set(body, path+"always.value", data.DefaultInformationOriginateAlways.ValueBool()) + } } if !data.DefaultInformationOriginateMetricVariable.IsNull() { - body, _ = sjson.Set(body, path+"metric.optionType", "variable") - body, _ = sjson.Set(body, path+"metric.value", data.DefaultInformationOriginateMetricVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"metric.optionType", "variable") + body, _ = sjson.Set(body, path+"metric.value", data.DefaultInformationOriginateMetricVariable.ValueString()) + } } else if data.DefaultInformationOriginateMetric.IsNull() { - body, _ = sjson.Set(body, path+"metric.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"metric.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"metric.optionType", "global") - body, _ = sjson.Set(body, path+"metric.value", data.DefaultInformationOriginateMetric.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"metric.optionType", "global") + body, _ = sjson.Set(body, path+"metric.value", data.DefaultInformationOriginateMetric.ValueInt64()) + } } if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"metricType.optionType", "variable") - body, _ = sjson.Set(body, path+"metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"metricType.optionType", "variable") + body, _ = sjson.Set(body, path+"metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString()) + } } else if data.DefaultInformationOriginateMetricType.IsNull() { - body, _ = sjson.Set(body, path+"metricType.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"metricType.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"metricType.optionType", "global") - body, _ = sjson.Set(body, path+"metricType.value", data.DefaultInformationOriginateMetricType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"metricType.optionType", "global") + body, _ = sjson.Set(body, path+"metricType.value", data.DefaultInformationOriginateMetricType.ValueString()) + } } if !data.DistanceExternalVariable.IsNull() { - body, _ = sjson.Set(body, path+"external.optionType", "variable") - body, _ = sjson.Set(body, path+"external.value", data.DistanceExternalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"external.optionType", "variable") + body, _ = sjson.Set(body, path+"external.value", data.DistanceExternalVariable.ValueString()) + } } else if data.DistanceExternal.IsNull() { - body, _ = sjson.Set(body, path+"external.optionType", "default") - body, _ = sjson.Set(body, path+"external.value", 110) + if true { + body, _ = sjson.Set(body, path+"external.optionType", "default") + body, _ = sjson.Set(body, path+"external.value", 110) + } } else { - body, _ = sjson.Set(body, path+"external.optionType", "global") - body, _ = sjson.Set(body, path+"external.value", data.DistanceExternal.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"external.optionType", "global") + body, _ = sjson.Set(body, path+"external.value", data.DistanceExternal.ValueInt64()) + } } if !data.DistanceInterAreaVariable.IsNull() { - body, _ = sjson.Set(body, path+"interArea.optionType", "variable") - body, _ = sjson.Set(body, path+"interArea.value", data.DistanceInterAreaVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interArea.optionType", "variable") + body, _ = sjson.Set(body, path+"interArea.value", data.DistanceInterAreaVariable.ValueString()) + } } else if data.DistanceInterArea.IsNull() { - body, _ = sjson.Set(body, path+"interArea.optionType", "default") - body, _ = sjson.Set(body, path+"interArea.value", 110) + if true { + body, _ = sjson.Set(body, path+"interArea.optionType", "default") + body, _ = sjson.Set(body, path+"interArea.value", 110) + } } else { - body, _ = sjson.Set(body, path+"interArea.optionType", "global") - body, _ = sjson.Set(body, path+"interArea.value", data.DistanceInterArea.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"interArea.optionType", "global") + body, _ = sjson.Set(body, path+"interArea.value", data.DistanceInterArea.ValueInt64()) + } } if !data.DistanceIntraAreaVariable.IsNull() { - body, _ = sjson.Set(body, path+"intraArea.optionType", "variable") - body, _ = sjson.Set(body, path+"intraArea.value", data.DistanceIntraAreaVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intraArea.optionType", "variable") + body, _ = sjson.Set(body, path+"intraArea.value", data.DistanceIntraAreaVariable.ValueString()) + } } else if data.DistanceIntraArea.IsNull() { - body, _ = sjson.Set(body, path+"intraArea.optionType", "default") - body, _ = sjson.Set(body, path+"intraArea.value", 110) + if true { + body, _ = sjson.Set(body, path+"intraArea.optionType", "default") + body, _ = sjson.Set(body, path+"intraArea.value", 110) + } } else { - body, _ = sjson.Set(body, path+"intraArea.optionType", "global") - body, _ = sjson.Set(body, path+"intraArea.value", data.DistanceIntraArea.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"intraArea.optionType", "global") + body, _ = sjson.Set(body, path+"intraArea.value", data.DistanceIntraArea.ValueInt64()) + } } if !data.SpfCalculationDelayVariable.IsNull() { - body, _ = sjson.Set(body, path+"delay.optionType", "variable") - body, _ = sjson.Set(body, path+"delay.value", data.SpfCalculationDelayVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"delay.optionType", "variable") + body, _ = sjson.Set(body, path+"delay.value", data.SpfCalculationDelayVariable.ValueString()) + } } else if data.SpfCalculationDelay.IsNull() { - body, _ = sjson.Set(body, path+"delay.optionType", "default") - body, _ = sjson.Set(body, path+"delay.value", 200) + if true { + body, _ = sjson.Set(body, path+"delay.optionType", "default") + body, _ = sjson.Set(body, path+"delay.value", 200) + } } else { - body, _ = sjson.Set(body, path+"delay.optionType", "global") - body, _ = sjson.Set(body, path+"delay.value", data.SpfCalculationDelay.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"delay.optionType", "global") + body, _ = sjson.Set(body, path+"delay.value", data.SpfCalculationDelay.ValueInt64()) + } } if !data.SpfInitialHoldTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"initialHold.optionType", "variable") - body, _ = sjson.Set(body, path+"initialHold.value", data.SpfInitialHoldTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"initialHold.optionType", "variable") + body, _ = sjson.Set(body, path+"initialHold.value", data.SpfInitialHoldTimeVariable.ValueString()) + } } else if data.SpfInitialHoldTime.IsNull() { - body, _ = sjson.Set(body, path+"initialHold.optionType", "default") - body, _ = sjson.Set(body, path+"initialHold.value", 1000) + if true { + body, _ = sjson.Set(body, path+"initialHold.optionType", "default") + body, _ = sjson.Set(body, path+"initialHold.value", 1000) + } } else { - body, _ = sjson.Set(body, path+"initialHold.optionType", "global") - body, _ = sjson.Set(body, path+"initialHold.value", data.SpfInitialHoldTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"initialHold.optionType", "global") + body, _ = sjson.Set(body, path+"initialHold.value", data.SpfInitialHoldTime.ValueInt64()) + } } if !data.SpfMaximumHoldTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"maxHold.optionType", "variable") - body, _ = sjson.Set(body, path+"maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"maxHold.optionType", "variable") + body, _ = sjson.Set(body, path+"maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString()) + } } else if data.SpfMaximumHoldTime.IsNull() { - body, _ = sjson.Set(body, path+"maxHold.optionType", "default") - body, _ = sjson.Set(body, path+"maxHold.value", 10000) + if true { + body, _ = sjson.Set(body, path+"maxHold.optionType", "default") + body, _ = sjson.Set(body, path+"maxHold.value", 10000) + } } else { - body, _ = sjson.Set(body, path+"maxHold.optionType", "global") - body, _ = sjson.Set(body, path+"maxHold.value", data.SpfMaximumHoldTime.ValueInt64()) - } - body, _ = sjson.Set(body, path+"redistribute", []interface{}{}) - for _, item := range data.Redistributes { - itemBody := "" - - if !item.ProtocolVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable") - 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 !item.NatDiaVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "dia.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "dia.value", item.NatDiaVariable.ValueString()) - } else if item.NatDia.IsNull() { - itemBody, _ = sjson.Set(itemBody, "dia.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "dia.value", true) - } else { - itemBody, _ = sjson.Set(itemBody, "dia.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "dia.value", item.NatDia.ValueBool()) - } - if !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) - } - body, _ = sjson.SetRaw(body, path+"redistribute.-1", itemBody) - } - body, _ = sjson.Set(body, path+"routerLsa", []interface{}{}) - for _, item := range data.RouterLsas { - itemBody := "" - if !item.Type.IsNull() { - itemBody, _ = sjson.Set(itemBody, "adType.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "adType.value", item.Type.ValueString()) - } - - if !item.TimeVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "time.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "time.value", item.TimeVariable.ValueString()) - } else if !item.Time.IsNull() { - itemBody, _ = sjson.Set(itemBody, "time.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "time.value", item.Time.ValueInt64()) - } - body, _ = sjson.SetRaw(body, path+"routerLsa.-1", itemBody) + if true { + body, _ = sjson.Set(body, path+"maxHold.optionType", "global") + body, _ = sjson.Set(body, path+"maxHold.value", data.SpfMaximumHoldTime.ValueInt64()) + } } - if !data.RoutePolicyId.IsNull() { - body, _ = sjson.Set(body, path+"routePolicy.refId.optionType", "global") - body, _ = sjson.Set(body, path+"routePolicy.refId.value", data.RoutePolicyId.ValueString()) - } - body, _ = sjson.Set(body, path+"area", []interface{}{}) - for _, item := range data.Areas { - itemBody := "" - - if !item.AreaNumberVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "aNum.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "aNum.value", item.AreaNumberVariable.ValueString()) - } else if !item.AreaNumber.IsNull() { - itemBody, _ = sjson.Set(itemBody, "aNum.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "aNum.value", item.AreaNumber.ValueInt64()) - } - if item.AreaType.IsNull() { - itemBody, _ = sjson.Set(itemBody, "aType.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "aType.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "aType.value", item.AreaType.ValueString()) - } - - if !item.NoSummaryVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "noSummary.value", item.NoSummaryVariable.ValueString()) - } else if item.NoSummary.IsNull() { - itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "noSummary.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "noSummary.value", item.NoSummary.ValueBool()) - } - itemBody, _ = sjson.Set(itemBody, "interface", []interface{}{}) - for _, childItem := range item.Interfaces { - itemChildBody := "" - - if !childItem.NameVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "name.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "name.value", childItem.NameVariable.ValueString()) - } else if !childItem.Name.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "name.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "name.value", childItem.Name.ValueString()) - } + if true { + body, _ = sjson.Set(body, path+"redistribute", []interface{}{}) + for _, item := range data.Redistributes { + itemBody := "" - if !childItem.HelloIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString()) - } else if childItem.HelloInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64()) + if !item.ProtocolVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString()) + } + } else if !item.Protocol.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString()) + } } - if !childItem.DeadIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString()) - } else if childItem.DeadInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40) + if !item.NatDiaVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "dia.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "dia.value", item.NatDiaVariable.ValueString()) + } + } else if item.NatDia.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "dia.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "dia.value", true) + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "dia.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "dia.value", item.NatDia.ValueBool()) + } } - - if !childItem.LsaRetransmitIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString()) - } else if childItem.LsaRetransmitInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64()) + if !item.RoutePolicyId.IsNull() { + 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+"redistribute.-1", itemBody) + } + } + if true { + body, _ = sjson.Set(body, path+"routerLsa", []interface{}{}) + for _, item := range data.RouterLsas { + itemBody := "" + if !item.Type.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "adType.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "adType.value", item.Type.ValueString()) + } } - if !childItem.CostVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) - } else if childItem.Cost.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") - - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) + if !item.TimeVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "time.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "time.value", item.TimeVariable.ValueString()) + } + } else if !item.Time.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "time.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "time.value", item.Time.ValueInt64()) + } } + body, _ = sjson.SetRaw(body, path+"routerLsa.-1", itemBody) + } + } + if !data.RoutePolicyId.IsNull() { + if true { + body, _ = sjson.Set(body, path+"routePolicy.refId.optionType", "global") + body, _ = sjson.Set(body, path+"routePolicy.refId.value", data.RoutePolicyId.ValueString()) + } + } + if true { + body, _ = sjson.Set(body, path+"area", []interface{}{}) + for _, item := range data.Areas { + itemBody := "" - if !childItem.DesignatedRouterPriorityVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", childItem.DesignatedRouterPriorityVariable.ValueString()) - } else if childItem.DesignatedRouterPriority.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", 1) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", childItem.DesignatedRouterPriority.ValueInt64()) + if !item.AreaNumberVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "aNum.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "aNum.value", item.AreaNumberVariable.ValueString()) + } + } else if !item.AreaNumber.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "aNum.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "aNum.value", item.AreaNumber.ValueInt64()) + } } + if item.AreaType.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "aType.optionType", "default") - if !childItem.NetworkTypeVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.NetworkTypeVariable.ValueString()) - } else if childItem.NetworkType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "network.value", "broadcast") + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.NetworkType.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "aType.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "aType.value", item.AreaType.ValueString()) + } } - if !childItem.PassiveInterfaceVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString()) - } else if childItem.PassiveInterface.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false) + if !item.NoSummaryVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "noSummary.value", item.NoSummaryVariable.ValueString()) + } + } else if item.NoSummary.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "noSummary.value", false) + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool()) + if true { + itemBody, _ = sjson.Set(itemBody, "noSummary.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "noSummary.value", item.NoSummary.ValueBool()) + } } + if true { + itemBody, _ = sjson.Set(itemBody, "interface", []interface{}{}) + for _, childItem := range item.Interfaces { + itemChildBody := "" + + if !childItem.NameVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "name.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "name.value", childItem.NameVariable.ValueString()) + } + } else if !childItem.Name.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "name.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "name.value", childItem.Name.ValueString()) + } + } - if !childItem.AuthenticationTypeVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "type.value", childItem.AuthenticationTypeVariable.ValueString()) - } else if childItem.AuthenticationType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "default") + if !childItem.HelloIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString()) + } + } else if childItem.HelloInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64()) + } + } - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "type.value", childItem.AuthenticationType.ValueString()) - } + if !childItem.DeadIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString()) + } + } else if childItem.DeadInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64()) + } + } - if !childItem.MessageDigestKeyIdVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.value", childItem.MessageDigestKeyIdVariable.ValueString()) - } else if childItem.MessageDigestKeyId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "default") + if !childItem.LsaRetransmitIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString()) + } + } else if childItem.LsaRetransmitInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64()) + } + } - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.value", childItem.MessageDigestKeyId.ValueInt64()) - } + if !childItem.CostVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) + } + } else if childItem.Cost.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") - if !childItem.MessageDigestKeyVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "md5.value", childItem.MessageDigestKeyVariable.ValueString()) - } else if childItem.MessageDigestKey.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "default") + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) + } + } - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "md5.value", childItem.MessageDigestKey.ValueString()) - } - itemBody, _ = sjson.SetRaw(itemBody, "interface.-1", itemChildBody) - } - itemBody, _ = sjson.Set(itemBody, "range", []interface{}{}) - for _, childItem := range item.Ranges { - itemChildBody := "" - - if !childItem.IpAddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.value", childItem.IpAddressVariable.ValueString()) - } else if !childItem.IpAddress.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.value", childItem.IpAddress.ValueString()) - } + if !childItem.DesignatedRouterPriorityVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", childItem.DesignatedRouterPriorityVariable.ValueString()) + } + } else if childItem.DesignatedRouterPriority.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", 1) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "priority.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "priority.value", childItem.DesignatedRouterPriority.ValueInt64()) + } + } - if !childItem.SubnetMaskVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.value", childItem.SubnetMaskVariable.ValueString()) - } else if !childItem.SubnetMask.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.value", childItem.SubnetMask.ValueString()) - } + if !childItem.NetworkTypeVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.NetworkTypeVariable.ValueString()) + } + } else if childItem.NetworkType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "network.value", "broadcast") + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.NetworkType.ValueString()) + } + } - if !childItem.CostVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) - } else if childItem.Cost.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") + if !childItem.PassiveInterfaceVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString()) + } + } else if childItem.PassiveInterface.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool()) + } + } - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) + if !childItem.AuthenticationTypeVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "type.value", childItem.AuthenticationTypeVariable.ValueString()) + } + } else if childItem.AuthenticationType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "default") + + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "type.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "type.value", childItem.AuthenticationType.ValueString()) + } + } + + if !childItem.MessageDigestKeyIdVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.value", childItem.MessageDigestKeyIdVariable.ValueString()) + } + } else if childItem.MessageDigestKeyId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "default") + + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "messageDigestKey.value", childItem.MessageDigestKeyId.ValueInt64()) + } + } + + if !childItem.MessageDigestKeyVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "md5.value", childItem.MessageDigestKeyVariable.ValueString()) + } + } else if childItem.MessageDigestKey.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "default") + + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "md5.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "md5.value", childItem.MessageDigestKey.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "interface.-1", itemChildBody) + } } + if true { + itemBody, _ = sjson.Set(itemBody, "range", []interface{}{}) + for _, childItem := range item.Ranges { + itemChildBody := "" + + if !childItem.IpAddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.value", childItem.IpAddressVariable.ValueString()) + } + } else if !childItem.IpAddress.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.ipAddress.value", childItem.IpAddress.ValueString()) + } + } - if !childItem.NoAdvertiseVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString()) - } else if childItem.NoAdvertise.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool()) + if !childItem.SubnetMaskVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.value", childItem.SubnetMaskVariable.ValueString()) + } + } else if !childItem.SubnetMask.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.subnetMask.value", childItem.SubnetMask.ValueString()) + } + } + + if !childItem.CostVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) + } + } else if childItem.Cost.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") + + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) + } + } + + if !childItem.NoAdvertiseVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString()) + } + } else if childItem.NoAdvertise.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "range.-1", itemChildBody) + } } - itemBody, _ = sjson.SetRaw(itemBody, "range.-1", itemChildBody) + body, _ = sjson.SetRaw(body, path+"area.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"area.-1", itemBody) } return body } diff --git a/internal/provider/model_sdwan_transport_routing_ospfv3_ipv4_profile_parcel.go b/internal/provider/model_sdwan_transport_routing_ospfv3_ipv4_profile_parcel.go index c76c4aa7..3a0ffbb1 100644 --- a/internal/provider/model_sdwan_transport_routing_ospfv3_ipv4_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_routing_ospfv3_ipv4_profile_parcel.go @@ -151,371 +151,563 @@ func (data TransportRoutingOSPFv3IPv4) toBody(ctx context.Context) string { path := "data." if !data.RouterIdVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.routerId.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterIdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.routerId.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterIdVariable.ValueString()) + } } else if data.RouterId.IsNull() { - body, _ = sjson.Set(body, path+"basic.routerId.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"basic.routerId.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"basic.routerId.optionType", "global") - body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.routerId.optionType", "global") + body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterId.ValueString()) + } } if !data.DistanceVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.distance.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.distance.value", data.DistanceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.distance.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.distance.value", data.DistanceVariable.ValueString()) + } } else if data.Distance.IsNull() { - body, _ = sjson.Set(body, path+"basic.distance.optionType", "default") - body, _ = sjson.Set(body, path+"basic.distance.value", 110) + if true { + body, _ = sjson.Set(body, path+"basic.distance.optionType", "default") + body, _ = sjson.Set(body, path+"basic.distance.value", 110) + } } else { - body, _ = sjson.Set(body, path+"basic.distance.optionType", "global") - body, _ = sjson.Set(body, path+"basic.distance.value", data.Distance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.distance.optionType", "global") + body, _ = sjson.Set(body, path+"basic.distance.value", data.Distance.ValueInt64()) + } } if !data.DistanceExternalVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternalVariable.ValueString()) + } } else if data.DistanceExternal.IsNull() { - body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "default") - body, _ = sjson.Set(body, path+"basic.externalDistance.value", 110) + if true { + body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "default") + body, _ = sjson.Set(body, path+"basic.externalDistance.value", 110) + } } else { - body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "global") - body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternal.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "global") + body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternal.ValueInt64()) + } } if !data.DistanceInterAreaVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterAreaVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterAreaVariable.ValueString()) + } } else if data.DistanceInterArea.IsNull() { - body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "default") - body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", 110) + if true { + body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "default") + body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", 110) + } } else { - body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "global") - body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterArea.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "global") + body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterArea.ValueInt64()) + } } if !data.DistanceIntraAreaVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraAreaVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraAreaVariable.ValueString()) + } } else if data.DistanceIntraArea.IsNull() { - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "default") - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", 110) + if true { + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "default") + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", 110) + } } else { - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "global") - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraArea.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "global") + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraArea.ValueInt64()) + } } if !data.ReferenceBandwidthVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString()) + } } else if data.ReferenceBandwidth.IsNull() { - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", 100) + if true { + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", 100) + } } else { - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64()) + } } if !data.Rfc1583CompatibleVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583CompatibleVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583CompatibleVariable.ValueString()) + } } else if data.Rfc1583Compatible.IsNull() { - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", true) + if true { + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", true) + } } else { - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583Compatible.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583Compatible.ValueBool()) + } } if !data.DefaultInformationOriginate.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.value", data.DefaultInformationOriginate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.value", data.DefaultInformationOriginate.ValueBool()) + } } if !data.DefaultInformationOriginateAlwaysVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString()) + } } else if !data.DefaultInformationOriginateAlways.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlways.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlways.ValueBool()) + } } if !data.DefaultInformationOriginateMetricVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetricVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetricVariable.ValueString()) + } } else if !data.DefaultInformationOriginateMetric.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetric.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetric.ValueInt64()) + } } if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString()) + } } else if !data.DefaultInformationOriginateMetricType.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricType.ValueString()) + } } if !data.SpfCalculationDelayVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelayVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelayVariable.ValueString()) + } } else if data.SpfCalculationDelay.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", 200) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", 200) + } } else { - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelay.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelay.ValueInt64()) + } } if !data.SpfInitialHoldTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTimeVariable.ValueString()) + } } else if data.SpfInitialHoldTime.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", 1000) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", 1000) + } } else { - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTime.ValueInt64()) + } } if !data.SpfMaximumHoldTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString()) + } } else if data.SpfMaximumHoldTime.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", 10000) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", 10000) + } } else { - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTime.ValueInt64()) + } } if !data.RoutePolicyId.IsNull() { - body, _ = sjson.Set(body, path+"advanced.policyName.refId.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.policyName.refId.value", data.RoutePolicyId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.policyName.refId.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.policyName.refId.value", data.RoutePolicyId.ValueString()) + } } if !data.FilterVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.filter.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.filter.value", data.FilterVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.filter.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.filter.value", data.FilterVariable.ValueString()) + } } else if data.Filter.IsNull() { - body, _ = sjson.Set(body, path+"advanced.filter.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.filter.value", false) + if true { + body, _ = sjson.Set(body, path+"advanced.filter.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.filter.value", false) + } } else { - body, _ = sjson.Set(body, path+"advanced.filter.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.filter.value", data.Filter.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.filter.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.filter.value", data.Filter.ValueBool()) + } } - body, _ = sjson.Set(body, path+"redistribute", []interface{}{}) - for _, item := range data.Redistributes { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"redistribute", []interface{}{}) + for _, item := range data.Redistributes { + itemBody := "" - if !item.ProtocolVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable") - 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 !item.ProtocolVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString()) + } + } else if !item.Protocol.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString()) + } + } - if !item.NatDiaVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "natDia.value", item.NatDiaVariable.ValueString()) - } else if item.NatDia.IsNull() { - itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "natDia.value", true) - } else { - itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "natDia.value", item.NatDia.ValueBool()) - } - if !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + if !item.NatDiaVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "natDia.value", item.NatDiaVariable.ValueString()) + } + } else if item.NatDia.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "natDia.value", true) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "natDia.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "natDia.value", item.NatDia.ValueBool()) + } + } + if !item.RoutePolicyId.IsNull() { + 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+"redistribute.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"redistribute.-1", itemBody) } if !data.RouterLsaAction.IsNull() { - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.optionType", "global") - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.value", data.RouterLsaAction.ValueString()) + if true { + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.optionType", "global") + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.value", data.RouterLsaAction.ValueString()) + } } if !data.RouterLsaOnStartupTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "variable") - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "variable") + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTimeVariable.ValueString()) + } } else if !data.RouterLsaOnStartupTime.IsNull() { - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "global") - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "global") + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTime.ValueInt64()) + } } + if true { - for _, item := range data.Areas { - itemBody := "" + for _, item := range data.Areas { + itemBody := "" - if !item.AreaNumberVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumberVariable.ValueString()) - } else if !item.AreaNumber.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumber.ValueInt64()) - } - if !item.AreaType.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.value", item.AreaType.ValueString()) - } + if !item.AreaNumberVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumberVariable.ValueString()) + } + } else if !item.AreaNumber.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumber.ValueInt64()) + } + } + if !item.AreaType.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.value", item.AreaType.ValueString()) + } + } - if !item.NoSummaryVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummaryVariable.ValueString()) - } else if !item.NoSummary.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummary.ValueBool()) - } + if !item.NoSummaryVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummaryVariable.ValueString()) + } + } else if !item.NoSummary.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummary.ValueBool()) + } + } - if !item.AlwaysTranslateVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslateVariable.ValueString()) - } else if !item.AlwaysTranslate.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslate.ValueBool()) - } + if !item.AlwaysTranslateVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslateVariable.ValueString()) + } + } else if !item.AlwaysTranslate.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslate.ValueBool()) + } + } + if true { - for _, childItem := range item.Interfaces { - itemChildBody := "" + for _, childItem := range item.Interfaces { + itemChildBody := "" - if !childItem.NameVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.NameVariable.ValueString()) - } else if !childItem.Name.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.Name.ValueString()) - } + if !childItem.NameVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.NameVariable.ValueString()) + } + } else if !childItem.Name.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.Name.ValueString()) + } + } - if !childItem.HelloIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString()) - } else if childItem.HelloInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64()) - } + if !childItem.HelloIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString()) + } + } else if childItem.HelloInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64()) + } + } - if !childItem.DeadIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString()) - } else if childItem.DeadInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64()) - } + if !childItem.DeadIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString()) + } + } else if childItem.DeadInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64()) + } + } - if !childItem.LsaRetransmitIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString()) - } else if childItem.LsaRetransmitInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64()) - } + if !childItem.LsaRetransmitIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString()) + } + } else if childItem.LsaRetransmitInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64()) + } + } - if !childItem.CostVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) - } else if childItem.Cost.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") + if !childItem.CostVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) + } + } else if childItem.Cost.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) - } + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) + } + } - if !childItem.NetworkTypeVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkTypeVariable.ValueString()) - } else if childItem.NetworkType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "default") + if !childItem.NetworkTypeVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkTypeVariable.ValueString()) + } + } else if childItem.NetworkType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "default") - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkType.ValueString()) - } + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkType.ValueString()) + } + } - if !childItem.PassiveInterfaceVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString()) - } else if childItem.PassiveInterface.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool()) - } - if !childItem.AuthenticationType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.value", childItem.AuthenticationType.ValueString()) - } + if !childItem.PassiveInterfaceVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString()) + } + } else if childItem.PassiveInterface.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool()) + } + } + if !childItem.AuthenticationType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.value", childItem.AuthenticationType.ValueString()) + } + } - if !childItem.AuthenticationSpiVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpiVariable.ValueString()) - } else if !childItem.AuthenticationSpi.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpi.ValueInt64()) - } + if !childItem.AuthenticationSpiVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpiVariable.ValueString()) + } + } else if !childItem.AuthenticationSpi.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpi.ValueInt64()) + } + } - if !childItem.AuthenticationKeyVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKeyVariable.ValueString()) - } else if !childItem.AuthenticationKey.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKey.ValueString()) - } - itemBody, _ = sjson.SetRaw(itemBody, "interfaces.-1", itemChildBody) - } - itemBody, _ = sjson.Set(itemBody, "ranges", []interface{}{}) - for _, childItem := range item.Ranges { - itemChildBody := "" - - if !childItem.IpAddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "network.address.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "network.address.value", childItem.IpAddressVariable.ValueString()) - } else if !childItem.IpAddress.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "network.address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "network.address.value", childItem.IpAddress.ValueString()) + if !childItem.AuthenticationKeyVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKeyVariable.ValueString()) + } + } else if !childItem.AuthenticationKey.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKey.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "interfaces.-1", itemChildBody) + } } + if true { + itemBody, _ = sjson.Set(itemBody, "ranges", []interface{}{}) + for _, childItem := range item.Ranges { + itemChildBody := "" + + if !childItem.IpAddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.address.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "network.address.value", childItem.IpAddressVariable.ValueString()) + } + } else if !childItem.IpAddress.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "network.address.value", childItem.IpAddress.ValueString()) + } + } - if !childItem.SubnetMaskVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.value", childItem.SubnetMaskVariable.ValueString()) - } else if !childItem.SubnetMask.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.value", childItem.SubnetMask.ValueString()) - } + if !childItem.SubnetMaskVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.value", childItem.SubnetMaskVariable.ValueString()) + } + } else if !childItem.SubnetMask.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "network.mask.value", childItem.SubnetMask.ValueString()) + } + } - if !childItem.CostVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) - } else if childItem.Cost.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") + if !childItem.CostVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) + } + } else if childItem.Cost.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) - } + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) + } + } - if !childItem.NoAdvertiseVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString()) - } else if childItem.NoAdvertise.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool()) + if !childItem.NoAdvertiseVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString()) + } + } else if childItem.NoAdvertise.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "ranges.-1", itemChildBody) + } } - itemBody, _ = sjson.SetRaw(itemBody, "ranges.-1", itemChildBody) + body, _ = sjson.SetRaw(body, path+"area.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"area.-1", itemBody) } return body } diff --git a/internal/provider/model_sdwan_transport_routing_ospfv3_ipv6_profile_parcel.go b/internal/provider/model_sdwan_transport_routing_ospfv3_ipv6_profile_parcel.go index eaaab4a9..cc47cd24 100644 --- a/internal/provider/model_sdwan_transport_routing_ospfv3_ipv6_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_routing_ospfv3_ipv6_profile_parcel.go @@ -147,352 +147,534 @@ func (data TransportRoutingOSPFv3IPv6) toBody(ctx context.Context) string { path := "data." if !data.RouterIdVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.routerId.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterIdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.routerId.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterIdVariable.ValueString()) + } } else if data.RouterId.IsNull() { - body, _ = sjson.Set(body, path+"basic.routerId.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"basic.routerId.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"basic.routerId.optionType", "global") - body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.routerId.optionType", "global") + body, _ = sjson.Set(body, path+"basic.routerId.value", data.RouterId.ValueString()) + } } if !data.DistanceVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.distance.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.distance.value", data.DistanceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.distance.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.distance.value", data.DistanceVariable.ValueString()) + } } else if data.Distance.IsNull() { - body, _ = sjson.Set(body, path+"basic.distance.optionType", "default") - body, _ = sjson.Set(body, path+"basic.distance.value", 110) + if true { + body, _ = sjson.Set(body, path+"basic.distance.optionType", "default") + body, _ = sjson.Set(body, path+"basic.distance.value", 110) + } } else { - body, _ = sjson.Set(body, path+"basic.distance.optionType", "global") - body, _ = sjson.Set(body, path+"basic.distance.value", data.Distance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.distance.optionType", "global") + body, _ = sjson.Set(body, path+"basic.distance.value", data.Distance.ValueInt64()) + } } if !data.DistanceExternalVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternalVariable.ValueString()) + } } else if data.DistanceExternal.IsNull() { - body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "default") - body, _ = sjson.Set(body, path+"basic.externalDistance.value", 110) + if true { + body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "default") + body, _ = sjson.Set(body, path+"basic.externalDistance.value", 110) + } } else { - body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "global") - body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternal.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.externalDistance.optionType", "global") + body, _ = sjson.Set(body, path+"basic.externalDistance.value", data.DistanceExternal.ValueInt64()) + } } if !data.DistanceInterAreaVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterAreaVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterAreaVariable.ValueString()) + } } else if data.DistanceInterArea.IsNull() { - body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "default") - body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", 110) + if true { + body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "default") + body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", 110) + } } else { - body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "global") - body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterArea.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.interAreaDistance.optionType", "global") + body, _ = sjson.Set(body, path+"basic.interAreaDistance.value", data.DistanceInterArea.ValueInt64()) + } } if !data.DistanceIntraAreaVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraAreaVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraAreaVariable.ValueString()) + } } else if data.DistanceIntraArea.IsNull() { - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "default") - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", 110) + if true { + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "default") + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", 110) + } } else { - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "global") - body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraArea.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.optionType", "global") + body, _ = sjson.Set(body, path+"basic.intraAreaDistance.value", data.DistanceIntraArea.ValueInt64()) + } } if !data.ReferenceBandwidthVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidthVariable.ValueString()) + } } else if data.ReferenceBandwidth.IsNull() { - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", 100) + if true { + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", 100) + } } else { - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.referenceBandwidth.value", data.ReferenceBandwidth.ValueInt64()) + } } if !data.Rfc1583CompatibleVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583CompatibleVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583CompatibleVariable.ValueString()) + } } else if data.Rfc1583Compatible.IsNull() { - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", true) + if true { + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", true) + } } else { - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583Compatible.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.compatibleRfc1583.value", data.Rfc1583Compatible.ValueBool()) + } } if !data.DefaultInformationOriginate.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.value", data.DefaultInformationOriginate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.originate.value", data.DefaultInformationOriginate.ValueBool()) + } } if !data.DefaultInformationOriginateAlwaysVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlwaysVariable.ValueString()) + } } else if !data.DefaultInformationOriginateAlways.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlways.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.always.value", data.DefaultInformationOriginateAlways.ValueBool()) + } } if !data.DefaultInformationOriginateMetricVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetricVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetricVariable.ValueString()) + } } else if !data.DefaultInformationOriginateMetric.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetric.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metric.value", data.DefaultInformationOriginateMetric.ValueInt64()) + } } if !data.DefaultInformationOriginateMetricTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricTypeVariable.ValueString()) + } } else if !data.DefaultInformationOriginateMetricType.IsNull() { - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.defaultOriginate.metricType.value", data.DefaultInformationOriginateMetricType.ValueString()) + } } if !data.SpfCalculationDelayVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelayVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelayVariable.ValueString()) + } } else if data.SpfCalculationDelay.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", 200) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", 200) + } } else { - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelay.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.spfTimers.delay.value", data.SpfCalculationDelay.ValueInt64()) + } } if !data.SpfInitialHoldTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTimeVariable.ValueString()) + } } else if data.SpfInitialHoldTime.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", 1000) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", 1000) + } } else { - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.spfTimers.initialHold.value", data.SpfInitialHoldTime.ValueInt64()) + } } if !data.SpfMaximumHoldTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTimeVariable.ValueString()) + } } else if data.SpfMaximumHoldTime.IsNull() { - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", 10000) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", 10000) + } } else { - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.spfTimers.maxHold.value", data.SpfMaximumHoldTime.ValueInt64()) + } } if !data.RoutePolicyId.IsNull() { - body, _ = sjson.Set(body, path+"advanced.policyName.refId.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.policyName.refId.value", data.RoutePolicyId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.policyName.refId.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.policyName.refId.value", data.RoutePolicyId.ValueString()) + } } if !data.FilterVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.filter.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.filter.value", data.FilterVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.filter.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.filter.value", data.FilterVariable.ValueString()) + } } else if data.Filter.IsNull() { - body, _ = sjson.Set(body, path+"advanced.filter.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.filter.value", false) + if true { + body, _ = sjson.Set(body, path+"advanced.filter.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.filter.value", false) + } } else { - body, _ = sjson.Set(body, path+"advanced.filter.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.filter.value", data.Filter.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.filter.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.filter.value", data.Filter.ValueBool()) + } } - body, _ = sjson.Set(body, path+"redistribute", []interface{}{}) - for _, item := range data.Redistributes { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"redistribute", []interface{}{}) + for _, item := range data.Redistributes { + itemBody := "" - if !item.ProtocolVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable") - 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 !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + if !item.ProtocolVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.ProtocolVariable.ValueString()) + } + } else if !item.Protocol.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "protocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "protocol.value", item.Protocol.ValueString()) + } + } + if !item.RoutePolicyId.IsNull() { + 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+"redistribute.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"redistribute.-1", itemBody) } if !data.RouterLsaAction.IsNull() { - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.optionType", "global") - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.value", data.RouterLsaAction.ValueString()) + if true { + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.optionType", "global") + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.action.value", data.RouterLsaAction.ValueString()) + } } if !data.RouterLsaOnStartupTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "variable") - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "variable") + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTimeVariable.ValueString()) + } } else if !data.RouterLsaOnStartupTime.IsNull() { - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "global") - body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.optionType", "global") + body, _ = sjson.Set(body, path+"maxMetricRouterLsa.onStartUpTime.value", data.RouterLsaOnStartupTime.ValueInt64()) + } } + if true { - for _, item := range data.Areas { - itemBody := "" + for _, item := range data.Areas { + itemBody := "" - if !item.AreaNumberVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumberVariable.ValueString()) - } else if !item.AreaNumber.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumber.ValueInt64()) - } - if !item.AreaType.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.value", item.AreaType.ValueString()) - } + if !item.AreaNumberVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumberVariable.ValueString()) + } + } else if !item.AreaNumber.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaNum.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "areaNum.value", item.AreaNumber.ValueInt64()) + } + } + if !item.AreaType.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.areaType.value", item.AreaType.ValueString()) + } + } - if !item.NoSummaryVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummaryVariable.ValueString()) - } else if !item.NoSummary.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummary.ValueBool()) - } + if !item.NoSummaryVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummaryVariable.ValueString()) + } + } else if !item.NoSummary.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.noSummary.value", item.NoSummary.ValueBool()) + } + } - if !item.AlwaysTranslateVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslateVariable.ValueString()) - } else if !item.AlwaysTranslate.IsNull() { - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslate.ValueBool()) - } + if !item.AlwaysTranslateVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslateVariable.ValueString()) + } + } else if !item.AlwaysTranslate.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "areaTypeConfig.alwaysTranslate.value", item.AlwaysTranslate.ValueBool()) + } + } + if true { - for _, childItem := range item.Interfaces { - itemChildBody := "" + for _, childItem := range item.Interfaces { + itemChildBody := "" - if !childItem.NameVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.NameVariable.ValueString()) - } else if !childItem.Name.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.Name.ValueString()) - } + if !childItem.NameVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.NameVariable.ValueString()) + } + } else if !childItem.Name.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ifName.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ifName.value", childItem.Name.ValueString()) + } + } - if !childItem.HelloIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString()) - } else if childItem.HelloInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64()) - } + if !childItem.HelloIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloIntervalVariable.ValueString()) + } + } else if childItem.HelloInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", 10) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "helloInterval.value", childItem.HelloInterval.ValueInt64()) + } + } - if !childItem.DeadIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString()) - } else if childItem.DeadInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64()) - } + if !childItem.DeadIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadIntervalVariable.ValueString()) + } + } else if childItem.DeadInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", 40) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "deadInterval.value", childItem.DeadInterval.ValueInt64()) + } + } - if !childItem.LsaRetransmitIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString()) - } else if childItem.LsaRetransmitInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64()) - } + if !childItem.LsaRetransmitIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitIntervalVariable.ValueString()) + } + } else if childItem.LsaRetransmitInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", 5) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmitInterval.value", childItem.LsaRetransmitInterval.ValueInt64()) + } + } - if !childItem.CostVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) - } else if childItem.Cost.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") + if !childItem.CostVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) + } + } else if childItem.Cost.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) - } + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) + } + } - if !childItem.NetworkTypeVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkTypeVariable.ValueString()) - } else if childItem.NetworkType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "default") + if !childItem.NetworkTypeVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkTypeVariable.ValueString()) + } + } else if childItem.NetworkType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "default") - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkType.ValueString()) - } + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "networkType.value", childItem.NetworkType.ValueString()) + } + } - if !childItem.PassiveInterfaceVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString()) - } else if childItem.PassiveInterface.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool()) - } - if !childItem.AuthenticationType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.value", childItem.AuthenticationType.ValueString()) - } + if !childItem.PassiveInterfaceVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterfaceVariable.ValueString()) + } + } else if childItem.PassiveInterface.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", false) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "passiveInterface.value", childItem.PassiveInterface.ValueBool()) + } + } + if !childItem.AuthenticationType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authType.value", childItem.AuthenticationType.ValueString()) + } + } - if !childItem.AuthenticationSpiVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpiVariable.ValueString()) - } else if !childItem.AuthenticationSpi.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpi.ValueInt64()) - } + if !childItem.AuthenticationSpiVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpiVariable.ValueString()) + } + } else if !childItem.AuthenticationSpi.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.spi.value", childItem.AuthenticationSpi.ValueInt64()) + } + } - if !childItem.AuthenticationKeyVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKeyVariable.ValueString()) - } else if !childItem.AuthenticationKey.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKey.ValueString()) - } - itemBody, _ = sjson.SetRaw(itemBody, "interfaces.-1", itemChildBody) - } - itemBody, _ = sjson.Set(itemBody, "ranges", []interface{}{}) - for _, childItem := range item.Ranges { - itemChildBody := "" - - if !childItem.PrefixVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.PrefixVariable.ValueString()) - } else if !childItem.Prefix.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.Prefix.ValueString()) + if !childItem.AuthenticationKeyVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKeyVariable.ValueString()) + } + } else if !childItem.AuthenticationKey.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "authenticationConfig.authKey.value", childItem.AuthenticationKey.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "interfaces.-1", itemChildBody) + } } + if true { + itemBody, _ = sjson.Set(itemBody, "ranges", []interface{}{}) + for _, childItem := range item.Ranges { + itemChildBody := "" + + if !childItem.PrefixVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.PrefixVariable.ValueString()) + } + } else if !childItem.Prefix.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "network.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "network.value", childItem.Prefix.ValueString()) + } + } - if !childItem.CostVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) - } else if childItem.Cost.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") + if !childItem.CostVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.CostVariable.ValueString()) + } + } else if childItem.Cost.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "default") - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) - } + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "cost.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "cost.value", childItem.Cost.ValueInt64()) + } + } - if !childItem.NoAdvertiseVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString()) - } else if childItem.NoAdvertise.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool()) + if !childItem.NoAdvertiseVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertiseVariable.ValueString()) + } + } else if childItem.NoAdvertise.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", false) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "noAdvertise.value", childItem.NoAdvertise.ValueBool()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "ranges.-1", itemChildBody) + } } - itemBody, _ = sjson.SetRaw(itemBody, "ranges.-1", itemChildBody) + body, _ = sjson.SetRaw(body, path+"area.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"area.-1", itemBody) } return body } diff --git a/templates/guides/changelog.md.tmpl b/templates/guides/changelog.md.tmpl index 34e7c1f8..d05c00d1 100644 --- a/templates/guides/changelog.md.tmpl +++ b/templates/guides/changelog.md.tmpl @@ -1,12 +1,12 @@ ---- -subcategory: "Guides" -page_title: "Changelog" -description: |- - Changelog ---- - -# Changelog - +--- +subcategory: "Guides" +page_title: "Changelog" +description: |- + Changelog +--- + +# Changelog + ## 0.3.14 (unreleased) - Fix issue when reading deleted `sdwan_cli_config_profile_parcel` resource, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/291) @@ -20,7 +20,7 @@ description: |- - BREAKING CHANGE: Rename `psk_selection` attribute of `sdwan_system_remote_access_profile_parcel` resource to `psk_authentication_type` - BREAKING CHANGE: Rename `aaa_derive_name_identity` attribute of `sdwan_system_remote_access_profile_parcel` resource to `aaa_derive_name_from_peer_identity` - BREAKING CHANGE: Rename `aaa_derive_name_domain` attribute of `sdwan_system_remote_access_profile_parcel` resource to `aaa_derive_name_from_peer_domain` -- BREAKING CHANGE: Removes `any_connect_eap_profile_download_status` and `any_connect_eap_profile_file_name` attributes of `sdwan_system_remote_access_profile_parcel +- BREAKING CHANGE: Removes `any_connect_eap_profile_download_status` and `any_connect_eap_profile_file_name` attributes of `sdwan_system_remote_access_profile_parcel` - Add `sdwan_policy_object_feature_profile` resource and data source - Add `sdwan_policy_object_class_map_profile_parcel` resource and data source - Add `sdwan_policy_object_color_list_profile_parcel` resource and data source @@ -327,4 +327,4 @@ description: |- ## 0.1.0 (July 23, 2021) - Initial Release - +